From 2dfc5a13b37d27aaa688a9f38586a7875efcd97d Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Thu, 4 Feb 2021 00:04:05 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B4=E2=80=8D=E2=98=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ LICENSE | 21 ++++++++++++++++++ Program.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ delver-se.csproj | 14 ++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Program.cs create mode 100644 delver-se.csproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd42ee3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bin/ +obj/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ca1c103 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..d6c17e2 --- /dev/null +++ b/Program.cs @@ -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 () { "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; + } +} diff --git a/delver-se.csproj b/delver-se.csproj new file mode 100644 index 0000000..c272529 --- /dev/null +++ b/delver-se.csproj @@ -0,0 +1,14 @@ + + + + Exe + net5.0 + delver_se + + + + + + + +