diff --git a/LICENSE b/LICENSE index 089bd9f..76d203b 100644 --- a/LICENSE +++ b/LICENSE @@ -208,8 +208,8 @@ If you develop a new program, and you want it to be of the greatest possible use To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. - PodrazNG - Copyright (C) 2026 toho + podraz-ng + Copyright (C) 2026 pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -221,7 +221,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - PodrazNG Copyright (C) 2026 toho + podraz-ng Copyright (C) 2026 pohl This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/PodrazNG.slnx b/PodrazNG.slnx new file mode 100644 index 0000000..4eda89d --- /dev/null +++ b/PodrazNG.slnx @@ -0,0 +1,3 @@ + + + diff --git a/PodrazNG/Apps/Notepad/NotepadForm.Designer.cs b/PodrazNG/Apps/Notepad/NotepadForm.Designer.cs new file mode 100644 index 0000000..81f7dd5 --- /dev/null +++ b/PodrazNG/Apps/Notepad/NotepadForm.Designer.cs @@ -0,0 +1,127 @@ +namespace PodrazNG.Apps.Notepad +{ + partial class NotepadForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + mnuNotepad = new MenuStrip(); + NotepadFile = new ToolStripMenuItem(); + NotepadFileNew = new ToolStripMenuItem(); + NotepadFileOpen = new ToolStripMenuItem(); + NotepadFileSave = new ToolStripMenuItem(); + NotepadFileSaveAs = new ToolStripMenuItem(); + NotepadFileExit = new ToolStripMenuItem(); + txtContent = new TextBox(); + mnuNotepad.SuspendLayout(); + SuspendLayout(); + // + // mnuNotepad + // + mnuNotepad.AllowMerge = false; + mnuNotepad.Items.AddRange(new ToolStripItem[] { NotepadFile }); + mnuNotepad.Location = new Point(0, 0); + mnuNotepad.Name = "mnuNotepad"; + mnuNotepad.Size = new Size(583, 24); + mnuNotepad.TabIndex = 0; + mnuNotepad.Text = "menuStrip1"; + // + // NotepadFile + // + NotepadFile.DropDownItems.AddRange(new ToolStripItem[] { NotepadFileNew, NotepadFileOpen, NotepadFileSave, NotepadFileSaveAs, NotepadFileExit }); + NotepadFile.Name = "NotepadFile"; + NotepadFile.Size = new Size(57, 20); + NotepadFile.Text = "Soubor"; + // + // NotepadFileNew + // + NotepadFileNew.Name = "NotepadFileNew"; + NotepadFileNew.Size = new Size(141, 22); + NotepadFileNew.Text = "Nový"; + // + // NotepadFileOpen + // + NotepadFileOpen.Name = "NotepadFileOpen"; + NotepadFileOpen.Size = new Size(141, 22); + NotepadFileOpen.Text = "Otevřít"; + // + // NotepadFileSave + // + NotepadFileSave.Name = "NotepadFileSave"; + NotepadFileSave.Size = new Size(141, 22); + NotepadFileSave.Text = "Uložit"; + // + // NotepadFileSaveAs + // + NotepadFileSaveAs.Name = "NotepadFileSaveAs"; + NotepadFileSaveAs.Size = new Size(141, 22); + NotepadFileSaveAs.Text = "Uložit jako ..."; + // + // NotepadFileExit + // + NotepadFileExit.Name = "NotepadFileExit"; + NotepadFileExit.Size = new Size(141, 22); + NotepadFileExit.Text = "Konec"; + // + // txtContent + // + txtContent.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + txtContent.Font = new Font("Consolas", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 238); + txtContent.Location = new Point(2, 27); + txtContent.Multiline = true; + txtContent.Name = "txtContent"; + txtContent.ScrollBars = ScrollBars.Both; + txtContent.Size = new Size(581, 222); + txtContent.TabIndex = 1; + // + // NotepadForm + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(583, 252); + Controls.Add(txtContent); + Controls.Add(mnuNotepad); + MainMenuStrip = mnuNotepad; + Name = "NotepadForm"; + Text = "NotepadForm"; + mnuNotepad.ResumeLayout(false); + mnuNotepad.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private MenuStrip mnuNotepad; + private ToolStripMenuItem NotepadFile; + private ToolStripMenuItem NotepadFileNew; + private ToolStripMenuItem NotepadFileOpen; + private ToolStripMenuItem NotepadFileSave; + private ToolStripMenuItem NotepadFileSaveAs; + private ToolStripMenuItem NotepadFileExit; + private TextBox txtContent; + } +} \ No newline at end of file diff --git a/PodrazNG/Apps/Notepad/NotepadForm.cs b/PodrazNG/Apps/Notepad/NotepadForm.cs new file mode 100644 index 0000000..9b14d7a --- /dev/null +++ b/PodrazNG/Apps/Notepad/NotepadForm.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace PodrazNG.Apps.Notepad +{ + public partial class NotepadForm : Form + { + public NotepadForm() + { + InitializeComponent(); + } + } +} diff --git a/PodrazNG/Apps/Notepad/NotepadForm.resx b/PodrazNG/Apps/Notepad/NotepadForm.resx new file mode 100644 index 0000000..2ce8a40 --- /dev/null +++ b/PodrazNG/Apps/Notepad/NotepadForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/PodrazNG/GameData/GameManager.cs b/PodrazNG/GameData/GameManager.cs new file mode 100644 index 0000000..2f37192 --- /dev/null +++ b/PodrazNG/GameData/GameManager.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace PodrazNG.GameData +{ + public class GameManager + { + private static GameManager? _instance; + public string Name { get; set; } = "Nová hra"; + public Dictionary VarGlobal { get; set; } = new Dictionary(); + public GameManager() + { + + } + + public static GameManager Data + { + get + { + if (_instance == null) + { + _instance = new GameManager(); + } + return _instance; + + } + } + + public SavingData ToSavingData() + { + return new SavingData + { + Name = this.Name, + VarGlobal = this.VarGlobal + }; + } + public void FromSavingData(SavingData data) + { + this.Name = data.Name; + this.VarGlobal = data.VarGlobal; + + } + + } +} diff --git a/PodrazNG/GameData/SavingData.cs b/PodrazNG/GameData/SavingData.cs new file mode 100644 index 0000000..4eb462a --- /dev/null +++ b/PodrazNG/GameData/SavingData.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace PodrazNG.GameData +{ + public class SavingData + { + public string Name { get; set; } = "Nová hra"; + public Dictionary VarGlobal { get; set; } = new Dictionary(); + } +} diff --git a/PodrazNG/PodrazNG.Designer.cs b/PodrazNG/PodrazNG.Designer.cs new file mode 100644 index 0000000..9ee799d --- /dev/null +++ b/PodrazNG/PodrazNG.Designer.cs @@ -0,0 +1,134 @@ +namespace PodrazNG +{ + partial class PodrazNG + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + menuStrip1 = new MenuStrip(); + mnuFile = new ToolStripMenuItem(); + mnuFileNew = new ToolStripMenuItem(); + mnuFileOpen = new ToolStripMenuItem(); + mnuFileSave = new ToolStripMenuItem(); + mnuFileSaveAs = new ToolStripMenuItem(); + mnuFileExit = new ToolStripMenuItem(); + mnuApps = new ToolStripMenuItem(); + mnuAppsNotepad = new ToolStripMenuItem(); + menuStrip1.SuspendLayout(); + SuspendLayout(); + // + // menuStrip1 + // + menuStrip1.Items.AddRange(new ToolStripItem[] { mnuFile, mnuApps }); + menuStrip1.Location = new Point(0, 0); + menuStrip1.Name = "menuStrip1"; + menuStrip1.Size = new Size(629, 24); + menuStrip1.TabIndex = 1; + menuStrip1.Text = "menuStrip1"; + // + // mnuFile + // + mnuFile.DropDownItems.AddRange(new ToolStripItem[] { mnuFileNew, mnuFileOpen, mnuFileSave, mnuFileSaveAs, mnuFileExit }); + mnuFile.Name = "mnuFile"; + mnuFile.Size = new Size(57, 20); + mnuFile.Text = "Soubor"; + // + // mnuFileNew + // + mnuFileNew.Name = "mnuFileNew"; + mnuFileNew.Size = new Size(180, 22); + mnuFileNew.Text = "Nová hra"; + // + // mnuFileOpen + // + mnuFileOpen.Name = "mnuFileOpen"; + mnuFileOpen.Size = new Size(180, 22); + mnuFileOpen.Text = "Otevřít hru"; + mnuFileOpen.Click += mnuFileOpen_Click; + // + // mnuFileSave + // + mnuFileSave.Name = "mnuFileSave"; + mnuFileSave.Size = new Size(180, 22); + mnuFileSave.Text = "Uložit hru"; + // + // mnuFileSaveAs + // + mnuFileSaveAs.Name = "mnuFileSaveAs"; + mnuFileSaveAs.Size = new Size(180, 22); + mnuFileSaveAs.Text = "Uložit hru jako..."; + mnuFileSaveAs.Click += mnuFileSaveAs_Click; + // + // mnuFileExit + // + mnuFileExit.Name = "mnuFileExit"; + mnuFileExit.Size = new Size(180, 22); + mnuFileExit.Text = "Konec"; + mnuFileExit.Click += mnuFileExit_Click; + // + // mnuApps + // + mnuApps.DropDownItems.AddRange(new ToolStripItem[] { mnuAppsNotepad }); + mnuApps.Name = "mnuApps"; + mnuApps.Size = new Size(64, 20); + mnuApps.Text = "Aplikace"; + // + // mnuAppsNotepad + // + mnuAppsNotepad.Name = "mnuAppsNotepad"; + mnuAppsNotepad.Size = new Size(180, 22); + mnuAppsNotepad.Text = "Poznámkový blok"; + mnuAppsNotepad.Click += mnuAppsNotepad_Click; + // + // PodrazNG + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(629, 359); + Controls.Add(menuStrip1); + IsMdiContainer = true; + MainMenuStrip = menuStrip1; + Name = "PodrazNG"; + Text = "Form1"; + menuStrip1.ResumeLayout(false); + menuStrip1.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private MenuStrip menuStrip1; + private ToolStripMenuItem mnuFile; + private ToolStripMenuItem mnuFileExit; + private ToolStripMenuItem mnuFileNew; + private ToolStripMenuItem mnuFileOpen; + private ToolStripMenuItem mnuFileSave; + private ToolStripMenuItem mnuFileSaveAs; + private ToolStripMenuItem mnuApps; + private ToolStripMenuItem mnuAppsNotepad; + } +} diff --git a/PodrazNG/PodrazNG.cs b/PodrazNG/PodrazNG.cs new file mode 100644 index 0000000..91ec3d4 --- /dev/null +++ b/PodrazNG/PodrazNG.cs @@ -0,0 +1,60 @@ +using PodrazNG.Apps.Notepad; +using PodrazNG.GameData; +using System.Text.Json; + +namespace PodrazNG +{ + public partial class PodrazNG : Form + { + public PodrazNG() + { + InitializeComponent(); + } + + private void mnuFileExit_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void mnuFileSaveAs_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog() + { + Filter = "JSON soubory (*.json)|*.json", + Title = "Uložit hru jako" + }; + if (dialog.ShowDialog() == DialogResult.OK) + { + string json = JsonSerializer.Serialize(GameManager.Data); + File.WriteAllText(dialog.FileName, json); + } + } + + private void mnuFileOpen_Click(object sender, EventArgs e) + { + using var dialog = new OpenFileDialog() + { + Filter = "JSON soubory (*.json)|*.json", + Title = "Otevřít hru" + }; + if (dialog.ShowDialog() == DialogResult.OK) + { + string json = File.ReadAllText(dialog.FileName); + SavingData? data = JsonSerializer.Deserialize(json); + if (data != null) + { + GameManager.Data.FromSavingData(data); + } + } + + } + + private void mnuAppsNotepad_Click(object sender, EventArgs e) + { + NotepadForm notepad = new NotepadForm(); + notepad.MdiParent = this; + notepad.Show(); + + } + } +} diff --git a/PodrazNG/PodrazNG.csproj b/PodrazNG/PodrazNG.csproj new file mode 100644 index 0000000..5151c0a --- /dev/null +++ b/PodrazNG/PodrazNG.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net10.0-windows + enable + true + enable + + + \ No newline at end of file diff --git a/PodrazNG/PodrazNG.resx b/PodrazNG/PodrazNG.resx new file mode 100644 index 0000000..c24f4f3 --- /dev/null +++ b/PodrazNG/PodrazNG.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 34 + + \ No newline at end of file diff --git a/PodrazNG/Program.cs b/PodrazNG/Program.cs new file mode 100644 index 0000000..c1aade5 --- /dev/null +++ b/PodrazNG/Program.cs @@ -0,0 +1,17 @@ +namespace PodrazNG +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new PodrazNG()); + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index d1b2a29..6807639 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# PodrazNG +# podraz-ng +Naše báječná hra \ No newline at end of file