🏴‍☠️

This commit is contained in:
Alexander Popov 2021-02-04 00:04:05 +03:00
commit 2dfc5a13b3
4 changed files with 93 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
bin/
obj/

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Alexander Popov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

56
Program.cs Normal file
View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using Terminal.Gui;
class Program
{
static void Main()
{
Application.Init();
var top = Application.Top;
var win = new Window("Delver Save Editor")
{ X = 0, Y = 0, Width = Dim.Fill(), Height = Dim.Fill() };
var menu = new MenuBar (new MenuBarItem [] {
new MenuBarItem ("_File", new MenuItem [] {
new MenuItem ("_Refresh", "Refresh Delver saves", null),
new MenuItem ("_About", "About this program", null),
new MenuItem ("_Quit", "", () => { if (Quit ()) top.Running = false; })
})
});
// var statusBar = new StatusBar (new Label("Delver path: "));
var delverPathLabel = new Label("Delver path: ")
{ X = 1, Y = 1, Width = Dim.Fill (), Height = 1 };
var savesListData = new List<string> () { "Save 0", "Save 1", "Save 3" };
var savesList = new ListView (savesListData) {
X = 0,
Y = 0,
Width = Dim.Fill(),
Height = Dim.Fill(),
AllowsMarking = false
};
var savesWindow = new Window("Saves slot")
{ X = 0, Y = 3, Width = 20, Height = Dim.Fill() };
savesWindow.Add(savesList);
var dataWindow = new Window("Data Editor")
{
X = 21, Y = 3, Width = Dim.Fill(), Height = Dim.Fill()
};
top.Add(win, menu);
win.Add(delverPathLabel, savesWindow, dataWindow);
Application.Run ();
}
static bool Quit ()
{
var n = MessageBox.Query (50, 7, "Quit", "Вы лох?", "Yes", "No");
return n == 0;
}
}

14
delver-se.csproj Normal file
View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>delver_se</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Terminal.Gui" Version="0.90.3" />
</ItemGroup>
</Project>