complete prototype

This commit is contained in:
Alexander Popov 2021-02-04 11:53:40 +03:00
parent 2dfc5a13b3
commit 5dfe38ca4d
5 changed files with 49 additions and 16 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
bin/
obj/
Build/

View File

@ -9,23 +9,25 @@ class Program
Application.Init();
var top = Application.Top;
var win = new Window("Delver Save Editor")
var mainWindow = new Window("Delver Save Editor")
{ X = 0, Y = 0, Width = Dim.Fill(), Height = Dim.Fill() };
var menu = new MenuBar (new MenuBarItem [] {
var menuWindow = 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; })
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 delverPathLabel = new Label("Delver path:")
{ X = 1, Y = 1, Width = 13, Height = 1 };
var delverPathField = new TextField("null")
{ X = 14, Y = 1, Width = Dim.Fill(), Height = 1 };
var savesListData = new List<string> () { "Save 0", "Save 1", "Save 3" };
var savesList = new ListView (savesListData) {
var savesListData = new List<string>() { "Save 0", "Save 1", "Save 3" };
var savesList = new ListView(savesListData) {
X = 0,
Y = 0,
Width = Dim.Fill(),
@ -36,19 +38,39 @@ class Program
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()
};
{ X = 21, Y = 3, Width = Dim.Fill(), Height = Dim.Fill() };
var playerHpLabel = new Label("HP:")
{ X = 0, Y = 0, Width = 10, Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right };
var playerHp = new TextField()
{ X = 11, Y = 0, Width = Dim.Fill() - 1, Height = 1 };
var playerMaxHpLabel = new Label("Max HP:")
{ X = 0, Y = 2, Width = 10, Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right };
var playerMaxHp = new TextField()
{ X = 11, Y = 2, Width = Dim.Fill() - 1, Height = 1 };
var playerGoldLabel = new Label("Gold:")
{ X = 0, Y = 4, Width = 10, Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right };
var playerGold = new TextField()
{ X = 11, Y = 4, Width = Dim.Fill() - 1, Height = 1 };
var playerXpLabel = new Label("XP:")
{ X = 0, Y = 6, Width = 10, Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right };
var playerXp = new TextField()
{ X = 11, Y = 6, Width = Dim.Fill() - 1, Height = 1 };
top.Add(win, menu);
win.Add(delverPathLabel, savesWindow, dataWindow);
Application.Run ();
savesWindow.Add(savesList);
dataWindow.Add
(
playerHpLabel,playerHp,
playerMaxHpLabel, playerMaxHp,
playerGoldLabel, playerGold,
playerXpLabel, playerXp
);
mainWindow.Add(delverPathLabel, delverPathField, savesWindow, dataWindow);
top.Add(mainWindow, menuWindow);
Application.Run();
}
static bool Quit ()
static bool Quit()
{
var n = MessageBox.Query (50, 7, "Quit", "Вы лох?", "Yes", "No");
return n == 0;

1
README.md Normal file
View File

@ -0,0 +1 @@

BIN
application.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 KiB

View File

@ -4,6 +4,15 @@
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>delver_se</RootNamespace>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<BuildDir>Build</BuildDir>
<PlatformTarget>x64</PlatformTarget>
<Version>0.1.0</Version>
<Company>Turn Around</Company>
<Authors>Alexander Popov</Authors>
<Product>Delver SE</Product>
<ApplicationIcon>application.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>