From cdcb78cf29402befe9a9fe2edc9a84b6a4db03f3 Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Wed, 11 Feb 2026 23:49:40 -0500 Subject: [PATCH 01/10] Fixed the sprite create issue --- Sprite.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprite.cs b/Sprite.cs index 875a277..7a34aea 100644 --- a/Sprite.cs +++ b/Sprite.cs @@ -42,7 +42,7 @@ private void Sprite_Load(object sender, EventArgs e) if (ImageCount == 0) { // First image! Grab the size.... - MainImageList.ImageSize = DS_Game_Maker.DSGMlib.PathToImage(X).Size; + MainImageList.ImageSize = DS_Game_Maker.DSGMlib.PathToImage(X_).Size; } ImageCount = (short)(ImageCount + 1); } From 03c2a58d06afcf6fb8a9abdd7bbc353c8e431190 Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Wed, 11 Feb 2026 23:50:11 -0500 Subject: [PATCH 02/10] cleaning up the \\ in action --- Action.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Action.cs b/Action.cs index 3835430..ad130ae 100644 --- a/Action.cs +++ b/Action.cs @@ -139,7 +139,7 @@ private void Action_Load(object sender, EventArgs e) byte DOn = 0; LabelsPanel.Controls.Clear(); ControlsPanel.Controls.Clear(); - foreach (string X_ in File.ReadAllLines(Constants.AppDirectory + @"Actions\" + ActionName + ".action")) + foreach (string X_ in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName + ".action")) { string X = X_; if (X.StartsWith("ARG ")) From 812e1a0f2362981f35f81cc9ff9d82d097f58aea Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 11:48:11 -0500 Subject: [PATCH 03/10] Remove registry stuff, Remove Vbasic stuff --- DSGMlib.cs | 6 +++ MainForm.cs | 140 +++++++++++++++++++++---------------------------- RegistryLib.cs | 41 --------------- 3 files changed, 67 insertions(+), 120 deletions(-) delete mode 100644 RegistryLib.cs diff --git a/DSGMlib.cs b/DSGMlib.cs index 88d9640..00810fd 100644 --- a/DSGMlib.cs +++ b/DSGMlib.cs @@ -1785,11 +1785,17 @@ public static void MsgInfo(string msg, string title = "DS Game Maker") public static object CanDivide(short num1, short num2) { if (num1 == 0 | num2 == 0) + { return false; + } if (num1 % num2 == 0) + { return true; + } else + { return false; + } } public static short ImageCountColors(Bitmap TheImage) diff --git a/MainForm.cs b/MainForm.cs index 3c2734a..3820737 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Windows.Forms; -using Microsoft.VisualBasic; -using Microsoft.VisualBasic.CompilerServices; +using System.Diagnostics; namespace DS_Game_Maker { @@ -106,75 +98,47 @@ private void MainForm_Load(object sender, EventArgs e) foreach (Control ctl in Controls) { if (ctl is MdiClient) + { ctl.BackgroundImage = Properties.Resources.MDIBG; + } } - string System32Path = Environment.GetFolderPath(Environment.SpecialFolder.System); - CacheHasTinternet = DS_Game_Maker.DSGMlib.HasInternetConnection("http://google.com"); - /*if (!File.Exists(System32Path + @"\SciLexer_x64.dll")) - { - File.Copy(DS_Game_Maker.DSGMlib.AppPath + "SciLexer_x64.dll", System32Path + @"\SciLexer_x64.dll"); - } - - if (!File.Exists(System32Path + @"\ScintillaNet.dll")) - { - File.Copy(DS_Game_Maker.DSGMlib.AppPath + "ScintillaNet.dll", System32Path + @"\ScintillaNet.dll"); - }*/ + List VitalFiles = + [ + Constants.AppDirectory + "Resources/NoSprite.png", + Constants.AppDirectory + "ActionIcons/Empty.png", + Constants.AppDirectory + "DefaultResources/Sprite.png", + Constants.AppDirectory + "DefaultResources/Background.png", + Constants.AppDirectory + "DefaultResources/Sound.wav", + ]; - // Also into Windows... nasty, rare suggested fix - /*string WindowsPath = System32Path.Substring(0, System32Path.LastIndexOf(@"\")); - if (!File.Exists(WindowsPath + @"\SciLexer_x64.dll")) - { - File.Copy(DS_Game_Maker.DSGMlib.AppPath + "SciLexer_x64.dll", WindowsPath + @"\SciLexer_x64.dll"); - } - - - if (!File.Exists(WindowsPath + @"\ScintillaNet.dll")) - { - File.Copy(DS_Game_Maker.DSGMlib.AppPath + "ScintillaNet.dll", WindowsPath + @"\ScintillaNet.dll"); - } - - - try - { - DS_Game_Maker.RegistryLib.SetFileType(".dsgm", "DSGMFile"); - DS_Game_Maker.RegistryLib.SetFileDescription("DSGMFile", Application.ProductName + " Project"); - DS_Game_Maker.RegistryLib.AddAction("DSGMFile", "open", "Open"); - DS_Game_Maker.RegistryLib.SetExtensionCommandLine("open", "DSGMFile", "\"" + DS_Game_Maker.DSGMlib.AppPath + Application.ProductName + ".exe\" \"%1\""); - DS_Game_Maker.RegistryLib.SetDefaultIcon("DSGMFile", "\"" + DS_Game_Maker.DSGMlib.AppPath + "Icon.ico\""); - } - catch (Exception ex) - { - DS_Game_Maker.DSGMlib.MsgWarn("You should run " + Application.ProductName + " as an Administrator." + Constants.vbCrLf + Constants.vbCrLf + "(" + ex.Message + ")"); - } */ - - var VitalFiles = new Collection(); - VitalFiles.Add(Constants.AppDirectory + "Resources/NoSprite.png"); - VitalFiles.Add(Constants.AppDirectory + "ActionIcons/Empty.png"); - VitalFiles.Add(Constants.AppDirectory + "DefaultResources/Sprite.png"); - VitalFiles.Add(Constants.AppDirectory + "DefaultResources/Background.png"); - VitalFiles.Add(Constants.AppDirectory + "DefaultResources/Sound.wav"); byte VitalBuggered = 0; + foreach (string X in VitalFiles) { - if (!File.Exists(X)) + if (File.Exists(X) == false) + { VitalBuggered = (byte)(VitalBuggered + 1); + } } if (VitalBuggered == 1) { - DS_Game_Maker.DSGMlib.MsgError("A vital file is missing. You must reinstall " + Application.ProductName + "."); + DSGMlib.MsgError("A vital file is missing. You must reinstall " + Application.ProductName + "."); return; } if (VitalBuggered > 1) { - DS_Game_Maker.DSGMlib.MsgError("Some vital files are missing. You must reinstall " + Application.ProductName + "."); + DSGMlib.MsgError("Some vital files are missing. You must reinstall " + Application.ProductName + "."); return; } - DS_Game_Maker.DSGMlib.RebuildFontCache(); + + DSGMlib.RebuildFontCache(); + // Toolstrip Renderers MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); DMainMenuStrip.Renderer = new DS_Game_Maker.clsMenuRenderer(); ResRightClickMenu.Renderer = new DS_Game_Maker.clsMenuRenderer(); + // Resources Setup DS_Game_Maker.DSGMlib.ResourceTypes[0] = "Sprites"; MainImageList.Images.Add("SpriteIcon", Properties.Resources.SpriteIcon); @@ -190,12 +154,15 @@ private void MainForm_Load(object sender, EventArgs e) MainImageList.Images.Add("PathIcon", Properties.Resources.PathIcon); DS_Game_Maker.DSGMlib.ResourceTypes[6] = "Scripts"; MainImageList.Images.Add("ScriptIcon", Properties.Resources.ScriptIcon); + // Imagelist Setup // MainImageList.Images.Add("ScriptIcon", My.Resources.ScriptIcon) MainImageList.Images.Add("FolderIcon", Properties.Resources.FolderIcon); // Resources Setup for (byte Resource = 0, loopTo = (byte)(DS_Game_Maker.DSGMlib.ResourceTypes.Length - 1); Resource <= loopTo; Resource++) + { ResourcesTreeView.Nodes.Add(string.Empty, DS_Game_Maker.DSGMlib.ResourceTypes[(int)Resource], 7, 7); + } // Settings @@ -258,31 +225,34 @@ public void GenerateShite(string DisplayResult) private void NewProject_Click(object sender, EventArgs e) { - Interaction.Shell(Constants.AppDirectory + ProductName + ".exe /skipauto"); + Process.Start(Constants.AppDirectory + ProductName, "/skipauto"); } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { - if (DS_Game_Maker.DSGMlib.BeingUsed) + if (DSGMlib.BeingUsed) { bool WillExit = false; string TheText = "Your new project"; - if (!DS_Game_Maker.DSGMlib.IsNewProject) + + if (DSGMlib.IsNewProject == false) { - TheText = "'" + DS_Game_Maker.DSGMlib.CacheProjectName + "'"; + TheText = "'" + DSGMlib.CacheProjectName + "'"; } - int Result = (int)MessageBox.Show(TheText + " may have unsaved changes." + Constants.vbCrLf + Constants.vbCrLf + "Do you want to save just in case?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); - if (Result == (int)MsgBoxResult.Yes) + + DialogResult Result = MessageBox.Show(TheText + " may have unsaved changes." + Constants.vbCrLf + Constants.vbCrLf + "Do you want to save just in case?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); + + if (Result == DialogResult.Yes) { SaveButton_Click(new object(), new EventArgs()); WillExit = true; } - else if (Result == (int)MsgBoxResult.No) + else if (Result == DialogResult.No) { e.Cancel = false; WillExit = true; } - else if (Result == (int)MsgBoxResult.Cancel) + else if (Result == DialogResult.Cancel) { e.Cancel = true; } @@ -290,10 +260,13 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (WillExit) { - Directory.Delete(DS_Game_Maker.SessionsLib.SessionPath, true); - Directory.Delete(DS_Game_Maker.SessionsLib.CompilePath, true); - if (DS_Game_Maker.DSGMlib.IsNewProject) - File.Delete(Constants.AppDirectory + "NewProjects/" + DS_Game_Maker.SessionsLib.Session + ".dsgm"); + Directory.Delete(SessionsLib.SessionPath, true); + Directory.Delete(SessionsLib.CompilePath, true); + + if (DSGMlib.IsNewProject) + { + File.Delete(Constants.AppDirectory + "NewProjects/" + SessionsLib.Session + ".dsgm"); + } } } catch @@ -444,14 +417,22 @@ private void AddScriptButton_Click(object sender, EventArgs e) public bool OpenWarn() { - string TheText = "'" + DS_Game_Maker.DSGMlib.CacheProjectName + "'"; - if (DS_Game_Maker.DSGMlib.IsNewProject) + string TheText = "'" + DSGMlib.CacheProjectName + "'"; + + if (DSGMlib.IsNewProject) + { TheText = "your new Project"; - byte Answer = (byte)MessageBox.Show("Are you sure you want to open another Project?" + Constants.vbCrLf + Constants.vbCrLf + "You will lose any changes you have made to " + TheText + ".", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - if (Answer == (int)MsgBoxResult.Yes) + } + + DialogResult Answer = MessageBox.Show("Are you sure you want to open another Project?" + Constants.vbCrLf + Constants.vbCrLf + "You will lose any changes you have made to " + TheText + ".", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (Answer == DialogResult.Yes) + { return true; + } else + { return false; + } } private void OpenProjectButton_Click(object sender, EventArgs e) @@ -486,11 +467,12 @@ public void LoadLastProject(bool Automatic) if ((LastPath ?? "") == (DS_Game_Maker.DSGMlib.ProjectPath ?? "")) { // Same Project - Reload job - byte Result = (byte)MessageBox.Show("Do you want to reload the current Project?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - if (Result == (int)MsgBoxResult.Yes) + DialogResult Result = MessageBox.Show("Do you want to reload the current Project?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (Result == DialogResult.Yes) { - DS_Game_Maker.DSGMlib.CleanFresh(false); - DS_Game_Maker.DSGMlib.OpenProject(DS_Game_Maker.DSGMlib.ProjectPath); + DSGMlib.CleanFresh(false); + DSGMlib.OpenProject(DSGMlib.ProjectPath); + return; } } @@ -607,7 +589,7 @@ private void CompileGameButton_Click(object sender, EventArgs e) var withBlock = Program.Forms.compiled_Form; withBlock.Text = DS_Game_Maker.DSGMlib.CacheProjectName; withBlock.MainLabel.Text = DS_Game_Maker.DSGMlib.CacheProjectName; - withBlock.SubLabel.Text = Conversions.ToString(Operators.AddObject("Compiled by " + Environment.UserName + " at ", DS_Game_Maker.DSGMlib.GetTime())); + withBlock.SubLabel.Text = "Compiled by " + Environment.UserName + " at " + DSGMlib.GetTime(); withBlock.ShowDialog(); } } @@ -798,7 +780,7 @@ private void MainForm_Shown(object sender, EventArgs e) string SessionName = string.Empty; for (byte Looper = 0; Looper <= 10; Looper++) { - SessionName = Conversions.ToString(Operators.AddObject("NewProject", DS_Game_Maker.SessionsLib.MakeSessionName())); + SessionName = "NewProject" + SessionsLib.MakeSessionName(); if (!Directory.Exists(Constants.AppDirectory + "ProjectTemp/" + SessionName)) break; } diff --git a/RegistryLib.cs b/RegistryLib.cs deleted file mode 100644 index 734b1e5..0000000 --- a/RegistryLib.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.Win32; - -namespace DS_Game_Maker -{ - - static class RegistryLib - { - - public static void SetFileType(string @extension, string FileType) - { - var ext = Registry.ClassesRoot.CreateSubKey(@extension, RegistryKeyPermissionCheck.ReadWriteSubTree); - ext.SetValue("", FileType); - } - - public static void SetFileDescription(string FileType, string Description) - { - var ext = Registry.ClassesRoot.CreateSubKey(FileType, RegistryKeyPermissionCheck.ReadWriteSubTree); - ext.SetValue("", Description); - } - - public static void SetDefaultIcon(string FileType, string Icon) - { - var ext = Registry.ClassesRoot.OpenSubKey(FileType, true); - ext.SetValue("DefaultIcon", Icon); - } - - public static void AddAction(string FileType, string Verb, string ActionDescription) - { - var ext = Registry.ClassesRoot.OpenSubKey(FileType, true).CreateSubKey("Shell").CreateSubKey(Verb); - ext.SetValue("", ActionDescription); - } - - public static void SetExtensionCommandLine(string Command, string FileType, string CommandLine, string Name = "") - { - var rk = Registry.ClassesRoot; - var ext = rk.OpenSubKey(FileType, true).OpenSubKey("Shell", true).OpenSubKey(Command, true).CreateSubKey("Command", RegistryKeyPermissionCheck.ReadWriteSubTree); - ext.SetValue(Name, CommandLine); - } - - } -} \ No newline at end of file From 14978a86b41b6c4d066eb54bddc2630073a61b69 Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 11:57:51 -0500 Subject: [PATCH 04/10] Remove the redundant "DS_Game_Maker." from all cs files --- AboutDSGM.cs | 4 +- Action.cs | 36 ++--- ActionsLib.cs | 12 +- Argument.cs | 10 +- Background.cs | 126 +++++++-------- Compile.cs | 4 +- Compiled.cs | 16 +- DEvent.cs | 8 +- DObject.cs | 168 +++++++++---------- DSGMlib.cs | 342 +++++++++++++++++++-------------------- EditCode.cs | 12 +- FoundInScripts.cs | 16 +- GameSettings.cs | 86 +++++----- GlobalArrays.cs | 38 ++--- GlobalStructures.cs | 30 ++-- GlobalVariables.cs | 20 +-- ImportSprite.cs | 12 +- InputBoxForm.cs | 2 +- MainForm.cs | 386 ++++++++++++++++++++++---------------------- Options.cs | 86 +++++----- Preview.cs | 4 +- Room.cs | 114 ++++++------- Script.cs | 62 +++---- ScriptsLib.cs | 20 +-- SetCoOrdinates.cs | 8 +- Sound.cs | 50 +++--- Sprite.cs | 138 ++++++++-------- SpriteSize.cs | 2 +- Statistics.cs | 30 ++-- StructureItem.cs | 6 +- TransformSprite.cs | 10 +- Update.cs | 10 +- 32 files changed, 934 insertions(+), 934 deletions(-) diff --git a/AboutDSGM.cs b/AboutDSGM.cs index 8d368c0..0968e8d 100644 --- a/AboutDSGM.cs +++ b/AboutDSGM.cs @@ -11,7 +11,7 @@ public AboutDSGM() private void WebAddressLabel_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.URL(DS_Game_Maker.DSGMlib.Domain); + DSGMlib.URL(DSGMlib.Domain); } private void DOkayButton_Click(object sender, EventArgs e) @@ -21,7 +21,7 @@ private void DOkayButton_Click(object sender, EventArgs e) private void AboutDSGM_Load(object sender, EventArgs e) { - string VersionString = DS_Game_Maker.DSGMlib.IDVersion.ToString(); + string VersionString = DSGMlib.IDVersion.ToString(); VersionLabel.Text = "Version " + VersionString.Substring(0, 1) + "." + (VersionString.Substring(1).EndsWith("0") ? VersionString.Substring(1).Substring(0, 1) : VersionString.Substring(1)) + " (Release " + VersionString + ")"; } } diff --git a/Action.cs b/Action.cs index ad130ae..04906f1 100644 --- a/Action.cs +++ b/Action.cs @@ -21,7 +21,7 @@ public Action() public void InstancesBugger() { - DS_Game_Maker.DSGMlib.MsgWarn("The instance numbers must be separated by single spaces. You may also the IRandom function." + Constants.vbCrLf + Constants.vbCrLf + "For more information, see the manual."); + DSGMlib.MsgWarn("The instance numbers must be separated by single spaces. You may also the IRandom function." + Constants.vbCrLf + Constants.vbCrLf + "For more information, see the manual."); InstancesTextBox.Focus(); } @@ -49,7 +49,7 @@ private void DOkayButton_Click(object sender, EventArgs e) } if (IsOneEmpty) { - DS_Game_Maker.DSGMlib.MsgWarn("You must put something in every Argument box or selector."); + DSGMlib.MsgWarn("You must put something in every Argument box or selector."); ControlsPanel.Controls[DOn - 1].Focus(); return; } @@ -116,7 +116,7 @@ private void DOkayButton_Click(object sender, EventArgs e) } else if (X.Name.StartsWith("Comparative")) { - TheText = DS_Game_Maker.ScriptsLib.StringToComparative(TheText); + TheText = ScriptsLib.StringToComparative(TheText); } ArgumentString += TheText + ";"; } @@ -152,7 +152,7 @@ private void Action_Load(object sender, EventArgs e) NewLabel.Location = new Point(1, 8 + DOn * 24); LabelsPanel.Controls.Add(NewLabel); Control InputControl; - string TheContent = DS_Game_Maker.DSGMlib.iGet(ArgumentString, DOn, ";").ToString().Replace("", ","); + string TheContent = DSGMlib.iGet(ArgumentString, DOn, ";").ToString().Replace("", ","); if (ArgumentType == 0 | ArgumentType == 12) { InputControl = new TextBox(); @@ -191,7 +191,7 @@ private void Action_Load(object sender, EventArgs e) } else if (ArgumentType == 3) { - foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("GLOBAL ")) + foreach (string Y_ in DSGMlib.GetXDSFilter("GLOBAL ")) { string Y = Y_; Y = Y.Substring(7); @@ -202,7 +202,7 @@ private void Action_Load(object sender, EventArgs e) } else if (ArgumentType == 4) { - foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ")) + foreach (string Y_ in DSGMlib.GetXDSFilter("OBJECT ")) { string Y = Y_; Y = Y.Substring(7); @@ -213,13 +213,13 @@ private void Action_Load(object sender, EventArgs e) } else if (ArgumentType == 5) { - foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("BACKGROUND ")) + foreach (string Y in DSGMlib.GetXDSFilter("BACKGROUND ")) ((ComboBox)InputControl).Items.Add(Y.Substring(11)); InputControl.Name = "Background" + DOn.ToString(); } else if (ArgumentType == 6) { - foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("SOUND ")) + foreach (string Y_ in DSGMlib.GetXDSFilter("SOUND ")) { string Y = Y_; Y = Y.Substring(6); @@ -229,7 +229,7 @@ private void Action_Load(object sender, EventArgs e) } else if (ArgumentType == 7) { - foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("ROOM ")) + foreach (string Y_ in DSGMlib.GetXDSFilter("ROOM ")) { string Y = Y_; Y = Y.Substring(5); @@ -240,13 +240,13 @@ private void Action_Load(object sender, EventArgs e) } else if (ArgumentType == 8) { - foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("PATH ")) + foreach (string Y in DSGMlib.GetXDSFilter("PATH ")) ((ComboBox)InputControl).Items.Add(Y.Substring(5)); InputControl.Name = "Path" + DOn.ToString(); } else if (ArgumentType == 9) { - foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("SCRIPT ")) + foreach (string Y in DSGMlib.GetXDSFilter("SCRIPT ")) { string ScriptName = Y.Substring(7); ScriptName = ScriptName.Substring(0, ScriptName.LastIndexOf(",")); @@ -262,18 +262,18 @@ private void Action_Load(object sender, EventArgs e) ((ComboBox)InputControl).Items.Add("Less than or Equal to"); ((ComboBox)InputControl).Items.Add("Greater than or Equal to"); ((ComboBox)InputControl).Items.Add("Not Equal to"); - TheContent = DS_Game_Maker.ScriptsLib.ComparativeToString(TheContent); + TheContent = ScriptsLib.ComparativeToString(TheContent); InputControl.Name = "Comparative" + DOn.ToString(); } else if (ArgumentType == 11) { - foreach (string F in DS_Game_Maker.DSGMlib.Fonts) + foreach (string F in DSGMlib.Fonts) ((ComboBox)InputControl).Items.Add(F); } // 12 Unrestrictive = no difference else if (ArgumentType == 13) { - foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("SPRITE ")) + foreach (string Y in DSGMlib.GetXDSFilter("SPRITE ")) { string SpriteName = Y; SpriteName = SpriteName.Substring(7); @@ -289,7 +289,7 @@ private void Action_Load(object sender, EventArgs e) } else if (ArgumentType == 15) { - foreach (string Y in DS_Game_Maker.DSGMlib.GetXDSFilter("ARRAY ")) + foreach (string Y in DSGMlib.GetXDSFilter("ARRAY ")) { string ArrayName = Y; ArrayName = ArrayName.Substring(6); @@ -300,7 +300,7 @@ private void Action_Load(object sender, EventArgs e) } else if (ArgumentType == 16) { - foreach (string Y_ in DS_Game_Maker.DSGMlib.GetXDSFilter("STRUCTURE ")) + foreach (string Y_ in DSGMlib.GetXDSFilter("STRUCTURE ")) { string Y = Y_; Y = Y.Substring(10); @@ -334,7 +334,7 @@ private void Action_Load(object sender, EventArgs e) ControlsPanel.Visible = true; } InstancesOfDropper.Items.Clear(); - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ")) + foreach (string X_ in DSGMlib.GetXDSFilter("OBJECT ")) { string X = X_; X = X.Substring(7); @@ -346,7 +346,7 @@ private void Action_Load(object sender, EventArgs e) ThisRadioButton.Checked = true; CheckedSomething = true; } - else if (DS_Game_Maker.DSGMlib.IsObject(AppliesTo)) + else if (DSGMlib.IsObject(AppliesTo)) { InstancesOfRadioButton.Checked = true; InstancesOfDropper.Text = AppliesTo; diff --git a/ActionsLib.cs b/ActionsLib.cs index d00d441..1bd511a 100644 --- a/ActionsLib.cs +++ b/ActionsLib.cs @@ -21,9 +21,9 @@ public static string ActionEquateDisplay(string ActionName, string ActionArgumen return ActionName; foreach (string Y in File.ReadAllLines(Constants.AppDirectory + @"Actions\" + ActionName + ".action")) { - for (int Z = 0, loopTo = (int)DS_Game_Maker.DSGMlib.HowManyChar(ActionArguments, ";"); Z <= loopTo; Z++) + for (int Z = 0, loopTo = (int)DSGMlib.HowManyChar(ActionArguments, ";"); Z <= loopTo; Z++) { - string Argument = DS_Game_Maker.DSGMlib.iGet(ActionArguments, (byte)Z, ";"); + string Argument = DSGMlib.iGet(ActionArguments, (byte)Z, ";"); string StringThing = Argument; if (StringThing == "1") StringThing = "true"; @@ -31,7 +31,7 @@ public static string ActionEquateDisplay(string ActionName, string ActionArgumen StringThing = "false"; if (StringThing == "<" | StringThing == ">" | StringThing == ">=" | StringThing == "<=" | StringThing == "==") { - StringThing = DS_Game_Maker.ScriptsLib.ComparativeToString(StringThing); + StringThing = ScriptsLib.ComparativeToString(StringThing); } string ScreenThing = Argument; if (ScreenThing == "1") @@ -80,7 +80,7 @@ public static Bitmap ActionGetIcon(string ActionName) { var TBMP = new Bitmap(32, 32); var TBMPGFX = Graphics.FromImage(TBMP); - Bitmap TIcon = (Bitmap)DS_Game_Maker.DSGMlib.PathToImage(ActionGetIconPath(ActionName, true)); + Bitmap TIcon = (Bitmap)DSGMlib.PathToImage(ActionGetIconPath(ActionName, true)); if (TIcon.Width == 32) { TBMPGFX.DrawImageUnscaled(Properties.Resources.ActionBacker, 0, 0); @@ -90,11 +90,11 @@ public static Bitmap ActionGetIcon(string ActionName) { if (ActionIsConditional(ActionName)) { - TBMPGFX.DrawImageUnscaled(DS_Game_Maker.DSGMlib.ActionConditionalBG, 0, 0); + TBMPGFX.DrawImageUnscaled(DSGMlib.ActionConditionalBG, 0, 0); } else { - TBMPGFX.DrawImageUnscaled(DS_Game_Maker.DSGMlib.ActionBG, 0, 0); + TBMPGFX.DrawImageUnscaled(DSGMlib.ActionBG, 0, 0); } TBMPGFX.DrawImageUnscaled(TIcon, new Point(8, 8)); } diff --git a/Argument.cs b/Argument.cs index ea2ec50..fc33675 100644 --- a/Argument.cs +++ b/Argument.cs @@ -23,13 +23,13 @@ private void Argument_Load(object sender, EventArgs e) if (IsAction) { for (byte X = 1; X <= 16; X++) - TypeDropper.Items.Add(DS_Game_Maker.ScriptsLib.ArgumentTypeToString(X)); - TypeDropper.Text = DS_Game_Maker.ScriptsLib.ArgumentTypeToString(Conversions.ToByte(ArgumentType)); + TypeDropper.Items.Add(ScriptsLib.ArgumentTypeToString(X)); + TypeDropper.Text = ScriptsLib.ArgumentTypeToString(Conversions.ToByte(ArgumentType)); } else { - for (byte X = 0, loopTo = (byte)(DS_Game_Maker.ScriptsLib.VariableTypes.Count - 1); X <= loopTo; X++) - TypeDropper.Items.Add(DS_Game_Maker.ScriptsLib.VariableTypes[(int)X]); + for (byte X = 0, loopTo = (byte)(ScriptsLib.VariableTypes.Count - 1); X <= loopTo; X++) + TypeDropper.Items.Add(ScriptsLib.VariableTypes[(int)X]); TypeDropper.Text = ArgumentType; } NameTextBox.Text = ArgumentName; @@ -40,7 +40,7 @@ private void DOkayButton_Click(object sender, EventArgs e) ArgumentName = NameTextBox.Text; if (IsAction) { - ArgumentType = DS_Game_Maker.ScriptsLib.ArgumentStringToType(TypeDropper.Text).ToString(); + ArgumentType = ScriptsLib.ArgumentStringToType(TypeDropper.Text).ToString(); } else { diff --git a/Background.cs b/Background.cs index 7d0af40..e873d50 100644 --- a/Background.cs +++ b/Background.cs @@ -23,11 +23,11 @@ public Background() private void Background_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); NameTextBox.Text = BackgroundName; Text = BackgroundName; - RealPath = DS_Game_Maker.SessionsLib.SessionPath + @"Backgrounds\" + BackgroundName + ".png"; - TempPath = DS_Game_Maker.SessionsLib.SessionPath + @"Backgrounds\" + BackgroundName + "_Copy.png"; + RealPath = SessionsLib.SessionPath + @"Backgrounds\" + BackgroundName + ".png"; + TempPath = SessionsLib.SessionPath + @"Backgrounds\" + BackgroundName + "_Copy.png"; File.Delete(TempPath); File.Copy(RealPath, TempPath); ImageChanged = false; @@ -45,63 +45,63 @@ private void DAcceptButton_Click(object sender, EventArgs e) string NewName = NameTextBox.Text; if (!((BackgroundName ?? "") == (NewName ?? ""))) { - if (DS_Game_Maker.DSGMlib.GUIResNameChecker(NewName)) + if (DSGMlib.GUIResNameChecker(NewName)) return; } File.Delete(RealPath); File.Move(TempPath, RealPath); if (!((NewName ?? "") == (BackgroundName ?? ""))) { - DS_Game_Maker.DSGMlib.XDSChangeLine("BACKGROUND " + BackgroundName, "BACKGROUND " + NewName); - DS_Game_Maker.DSGMlib.SilentMoveFile(RealPath, DS_Game_Maker.SessionsLib.SessionPath + @"Backgrounds\" + NewName + ".png"); + DSGMlib.XDSChangeLine("BACKGROUND " + BackgroundName, "BACKGROUND " + NewName); + DSGMlib.SilentMoveFile(RealPath, SessionsLib.SessionPath + @"Backgrounds\" + NewName + ".png"); // File.Move(RealPath, SessionPath + "Backgrounds\" + NewName + ".png") foreach (Form X in Program.Forms.main_Form.MdiChildren) { if (X.Name == "Room") { - DS_Game_Maker.Room DForm = (DS_Game_Maker.Room)X; + Room DForm = (Room)X; DForm.RenameBackground(BackgroundName, NewName); } else if (X.Name == "DObject") { - DS_Game_Maker.DObject DForm = (DS_Game_Maker.DObject)X; - DForm.MyXDSLines = DS_Game_Maker.DSGMlib.UpdateActionsName(DForm.MyXDSLines, "Background", BackgroundName, NewName, false); + DObject DForm = (DObject)X; + DForm.MyXDSLines = DSGMlib.UpdateActionsName(DForm.MyXDSLines, "Background", BackgroundName, NewName, false); } } - if (DS_Game_Maker.DSGMlib.BGsToRedo.Contains(BackgroundName)) + if (DSGMlib.BGsToRedo.Contains(BackgroundName)) { byte P = 0; - foreach (string D in DS_Game_Maker.DSGMlib.BGsToRedo) + foreach (string D in DSGMlib.BGsToRedo) { if ((D ?? "") == (BackgroundName ?? "")) break; P = (byte)(P + 1); } - DS_Game_Maker.DSGMlib.BGsToRedo[(int)P] = NewName; + DSGMlib.BGsToRedo[(int)P] = NewName; } - DS_Game_Maker.DSGMlib.UpdateArrayActionsName("Background", BackgroundName, NewName, false); - DS_Game_Maker.DSGMlib.CurrentXDS = DS_Game_Maker.DSGMlib.UpdateActionsName(DS_Game_Maker.DSGMlib.CurrentXDS, "Background", BackgroundName, NewName, false); - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("ROOM ")) + DSGMlib.UpdateArrayActionsName("Background", BackgroundName, NewName, false); + DSGMlib.CurrentXDS = DSGMlib.UpdateActionsName(DSGMlib.CurrentXDS, "Background", BackgroundName, NewName, false); + foreach (string X_ in DSGMlib.GetXDSFilter("ROOM ")) { string X = X_; string Backup = X; X = X.Substring(5); bool TopChange = false; bool BottomChange = false; - if ((DS_Game_Maker.DSGMlib.iGet(X, (byte)4, ",") ?? "") == (BackgroundName ?? "")) + if ((DSGMlib.iGet(X, (byte)4, ",") ?? "") == (BackgroundName ?? "")) TopChange = true; - if ((DS_Game_Maker.DSGMlib.iGet(X, (byte)8, ",") ?? "") == (BackgroundName ?? "")) + if ((DSGMlib.iGet(X, (byte)8, ",") ?? "") == (BackgroundName ?? "")) BottomChange = true; if (TopChange & BottomChange) { string NewLine = "ROOM "; for (byte I = 0; I <= 3; I++) - NewLine += DS_Game_Maker.DSGMlib.iGet(X, I, ",") + ","; + NewLine += DSGMlib.iGet(X, I, ",") + ","; NewLine += NewName + ","; for (byte I = 5; I <= 7; I++) - NewLine += DS_Game_Maker.DSGMlib.iGet(X, I, ",") + ","; + NewLine += DSGMlib.iGet(X, I, ",") + ","; NewLine += NewName; - DS_Game_Maker.DSGMlib.XDSChangeLine(Backup, NewLine); + DSGMlib.XDSChangeLine(Backup, NewLine); } else { @@ -109,62 +109,62 @@ private void DAcceptButton_Click(object sender, EventArgs e) { string NewLine = "ROOM "; for (byte I = 0; I <= 3; I++) - NewLine += DS_Game_Maker.DSGMlib.iGet(X, I, ",") + ","; + NewLine += DSGMlib.iGet(X, I, ",") + ","; NewLine += NewName + ","; for (byte I = 5; I <= 8; I++) - NewLine += DS_Game_Maker.DSGMlib.iGet(X, I, ",") + ","; + NewLine += DSGMlib.iGet(X, I, ",") + ","; NewLine = NewLine.Substring(0, NewLine.Length - 1); - DS_Game_Maker.DSGMlib.XDSChangeLine(Backup, NewLine); + DSGMlib.XDSChangeLine(Backup, NewLine); } if (BottomChange) { string NewLine = "ROOM "; for (byte I = 0; I <= 7; I++) - NewLine += DS_Game_Maker.DSGMlib.iGet(X, I, ",") + ","; + NewLine += DSGMlib.iGet(X, I, ",") + ","; NewLine += NewName; - DS_Game_Maker.DSGMlib.XDSChangeLine(Backup, NewLine); + DSGMlib.XDSChangeLine(Backup, NewLine); } } } } if (ImageChanged) { - if (DS_Game_Maker.DSGMlib.BGsToRedo.Contains(BackgroundName)) - DS_Game_Maker.DSGMlib.BGsToRedo.Remove(BackgroundName); - DS_Game_Maker.DSGMlib.BGsToRedo.Add(NewName); + if (DSGMlib.BGsToRedo.Contains(BackgroundName)) + DSGMlib.BGsToRedo.Remove(BackgroundName); + DSGMlib.BGsToRedo.Add(NewName); foreach (Form X in Program.Forms.main_Form.MdiChildren) { if (!(X.Name == "Room")) continue; - if ((((DS_Game_Maker.Room)X).TopBG ?? "") == (NewName ?? "")) + if ((((Room)X).TopBG ?? "") == (NewName ?? "")) { - ((DS_Game_Maker.Room)X).RefreshRoom(true); + ((Room)X).RefreshRoom(true); } - if ((((DS_Game_Maker.Room)X).BottomBG ?? "") == (NewName ?? "")) + if ((((Room)X).BottomBG ?? "") == (NewName ?? "")) { - ((DS_Game_Maker.Room)X).RefreshRoom(false); + ((Room)X).RefreshRoom(false); } } // Remove the old files (no use!!!!!) - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\" + BackgroundName + ".png"); - if (Directory.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin")) + File.Delete(SessionsLib.CompilePath + @"gfx\" + BackgroundName + ".png"); + if (Directory.Exists(SessionsLib.CompilePath + @"gfx\bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Tiles.bin"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Map.bin"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Pal.bin"); + File.Delete(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c"); + File.Delete(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Tiles.bin"); + File.Delete(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Map.bin"); + File.Delete(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Pal.bin"); } } if (!((BackgroundName ?? "") == (NewName ?? ""))) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c")) + if (File.Exists(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c")) { - var BackupDate = File.GetLastWriteTime(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c"); + var BackupDate = File.GetLastWriteTime(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c"); // SilentMoveFile(CompilePath + "gfx\bin\" + BackgroundName + ".c", CompilePath + "gfx\bin\" + NewName + ".c") - File.Move(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c", DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c"); + File.Move(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + ".c", SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c"); string ToWrite = string.Empty; string ToPaste = string.Empty; - foreach (string X in DS_Game_Maker.DSGMlib.StringToLines(DS_Game_Maker.DSGMlib.PathToString(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c"))) + foreach (string X in DSGMlib.StringToLines(DSGMlib.PathToString(SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c"))) { ToPaste = X; switch (X ?? "") @@ -207,38 +207,38 @@ private void DAcceptButton_Click(object sender, EventArgs e) } ToWrite += ToPaste + Constants.vbCrLf; } - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c", ToWrite); - File.SetLastWriteTime(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c", BackupDate); + File.WriteAllText(SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c", ToWrite); + File.SetLastWriteTime(SessionsLib.CompilePath + @"gfx\bin\" + NewName + ".c", BackupDate); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Map.bin")) + if (File.Exists(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Map.bin")) { - DS_Game_Maker.DSGMlib.SilentMoveFile(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Map.bin", DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + NewName + "_Map.bin"); + DSGMlib.SilentMoveFile(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Map.bin", SessionsLib.CompilePath + @"gfx\bin\" + NewName + "_Map.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Tiles.bin")) + if (File.Exists(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Tiles.bin")) { - DS_Game_Maker.DSGMlib.SilentMoveFile(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Tiles.bin", DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + NewName + "_Tiles.bin"); + DSGMlib.SilentMoveFile(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Tiles.bin", SessionsLib.CompilePath + @"gfx\bin\" + NewName + "_Tiles.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Pal.bin")) + if (File.Exists(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Pal.bin")) { - DS_Game_Maker.DSGMlib.SilentMoveFile(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Pal.bin", DS_Game_Maker.SessionsLib.CompilePath + @"gfx\bin\" + NewName + "_Pal.bin"); + DSGMlib.SilentMoveFile(SessionsLib.CompilePath + @"gfx\bin\" + BackgroundName + "_Pal.bin", SessionsLib.CompilePath + @"gfx\bin\" + NewName + "_Pal.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\" + BackgroundName + ".png")) + if (File.Exists(SessionsLib.CompilePath + @"gfx\" + BackgroundName + ".png")) { - DS_Game_Maker.DSGMlib.SilentMoveFile(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\" + BackgroundName + ".png", DS_Game_Maker.SessionsLib.CompilePath + @"gfx\" + NewName + ".png"); + DSGMlib.SilentMoveFile(SessionsLib.CompilePath + @"gfx\" + BackgroundName + ".png", SessionsLib.CompilePath + @"gfx\" + NewName + ".png"); } string NewString = string.Empty; - foreach (string X_ in DS_Game_Maker.DSGMlib.StringToLines(DS_Game_Maker.DSGMlib.PathToString(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\dsgm_gfx.h"))) + foreach (string X_ in DSGMlib.StringToLines(DSGMlib.PathToString(SessionsLib.CompilePath + @"gfx\dsgm_gfx.h"))) { string X = X_; if ((X ?? "") == ("extern const PA_BgStruct " + BackgroundName + ";" ?? "")) X = "extern const PA_BgStruct " + NewName + ";"; NewString += X + Constants.vbCrLf; } - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\temp_gfx.h", NewString); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\dsgm_gfx.h"); - DS_Game_Maker.DSGMlib.SilentMoveFile(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\temp_gfx.h", DS_Game_Maker.SessionsLib.CompilePath + @"gfx\dsgm_gfx.h"); + File.WriteAllText(SessionsLib.CompilePath + @"gfx\temp_gfx.h", NewString); + File.Delete(SessionsLib.CompilePath + @"gfx\dsgm_gfx.h"); + DSGMlib.SilentMoveFile(SessionsLib.CompilePath + @"gfx\temp_gfx.h", SessionsLib.CompilePath + @"gfx\dsgm_gfx.h"); } - foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DS_Game_Maker.DSGMlib.ResourceIDs.Background].Nodes) + foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DSGMlib.ResourceIDs.Background].Nodes) { if ((X.Text ?? "") == (BackgroundName ?? "")) X.Text = NewName; @@ -248,23 +248,23 @@ private void DAcceptButton_Click(object sender, EventArgs e) public void MakePreview() { - PreviewPanel.BackgroundImage = DS_Game_Maker.DSGMlib.PathToImage(TempPath); + PreviewPanel.BackgroundImage = DSGMlib.PathToImage(TempPath); } private void LoadfromFileButton_Click(object sender, EventArgs e) { - string Result = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, DS_Game_Maker.DSGMlib.ImageFilter); + string Result = DSGMlib.OpenFile(string.Empty, DSGMlib.ImageFilter); if (Result.Length == 0) return; - var NewSize = DS_Game_Maker.DSGMlib.PathToImage(Result).Size; + var NewSize = DSGMlib.PathToImage(Result).Size; if (!(NewSize.Width % 256 == 0)) { - DS_Game_Maker.DSGMlib.MsgError("The width of the Background must be a multiple of 256 pixels."); + DSGMlib.MsgError("The width of the Background must be a multiple of 256 pixels."); return; } if (!(NewSize.Height % 256 == 0) & !(NewSize.Height == 192)) { - DS_Game_Maker.DSGMlib.MsgError("The height of the Background must be either 192 pixels high or a multiple of 256 pixels."); + DSGMlib.MsgError("The height of the Background must be either 192 pixels high or a multiple of 256 pixels."); return; } File.Delete(TempPath); @@ -275,7 +275,7 @@ private void LoadfromFileButton_Click(object sender, EventArgs e) private void EditButton_Click(object sender, EventArgs e) { - if (!DS_Game_Maker.DSGMlib.EditImage(TempPath, BackgroundName, false)) + if (!DSGMlib.EditImage(TempPath, BackgroundName, false)) return; ImageChanged = true; MakePreview(); diff --git a/Compile.cs b/Compile.cs index 084262a..94fceaa 100644 --- a/Compile.cs +++ b/Compile.cs @@ -25,8 +25,8 @@ public void CustomPerformStep(string Stage) private void Compile_Shown(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.CompileWrapper(); - Success = DS_Game_Maker.DSGMlib.CompileGame(); + DSGMlib.CompileWrapper(); + Success = DSGMlib.CompileGame(); Close(); } diff --git a/Compiled.cs b/Compiled.cs index 2477d8c..75c6554 100644 --- a/Compiled.cs +++ b/Compiled.cs @@ -21,20 +21,20 @@ private void CloseButton_Click(object sender, EventArgs e) private void OpenCompileFolderButton_Click(object sender, EventArgs e) { - Process.Start("explorer", DS_Game_Maker.SessionsLib.CompilePath); + Process.Start("explorer", SessionsLib.CompilePath); } private void PlayButton_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.NOGBAShizzle(); + DSGMlib.NOGBAShizzle(); } private void SaveNDSFileButton_Click(object sender, EventArgs e) { - string Response = DS_Game_Maker.DSGMlib.SaveFile(string.Empty, "NDS Binaries|*.nds", DS_Game_Maker.DSGMlib.CacheProjectName + ".nds"); + string Response = DSGMlib.SaveFile(string.Empty, "NDS Binaries|*.nds", DSGMlib.CacheProjectName + ".nds"); if (Response.Length == 0) return; - File.Copy(DS_Game_Maker.SessionsLib.CompilePath + DS_Game_Maker.SessionsLib.CompileName + ".nds", Response, true); + File.Copy(SessionsLib.CompilePath + SessionsLib.CompileName + ".nds", Response, true); } private void SavetoKitButton_Click(object sender, EventArgs e) @@ -50,14 +50,14 @@ private void SavetoKitButton_Click(object sender, EventArgs e) } if (HBKitDrive.Length == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("There is no USB Reader for a DS Homebrew Kit connected."); + DSGMlib.MsgWarn("There is no USB Reader for a DS Homebrew Kit connected."); return; } - File.Copy(DS_Game_Maker.SessionsLib.CompilePath + DS_Game_Maker.SessionsLib.CompileName + ".nds", HBKitDrive + DS_Game_Maker.DSGMlib.CacheProjectName + ".nds", true); - byte Response = (byte)MessageBox.Show("'" + DS_Game_Maker.DSGMlib.CacheProjectName + "' was copied successfully." + Constants.vbCrLf + Constants.vbCrLf + "Safely disconnect USB Reader now?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question); + File.Copy(SessionsLib.CompilePath + SessionsLib.CompileName + ".nds", HBKitDrive + DSGMlib.CacheProjectName + ".nds", true); + byte Response = (byte)MessageBox.Show("'" + DSGMlib.CacheProjectName + "' was copied successfully." + Constants.vbCrLf + Constants.vbCrLf + "Safely disconnect USB Reader now?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (!(Response == (int)MsgBoxResult.Yes)) return; - DS_Game_Maker.DSGMlib.RunBatchString("EjectMedia " + HBKitDrive + Constants.vbCrLf + "RemoveDrive " + HBKitDrive, Constants.AppDirectory, false); + DSGMlib.RunBatchString("EjectMedia " + HBKitDrive + Constants.vbCrLf + "RemoveDrive " + HBKitDrive, Constants.AppDirectory, false); } } } \ No newline at end of file diff --git a/DEvent.cs b/DEvent.cs index 98e4eff..1ddb7be 100644 --- a/DEvent.cs +++ b/DEvent.cs @@ -26,7 +26,7 @@ private void DCancelButton_Click() private void DEvent_Load(object sender, EventArgs e) { - Dropper.Renderer = new DS_Game_Maker.clsMenuRenderer(); + Dropper.Renderer = new clsMenuRenderer(); UseData = false; } @@ -34,7 +34,7 @@ public void EquateDropper() { Dropper.Items.Clear(); var NewItems = new List(); - switch (DS_Game_Maker.ScriptsLib.MainClassStringToType(MainClass)) + switch (ScriptsLib.MainClassStringToType(MainClass)) { case (byte)2: case (byte)3: @@ -64,7 +64,7 @@ public void EquateDropper() } case (byte)6: { - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ")) + foreach (string X_ in DSGMlib.GetXDSFilter("OBJECT ")) { string X = X_; X = X.Substring(7); @@ -83,7 +83,7 @@ public void EquateDropper() private void EventButtons_Click(object sender, EventArgs e) { MainClass = ((Button)sender).Text.Substring(6); - byte X = DS_Game_Maker.ScriptsLib.MainClassStringToType(MainClass); + byte X = ScriptsLib.MainClassStringToType(MainClass); if (X == 1 | X == 7) { SubClass = "NoData"; diff --git a/DObject.cs b/DObject.cs index 12c0022..d9acb58 100644 --- a/DObject.cs +++ b/DObject.cs @@ -58,7 +58,7 @@ public void ActionMouseEnter(object sender, EventArgs e) if (X.StartsWith("ARG ")) { X = X.Substring(4); - string ArgumentName = DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ","); + string ArgumentName = DSGMlib.iGet(X, (byte)0, ","); ArgumentsListLabel.Text += ArgumentName + Constants.vbCrLf; ArgumentCount = (byte)(ArgumentCount + 1); } @@ -66,7 +66,7 @@ public void ActionMouseEnter(object sender, EventArgs e) if (ArgumentCount == 0) ArgumentsListLabel.Text = ""; bool RequiresPro = false; - foreach (string X in DS_Game_Maker.DSGMlib.ProActions) + foreach (string X in DSGMlib.ProActions) { if ((X ?? "") == (ActionName ?? "")) RequiresPro = true; @@ -90,7 +90,7 @@ public void ActionMouseUp(object sender, MouseEventArgs e) string ActionName = (string)DraggingFromBottom.Tag; if (SelectedEvent == 100) { - DS_Game_Maker.DSGMlib.MsgWarn("You must add an Event, to which to add Actions."); + DSGMlib.MsgWarn("You must add an Event, to which to add Actions."); return; } if (!DragFromBottom) @@ -135,9 +135,9 @@ public void ActionMouseUp(object sender, MouseEventArgs e) if (JustAdd) { Actions.Add(ActionName); - ActionImages.Add(DS_Game_Maker.ActionsLib.ActionGetIconPath(ActionName, false)); + ActionImages.Add(ActionsLib.ActionGetIconPath(ActionName, false)); ActionArguments.Add(string.Empty); - ActionDisplays.Add(DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, string.Empty)); + ActionDisplays.Add(ActionsLib.ActionEquateDisplay(ActionName, string.Empty)); ActionAppliesTos.Add("this"); GenerateIndentIndices(); ActionsList.Items.Add(string.Empty); @@ -147,9 +147,9 @@ public void ActionMouseUp(object sender, MouseEventArgs e) else { Actions.Insert(Position, ActionName); - ActionImages.Insert((int)Position, DS_Game_Maker.ActionsLib.ActionGetIconPath(ActionName, false)); + ActionImages.Insert((int)Position, ActionsLib.ActionGetIconPath(ActionName, false)); ActionArguments.Insert(Position, string.Empty); - ActionDisplays.Insert((int)Position, DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, string.Empty)); + ActionDisplays.Insert((int)Position, ActionsLib.ActionEquateDisplay(ActionName, string.Empty)); ActionAppliesTos.Insert(Position, "this"); GenerateIndentIndices(); ActionsList.Items.Insert(Position, string.Empty); @@ -196,38 +196,38 @@ public void ActionMouseUp(object sender, MouseEventArgs e) if (JustAdd) { Actions.Add(ActionName); - ActionImages.Add(DS_Game_Maker.ActionsLib.ActionGetIconPath(ActionName, false)); + ActionImages.Add(ActionsLib.ActionGetIconPath(ActionName, false)); } else { Actions.Insert(Position, ActionName); - ActionImages.Insert((int)Position, DS_Game_Maker.ActionsLib.ActionGetIconPath(ActionName, false)); + ActionImages.Insert((int)Position, ActionsLib.ActionGetIconPath(ActionName, false)); } if (Code) { if (JustAdd) { ActionArguments.Add(Program.Forms.editCode_Form.ReturnableCode); - ActionDisplays.Add(DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.editCode_Form.ReturnableCode)); + ActionDisplays.Add(ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.editCode_Form.ReturnableCode)); ActionAppliesTos.Add("this"); } else { ActionArguments.Insert((int)Position, Program.Forms.editCode_Form.ReturnableCode); - ActionDisplays.Insert((int)Position, DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.editCode_Form.ReturnableCode)); + ActionDisplays.Insert((int)Position, ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.editCode_Form.ReturnableCode)); ActionAppliesTos.Insert(Position, "this"); } } else if (JustAdd) { ActionArguments.Add(Program.Forms.action_Form.ArgumentString); - ActionDisplays.Add(DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.action_Form.ArgumentString)); + ActionDisplays.Add(ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.action_Form.ArgumentString)); ActionAppliesTos.Add(Program.Forms.action_Form.AppliesTo); } else { ActionArguments.Insert((int)Position, Program.Forms.action_Form.ArgumentString); - ActionDisplays.Insert((int)Position, DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.action_Form.ArgumentString)); + ActionDisplays.Insert((int)Position, ActionsLib.ActionEquateDisplay(ActionName, Program.Forms.action_Form.ArgumentString)); ActionAppliesTos.Insert((int)Position, Program.Forms.action_Form.AppliesTo); } GenerateIndentIndices(); @@ -324,17 +324,17 @@ public void RenderSprite() } else { - ImagePath = DS_Game_Maker.SessionsLib.SessionPath + @"Sprites\" + Frame.ToString() + "_" + SpriteDropper.Text + ".png"; + ImagePath = SessionsLib.SessionPath + @"Sprites\" + Frame.ToString() + "_" + SpriteDropper.Text + ".png"; } - var Drawable = DS_Game_Maker.DSGMlib.PathToImage(ImagePath); - Drawable = DS_Game_Maker.DSGMlib.MakeBMPTransparent(Drawable, Color.Magenta); + var Drawable = DSGMlib.PathToImage(ImagePath); + Drawable = DSGMlib.MakeBMPTransparent(Drawable, Color.Magenta); FinalGFX.DrawImage(Drawable, new Point((int)Math.Round(32d - (double)Drawable.Width / 2d), (int)Math.Round(32d - (double)Drawable.Height / 2d))); SpritePanel.BackgroundImage = Final; } public void PopulateActionsTabControl(ref TabControl RAppliesTo) { - bool Hide = DS_Game_Maker.SettingsLib.GetSetting("HIDE_OLD_ACTIONS") == "1"; + bool Hide = SettingsLib.GetSetting("HIDE_OLD_ACTIONS") == "1"; var BannedActions = new List(); BannedActions.Add("load collision map"); BannedActions.Add("if position free"); @@ -375,8 +375,8 @@ public void PopulateActionsTabControl(ref TabControl RAppliesTo) for (byte X = 0; X <= 5; X++) { var Y = new TabPage(); - Y.Text = DS_Game_Maker.ScriptsLib.ActionTypeToString(X); - Y.Name = DS_Game_Maker.ScriptsLib.ActionTypeToString(X) + "TabPage"; + Y.Text = ScriptsLib.ActionTypeToString(X); + Y.Name = ScriptsLib.ActionTypeToString(X) + "TabPage"; Y.AutoScroll = true; Y.SetAutoScrollMargin(8, 8); @@ -414,7 +414,7 @@ public void PopulateActionsTabControl(ref TabControl RAppliesTo) NewPanel.Name = Z.Replace(" ", "_") + "ActionPanel"; NewPanel.Location = new Point(10 + XOn * 32 + XOn * 10, 10 + YOn * 32 + YOn * 10); // MsgError(Z + " at " + NewPanel.Location.ToString) - NewPanel.BackgroundImage = DS_Game_Maker.ActionsLib.ActionGetIcon(Z); + NewPanel.BackgroundImage = ActionsLib.ActionGetIcon(Z); Y.Controls.Add(NewPanel); // AddHandler NewPanel.Click, AddressOf ActionPanelClicked NewPanel.MouseDown += ActionMouseDown; @@ -468,7 +468,7 @@ private void DObject_Load(object sender, EventArgs e) foreach (string X in DSGMlib.GetXDSFilter("EVENT " + ObjectName + ",")) { MyXDSLines += X + Constants.vbCrLf; - //DEventMainClasses.Add(DS_Game_Maker.ScriptsLib.MainClassTypeToString(Conversions.ToByte(DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",")))); + //DEventMainClasses.Add(ScriptsLib.MainClassTypeToString(Conversions.ToByte(DSGMlib.iGet(X, (byte)1, ",")))); DEventMainClasses.Add(ScriptsLib.MainClassTypeToString(Convert.ToByte(DSGMlib.iGet(X, 1, ",")))); DEventSubClasses.Add(DSGMlib.iGet(X, 2, ",")); } @@ -505,26 +505,26 @@ private void DAcceptButton_Click(object sender, EventArgs e) string NewName = NameTextBox.Text; if (!((ObjectName ?? "") == (NewName ?? ""))) { - if (DS_Game_Maker.DSGMlib.GUIResNameChecker(NameTextBox.Text)) + if (DSGMlib.GUIResNameChecker(NameTextBox.Text)) return; } if (NewName == "NoData") { - DS_Game_Maker.DSGMlib.MsgWarn("'NoData' is not a valid name. You must choose another name."); + DSGMlib.MsgWarn("'NoData' is not a valid name. You must choose another name."); return; } if (NewName == "this") { - DS_Game_Maker.DSGMlib.MsgWarn("'this' is not a valid name. You must choose another name."); + DSGMlib.MsgWarn("'this' is not a valid name. You must choose another name."); return; } - string OldLine = DS_Game_Maker.DSGMlib.GetXDSLine("OBJECT " + ObjectName + ","); + string OldLine = DSGMlib.GetXDSLine("OBJECT " + ObjectName + ","); string NewLine = "OBJECT " + NewName + "," + SpriteDropper.Text + "," + Frame.ToString(); - DS_Game_Maker.DSGMlib.XDSChangeLine(OldLine, NewLine); - DS_Game_Maker.DSGMlib.XDSRemoveFilter("EVENT " + ObjectName + ","); - DS_Game_Maker.DSGMlib.XDSRemoveFilter("ACT " + ObjectName + ","); - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECTPLOT " + ObjectName + ",")) - DS_Game_Maker.DSGMlib.XDSChangeLine(X, "OBJECTPLOT " + NewName + X.Substring(X.IndexOf(","))); + DSGMlib.XDSChangeLine(OldLine, NewLine); + DSGMlib.XDSRemoveFilter("EVENT " + ObjectName + ","); + DSGMlib.XDSRemoveFilter("ACT " + ObjectName + ","); + foreach (string X in DSGMlib.GetXDSFilter("OBJECTPLOT " + ObjectName + ",")) + DSGMlib.XDSChangeLine(X, "OBJECTPLOT " + NewName + X.Substring(X.IndexOf(","))); string FinalString = string.Empty; if ((NewName ?? "") == (ObjectName ?? "")) { @@ -532,7 +532,7 @@ private void DAcceptButton_Click(object sender, EventArgs e) } else if (MyXDSLines.Length > 0) { - foreach (string X_ in DS_Game_Maker.DSGMlib.StringToLines(MyXDSLines)) + foreach (string X_ in DSGMlib.StringToLines(MyXDSLines)) { string X = X_; if (X.StartsWith("EVENT ")) @@ -547,12 +547,12 @@ private void DAcceptButton_Click(object sender, EventArgs e) } } // FinalString = UpdateActionsName(FinalString, "Object", ObjectName, NewName, True) - DS_Game_Maker.DSGMlib.CurrentXDS += Constants.vbCrLf + FinalString + Constants.vbCrLf; + DSGMlib.CurrentXDS += Constants.vbCrLf + FinalString + Constants.vbCrLf; foreach (Form X in Program.Forms.main_Form.MdiChildren) { if (X.Name == "Room") { - DS_Game_Maker.Room DForm = (DS_Game_Maker.Room)X; + Room DForm = (Room)X; DForm.RenameObjectDropper(ObjectName, NewName); for (byte DOn = 0, loopTo = (byte)(DForm.Objects.Length - 1); DOn <= loopTo; DOn++) { @@ -561,45 +561,45 @@ private void DAcceptButton_Click(object sender, EventArgs e) } } } - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("ACT ")) + foreach (string X in DSGMlib.GetXDSFilter("ACT ")) { - short SubPoint = (short)(DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ",").Length + 1 + DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",").Length); - short SubPoint2 = (short)(SubPoint + 1 + DS_Game_Maker.DSGMlib.iGet(X, (byte)2, ",").Length + 1); - if (DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",") == "6") + short SubPoint = (short)(DSGMlib.iGet(X, (byte)0, ",").Length + 1 + DSGMlib.iGet(X, (byte)1, ",").Length); + short SubPoint2 = (short)(SubPoint + 1 + DSGMlib.iGet(X, (byte)2, ",").Length + 1); + if (DSGMlib.iGet(X, (byte)1, ",") == "6") { - if ((DS_Game_Maker.DSGMlib.iGet(X, (byte)2, ",") ?? "") == (ObjectName ?? "")) + if ((DSGMlib.iGet(X, (byte)2, ",") ?? "") == (ObjectName ?? "")) { - DS_Game_Maker.DSGMlib.XDSChangeLine(X, X.Substring(0, SubPoint) + "," + NewName + "," + X.Substring(SubPoint2)); + DSGMlib.XDSChangeLine(X, X.Substring(0, SubPoint) + "," + NewName + "," + X.Substring(SubPoint2)); } } } - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("EVENT ")) + foreach (string X in DSGMlib.GetXDSFilter("EVENT ")) { - if (DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",") == "6" & (DS_Game_Maker.DSGMlib.iGet(X, (byte)2, ",") ?? "") == (ObjectName ?? "")) - DS_Game_Maker.DSGMlib.XDSChangeLine(X, DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ",") + ",6," + NewName); + if (DSGMlib.iGet(X, (byte)1, ",") == "6" & (DSGMlib.iGet(X, (byte)2, ",") ?? "") == (ObjectName ?? "")) + DSGMlib.XDSChangeLine(X, DSGMlib.iGet(X, (byte)0, ",") + ",6," + NewName); } - DS_Game_Maker.DSGMlib.CurrentXDS = DS_Game_Maker.DSGMlib.UpdateActionsName(DS_Game_Maker.DSGMlib.CurrentXDS, "Object", ObjectName, NewName, true); + DSGMlib.CurrentXDS = DSGMlib.UpdateActionsName(DSGMlib.CurrentXDS, "Object", ObjectName, NewName, true); foreach (Form X in Program.Forms.main_Form.MdiChildren) { - if (!DS_Game_Maker.DSGMlib.IsObject(X.Text)) + if (!DSGMlib.IsObject(X.Text)) continue; DObject DForm = (DObject)X; if (DForm.MyXDSLines.Length == 0) continue; string LF = string.Empty; - foreach (string Y_ in DS_Game_Maker.DSGMlib.StringToLines(DForm.MyXDSLines)) + foreach (string Y_ in DSGMlib.StringToLines(DForm.MyXDSLines)) { string Y = Y_; if (Y.StartsWith("EVENT ")) { - if (DS_Game_Maker.DSGMlib.iGet(Y, (byte)1, ",") == "6" & (DS_Game_Maker.DSGMlib.iGet(Y, (byte)2, ",") ?? "") == (ObjectName ?? "")) - Y = DS_Game_Maker.DSGMlib.iGet(Y, (byte)0, ",") + ",6," + NewName; + if (DSGMlib.iGet(Y, (byte)1, ",") == "6" & (DSGMlib.iGet(Y, (byte)2, ",") ?? "") == (ObjectName ?? "")) + Y = DSGMlib.iGet(Y, (byte)0, ",") + ",6," + NewName; } if (Y.StartsWith("ACT ")) { - short SubPoint = (short)(DS_Game_Maker.DSGMlib.iGet(Y, (byte)0, ",").Length + 1 + DS_Game_Maker.DSGMlib.iGet(Y, (byte)1, ",").Length); - short SubPoint2 = (short)(SubPoint + 1 + DS_Game_Maker.DSGMlib.iGet(Y, (byte)2, ",").Length + 1); - if (DS_Game_Maker.DSGMlib.iGet(Y, (byte)1, ",") == "6" & (DS_Game_Maker.DSGMlib.iGet(Y, (byte)2, ",") ?? "") == (ObjectName ?? "")) + short SubPoint = (short)(DSGMlib.iGet(Y, (byte)0, ",").Length + 1 + DSGMlib.iGet(Y, (byte)1, ",").Length); + short SubPoint2 = (short)(SubPoint + 1 + DSGMlib.iGet(Y, (byte)2, ",").Length + 1); + if (DSGMlib.iGet(Y, (byte)1, ",") == "6" & (DSGMlib.iGet(Y, (byte)2, ",") ?? "") == (ObjectName ?? "")) { Y = Y.Substring(0, SubPoint) + "," + NewName + "," + Y.Substring(SubPoint2); } @@ -613,9 +613,9 @@ private void DAcceptButton_Click(object sender, EventArgs e) if (!(X.Name == "DObject")) continue; DObject DForm = (DObject)X; - DForm.MyXDSLines = DS_Game_Maker.DSGMlib.UpdateActionsName(DForm.MyXDSLines, "Object", ObjectName, NewName, true); + DForm.MyXDSLines = DSGMlib.UpdateActionsName(DForm.MyXDSLines, "Object", ObjectName, NewName, true); } - DS_Game_Maker.DSGMlib.UpdateArrayActionsName("Object", ObjectName, NewName, true); + DSGMlib.UpdateArrayActionsName("Object", ObjectName, NewName, true); foreach (Form X in Program.Forms.main_Form.MdiChildren) { if (!(X.Name == "DObject")) @@ -643,7 +643,7 @@ private void DAcceptButton_Click(object sender, EventArgs e) } } } - foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DS_Game_Maker.DSGMlib.ResourceIDs.DObject].Nodes) + foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DSGMlib.ResourceIDs.DObject].Nodes) { if ((X.Text ?? "") == (ObjectName ?? "")) X.Text = NewName; @@ -677,7 +677,7 @@ private void SpriteDropper_SelectedIndexChanged(object sender, EventArgs e) } else { - foreach (string X_ in Directory.GetFiles(DS_Game_Maker.SessionsLib.SessionPath + "Sprites")) + foreach (string X_ in Directory.GetFiles(SessionsLib.SessionPath + "Sprites")) { string X = X_; X = X.Substring(X.LastIndexOf(@"\") + 1); @@ -738,7 +738,7 @@ private void AddEventButton_Click(object sender, EventArgs e) return; } } - string NewLine = "EVENT " + NameTextBox.Text + "," + DS_Game_Maker.ScriptsLib.MainClassStringToType(MainClass).ToString() + "," + SubClass; + string NewLine = "EVENT " + NameTextBox.Text + "," + ScriptsLib.MainClassStringToType(MainClass).ToString() + "," + SubClass; MyXDSLines += NewLine + Constants.vbCrLf; if (DEventMainClasses.Count == 0) { @@ -768,7 +768,7 @@ private void EventsListBox_DrawItem(object sender, DrawItemEventArgs e) IsSelected = true; var Drawable = new Bitmap(16, 16); string FinalText = string.Empty; - switch (DS_Game_Maker.ScriptsLib.MainClassStringToType(DEventMainClasses[e.Index])) + switch (ScriptsLib.MainClassStringToType(DEventMainClasses[e.Index])) { case (byte)0: { @@ -859,13 +859,13 @@ public void DeleteEvent(short TheIndex) SelectedEvent = 100; } string FinalString = string.Empty; - foreach (string X in DS_Game_Maker.DSGMlib.StringToLines(MyXDSLines)) + foreach (string X in DSGMlib.StringToLines(MyXDSLines)) { - if (X.StartsWith("EVENT " + ObjectName + "," + DS_Game_Maker.ScriptsLib.MainClassStringToType(DEventMainClasses[TheIndex]).ToString() + "," + DEventSubClasses[TheIndex])) + if (X.StartsWith("EVENT " + ObjectName + "," + ScriptsLib.MainClassStringToType(DEventMainClasses[TheIndex]).ToString() + "," + DEventSubClasses[TheIndex])) { continue; } - if (X.StartsWith("ACT " + ObjectName + "," + DS_Game_Maker.ScriptsLib.MainClassStringToType(DEventMainClasses[TheIndex]).ToString() + "," + DEventSubClasses[TheIndex] + ",")) + if (X.StartsWith("ACT " + ObjectName + "," + ScriptsLib.MainClassStringToType(DEventMainClasses[TheIndex]).ToString() + "," + DEventSubClasses[TheIndex] + ",")) { continue; } @@ -910,19 +910,19 @@ private void ChangeEventButton_Click(object sender, EventArgs e) if (Program.Forms.dEvent_Form.UseData == false) return; short I = (short)EventsListBox.SelectedIndex; - byte OldMC = DS_Game_Maker.ScriptsLib.MainClassStringToType(DEventMainClasses[I]); + byte OldMC = ScriptsLib.MainClassStringToType(DEventMainClasses[I]); string OldSC = DEventSubClasses[I]; - byte MC = DS_Game_Maker.ScriptsLib.MainClassStringToType(Program.Forms.dEvent_Form.MainClass); + byte MC = ScriptsLib.MainClassStringToType(Program.Forms.dEvent_Form.MainClass); string SC = Program.Forms.dEvent_Form.SubClass; if (MC == OldMC & (SC ?? "") == (OldSC ?? "")) return; if (DEventMainClasses.Contains(Program.Forms.dEvent_Form.MainClass) & DEventSubClasses.Contains(Program.Forms.dEvent_Form.SubClass)) { - DS_Game_Maker.DSGMlib.MsgWarn("That event is already in-use."); + DSGMlib.MsgWarn("That event is already in-use."); return; } string FinalString = string.Empty; - foreach (string P_ in DS_Game_Maker.DSGMlib.StringToLines(MyXDSLines)) + foreach (string P_ in DSGMlib.StringToLines(MyXDSLines)) { string P = P_; if (P.Length == 0) @@ -982,14 +982,14 @@ private void ActionsList_DrawItem(object sender, DrawItemEventArgs e) if (ThinList) { e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImage(DS_Game_Maker.ActionsLib.ActionGetIcon(Actions[e.Index]), new Rectangle(MyX + 2, e.Bounds.Y + 2, 20, 20)); + e.Graphics.DrawImage(ActionsLib.ActionGetIcon(Actions[e.Index]), new Rectangle(MyX + 2, e.Bounds.Y + 2, 20, 20)); e.Graphics.DrawString(ActionDisplays[e.Index], new Font("Tahoma", 11f, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.White, MyX + ThinNum, e.Bounds.Y + 5 + 1); e.Graphics.DrawString(ActionDisplays[e.Index], new Font("Tahoma", 11f, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.Black, MyX + ThinNum, e.Bounds.Y + 5); return; } else { - e.Graphics.DrawImageUnscaled(DS_Game_Maker.ActionsLib.ActionGetIcon(Actions[e.Index]), new Point(MyX + 2, e.Bounds.Y + 2)); + e.Graphics.DrawImageUnscaled(ActionsLib.ActionGetIcon(Actions[e.Index]), new Point(MyX + 2, e.Bounds.Y + 2)); if (NiceArgs.Length > 0) { if (ThingString == "this") @@ -1003,7 +1003,7 @@ private void ActionsList_DrawItem(object sender, DrawItemEventArgs e) ArgString = "Arguments of " + NiceArgs; } } - else if (DS_Game_Maker.DSGMlib.IsObject(ThingString)) + else if (DSGMlib.IsObject(ThingString)) { if (Actions[e.Index] == "Execute Code") { @@ -1075,12 +1075,12 @@ public void SaveCurrentData() // MsgError("filter is ACT " + ObjectName + "," + DEventMainClasses(TempIndex) + "," + DEventSubClasses(TempIndex) + ",") // MsgError("filter is ACT " + ObjectName + "," + MainClassStringToType(DEventMainClasses(SelectedEvent)).ToString + "," + DEventSubClasses(SelectedEvent) + ",") // MsgError(MainClassStringToType(DEventMainClasses(SelectedEvent)).ToString) - foreach (string X in DS_Game_Maker.DSGMlib.StringToLines(MyXDSLines)) + foreach (string X in DSGMlib.StringToLines(MyXDSLines)) { if (X.Length == 0) continue; // MsgError(X + vbcrlf + vbcrlf + "against" + vbcrlf + vbcrlf + "ACT " + ObjectName + "," + MainClassStringToType(DEventMainClasses(SelectedEvent)).ToString + "," + DEventSubClasses(SelectedEvent) + ",") - if (!X.StartsWith("ACT " + ObjectName + "," + DS_Game_Maker.ScriptsLib.MainClassStringToType(DEventMainClasses[SelectedEvent]).ToString() + "," + DEventSubClasses[SelectedEvent] + ",")) + if (!X.StartsWith("ACT " + ObjectName + "," + ScriptsLib.MainClassStringToType(DEventMainClasses[SelectedEvent]).ToString() + "," + DEventSubClasses[SelectedEvent] + ",")) { FinalString += X + Constants.vbCrLf; } @@ -1090,7 +1090,7 @@ public void SaveCurrentData() // Dim TempIndex As Byte = EventsListBox.SelectedIndex for (short X = 0, loopTo = (short)(Actions.Count - 1); X <= loopTo; X++) { - string TheNewLine = "ACT " + ObjectName + "," + DS_Game_Maker.ScriptsLib.MainClassStringToType(DEventMainClasses[SelectedEvent]).ToString() + "," + DEventSubClasses[SelectedEvent] + ","; + string TheNewLine = "ACT " + ObjectName + "," + ScriptsLib.MainClassStringToType(DEventMainClasses[SelectedEvent]).ToString() + "," + DEventSubClasses[SelectedEvent] + ","; TheNewLine += Actions[X] + "," + ActionArguments[X] + "," + ActionAppliesTos[X]; FinalString += TheNewLine + Constants.vbCrLf; } @@ -1117,7 +1117,7 @@ private void EventsListBox_SelectedIndexChanged(object sender, EventArgs e) ActionImages.Clear(); ActionsList.Items.Clear(); // GenerateIndentIndices() - byte MainClass = DS_Game_Maker.ScriptsLib.MainClassStringToType(DEventMainClasses[EventsListBox.SelectedIndex]); + byte MainClass = ScriptsLib.MainClassStringToType(DEventMainClasses[EventsListBox.SelectedIndex]); string SubClass = DEventSubClasses[EventsListBox.SelectedIndex]; // MsgError("Mainclass is " + MainClass.ToString) // MsgError("Subclass is " + SubClass.ToString) @@ -1125,7 +1125,7 @@ private void EventsListBox_SelectedIndexChanged(object sender, EventArgs e) short TempCount = 0; if (MyXDSLines.Length > 0) { - foreach (string X_ in DS_Game_Maker.DSGMlib.StringToLines(MyXDSLines)) + foreach (string X_ in DSGMlib.StringToLines(MyXDSLines)) { string X = X_; if (X.Length == 0) @@ -1134,21 +1134,21 @@ private void EventsListBox_SelectedIndexChanged(object sender, EventArgs e) continue; X = DSGMlib.SillyFixMe(X).ToString(); // MsgError(X(X.Length - 1)) - if (!((DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",") ?? "") == (MainClass.ToString() ?? "")) | !((DS_Game_Maker.DSGMlib.iGet(X, (byte)2, ",") ?? "") == (SubClass ?? ""))) + if (!((DSGMlib.iGet(X, (byte)1, ",") ?? "") == (MainClass.ToString() ?? "")) | !((DSGMlib.iGet(X, (byte)2, ",") ?? "") == (SubClass ?? ""))) continue; // MsgError("On X at " + X) - string ActionName = DS_Game_Maker.DSGMlib.iGet(X, (byte)3, ","); + string ActionName = DSGMlib.iGet(X, (byte)3, ","); // MsgError("ActionName is " + ActionName) - string ActionArgs = DS_Game_Maker.DSGMlib.iGet(X, (byte)4, ","); + string ActionArgs = DSGMlib.iGet(X, (byte)4, ","); // ActionArgs = ActionArgs.Replace("", ",") // MsgError("Action Arguments are " + ActionArgs.ToString) Actions.Add(ActionName); ActionArguments.Add(ActionArgs); - string AppliesTo = DS_Game_Maker.DSGMlib.iGet(X, (byte)5, ","); + string AppliesTo = DSGMlib.iGet(X, (byte)5, ","); // MsgError(ActionEquateDisplay(ActionName, ActionArgs)) - ActionDisplays.Add(DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, ActionArgs)); + ActionDisplays.Add(ActionsLib.ActionEquateDisplay(ActionName, ActionArgs)); ActionAppliesTos.Add(AppliesTo); - ActionImages.Add(DS_Game_Maker.ActionsLib.ActionGetIconPath(ActionName, false)); + ActionImages.Add(ActionsLib.ActionGetIconPath(ActionName, false)); // MsgError(ActionGetIconPath(ActionName, False)) TempCount = (short)(TempCount + 1); } @@ -1175,11 +1175,11 @@ private void OpenSpriteButton_Click(object sender, EventArgs e) return; } } - var SpriteForm = new DS_Game_Maker.Sprite(); + var SpriteForm = new Sprite(); SpriteForm.SpriteName = SpriteDropper.Text; object argInstance = (object)SpriteForm; - DS_Game_Maker.DSGMlib.ShowInternalForm(ref argInstance); - SpriteForm = (DS_Game_Maker.Sprite)argInstance; + DSGMlib.ShowInternalForm(ref argInstance); + SpriteForm = (Sprite)argInstance; } public void EditAction() @@ -1188,14 +1188,14 @@ public void EditAction() return; if (ActionsList.SelectedIndices.Count > 1) { - DS_Game_Maker.DSGMlib.MsgWarn("You may only edit one Action at once."); + DSGMlib.MsgWarn("You may only edit one Action at once."); return; } short EditingIndex = (short)ActionsList.SelectedIndices[0]; if (Actions[EditingIndex] == "Execute Code") { Program.Forms.editCode_Form.ReturnableCode = ActionArguments[EditingIndex]; - Program.Forms.editCode_Form.CodeMode = (byte)DS_Game_Maker.DSGMlib.CodeMode.DBAS; + Program.Forms.editCode_Form.CodeMode = (byte)DSGMlib.CodeMode.DBAS; Program.Forms.editCode_Form.ImportExport = true; if (Program.Forms.editCode_Form.ShowDialog() == DialogResult.OK) { @@ -1216,7 +1216,7 @@ public void EditAction() return; ActionAppliesTos[EditingIndex] = withBlock.AppliesTo; ActionArguments[EditingIndex] = withBlock.ArgumentString; - ActionDisplays[EditingIndex] = DS_Game_Maker.ActionsLib.ActionEquateDisplay(withBlock.ActionName, withBlock.ArgumentString); + ActionDisplays[EditingIndex] = ActionsLib.ActionEquateDisplay(withBlock.ActionName, withBlock.ArgumentString); } ActionsList.Invalidate(); } @@ -1278,7 +1278,7 @@ private void ActionRightClickMenu_Opening(object sender, System.ComponentModel.C { int DOn = 0; var TheItems = new List(); - foreach (string X in DS_Game_Maker.DSGMlib.StringToLines(Clipboard.GetText())) + foreach (string X in DSGMlib.StringToLines(Clipboard.GetText())) { if (X.Length > 0) { diff --git a/DSGMlib.cs b/DSGMlib.cs index 00810fd..87169ec 100644 --- a/DSGMlib.cs +++ b/DSGMlib.cs @@ -119,7 +119,7 @@ public static string ResurrectResourceName(string ResourceName) public static Bitmap GenerateDSSprite(string TheSpriteName) { - string Folder = DS_Game_Maker.SessionsLib.SessionPath + @"Sprites\"; + string Folder = SessionsLib.SessionPath + @"Sprites\"; byte ImageCount = 0; var Images = new List(); foreach (string X_ in Directory.GetFiles(Folder)) @@ -205,57 +205,57 @@ public static void OpenResource(string ResourceName, byte ResourceType, bool Spr { case (byte)ResourceIDs.Sprite: { - var SpriteForm = new DS_Game_Maker.Sprite(); + var SpriteForm = new Sprite(); SpriteForm.SpriteName = ResourceName; SpriteForm.DataChanged = SpriteDataChanged; object argInstance = (object)SpriteForm; ShowInternalForm(ref argInstance); - SpriteForm = (DS_Game_Maker.Sprite)argInstance; + SpriteForm = (Sprite)argInstance; break; } case (byte)ResourceIDs.DObject: { - var ObjectForm = new DS_Game_Maker.DObject(); + var ObjectForm = new DObject(); ObjectForm.ObjectName = ResourceName; object argInstance1 = (object)ObjectForm; ShowInternalForm(ref argInstance1); - ObjectForm = (DS_Game_Maker.DObject)argInstance1; + ObjectForm = (DObject)argInstance1; break; } case (byte)ResourceIDs.Background: { - var BGForm = new DS_Game_Maker.Background(); + var BGForm = new Background(); BGForm.BackgroundName = ResourceName; object argInstance2 = (object)BGForm; ShowInternalForm(ref argInstance2); - BGForm = (DS_Game_Maker.Background)argInstance2; + BGForm = (Background)argInstance2; break; } case (byte)ResourceIDs.Sound: { - var SoundForm = new DS_Game_Maker.Sound(); + var SoundForm = new Sound(); SoundForm.SoundName = ResourceName; object argInstance3 = (object)SoundForm; ShowInternalForm(ref argInstance3); - SoundForm = (DS_Game_Maker.Sound)argInstance3; + SoundForm = (Sound)argInstance3; break; } case (byte)ResourceIDs.Room: { - var RoomForm = new DS_Game_Maker.Room(); + var RoomForm = new Room(); RoomForm.RoomName = ResourceName; object argInstance4 = (object)RoomForm; ShowInternalForm(ref argInstance4); - RoomForm = (DS_Game_Maker.Room)argInstance4; + RoomForm = (Room)argInstance4; break; } case (byte)ResourceIDs.Script: { - var ScriptForm = new DS_Game_Maker.Script(); + var ScriptForm = new Script(); ScriptForm.ScriptName = ResourceName; object argInstance5 = (object)ScriptForm; ShowInternalForm(ref argInstance5); - ScriptForm = (DS_Game_Maker.Script)argInstance5; + ScriptForm = (Script)argInstance5; break; } } @@ -305,7 +305,7 @@ public static object GetTime() public static bool CompileGame() { Program.Forms.main_Form.compileForm.CustomPerformStep("Cleaning Temporary Data"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "DSGMTemp" + DS_Game_Maker.SessionsLib.Session + ".nds"); + File.Delete(SessionsLib.CompilePath + "DSGMTemp" + SessionsLib.Session + ".nds"); foreach (Process TheProcess in Process.GetProcesses()) { if (TheProcess.ProcessName.ToLower() == "pagfx" | TheProcess.ProcessName.ToLower() == "make") @@ -325,19 +325,19 @@ public static bool CompileGame() if (!FontsUsedThisTime.Contains(X)) FontsUsedThisTime.Add(X); } - if (!Directory.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin")) + if (!Directory.Exists(SessionsLib.CompilePath + "gfx/bin")) { - Directory.CreateDirectory(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin"); + Directory.CreateDirectory(SessionsLib.CompilePath + "gfx/bin"); } // Remove fonts not used this time foreach (string X in FontsUsedLastTime) { if (!FontsUsedThisTime.Contains(X)) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + ".c"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + "_Map.bin"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + "_Tiles.bin"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + "_Pal.bin"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + X + ".c"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + X + "_Map.bin"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + X + "_Tiles.bin"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + X + "_Pal.bin"); } } string FontH = string.Empty; @@ -355,21 +355,21 @@ public static bool CompileGame() // If there's a font in this time's that's not in last times... if (!FontsUsedLastTime.Contains(X)) { - File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + ".c", DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + ".c", true); - File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + "_Map.bin", DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + "_Map.bin", true); - File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + "_Tiles.bin", DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + "_Tiles.bin", true); - File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + "_Pal.bin", DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + X + "_Pal.bin", true); + File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + ".c", SessionsLib.CompilePath + "gfx/bin/" + X + ".c", true); + File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + "_Map.bin", SessionsLib.CompilePath + "gfx/bin/" + X + "_Map.bin", true); + File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + "_Tiles.bin", SessionsLib.CompilePath + "gfx/bin/" + X + "_Tiles.bin", true); + File.Copy(Constants.AppDirectory + "CompiledBINs/" + X + "_Pal.bin", SessionsLib.CompilePath + "gfx/bin/" + X + "_Pal.bin", true); } FontH += "extern const PA_BgStruct " + X + ";" + Constants.vbCrLf; } // FontH += "#ifdef __cplusplus" + vbcrlf // FontH += " }" + vbcrlf // FontH += "#endif" - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + "gfx/custom_gfx.h", FontH); + File.WriteAllText(SessionsLib.CompilePath + "gfx/custom_gfx.h", FontH); FileInfo[] MyFiles; if (RedoAllGraphics) { - MyFiles = new DirectoryInfo(DS_Game_Maker.SessionsLib.CompilePath + "gfx").GetFiles(); + MyFiles = new DirectoryInfo(SessionsLib.CompilePath + "gfx").GetFiles(); foreach (FileInfo dra in MyFiles) { if (dra.Name.ToLower() == "pagfx.exe" | dra.Name.ToLower() == "custom_gfx.h") @@ -377,14 +377,14 @@ public static bool CompileGame() File.Delete(dra.FullName); } } - MyFiles = new DirectoryInfo(DS_Game_Maker.SessionsLib.CompilePath + "data").GetFiles(); + MyFiles = new DirectoryInfo(SessionsLib.CompilePath + "data").GetFiles(); foreach (FileInfo TheFile in MyFiles) { if (TheFile.Name.EndsWith(".raw")) continue; File.Delete(TheFile.FullName); } - MyFiles = new DirectoryInfo(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles").GetFiles(); + MyFiles = new DirectoryInfo(SessionsLib.CompilePath + "nitrofiles").GetFiles(); foreach (FileInfo TheFile in MyFiles) { if (TheFile.FullName.EndsWith(".mp3")) @@ -403,7 +403,7 @@ public static bool CompileGame() File.Delete(TheFile.FullName); } } - MyFiles = new DirectoryInfo(DS_Game_Maker.SessionsLib.CompilePath + "include").GetFiles(); + MyFiles = new DirectoryInfo(SessionsLib.CompilePath + "include").GetFiles(); foreach (FileInfo TheFile in MyFiles) { // File.Delete(TheFile.FullName) @@ -415,24 +415,24 @@ public static bool CompileGame() var ff = new byte[32769]; for (short i = 0; i <= 32767; i++) ff[i] = 0; - File.WriteAllBytes(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/SaveData.dat", ff); + File.WriteAllBytes(SessionsLib.CompilePath + "nitrofiles/SaveData.dat", ff); } if (GetXDSLine("PROJECTLOGO ").Length < 12) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "logo.bmp")) + if (File.Exists(SessionsLib.CompilePath + "logo.bmp")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "logo.bmp"); + File.Delete(SessionsLib.CompilePath + "logo.bmp"); } - File.Copy(Constants.AppDirectory + "logo.bmp", DS_Game_Maker.SessionsLib.CompilePath + "logo.bmp"); + File.Copy(Constants.AppDirectory + "logo.bmp", SessionsLib.CompilePath + "logo.bmp"); } else { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "logo.bmp")) + if (File.Exists(SessionsLib.CompilePath + "logo.bmp")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "logo.bmp"); + File.Delete(SessionsLib.CompilePath + "logo.bmp"); } - File.Copy(GetXDSLine("PROJECTLOGO ").Substring(12), DS_Game_Maker.SessionsLib.CompilePath + "logo.bmp"); + File.Copy(GetXDSLine("PROJECTLOGO ").Substring(12), SessionsLib.CompilePath + "logo.bmp"); } string BootRoom = GetXDSLine("BOOTROOM ").Substring(9); @@ -444,28 +444,28 @@ public static bool CompileGame() // FinalString += "#include ""NitroGraphics.h""" + vbCrLf - File.WriteAllBytes(DS_Game_Maker.SessionsLib.CompilePath + "include/NitroGraphics.h", Properties.Resources.NitroGraphics); + File.WriteAllBytes(SessionsLib.CompilePath + "include/NitroGraphics.h", Properties.Resources.NitroGraphics); if (GetXDSLine("INCLUDE_WIFI_LIB ").Substring(17) == "1") { FinalString += "#include \"ky_geturl.h\"" + Constants.vbCrLf; - if (!File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.h")) + if (!File.Exists(SessionsLib.CompilePath + "source/ky_geturl.h")) { - File.WriteAllBytes(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.h", Properties.Resources.WifiLibH); + File.WriteAllBytes(SessionsLib.CompilePath + "source/ky_geturl.h", Properties.Resources.WifiLibH); } - if (!File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.c")) + if (!File.Exists(SessionsLib.CompilePath + "source/ky_geturl.c")) { - File.WriteAllBytes(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.c", Properties.Resources.WifiLibC); + File.WriteAllBytes(SessionsLib.CompilePath + "source/ky_geturl.c", Properties.Resources.WifiLibC); } } else { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.h")) + if (File.Exists(SessionsLib.CompilePath + "source/ky_geturl.h")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.h"); + File.Delete(SessionsLib.CompilePath + "source/ky_geturl.h"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.c")) + if (File.Exists(SessionsLib.CompilePath + "source/ky_geturl.c")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "source/ky_geturl.c"); + File.Delete(SessionsLib.CompilePath + "source/ky_geturl.c"); } } FinalString += "#include \"dsgm_gfx.h\"" + Constants.vbCrLf; @@ -480,51 +480,51 @@ public static bool CompileGame() if (iGet(GetXDSLine("SOUND " + X + ","), 1, ",") == "1") { MP3String += "mp3enc -b 64 \"" + X + "_enc.mp3\" \"" + X + "\".mp3" + Constants.vbCrLf; - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + @"Sounds\" + X + ".mp3", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + X + "_enc.mp3"); + File.Copy(SessionsLib.SessionPath + @"Sounds\" + X + ".mp3", SessionsLib.CompilePath + "nitrofiles/" + X + "_enc.mp3"); DoMP3 = true; } else { RAWString += "sox \"" + X + "\".wav -r 11025 -c 1 -e signed -b 8 \"" + X + "\".raw" + Constants.vbCrLf; - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + @"Sounds\" + X + ".wav", DS_Game_Maker.SessionsLib.CompilePath + "data/" + X + ".wav"); + File.Copy(SessionsLib.SessionPath + @"Sounds\" + X + ".wav", SessionsLib.CompilePath + "data/" + X + ".wav"); DoRAW = true; } } if (DoRAW) { - File.Copy(Constants.AppDirectory + "sox.exe", DS_Game_Maker.SessionsLib.CompilePath + "data/sox.exe"); - File.Copy(Constants.AppDirectory + "libgomp-1.dll", DS_Game_Maker.SessionsLib.CompilePath + "data/libgomp-1.dll"); - File.Copy(Constants.AppDirectory + "pthreadgc2.dll", DS_Game_Maker.SessionsLib.CompilePath + "data/pthreadgc2.dll"); - File.Copy(Constants.AppDirectory + "zlib1.dll", DS_Game_Maker.SessionsLib.CompilePath + "data/zlib1.dll"); - DSGMlib.RunBatchString(RAWString, DS_Game_Maker.SessionsLib.CompilePath + "data", false); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "data/sox.exe"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "data/libgomp-1.dll"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "data/pthreadgc2.dll"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "data/zlib1.dll"); + File.Copy(Constants.AppDirectory + "sox.exe", SessionsLib.CompilePath + "data/sox.exe"); + File.Copy(Constants.AppDirectory + "libgomp-1.dll", SessionsLib.CompilePath + "data/libgomp-1.dll"); + File.Copy(Constants.AppDirectory + "pthreadgc2.dll", SessionsLib.CompilePath + "data/pthreadgc2.dll"); + File.Copy(Constants.AppDirectory + "zlib1.dll", SessionsLib.CompilePath + "data/zlib1.dll"); + DSGMlib.RunBatchString(RAWString, SessionsLib.CompilePath + "data", false); + File.Delete(SessionsLib.CompilePath + "data/sox.exe"); + File.Delete(SessionsLib.CompilePath + "data/libgomp-1.dll"); + File.Delete(SessionsLib.CompilePath + "data/pthreadgc2.dll"); + File.Delete(SessionsLib.CompilePath + "data/zlib1.dll"); foreach (string X in SoundsToRedo) { if (iGet(GetXDSLine("SOUND " + X + ","), 1, ",") == "1") continue; - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "data/" + X + ".wav"); + File.Delete(SessionsLib.CompilePath + "data/" + X + ".wav"); } } if (DoMP3) { - File.Copy(Constants.AppDirectory + "mp3enc.exe", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/mp3enc.exe"); - DSGMlib.RunBatchString(MP3String, DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles", false); + File.Copy(Constants.AppDirectory + "mp3enc.exe", SessionsLib.CompilePath + "nitrofiles/mp3enc.exe"); + DSGMlib.RunBatchString(MP3String, SessionsLib.CompilePath + "nitrofiles", false); foreach (string X in SoundsToRedo) { if (iGet(GetXDSLine("SOUND " + X + ","), 1, ",") == "0") continue; - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + X + "_enc.mp3"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + X + "_enc.mp3"); } - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/mp3enc.exe"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/mp3enc.exe"); } FinalString += Constants.vbCrLf; foreach (string X in GetXDSFilter("NITROFS ")) { string FileName = X.Substring(8); - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "NitroFSFiles/" + FileName, DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + FileName, true); + File.Copy(SessionsLib.SessionPath + "NitroFSFiles/" + FileName, SessionsLib.CompilePath + "nitrofiles/" + FileName, true); } // FinalString += "s16 score = " + GetXDSLine("SCORE ").ToString.Substring(6) + ";" + vbcrlf // FinalString += "s16 health = " + GetXDSLine("HEALTH ").ToString.Substring(7) + ";" + vbcrlf @@ -588,7 +588,7 @@ public static bool CompileGame() string XDSLine = XDSLine_; XDSLine = XDSLine.Substring(11); string BackgroundName = iGet(XDSLine, 0, ","); - var BGImage = DSGMlib.PathToImage(DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + BackgroundName + ".png"); + var BGImage = DSGMlib.PathToImage(SessionsLib.SessionPath + "Backgrounds/" + BackgroundName + ".png"); PAini += BackgroundName + ".png "; if (BGImage.Width > 256 & BGImage.Height > 256) { @@ -598,7 +598,7 @@ public static bool CompileGame() { PAini += "EasyBG"; } - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + BackgroundName + ".png", DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + BackgroundName + ".png"); + File.Copy(SessionsLib.SessionPath + "Backgrounds/" + BackgroundName + ".png", SessionsLib.CompilePath + "gfx/" + BackgroundName + ".png"); PAini += Constants.vbCrLf; } } @@ -608,7 +608,7 @@ public static bool CompileGame() { // Dim IsBG As Boolean = DoesXDSLineExist("BACKGROUND " + X) // If Not IsBG Then Continue For - var BGImage = DSGMlib.PathToImage(DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + X + ".png"); + var BGImage = DSGMlib.PathToImage(SessionsLib.SessionPath + "Backgrounds/" + X + ".png"); PAini += X + ".png "; if (BGImage.Width > 256 & BGImage.Height > 256) { @@ -619,7 +619,7 @@ public static bool CompileGame() PAini += "EasyBG"; } PAini += Constants.vbCrLf; - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + X + ".png", DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + X + ".png", true); + File.Copy(SessionsLib.SessionPath + "Backgrounds/" + X + ".png", SessionsLib.CompilePath + "gfx/" + X + ".png", true); BGImage.Dispose(); DOn = (short)(DOn + 1); } @@ -697,7 +697,7 @@ public static bool CompileGame() } if (RedoSprites) { - TheImage.Save(DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + SpriteNameExtension); + TheImage.Save(SessionsLib.CompilePath + "gfx/" + SpriteNameExtension); if (iGet(GetXDSLine("SPRITE " + XDSLine), 3, ",") == "Nitro") { PAini += SpriteNameExtension + " 256Colors " + "NitroPal" + PalletOn_Nitro.ToString() + Constants.vbCrLf; @@ -730,7 +730,7 @@ public static bool CompileGame() PalletNames.Add(SpriteName, PalletOn.ToString()); } } - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + "gfx/PAGfx.ini", PAini); + File.WriteAllText(SessionsLib.CompilePath + "gfx/PAGfx.ini", PAini); string EventsString = string.Empty; foreach (string XDSLine_ in GetXDSFilter("EVENT ")) { @@ -739,7 +739,7 @@ public static bool CompileGame() XDSLine = XDSLine.Substring(6); string ObjectName = iGet(XDSLine, 0, ","); string MainClass = iGet(XDSLine, 1, ","); - string StringMainClass = DS_Game_Maker.ScriptsLib.MainClassTypeToString(Convert.ToByte(MainClass)).Replace(" ", string.Empty); + string StringMainClass = ScriptsLib.MainClassTypeToString(Convert.ToByte(MainClass)).Replace(" ", string.Empty); string SubClass = iGet(XDSLine, 2, ","); string StringSubClass = SubClass.Replace(" ", string.Empty); if (StringSubClass == "NoData") @@ -786,7 +786,7 @@ public static bool CompileGame() // Next if (!(ActionName == "Execute Code")) { - foreach (string X in DS_Game_Maker.ScriptsLib.ApplyFinders) + foreach (string X in ScriptsLib.ApplyFinders) { if (Arguments.Contains(X)) NeedsAppliesToVar = true; @@ -800,7 +800,7 @@ public static bool CompileGame() ToReplace = "DAppliesTo"; for (byte X = 0, loopTo1 = (byte)(InputtedArgumentValues.Count - 1); X <= loopTo1; X++) { - foreach (string D in DS_Game_Maker.ScriptsLib.ApplyFinders) + foreach (string D in ScriptsLib.ApplyFinders) { string NoBrackets = D; NoBrackets = NoBrackets.Substring(1); @@ -878,7 +878,7 @@ public static bool CompileGame() // Next DBASCode = DBASCode.Replace("", Constants.vbCrLf).Replace("", ",").Replace("", ";"); - string CCode = DS_Game_Maker.ScriptsLib.ScriptParseFromContent("Temp", DBASCode, string.Empty, string.Empty, false, true, false); + string CCode = ScriptsLib.ScriptParseFromContent("Temp", DBASCode, string.Empty, string.Empty, false, true, false); foreach (string X in StringToLines(CCode)) { EventsString = EventsString + MakeSpaces((byte)(CurrentIndent * 2)) + X + Constants.vbCrLf; @@ -1265,7 +1265,7 @@ public static bool CompileGame() // FinalString += " return true;" + vbcrlf // FinalString += "}" + vbcrlf + vbcrlf // File.WriteAllText(CompilePath + "gfx\PAGfx.ini", PAini) - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + "source/main.c", FinalString); + File.WriteAllText(SessionsLib.CompilePath + "source/main.c", FinalString); string DefsString = string.Empty; foreach (string XDSLine in GetXDSFilter("ROOM ")) DefsString += "bool " + iGet(XDSLine.Substring(5), 0, ",") + "();" + Constants.vbCrLf; @@ -1278,7 +1278,7 @@ public static bool CompileGame() foreach (string YXDSLine in GetXDSFilter("SCRIPTARG " + ScriptName + ",")) { string ArgumentName = iGet(YXDSLine, 1, ","); - string ArgumentType = DS_Game_Maker.ScriptsLib.GenerateCType(iGet(YXDSLine, 2, ",")); + string ArgumentType = ScriptsLib.GenerateCType(iGet(YXDSLine, 2, ",")); ArgumentString += ArgumentType + " "; if (ArgumentType == "char") ArgumentString += "*"; @@ -1296,7 +1296,7 @@ public static bool CompileGame() DefsString += ");" + Constants.vbCrLf; } // fsdds() - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + "include/Defines.h", DefsString); + File.WriteAllText(SessionsLib.CompilePath + "include/Defines.h", DefsString); // File.WriteAllBytes(CompilePath + "include\ActionWorks.h", My.Resources.ActionWorks) string GameString = string.Empty; GameString += "#include \"dsgm_gfx.h\"" + Constants.vbCrLf; @@ -1307,7 +1307,7 @@ public static bool CompileGame() { string FileName = X.Substring(8); GameString += "#include \"" + FileName + "\"" + Constants.vbCrLf; - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + @"IncludeFiles\" + FileName, DS_Game_Maker.SessionsLib.CompilePath + "include/" + FileName); + File.Copy(SessionsLib.SessionPath + @"IncludeFiles\" + FileName, SessionsLib.CompilePath + "include/" + FileName); } foreach (string X_ in GetXDSFilter("SOUND ")) { @@ -1316,7 +1316,7 @@ public static bool CompileGame() continue; X = X.Substring(6); string SoundName = iGet(X, 0, ","); - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "data/" + SoundName + ".raw")) + if (File.Exists(SessionsLib.CompilePath + "data/" + SoundName + ".raw")) { GameString += "#include \"" + SoundName + ".h\"" + Constants.vbCrLf; } @@ -1337,7 +1337,7 @@ public static bool CompileGame() string ItemName = Y.Substring(0, Y.IndexOf(",")); string ItemType = Y.Substring(ItemName.Length + 1); ItemType = ItemType.Substring(0, ItemType.IndexOf(",")); - ItemType = DS_Game_Maker.ScriptsLib.GenerateCType(ItemType); + ItemType = ScriptsLib.GenerateCType(ItemType); string ItemValue = Y.Substring(Y.LastIndexOf(",") + 1).Replace("", ","); GameString += " " + ItemType + " " + (ItemType == "char" ? "*" : string.Empty) + ItemName + ";" + Constants.vbCrLf; } @@ -1352,7 +1352,7 @@ public static bool CompileGame() XDSLine = XDSLine.Substring(7); string VariableName = iGet(XDSLine, 0, ","); string VariableType = iGet(XDSLine, 1, ","); - string CVariableType = DS_Game_Maker.ScriptsLib.GenerateCType(VariableType); + string CVariableType = ScriptsLib.GenerateCType(VariableType); // If RealVariableType = "pie" Then RealVariableType = VariableType string VariableValue = iGet(XDSLine, 2, ","); TempString = CVariableType + " " + VariableName; @@ -1412,7 +1412,7 @@ public static bool CompileGame() XDSLine = XDSLine.Substring(7); bool C = XDSLine.EndsWith(",0"); XDSLine = XDSLine.Substring(0, XDSLine.LastIndexOf(",")); - GameString += Constants.vbCrLf + DS_Game_Maker.ScriptsLib.ScriptParse(XDSLine, C) + Constants.vbCrLf; + GameString += Constants.vbCrLf + ScriptsLib.ScriptParse(XDSLine, C) + Constants.vbCrLf; } GameString += Constants.vbCrLf; // GameString += "s16 score = " + GetXDSLine("SCORE ").ToString.Substring(6) + ";" + vbcrlf @@ -1578,7 +1578,7 @@ public static bool CompileGame() // GameString += "void Goto_Room(char *RoomName) {" + vbcrlf // GameString += " Goto_Room_Backend(Room_Get_Index(RoomName));" + vbcrlf // GameString += "}" + vbcrlf - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + "include/GameWorks.h", GameString); + File.WriteAllText(SessionsLib.CompilePath + "include/GameWorks.h", GameString); string MF = "ARM7_SELECTED = ARM7_MP3_DSWIFI" + Constants.vbCrLf; MF += "USE_NITROFS = YES" + Constants.vbCrLf; MF += "NITRODATA := nitrofiles" + Constants.vbCrLf; @@ -1592,20 +1592,20 @@ public static bool CompileGame() MF += "RELEASEPATH := " + Constants.vbCrLf; MF += "MAKEFILE_VER := ver2" + Constants.vbCrLf; MF += "include " + Constants.AppDirectory + "devkitPro/PAlib/lib/PA_Makefile" + Constants.vbCrLf; - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + "Makefile", MF); + File.WriteAllText(SessionsLib.CompilePath + "Makefile", MF); Program.Forms.main_Form.compileForm.CustomPerformStep("Processing Graphics"); var MyProcess = new Process(); var MyInfo = new ProcessStartInfo(); if (RedoAllGraphics | BGsToRedo.Count > 0 | RedoSprites) { - MyInfo.FileName = DS_Game_Maker.SessionsLib.CompilePath + "gfx/PAGfx.exe"; - MyInfo.WorkingDirectory = DS_Game_Maker.SessionsLib.CompilePath + "gfx"; + MyInfo.FileName = SessionsLib.CompilePath + "gfx/PAGfx.exe"; + MyInfo.WorkingDirectory = SessionsLib.CompilePath + "gfx"; MyProcess.StartInfo = MyInfo; MyProcess.Start(); MyProcess.WaitForExit(); } - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\PAGfx.txt"); - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\all_gfx.h"); + File.Delete(SessionsLib.CompilePath + @"gfx\PAGfx.txt"); + File.Delete(SessionsLib.CompilePath + @"gfx\all_gfx.h"); // Make a hacky GFX file ... string DSGMH = string.Empty; DSGMH += "#pragma once" + Constants.vbCrLf; @@ -1617,11 +1617,11 @@ public static bool CompileGame() X = X.Substring(7); if (iGet(GetXDSLine("SPRITE " + X), 3, ",") == "Nitro") { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Sprite.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Sprite.bin")) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Sprite.bin")) - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Sprite.bin"); - File.Move(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Sprite.bin", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Sprite.bin"); + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Sprite.bin")) + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Sprite.bin"); + File.Move(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Sprite.bin", SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Sprite.bin"); } byte PalletNumber = 0; foreach (var PalletString in PalletNumbers) @@ -1632,11 +1632,11 @@ public static bool CompileGame() } } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin")) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin")) - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin"); - File.Move(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin"); + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin")) + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin"); + File.Move(SessionsLib.CompilePath + "gfx/bin/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin", SessionsLib.CompilePath + "nitrofiles/" + "NitroPal" + PalletNumber.ToString() + "_Pal.bin"); } } else @@ -1655,29 +1655,29 @@ public static bool CompileGame() if (iGet(GetXDSLine("BACKGROUND " + X), 1, ",") == "Nitro") { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Map.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Map.bin")) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Map.bin")) - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Map.bin"); - File.Move(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Map.bin", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Map.bin"); + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Map.bin")) + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Map.bin"); + File.Move(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Map.bin", SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Map.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Tiles.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Tiles.bin")) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Tiles.bin")) - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Tiles.bin"); - File.Move(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Tiles.bin", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Tiles.bin"); + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Tiles.bin")) + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Tiles.bin"); + File.Move(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Tiles.bin", SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Tiles.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Pal.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Pal.bin")) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Pal.bin")) - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Pal.bin"); - File.Move(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Pal.bin", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Pal.bin"); + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Pal.bin")) + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Pal.bin"); + File.Move(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + "_Pal.bin", SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + "_Pal.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + ".c")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + ".c")) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + ".c")) - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + ".c"); - File.Move(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + ".c", DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + ".c"); + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + ".c")) + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + ".c"); + File.Move(SessionsLib.CompilePath + "gfx/bin/" + iGet(X, 0, ",") + ".c", SessionsLib.CompilePath + "nitrofiles/" + iGet(X, 0, ",") + ".c"); } } else @@ -1693,14 +1693,14 @@ public static bool CompileGame() DSGMH += " extern const unsigned short DSGMPal" + i.ToString() + "_Pal[256] _GFX_ALIGN;" + Constants.vbCrLf; } } - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + "gfx/dsgm_gfx.h", DSGMH); + File.WriteAllText(SessionsLib.CompilePath + "gfx/dsgm_gfx.h", DSGMH); Program.Forms.main_Form.compileForm.CustomPerformStep("Compiling Game"); - MyInfo.FileName = DS_Game_Maker.SessionsLib.CompilePath + "build.bat"; - MyInfo.WorkingDirectory = DS_Game_Maker.SessionsLib.CompilePath; + MyInfo.FileName = SessionsLib.CompilePath + "build.bat"; + MyInfo.WorkingDirectory = SessionsLib.CompilePath; MyProcess.StartInfo = MyInfo; MyProcess.Start(); MyProcess.WaitForExit(); - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + DS_Game_Maker.SessionsLib.CompileName + ".nds")) + if (File.Exists(SessionsLib.CompilePath + SessionsLib.CompileName + ".nds")) { RedoAllGraphics = false; RedoSprites = false; @@ -1727,7 +1727,7 @@ public static string FormNOGBAPath() public static void NOGBAShizzle() { - if ((int)Convert.ToByte(DS_Game_Maker.SettingsLib.GetSetting("USE_NOGBA")) == 1) + if ((int)Convert.ToByte(SettingsLib.GetSetting("USE_NOGBA")) == 1) { if (!Directory.Exists(FormNOGBAPath())) { @@ -1735,16 +1735,16 @@ public static void NOGBAShizzle() return; } // MsgError(CompilePath + GetXDSLine("PROJECTNAME ").ToString.Substring(12) + ".nds") - Process.Start(FormNOGBAPath() + "/NO$GBA.exe", DS_Game_Maker.SessionsLib.CompilePath + "DSGMTemp" + DS_Game_Maker.SessionsLib.Session + ".nds"); + Process.Start(FormNOGBAPath() + "/NO$GBA.exe", SessionsLib.CompilePath + "DSGMTemp" + SessionsLib.Session + ".nds"); } else { - if (!File.Exists(DS_Game_Maker.SettingsLib.GetSetting("EMULATOR_PATH"))) + if (!File.Exists(SettingsLib.GetSetting("EMULATOR_PATH"))) { MsgError("The selected Custom Emulator does not exist."); return; } - Process.Start(DS_Game_Maker.SettingsLib.GetSetting("EMULATOR_PATH"), DS_Game_Maker.SessionsLib.CompilePath + "DSGMTemp" + DS_Game_Maker.SessionsLib.Session + ".nds"); + Process.Start(SettingsLib.GetSetting("EMULATOR_PATH"), SessionsLib.CompilePath + "DSGMTemp" + SessionsLib.Session + ".nds"); } } @@ -1967,7 +1967,7 @@ public static void XDSChangeLine(string Input, string ChangeTo) public static string GetInput(string Descriptor, string DefaultValue, byte VM) { - var X = new DS_Game_Maker.InputBoxForm(); + var X = new InputBoxForm(); X.Descriptor = Descriptor; X.TheInput = DefaultValue; X.Validation = VM; @@ -2063,7 +2063,7 @@ public static void UpdateArrayActionsName(string ResourceTypeString, string OldN { if (!(X.Name == "DObject")) continue; - DS_Game_Maker.DObject DForm = (DS_Game_Maker.DObject)X; + DObject DForm = (DObject)X; for (short DOn = 0, loopTo = (short)(DForm.ActionArguments.Count - 1); DOn <= loopTo; DOn++) { string Y = DForm.ActionArguments[(int)DOn]; @@ -2086,7 +2086,7 @@ public static void UpdateArrayActionsName(string ResourceTypeString, string OldN if (!((NewArgumentString ?? "") == (Y ?? ""))) { DForm.ActionArguments[(int)DOn] = NewArgumentString; - DForm.ActionDisplays[(int)DOn] = DS_Game_Maker.ActionsLib.ActionEquateDisplay(ActionName, NewArgumentString); + DForm.ActionDisplays[(int)DOn] = ActionsLib.ActionEquateDisplay(ActionName, NewArgumentString); } // Something here, James? // Damn, shouldn't do more than one thing at once >.< @@ -2248,9 +2248,9 @@ public static void DeleteResource(string ResourceName, string Type) // If X = ResourceName Then GraphicsToRedo.RemoveAt(DOn) // DOn += 1 // Next - if (Directory.Exists(DS_Game_Maker.SessionsLib.CompilePath + "build")) + if (Directory.Exists(SessionsLib.CompilePath + "build")) { - foreach (string X in Directory.GetFiles(DS_Game_Maker.SessionsLib.CompilePath + "build")) + foreach (string X in Directory.GetFiles(SessionsLib.CompilePath + "build")) { if (X.EndsWith("/" + ResourceName + "_Sprite.h") | X.EndsWith("/" + ResourceName + "_Sprite.o")) { @@ -2258,16 +2258,16 @@ public static void DeleteResource(string ResourceName, string Type) } } } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + ResourceName + ".png")) + if (File.Exists(SessionsLib.CompilePath + "gfx/" + ResourceName + ".png")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + ResourceName + ".png"); + File.Delete(SessionsLib.CompilePath + "gfx/" + ResourceName + ".png"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Sprite.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Sprite.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Sprite.bin"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Sprite.bin"); } XDSRemoveLine(GetXDSLine("SPRITE " + ResourceName + ",")); - foreach (string X in Directory.GetFiles(DS_Game_Maker.SessionsLib.SessionPath + "Sprites")) + foreach (string X in Directory.GetFiles(SessionsLib.SessionPath + "Sprites")) { if (X.EndsWith("_" + ResourceName + ".png")) File.Delete(X); @@ -2288,7 +2288,7 @@ public static void DeleteResource(string ResourceName, string Type) { if (X.Name == "Room") { - DS_Game_Maker.Room DForm = (DS_Game_Maker.Room)X; + Room DForm = (Room)X; byte TopAffected = 0; byte BottomAffected = 0; DOn = 0; @@ -2311,7 +2311,7 @@ public static void DeleteResource(string ResourceName, string Type) } else if (X.Name == "DObject") { - DS_Game_Maker.DObject DForm = (DS_Game_Maker.DObject)X; + DObject DForm = (DObject)X; string SpriteName = DForm.GetSpriteName(); if ((SpriteName ?? "") == (ResourceName ?? "")) DForm.DeleteSprite(); @@ -2342,12 +2342,12 @@ public static void DeleteResource(string ResourceName, string Type) if (X.Name == "Room") { - DS_Game_Maker.Room DForm = (DS_Game_Maker.Room)X; + Room DForm = (Room)X; DForm.RemoveObjectFromDropper(ResourceName); byte TopAffected = 0; byte BottomAffected = 0; DOn = 0; - foreach (DS_Game_Maker.Room.AnObject Y in DForm.Objects) + foreach (Room.AnObject Y in DForm.Objects) { if (Y.InUse & (Y.ObjectName == ResourceName)) { @@ -2370,7 +2370,7 @@ public static void DeleteResource(string ResourceName, string Type) } else if (X.Name == "DObject") { - DS_Game_Maker.DObject DForm = (DS_Game_Maker.DObject)X; + DObject DForm = (DObject)X; string FinalXDS = string.Empty; foreach (string Y_ in DSGMlib.StringToLines(DForm.MyXDSLines)) { @@ -2405,46 +2405,46 @@ public static void DeleteResource(string ResourceName, string Type) else if (Type == "Background") { XDSRemoveLine(GetXDSLine("BACKGROUND " + ResourceName)); - File.Delete(DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + ResourceName + ".png"); - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + ResourceName + ".png")) + File.Delete(SessionsLib.SessionPath + "Backgrounds/" + ResourceName + ".png"); + if (File.Exists(SessionsLib.CompilePath + "gfx/" + ResourceName + ".png")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + ResourceName + ".png"); + File.Delete(SessionsLib.CompilePath + "gfx/" + ResourceName + ".png"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + ".c")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + ".c")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + ".c"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + ".c"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Map.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Map.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Map.bin"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Map.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Tiles.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Tiles.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Tiles.bin"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Tiles.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Pal.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Pal.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Pal.bin"); + File.Delete(SessionsLib.CompilePath + "gfx/bin/" + ResourceName + "_Pal.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin"); } - if (Directory.Exists(DS_Game_Maker.SessionsLib.CompilePath + "build")) + if (Directory.Exists(SessionsLib.CompilePath + "build")) { - foreach (string X in Directory.GetFiles(DS_Game_Maker.SessionsLib.CompilePath + "build")) + foreach (string X in Directory.GetFiles(SessionsLib.CompilePath + "build")) { string FName = X.Substring(X.LastIndexOf("/") + 1); FName = FName.Substring(0, FName.LastIndexOf(".")); @@ -2470,12 +2470,12 @@ public static void DeleteResource(string ResourceName, string Type) continue; if (X.Name == "Room") { - ((DS_Game_Maker.Room)X).RemoveBackground(ResourceName); + ((Room)X).RemoveBackground(ResourceName); continue; } if (X.Name == "DObject") { - DS_Game_Maker.DObject DForm = (DS_Game_Maker.DObject)X; + DObject DForm = (DObject)X; DForm.MyXDSLines = DSGMlib.UpdateActionsName(DForm.MyXDSLines, "Background", ResourceName, "", false); } } @@ -2492,7 +2492,7 @@ public static void DeleteResource(string ResourceName, string Type) string SoundLine = GetXDSLine("SOUND " + ResourceName + ","); string Extension = SoundLine.EndsWith(",0") ? "wav" : "mp3"; XDSRemoveLine(SoundLine); - File.Delete(DS_Game_Maker.SessionsLib.SessionPath + "Sounds/" + ResourceName + "." + Extension); + File.Delete(SessionsLib.SessionPath + "Sounds/" + ResourceName + "." + Extension); CurrentXDS = UpdateActionsName(CurrentXDS, "Sound", ResourceName, "", false); UpdateArrayActionsName("Sound", ResourceName, "", false); foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)ResourceIDs.Sound].Nodes) @@ -2546,7 +2546,7 @@ public static void DeleteResource(string ResourceName, string Type) { XDSRemoveLine(GetXDSLine("SCRIPT " + ResourceName + ",")); XDSRemoveFilter("SCRIPTARG " + ResourceName + ","); - File.Delete(DS_Game_Maker.SessionsLib.SessionPath + "Scripts/" + ResourceName + ".dbas"); + File.Delete(SessionsLib.SessionPath + "Scripts/" + ResourceName + ".dbas"); CurrentXDS = UpdateActionsName(CurrentXDS, "Script", ResourceName, "", false); UpdateArrayActionsName("Script", ResourceName, "", false); foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)ResourceIDs.Script].Nodes) @@ -2586,7 +2586,7 @@ public static void CopyResource(string OldName, string NewName, byte ResourceTyp } case (byte)ResourceIDs.Background: { - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + OldName + ".png", DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + NewName + ".png"); + File.Copy(SessionsLib.SessionPath + "Backgrounds/" + OldName + ".png", SessionsLib.SessionPath + "Backgrounds/" + NewName + ".png"); XDSAddLine("BACKGROUND " + NewName); AddResourceNode(ref ResourceType, NewName, "BackgroundNode", true); break; @@ -2596,7 +2596,7 @@ public static void CopyResource(string OldName, string NewName, byte ResourceTyp string OldLine = GetXDSLine("SCRIPT " + OldName + ","); OldLine = OldLine.Substring(OldLine.LastIndexOf(",") + 1); XDSAddLine("SCRIPT " + NewName + "," + OldLine); - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "Scripts/" + OldName + ".dbas", DS_Game_Maker.SessionsLib.SessionPath + "Scripts/" + NewName + ".dbas"); + File.Copy(SessionsLib.SessionPath + "Scripts/" + OldName + ".dbas", SessionsLib.SessionPath + "Scripts/" + NewName + ".dbas"); foreach (string X_ in GetXDSFilter("SCRIPTARG " + OldName + ",")) { string X = X_; @@ -2612,11 +2612,11 @@ public static void CopyResource(string OldName, string NewName, byte ResourceTyp byte Type = Convert.ToByte(OldLine.Substring(7 + OldName.Length)); if (Type == 1) { - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "Sounds/" + OldName + ".mp3", DS_Game_Maker.SessionsLib.SessionPath + "Sounds/" + NewName + ".mp3"); + File.Copy(SessionsLib.SessionPath + "Sounds/" + OldName + ".mp3", SessionsLib.SessionPath + "Sounds/" + NewName + ".mp3"); } else { - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "Sounds/" + OldName + ".wav", DS_Game_Maker.SessionsLib.SessionPath + "Sounds/" + NewName + ".wav"); + File.Copy(SessionsLib.SessionPath + "Sounds/" + OldName + ".wav", SessionsLib.SessionPath + "Sounds/" + NewName + ".wav"); } break; @@ -2800,19 +2800,19 @@ public static void CleanFresh(bool WishCloseNews) { try { - if (DS_Game_Maker.SessionsLib.SessionPath.Length > 0 & Directory.Exists(Constants.AppDirectory + "ProjectTemp/" + DS_Game_Maker.SessionsLib.Session)) + if (SessionsLib.SessionPath.Length > 0 & Directory.Exists(Constants.AppDirectory + "ProjectTemp/" + SessionsLib.Session)) { - Directory.Delete(DS_Game_Maker.SessionsLib.SessionPath, true); + Directory.Delete(SessionsLib.SessionPath, true); } - if (DS_Game_Maker.SessionsLib.CompilePath.Length > 0 & Directory.Exists(DS_Game_Maker.SessionsLib.CompilePath)) + if (SessionsLib.CompilePath.Length > 0 & Directory.Exists(SessionsLib.CompilePath)) { - Directory.Delete(DS_Game_Maker.SessionsLib.CompilePath, true); + Directory.Delete(SessionsLib.CompilePath, true); } } catch { } - bool AvoidNewsline = DS_Game_Maker.SettingsLib.GetSetting("CLOSE_NEWS") == "0" ? true : false; + bool AvoidNewsline = SettingsLib.GetSetting("CLOSE_NEWS") == "0" ? true : false; foreach (Form X in Program.Forms.main_Form.MdiChildren) { if (X.Name == "Newsline" & AvoidNewsline & WishCloseNews == false) @@ -2951,8 +2951,8 @@ public static void OpenProject(string Result) BGsToRedo.Clear(); FontsUsedLastTime.Clear(); BuildSoundsRedoFromFile(); - DS_Game_Maker.SettingsLib.SetSetting("LAST_PROJECT", Result); - DS_Game_Maker.SettingsLib.SaveSettings(); + SettingsLib.SetSetting("LAST_PROJECT", Result); + SettingsLib.SaveSettings(); } public static void BuildSoundsRedoFromFile() @@ -3011,7 +3011,7 @@ public static string GetActionTypes(object ActionName) if (!X.StartsWith("ARG ")) continue; X = X.Substring(4); - string R = DS_Game_Maker.ScriptsLib.ArgumentTypeToString(Convert.ToByte(iGet(X, 1, ","))); + string R = ScriptsLib.ArgumentTypeToString(Convert.ToByte(iGet(X, 1, ","))); Returnable += R + ","; } if (Returnable.Length > 0) @@ -3072,7 +3072,7 @@ public static Bitmap ObjectGetImage(string ObjectName) return (Bitmap)MakeBMPTransparent(PathToImage(Constants.AppDirectory + "Resources/NoSprite.png"), Color.Magenta); short FrameNo = Convert.ToInt16(iGet(XDSLine, 2, ",")); // MsgError(iget(XDSLine, 2, ",")) - return (Bitmap)MakeBMPTransparent(DSGMlib.PathToImage(DS_Game_Maker.SessionsLib.SessionPath + "Sprites/" + FrameNo.ToString() + "_" + SpriteName + ".png"), Color.Magenta); + return (Bitmap)MakeBMPTransparent(DSGMlib.PathToImage(SessionsLib.SessionPath + "Sprites/" + FrameNo.ToString() + "_" + SpriteName + ".png"), Color.Magenta); } public static void RunBatchString(string BatchString, string WorkingDirectory, bool is7Zip) diff --git a/EditCode.cs b/EditCode.cs index 75a8396..8845aeb 100644 --- a/EditCode.cs +++ b/EditCode.cs @@ -18,7 +18,7 @@ public EditCode() private void EditCode_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); LoadInButton.Enabled = ImportExport; SaveOutButton.Enabled = ImportExport; string NewCode = ReturnableCode; @@ -67,12 +67,12 @@ private void LoadInButton_Click(object sender, EventArgs e) byte MsgResponse = (byte)MessageBox.Show("Importing a Script will erase and replace the current code." + Constants.vbCrLf + Constants.vbCrLf + "Would you like to Continue?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (!(MsgResponse == (int)MsgBoxResult.Yes)) return; - string Response = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, "Dynamic Basic Files|*.dbas"); + string Response = DSGMlib.OpenFile(string.Empty, "Dynamic Basic Files|*.dbas"); if (Response.Length == 0) return; - string Content = DS_Game_Maker.DSGMlib.PathToString(Response); + string Content = DSGMlib.PathToString(Response); string FinalContent = string.Empty; - foreach (string X in DS_Game_Maker.DSGMlib.StringToLines(Content)) + foreach (string X in DSGMlib.StringToLines(Content)) { if (X.StartsWith("SCRIPTARG ")) continue; @@ -84,7 +84,7 @@ private void LoadInButton_Click(object sender, EventArgs e) private void SaveOutButton_Click(object sender, EventArgs e) { - string Response = DS_Game_Maker.DSGMlib.SaveFile(string.Empty, "Dynamic Basic Files|*.dbas", "Expoted Code.dbas"); + string Response = DSGMlib.SaveFile(string.Empty, "Dynamic Basic Files|*.dbas", "Expoted Code.dbas"); if (Response.Length == 0) return; string ToWrite = MainTextBox.Text; @@ -97,7 +97,7 @@ private void MainTextBox_CharAdded(object sender, ScintillaNET.CharAddedEventArg //if (!(e.Ch == '\r')) // return; ScintillaNET.Scintilla argTheControl = (ScintillaNET.Scintilla)sender; - DS_Game_Maker.DSGMlib.IntelliSense(ref argTheControl); + DSGMlib.IntelliSense(ref argTheControl); sender = argTheControl; } diff --git a/FoundInScripts.cs b/FoundInScripts.cs index 3262cb6..0f151fc 100644 --- a/FoundInScripts.cs +++ b/FoundInScripts.cs @@ -20,7 +20,7 @@ public FoundInScripts() private void FoundInScripts_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); if (Term.Length == 0) return; FindInScriptsDoIt(); @@ -34,12 +34,12 @@ public void FindInScriptsDoIt() ScriptLines.Clear(); ScriptPositions.Clear(); short DOn = 0; - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("SCRIPT ")) + foreach (string X in DSGMlib.GetXDSFilter("SCRIPT ")) { DOn = 0; string ScriptName = X.Substring(7); ScriptName = ScriptName.Substring(0, ScriptName.LastIndexOf(",")); - foreach (string ThisLine in DS_Game_Maker.DSGMlib.StringToLines(DS_Game_Maker.DSGMlib.PathToString(DS_Game_Maker.SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas"))) + foreach (string ThisLine in DSGMlib.StringToLines(DSGMlib.PathToString(SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas"))) { short FullLength = (short)ThisLine.Length; // MsgError("Line: " + ThisLine + vbcrlf + vbcrlf + "Length: " + FullLength.ToString) @@ -63,7 +63,7 @@ public void FindInScriptsDoIt() // MsgError(i.ToString + ": Observing: " + ThisLine.Substring(i)) if (ThisLine.Substring(i).StartsWith(Term)) { - DS_Game_Maker.DSGMlib.MsgError(i.ToString() + " - '" + ThisLine.Substring(i) + "' starts with '" + Term + "' so I'm addin' it"); + DSGMlib.MsgError(i.ToString() + " - '" + ThisLine.Substring(i) + "' starts with '" + Term + "' so I'm addin' it"); ScriptNames.Add(ScriptName); ScriptLines.Add((short)(DOn + 1)); ScriptPositions.Add(i); @@ -116,18 +116,18 @@ private void MainListBox_SelectedIndexChanged(object sender, EventArgs e) { if (X.Name == "Script" & (X.Text ?? "") == (ScriptName ?? "")) { - ((DS_Game_Maker.Script)X).GoToLine((short)(ScriptLines[MainListBox.SelectedIndex] - 1), ScriptPositions[MainListBox.SelectedIndex], (short)Term.Length); + ((Script)X).GoToLine((short)(ScriptLines[MainListBox.SelectedIndex] - 1), ScriptPositions[MainListBox.SelectedIndex], (short)Term.Length); X.BringToFront(); HasDone = true; } } if (!HasDone) { - var P = new DS_Game_Maker.Script(); + var P = new Script(); P.ScriptName = ScriptName; object argInstance = (object)P; - DS_Game_Maker.DSGMlib.ShowInternalForm(ref argInstance); - P = (DS_Game_Maker.Script)argInstance; + DSGMlib.ShowInternalForm(ref argInstance); + P = (Script)argInstance; P.GoToLine((short)(ScriptLines[MainListBox.SelectedIndex] - 1), ScriptPositions[MainListBox.SelectedIndex], (short)Term.Length); } } diff --git a/GameSettings.cs b/GameSettings.cs index 9c85da5..650cac9 100644 --- a/GameSettings.cs +++ b/GameSettings.cs @@ -15,29 +15,29 @@ public GameSettings() private void GameSettings_Load(object sender, EventArgs e) { StartingRoomDropper.Items.Clear(); - foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DS_Game_Maker.DSGMlib.ResourceIDs.Room].Nodes) + foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DSGMlib.ResourceIDs.Room].Nodes) StartingRoomDropper.Items.Add(X.Text); - StartingRoomDropper.Text = DS_Game_Maker.DSGMlib.GetXDSLine("BOOTROOM ").Substring(9); - ProjectNameTextBox.Text = DS_Game_Maker.DSGMlib.GetXDSLine("PROJECTNAME ").Substring(12); - Text2TextBox.Text = DS_Game_Maker.DSGMlib.GetXDSLine("TEXT2 ").Substring(6); - Text3TextBox.Text = DS_Game_Maker.DSGMlib.GetXDSLine("TEXT3 ").Substring(6); - if (DS_Game_Maker.DSGMlib.GetXDSLine("PROJECTLOGO ").Length > 12) + StartingRoomDropper.Text = DSGMlib.GetXDSLine("BOOTROOM ").Substring(9); + ProjectNameTextBox.Text = DSGMlib.GetXDSLine("PROJECTNAME ").Substring(12); + Text2TextBox.Text = DSGMlib.GetXDSLine("TEXT2 ").Substring(6); + Text3TextBox.Text = DSGMlib.GetXDSLine("TEXT3 ").Substring(6); + if (DSGMlib.GetXDSLine("PROJECTLOGO ").Length > 12) { - IconFileTextbox.Text = DS_Game_Maker.DSGMlib.GetXDSLine("PROJECTLOGO ").Substring(12); + IconFileTextbox.Text = DSGMlib.GetXDSLine("PROJECTLOGO ").Substring(12); } - ScoreDropper.Value = Convert.ToInt16(DS_Game_Maker.DSGMlib.GetXDSLine("SCORE ").Substring(6)); - LivesDropper.Value = Convert.ToInt16(DS_Game_Maker.DSGMlib.GetXDSLine("LIVES ").Substring(6)); - HealthDropper.Value = Convert.ToInt16(DS_Game_Maker.DSGMlib.GetXDSLine("HEALTH ").ToString().Substring(7)); - FATCallCheckBox.Checked = DS_Game_Maker.DSGMlib.GetXDSLine("FAT_CALL ").Substring(9) == "1" ? true : false; - NitroFSCallCheckBox.Checked = DS_Game_Maker.DSGMlib.GetXDSLine("NITROFS_CALL ").Substring(13) == "1" ? true : false; - MidPointCheckBox.Checked = DS_Game_Maker.DSGMlib.GetXDSLine("MIDPOINT_COLLISIONS ").Substring(20) == "1" ? true : false; - IncludeWiFiLibChecker.Checked = DS_Game_Maker.DSGMlib.GetXDSLine("INCLUDE_WIFI_LIB ").Substring(17) == "1" ? true : false; + ScoreDropper.Value = Convert.ToInt16(DSGMlib.GetXDSLine("SCORE ").Substring(6)); + LivesDropper.Value = Convert.ToInt16(DSGMlib.GetXDSLine("LIVES ").Substring(6)); + HealthDropper.Value = Convert.ToInt16(DSGMlib.GetXDSLine("HEALTH ").ToString().Substring(7)); + FATCallCheckBox.Checked = DSGMlib.GetXDSLine("FAT_CALL ").Substring(9) == "1" ? true : false; + NitroFSCallCheckBox.Checked = DSGMlib.GetXDSLine("NITROFS_CALL ").Substring(13) == "1" ? true : false; + MidPointCheckBox.Checked = DSGMlib.GetXDSLine("MIDPOINT_COLLISIONS ").Substring(20) == "1" ? true : false; + IncludeWiFiLibChecker.Checked = DSGMlib.GetXDSLine("INCLUDE_WIFI_LIB ").Substring(17) == "1" ? true : false; IncludeFilesList.Items.Clear(); NitroFSFilesList.Items.Clear(); - foreach (string P in DS_Game_Maker.DSGMlib.GetXDSFilter("INCLUDE ")) + foreach (string P in DSGMlib.GetXDSFilter("INCLUDE ")) IncludeFilesList.Items.Add(P.Substring(8)); - foreach (string P in DS_Game_Maker.DSGMlib.GetXDSFilter("NITROFS ")) + foreach (string P in DSGMlib.GetXDSFilter("NITROFS ")) NitroFSFilesList.Items.Add(P.Substring(8)); } @@ -48,31 +48,31 @@ private void DCancelButton_Click(object sender, EventArgs e) private void DOkayButton_Click(object sender, EventArgs e) { - var Logo = DS_Game_Maker.DSGMlib.PathToImage(IconOpenFileDialog.FileName); + var Logo = DSGMlib.PathToImage(IconOpenFileDialog.FileName); if (!(Logo.Width == 32) & !(Logo.Height == 32)) { - DS_Game_Maker.DSGMlib.MsgError("Your project's icon must be 32 x 32!"); + DSGMlib.MsgError("Your project's icon must be 32 x 32!"); return; } - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("BOOTROOM "), "BOOTROOM " + StartingRoomDropper.Text); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("PROJECTNAME "), "PROJECTNAME " + ProjectNameTextBox.Text); - DS_Game_Maker.DSGMlib.CacheProjectName = ProjectNameTextBox.Text; - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("TEXT2 "), "TEXT2 " + Text2TextBox.Text); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("TEXT3 "), "TEXT3 " + Text3TextBox.Text); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("SCORE "), "SCORE " + ScoreDropper.Value.ToString()); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("LIVES "), "LIVES " + LivesDropper.Value.ToString()); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("HEALTH "), "HEALTH " + HealthDropper.Value.ToString()); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("FAT_CALL "), "FAT_CALL " + (FATCallCheckBox.Checked ? "1" : "0")); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("NITROFS_CALL "), "NITROFS_CALL " + (NitroFSCallCheckBox.Checked ? "1" : "0")); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("MIDPOINT_COLLISIONS "), "MIDPOINT_COLLISIONS " + (MidPointCheckBox.Checked ? "1" : "0")); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("INCLUDE_WIFI_LIB "), "INCLUDE_WIFI_LIB " + (IncludeWiFiLibChecker.Checked ? "1" : "0")); - if (string.IsNullOrEmpty(DS_Game_Maker.DSGMlib.GetXDSLine("PROJECTLOGO "))) + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("BOOTROOM "), "BOOTROOM " + StartingRoomDropper.Text); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("PROJECTNAME "), "PROJECTNAME " + ProjectNameTextBox.Text); + DSGMlib.CacheProjectName = ProjectNameTextBox.Text; + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("TEXT2 "), "TEXT2 " + Text2TextBox.Text); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("TEXT3 "), "TEXT3 " + Text3TextBox.Text); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("SCORE "), "SCORE " + ScoreDropper.Value.ToString()); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("LIVES "), "LIVES " + LivesDropper.Value.ToString()); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("HEALTH "), "HEALTH " + HealthDropper.Value.ToString()); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("FAT_CALL "), "FAT_CALL " + (FATCallCheckBox.Checked ? "1" : "0")); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("NITROFS_CALL "), "NITROFS_CALL " + (NitroFSCallCheckBox.Checked ? "1" : "0")); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("MIDPOINT_COLLISIONS "), "MIDPOINT_COLLISIONS " + (MidPointCheckBox.Checked ? "1" : "0")); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("INCLUDE_WIFI_LIB "), "INCLUDE_WIFI_LIB " + (IncludeWiFiLibChecker.Checked ? "1" : "0")); + if (string.IsNullOrEmpty(DSGMlib.GetXDSLine("PROJECTLOGO "))) { - DS_Game_Maker.DSGMlib.XDSAddLine("PROJECTLOGO " + IconFileTextbox.Text); + DSGMlib.XDSAddLine("PROJECTLOGO " + IconFileTextbox.Text); } else { - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("PROJECTLOGO "), "PROJECTLOGO " + IconFileTextbox.Text); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("PROJECTLOGO "), "PROJECTLOGO " + IconFileTextbox.Text); } Close(); } @@ -82,8 +82,8 @@ private void DeleteIncludeFileButton_Click(object sender, EventArgs e) if (IncludeFilesList.SelectedIndices.Count == 0) return; string TheName = Conversions.ToString(IncludeFilesList.Items[IncludeFilesList.SelectedIndex]); - System.IO.File.Delete(DS_Game_Maker.SessionsLib.SessionPath + @"IncludeFiles\" + TheName); - DS_Game_Maker.DSGMlib.XDSRemoveLine("INCLUDE " + TheName); + System.IO.File.Delete(SessionsLib.SessionPath + @"IncludeFiles\" + TheName); + DSGMlib.XDSRemoveLine("INCLUDE " + TheName); IncludeFilesList.Items.RemoveAt(IncludeFilesList.SelectedIndex); } @@ -92,18 +92,18 @@ private void DeleteNitroFSFileButton_Click(object sender, EventArgs e) if (NitroFSFilesList.SelectedIndices.Count == 0) return; string TheName = Conversions.ToString(NitroFSFilesList.Items[NitroFSFilesList.SelectedIndex]); - System.IO.File.Delete(DS_Game_Maker.SessionsLib.SessionPath + @"NitroFSFiles\" + TheName); - DS_Game_Maker.DSGMlib.XDSRemoveLine("NITROFS " + TheName); + System.IO.File.Delete(SessionsLib.SessionPath + @"NitroFSFiles\" + TheName); + DSGMlib.XDSRemoveLine("NITROFS " + TheName); NitroFSFilesList.Items.RemoveAt(NitroFSFilesList.SelectedIndex); } public void AddThing(string SysName) { - string Result = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, "All Files|*.*"); + string Result = DSGMlib.OpenFile(string.Empty, "All Files|*.*"); if (Result.Length == 0) return; string ShortName = Result.Substring(Result.LastIndexOf(@"\") + 1); - DS_Game_Maker.DSGMlib.XDSAddLine(SysName.ToUpper() + " " + ShortName); + DSGMlib.XDSAddLine(SysName.ToUpper() + " " + ShortName); foreach (Control P in CodingTabPage.Controls) { if ((P.Name ?? "") == (SysName + "FilesList" ?? "")) @@ -111,7 +111,7 @@ public void AddThing(string SysName) ((ListBox)P).Items.Add(ShortName); } } - System.IO.File.Copy(Result, DS_Game_Maker.SessionsLib.SessionPath + SysName + @"Files\" + ShortName, true); + System.IO.File.Copy(Result, SessionsLib.SessionPath + SysName + @"Files\" + ShortName, true); } private void AddIncludeFileButton_Click(object sender, EventArgs e) @@ -128,15 +128,15 @@ private void EditIncludeFileButton_Click(object sender, EventArgs e) { if (IncludeFilesList.SelectedIndices.Count == 0) return; - DS_Game_Maker.DSGMlib.URL(Conversions.ToString(Operators.AddObject(DS_Game_Maker.SessionsLib.SessionPath + @"IncludeFiles\", IncludeFilesList.Items[IncludeFilesList.SelectedIndex]))); + DSGMlib.URL(Conversions.ToString(Operators.AddObject(SessionsLib.SessionPath + @"IncludeFiles\", IncludeFilesList.Items[IncludeFilesList.SelectedIndex]))); } private void EditNitroFSFileButton_Click(object sender, EventArgs e) { if (NitroFSFilesList.SelectedIndices.Count == 0) return; - DS_Game_Maker.DSGMlib.MsgError(Conversions.ToString(Operators.AddObject(DS_Game_Maker.SessionsLib.SessionPath + @"NitroFSFiles\", NitroFSFilesList.Items[NitroFSFilesList.SelectedIndex]))); - DS_Game_Maker.DSGMlib.URL(Conversions.ToString(Operators.AddObject(DS_Game_Maker.SessionsLib.SessionPath + @"NitroFSFiles\", NitroFSFilesList.Items[NitroFSFilesList.SelectedIndex]))); + DSGMlib.MsgError(Conversions.ToString(Operators.AddObject(SessionsLib.SessionPath + @"NitroFSFiles\", NitroFSFilesList.Items[NitroFSFilesList.SelectedIndex]))); + DSGMlib.URL(Conversions.ToString(Operators.AddObject(SessionsLib.SessionPath + @"NitroFSFiles\", NitroFSFilesList.Items[NitroFSFilesList.SelectedIndex]))); } private void BrowseButton_Click(object sender, EventArgs e) diff --git a/GlobalArrays.cs b/GlobalArrays.cs index 5f10532..ec0b987 100644 --- a/GlobalArrays.cs +++ b/GlobalArrays.cs @@ -33,18 +33,18 @@ public void ClearShizzle() private void Globals_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); var TMPList = new ImageList(); TMPList.ImageSize = new Size(16, 16); TMPList.ColorDepth = ColorDepth.Depth32Bit; TMPList.Images.Add(Properties.Resources.ArrayIcon); ArraysList.ImageList = TMPList; ArraysList.Nodes.Clear(); - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("ARRAY ")) + foreach (string X_ in DSGMlib.GetXDSFilter("ARRAY ")) { string X = X_; X = X.Substring(6); - string ArrayName = DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ","); + string ArrayName = DSGMlib.iGet(X, (byte)0, ","); ArraysList.Nodes.Add(string.Empty, ArrayName, 0); } ClearShizzle(); @@ -55,11 +55,11 @@ private void DeleteButton_Click(object sender, EventArgs e) if (SN == 200) return; string ArrayName = ArraysList.Nodes[SN].Text; - DS_Game_Maker.DSGMlib.XDSRemoveLine(DS_Game_Maker.DSGMlib.GetXDSLine("ARRAY " + ArrayName + ",")); + DSGMlib.XDSRemoveLine(DSGMlib.GetXDSLine("ARRAY " + ArrayName + ",")); ArraysList.Nodes.Remove(ArraysList.Nodes[SN]); string Message = "You have just deleted '" + ArrayName + "'." + Constants.vbCrLf + Constants.vbCrLf; Message += "Be sure to update any logic that uses this Array."; - DS_Game_Maker.DSGMlib.MsgInfo(Message); + DSGMlib.MsgInfo(Message); ClearShizzle(); } @@ -68,18 +68,18 @@ private void VariablesList_NodeMouseDoubleClick(object sender, TreeNodeMouseClic SN = (byte)e.Node.Index; NameTextBox.Text = e.Node.Text; MainGroupBox.Text = e.Node.Text; - string XDSLine = DS_Game_Maker.DSGMlib.GetXDSLine("ARRAY " + e.Node.Text + ","); - byte Type = Convert.ToByte(DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)1, ",")); + string XDSLine = DSGMlib.GetXDSLine("ARRAY " + e.Node.Text + ","); + byte Type = Convert.ToByte(DSGMlib.iGet(XDSLine, (byte)1, ",")); TypeDropper.Text = "Number"; if (Type == 1) TypeDropper.Text = "TrueFalse"; - string ValuesString = DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)2, ","); + string ValuesString = DSGMlib.iGet(XDSLine, (byte)2, ","); ValuesListBox.Items.Clear(); if (ValuesString.Length > 0) { - for (short i = 0, loopTo = DS_Game_Maker.DSGMlib.HowManyChar(ValuesString, ";"); i <= loopTo; i++) + for (short i = 0, loopTo = DSGMlib.HowManyChar(ValuesString, ";"); i <= loopTo; i++) { - string Value = DS_Game_Maker.DSGMlib.iGet(ValuesString, (byte)i, ";"); + string Value = DSGMlib.iGet(ValuesString, (byte)i, ";"); ValuesListBox.Items.Add(Value); } } @@ -92,19 +92,19 @@ private void VariablesList_NodeMouseDoubleClick(object sender, TreeNodeMouseClic private void SaveButton_Click(object sender, EventArgs e) { // If SN = 200 Then MsgWarn("No Variable is selected.") : Exit Sub - if (!DS_Game_Maker.DSGMlib.ValidateSomething(NameTextBox.Text, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.Tight)) + if (!DSGMlib.ValidateSomething(NameTextBox.Text, (byte)DSGMlib.ValidateLevel.Tight)) { - DS_Game_Maker.DSGMlib.MsgWarn("You must provide a valid name."); + DSGMlib.MsgWarn("You must provide a valid name."); return; } if (TypeDropper.Text.Length == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("You must select a Type."); + DSGMlib.MsgWarn("You must select a Type."); return; } if (!(TypeDropper.Text == "TrueFalse") & !(TypeDropper.Text == "Number")) { - DS_Game_Maker.DSGMlib.MsgWarn("A Variable can only be a 'TrueFalse' or a 'Number'."); + DSGMlib.MsgWarn("A Variable can only be a 'TrueFalse' or a 'Number'."); return; } if (TypeDropper.Text == "TrueFalse") @@ -123,7 +123,7 @@ private void SaveButton_Click(object sender, EventArgs e) } if (!AllTrueFalse) { - DS_Game_Maker.DSGMlib.MsgWarn("With a TrueFalse Array, all Values must be 'true' or 'false'."); + DSGMlib.MsgWarn("With a TrueFalse Array, all Values must be 'true' or 'false'."); return; } } @@ -133,7 +133,7 @@ private void SaveButton_Click(object sender, EventArgs e) ValuesString += X + ";"; if (ValuesString.Length > 0) ValuesString = ValuesString.Substring(0, ValuesString.Length - 1); - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("ARRAY " + ArraysList.Nodes[SN].Text + ","), "ARRAY " + NameTextBox.Text + "," + TheType.ToString() + "," + ValuesString); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("ARRAY " + ArraysList.Nodes[SN].Text + ","), "ARRAY " + NameTextBox.Text + "," + TheType.ToString() + "," + ValuesString); ArraysList.SelectedNode.Text = NameTextBox.Text; MainGroupBox.Text = NameTextBox.Text; } @@ -143,13 +143,13 @@ private void AddButton_Click(object sender, EventArgs e) short ToUse = 1; for (int i = 1; i <= 1000; i++) { - if (DS_Game_Maker.DSGMlib.GetXDSFilter("ARRAY Array_" + i.ToString() + ",").Length == 0) + if (DSGMlib.GetXDSFilter("ARRAY Array_" + i.ToString() + ",").Length == 0) { ToUse = (short)i; break; } } - DS_Game_Maker.DSGMlib.XDSAddLine("ARRAY Array_" + ToUse.ToString() + ",0,"); + DSGMlib.XDSAddLine("ARRAY Array_" + ToUse.ToString() + ",0,"); ArraysList.Nodes.Add(string.Empty, "Array_" + ToUse.ToString(), 0); } @@ -177,7 +177,7 @@ private void EditValueButton_Click(object sender, EventArgs e) { if (ValuesListBox.SelectedIndices.Count == 0) return; - string Response = DS_Game_Maker.DSGMlib.GetInput("Please enter a new Value", ValuesListBox.Text, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.None); + string Response = DSGMlib.GetInput("Please enter a new Value", ValuesListBox.Text, (byte)DSGMlib.ValidateLevel.None); if (Response.Length == 0) return; ValuesListBox.Items[ValuesListBox.SelectedIndices[0]] = Response; diff --git a/GlobalStructures.cs b/GlobalStructures.cs index 289965e..cdf2f03 100644 --- a/GlobalStructures.cs +++ b/GlobalStructures.cs @@ -35,7 +35,7 @@ private void GlobalStructures_Load(object sender, EventArgs e) Names.Clear(); Types.Clear(); Values.Clear(); - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("STRUCT ")) + foreach (string X_ in DSGMlib.GetXDSFilter("STRUCT ")) { string X = X_; X = X.Substring(7); @@ -98,15 +98,15 @@ private void AddButton_Click(object sender, EventArgs e) short ToUse = 1; for (int i = 1; i <= 1000; i++) { - if (!DS_Game_Maker.DSGMlib.DoesXDSLineExist("STRUCT Structure_" + i.ToString())) + if (!DSGMlib.DoesXDSLineExist("STRUCT Structure_" + i.ToString())) { ToUse = (short)i; break; } } string TheName = "Structure_" + ToUse.ToString(); - DS_Game_Maker.DSGMlib.XDSAddLine("STRUCT " + TheName); - DS_Game_Maker.DSGMlib.XDSAddLine("STRUCTMEMBER " + TheName + ",Item_1,Integer,0"); + DSGMlib.XDSAddLine("STRUCT " + TheName); + DSGMlib.XDSAddLine("STRUCTMEMBER " + TheName + ",Item_1,Integer,0"); Structures.Add(TheName); SaveOnChange = StructuresList.SelectedIndices.Count == 1; StructuresList.Items.Add(TheName); @@ -124,11 +124,11 @@ private void RemoveButton_Click(object sender, EventArgs e) Values.Clear(); MembersList.Items.Clear(); NameTextBox.Text = string.Empty; - DS_Game_Maker.DSGMlib.XDSRemoveLine("STRUCT " + CurrentName); - DS_Game_Maker.DSGMlib.XDSRemoveFilter("STRUCTMEMBER " + CurrentName + ","); + DSGMlib.XDSRemoveLine("STRUCT " + CurrentName); + DSGMlib.XDSRemoveFilter("STRUCTMEMBER " + CurrentName + ","); string Message = "You have just deleted '" + CurrentName + "'." + Constants.vbCrLf + Constants.vbCrLf; Message += "Be sure to update any logic that uses this Structure."; - DS_Game_Maker.DSGMlib.MsgInfo(Message); + DSGMlib.MsgInfo(Message); SaveOnChange = false; if (StructuresList.Items.Count > 0) { @@ -144,7 +144,7 @@ private void NameTextBox_TextChanged(object sender, EventArgs e) { if (Structures.Count == 0) return; - if (DS_Game_Maker.DSGMlib.ValidateSomething(NameTextBox.Text, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.Tight)) + if (DSGMlib.ValidateSomething(NameTextBox.Text, (byte)DSGMlib.ValidateLevel.Tight)) { NameTextBox.BackColor = Color.FromArgb(64, 64, 64); AllowChangeOrQuit = true; @@ -168,8 +168,8 @@ private void GlobalStructures_FormClosing(object sender, FormClosingEventArgs e) string OldName = Structures[OldIndex]; // Structures(OldIndex) = NameTextBox.Text // StructuresList.Items(OldIndex) = NameTextBox.Text - DS_Game_Maker.DSGMlib.XDSChangeLine("STRUCT " + OldName, "STRUCT " + NameTextBox.Text); - DS_Game_Maker.DSGMlib.XDSRemoveFilter("STRUCTMEMBER " + OldName + ","); + DSGMlib.XDSChangeLine("STRUCT " + OldName, "STRUCT " + NameTextBox.Text); + DSGMlib.XDSRemoveFilter("STRUCTMEMBER " + OldName + ","); if (Names.Count > 0) { for (byte P = 0, loopTo = (byte)(Names.Count - 1); P <= loopTo; P++) @@ -178,7 +178,7 @@ private void GlobalStructures_FormClosing(object sender, FormClosingEventArgs e) FS += Names[P] + ","; FS += Types[P] + ","; FS += Values[P].Replace(",", ""); - DS_Game_Maker.DSGMlib.XDSAddLine(FS); + DSGMlib.XDSAddLine(FS); } } @@ -204,8 +204,8 @@ private void StructuresList_SelectedIndexChanged(object sender, EventArgs e) string OldName = Structures[OldIndex]; Structures[OldIndex] = NameTextBox.Text; StructuresList.Items[OldIndex] = NameTextBox.Text; - DS_Game_Maker.DSGMlib.XDSChangeLine("STRUCT " + OldName, "STRUCT " + NameTextBox.Text); - DS_Game_Maker.DSGMlib.XDSRemoveFilter("STRUCTMEMBER " + OldName + ","); + DSGMlib.XDSChangeLine("STRUCT " + OldName, "STRUCT " + NameTextBox.Text); + DSGMlib.XDSRemoveFilter("STRUCTMEMBER " + OldName + ","); if (Names.Count > 0) { for (byte P = 0, loopTo = (byte)(Names.Count - 1); P <= loopTo; P++) @@ -214,7 +214,7 @@ private void StructuresList_SelectedIndexChanged(object sender, EventArgs e) FS += Names[P] + ","; FS += Types[P] + ","; FS += Values[P].Replace(",", ""); - DS_Game_Maker.DSGMlib.XDSAddLine(FS); + DSGMlib.XDSAddLine(FS); } } // For Each X As String In GetXDSFilter("STRUCTMEMBER " + OldName + ",") @@ -227,7 +227,7 @@ private void StructuresList_SelectedIndexChanged(object sender, EventArgs e) Types.Clear(); Values.Clear(); MembersList.Items.Clear(); - foreach (string P_ in DS_Game_Maker.DSGMlib.GetXDSFilter("STRUCTMEMBER " + CurrentName + ",")) + foreach (string P_ in DSGMlib.GetXDSFilter("STRUCTMEMBER " + CurrentName + ",")) { string P = P_; P = P.Substring(("STRUCTMEMBER " + CurrentName).Length + 1); diff --git a/GlobalVariables.cs b/GlobalVariables.cs index 97f745f..8c8423d 100644 --- a/GlobalVariables.cs +++ b/GlobalVariables.cs @@ -27,20 +27,20 @@ private void Globals_Load(object sender, EventArgs e) { SetEnablity(false); TypeList.Items.Clear(); - foreach (string X in DS_Game_Maker.ScriptsLib.VariableTypes) + foreach (string X in ScriptsLib.VariableTypes) TypeList.Items.Add(X); - foreach (string P in DS_Game_Maker.DSGMlib.GetXDSFilter("STRUCT ")) + foreach (string P in DSGMlib.GetXDSFilter("STRUCT ")) TypeList.Items.Add(P.Substring(7)); Variables.Clear(); MyVariableTypes.Clear(); VariableValues.Clear(); - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("GLOBAL ")) + foreach (string X_ in DSGMlib.GetXDSFilter("GLOBAL ")) { string X = X_; X = X.Substring(7); - Variables.Add(DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ",")); - MyVariableTypes.Add(DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",")); - VariableValues.Add(DS_Game_Maker.DSGMlib.iGet(X, (byte)2, ",")); + Variables.Add(DSGMlib.iGet(X, (byte)0, ",")); + MyVariableTypes.Add(DSGMlib.iGet(X, (byte)1, ",")); + VariableValues.Add(DSGMlib.iGet(X, (byte)2, ",")); } VariablesList.Items.Clear(); if (Variables.Count > 0) @@ -88,7 +88,7 @@ private void RemoveButton_Click(object sender, EventArgs e) SetEnablity(false); } Message += "Be sure to update any logic that uses this Variable."; - DS_Game_Maker.DSGMlib.MsgInfo(Message); + DSGMlib.MsgInfo(Message); CurrentName = string.Empty; } @@ -189,7 +189,7 @@ private void NameTextBox_TextChanged(object sender, EventArgs e) { if (Variables.Count == 0) return; - if (DS_Game_Maker.DSGMlib.ValidateSomething(NameTextBox.Text, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.Tight)) + if (DSGMlib.ValidateSomething(NameTextBox.Text, (byte)DSGMlib.ValidateLevel.Tight)) { NameTextBox.BackColor = Color.FromArgb(64, 64, 64); Variables[VariablesList.SelectedIndex] = NameTextBox.Text; @@ -277,13 +277,13 @@ private void GlobalVariables_FormClosing(object sender, FormClosingEventArgs e) e.Cancel = true; return; } - DS_Game_Maker.DSGMlib.XDSRemoveFilter("GLOBAL "); + DSGMlib.XDSRemoveFilter("GLOBAL "); for (short i = 0, loopTo = (short)(Variables.Count - 1); i <= loopTo; i++) { string NewLine = "GLOBAL " + Variables[i] + ","; NewLine += MyVariableTypes[i] + ","; NewLine += VariableValues[i]; - DS_Game_Maker.DSGMlib.XDSAddLine(NewLine); + DSGMlib.XDSAddLine(NewLine); } } } diff --git a/ImportSprite.cs b/ImportSprite.cs index 9e8627b..ce6259e 100644 --- a/ImportSprite.cs +++ b/ImportSprite.cs @@ -22,10 +22,10 @@ public ImportSprite() public Bitmap RenderImage() { - var TheSize = DS_Game_Maker.DSGMlib.PathToImage(FileName).Size; + var TheSize = DSGMlib.PathToImage(FileName).Size; var Returnable = new Bitmap(TheSize.Width, TheSize.Height); var RGFX = Graphics.FromImage(Returnable); - RGFX.DrawImage(DS_Game_Maker.DSGMlib.PathToImage(FileName), new Point(0, 0)); + RGFX.DrawImage(DSGMlib.PathToImage(FileName), new Point(0, 0)); bool XStartWhite = true; for (short Y = 0, loopTo = (short)Math.Round(ImagesPerColumnDropper.Value - 1m); Y <= loopTo; Y++) { @@ -56,14 +56,14 @@ public short EquateHRow() { if (FileName.Length == 0) return 1; - short HRow = (short)DS_Game_Maker.DSGMlib.PathToImage(FileName).Width; + short HRow = (short)DSGMlib.PathToImage(FileName).Width; if (HRow % FrameWidth == 0) { return (short)Math.Round(HRow / (double)FrameWidth); } else { - HRow = (short)(HRow + ((int)FrameWidth - DS_Game_Maker.DSGMlib.PathToImage(FileName).Width % (int)FrameWidth)); + HRow = (short)(HRow + ((int)FrameWidth - DSGMlib.PathToImage(FileName).Width % (int)FrameWidth)); HRow = (short)Math.Round(HRow / (double)FrameWidth); } return HRow; @@ -73,7 +73,7 @@ public short EquateVRow() { if (FileName.Length == 0) return 1; - short VRow = (short)DS_Game_Maker.DSGMlib.PathToImage(FileName).Height; + short VRow = (short)DSGMlib.PathToImage(FileName).Height; if (VRow % FrameHeight == 0) { return (short)Math.Round(VRow / (double)FrameHeight); @@ -104,7 +104,7 @@ private void DAcceptButton_Click(object sender, EventArgs e) { // TODO LATER Rows beyond the image width = bad frames! // Limit on selector, or ignore extra value? - Bitmap TheImage = (Bitmap)DS_Game_Maker.DSGMlib.PathToImage(FileName); + Bitmap TheImage = (Bitmap)DSGMlib.PathToImage(FileName); short DOn = 0; for (short Y = 0, loopTo = (short)Math.Round(ImagesPerColumnDropper.Value - 1m); Y <= loopTo; Y++) { diff --git a/InputBoxForm.cs b/InputBoxForm.cs index a807142..c9972b4 100644 --- a/InputBoxForm.cs +++ b/InputBoxForm.cs @@ -40,7 +40,7 @@ private void DOkayButton_Click(object sender, EventArgs e) private void MainTextBox_TextChanged(object sender, EventArgs e) { - DOkayButton.Enabled = DS_Game_Maker.DSGMlib.ValidateSomething(MainTextBox.Text, Validation); + DOkayButton.Enabled = DSGMlib.ValidateSomething(MainTextBox.Text, Validation); } } } \ No newline at end of file diff --git a/MainForm.cs b/MainForm.cs index 3820737..ad1114e 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -38,7 +38,7 @@ public void PatchSetting(string SettingName, string SettingValue) { bool DoTheAdd = true; string FS = string.Empty; - foreach (string SettingLine in File.ReadAllLines(DS_Game_Maker.SettingsLib.SettingsPath)) + foreach (string SettingLine in File.ReadAllLines(SettingsLib.SettingsPath)) { // If SettingLine.Length = 0 Then Continue For if (SettingLine.StartsWith(SettingName + " ")) @@ -48,7 +48,7 @@ public void PatchSetting(string SettingName, string SettingValue) if (DoTheAdd) { FS += SettingName + " " + SettingValue; - File.WriteAllText(DS_Game_Maker.SettingsLib.SettingsPath, FS); + File.WriteAllText(SettingsLib.SettingsPath, FS); } } @@ -69,7 +69,7 @@ private void MainForm_Load(object sender, EventArgs e) // Initialize Apply Finders { - ref var withBlock = ref DS_Game_Maker.ScriptsLib.ApplyFinders; + ref var withBlock = ref ScriptsLib.ApplyFinders; withBlock.Add("[X]"); withBlock.Add("[Y]"); withBlock.Add("[VX]"); @@ -82,7 +82,7 @@ private void MainForm_Load(object sender, EventArgs e) } // Initialize Variable Types { - ref var withBlock1 = ref DS_Game_Maker.ScriptsLib.VariableTypes; + ref var withBlock1 = ref ScriptsLib.VariableTypes; withBlock1.Add("Integer"); withBlock1.Add("Boolean"); withBlock1.Add("Float"); @@ -92,8 +92,8 @@ private void MainForm_Load(object sender, EventArgs e) } // Set Up Action icons - DS_Game_Maker.DSGMlib.ActionBG = (Bitmap)(File.Exists(Constants.AppDirectory + "ActionBG.png") ? DS_Game_Maker.DSGMlib.PathToImage(Constants.AppDirectory + "ActionBG.png") : Properties.Resources.ActionBG); - DS_Game_Maker.DSGMlib.ActionConditionalBG = (Bitmap)(File.Exists(Constants.AppDirectory + "ActionConditionalBG.png") ? DS_Game_Maker.DSGMlib.PathToImage(Constants.AppDirectory + "ActionConditionalBG.png") : Properties.Resources.ActionConditionalBG); + DSGMlib.ActionBG = (Bitmap)(File.Exists(Constants.AppDirectory + "ActionBG.png") ? DSGMlib.PathToImage(Constants.AppDirectory + "ActionBG.png") : Properties.Resources.ActionBG); + DSGMlib.ActionConditionalBG = (Bitmap)(File.Exists(Constants.AppDirectory + "ActionConditionalBG.png") ? DSGMlib.PathToImage(Constants.AppDirectory + "ActionConditionalBG.png") : Properties.Resources.ActionConditionalBG); foreach (Control ctl in Controls) { @@ -135,33 +135,33 @@ private void MainForm_Load(object sender, EventArgs e) DSGMlib.RebuildFontCache(); // Toolstrip Renderers - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); - DMainMenuStrip.Renderer = new DS_Game_Maker.clsMenuRenderer(); - ResRightClickMenu.Renderer = new DS_Game_Maker.clsMenuRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); + DMainMenuStrip.Renderer = new clsMenuRenderer(); + ResRightClickMenu.Renderer = new clsMenuRenderer(); // Resources Setup - DS_Game_Maker.DSGMlib.ResourceTypes[0] = "Sprites"; + DSGMlib.ResourceTypes[0] = "Sprites"; MainImageList.Images.Add("SpriteIcon", Properties.Resources.SpriteIcon); - DS_Game_Maker.DSGMlib.ResourceTypes[1] = "Objects"; + DSGMlib.ResourceTypes[1] = "Objects"; MainImageList.Images.Add("ObjectIcon", Properties.Resources.ObjectIcon); - DS_Game_Maker.DSGMlib.ResourceTypes[2] = "Backgrounds"; + DSGMlib.ResourceTypes[2] = "Backgrounds"; MainImageList.Images.Add("BackgroundIcon", Properties.Resources.BackgroundIcon); - DS_Game_Maker.DSGMlib.ResourceTypes[3] = "Sounds"; + DSGMlib.ResourceTypes[3] = "Sounds"; MainImageList.Images.Add("SoundIcon", Properties.Resources.SoundIcon); - DS_Game_Maker.DSGMlib.ResourceTypes[4] = "Rooms"; + DSGMlib.ResourceTypes[4] = "Rooms"; MainImageList.Images.Add("RoomIcon", Properties.Resources.RoomIcon); - DS_Game_Maker.DSGMlib.ResourceTypes[5] = "Paths"; + DSGMlib.ResourceTypes[5] = "Paths"; MainImageList.Images.Add("PathIcon", Properties.Resources.PathIcon); - DS_Game_Maker.DSGMlib.ResourceTypes[6] = "Scripts"; + DSGMlib.ResourceTypes[6] = "Scripts"; MainImageList.Images.Add("ScriptIcon", Properties.Resources.ScriptIcon); // Imagelist Setup // MainImageList.Images.Add("ScriptIcon", My.Resources.ScriptIcon) MainImageList.Images.Add("FolderIcon", Properties.Resources.FolderIcon); // Resources Setup - for (byte Resource = 0, loopTo = (byte)(DS_Game_Maker.DSGMlib.ResourceTypes.Length - 1); Resource <= loopTo; Resource++) + for (byte Resource = 0, loopTo = (byte)(DSGMlib.ResourceTypes.Length - 1); Resource <= loopTo; Resource++) { - ResourcesTreeView.Nodes.Add(string.Empty, DS_Game_Maker.DSGMlib.ResourceTypes[(int)Resource], 7, 7); + ResourcesTreeView.Nodes.Add(string.Empty, DSGMlib.ResourceTypes[(int)Resource], 7, 7); } @@ -172,26 +172,26 @@ private void MainForm_Load(object sender, EventArgs e) } - DS_Game_Maker.SettingsLib.SettingsPath = Constants.AppDirectory + "data.dat"; + SettingsLib.SettingsPath = Constants.AppDirectory + "data.dat"; PatchSetting("USE_EXTERNAL_SCRIPT_EDITOR", "0"); PatchSetting("RIGHT_CLICK", "1"); PatchSetting("HIDE_OLD_ACTIONS", "1"); PatchSetting("SHRINK_ACTIONS_LIST", "0"); - DS_Game_Maker.SettingsLib.LoadSettings(); + SettingsLib.LoadSettings(); // Fonts Setup foreach (string FontFile in Directory.GetFiles(Constants.AppDirectory + "Fonts")) { string FontName = FontFile.Substring(FontFile.LastIndexOf("/") + 1); FontName = FontName.Substring(0, FontName.IndexOf(".")); - DS_Game_Maker.DSGMlib.FontNames.Add(FontName); + DSGMlib.FontNames.Add(FontName); } - Text = DS_Game_Maker.DSGMlib.TitleDataWorks(); + Text = DSGMlib.TitleDataWorks(); } public void GenerateShite(string DisplayResult) { - short DW = Convert.ToInt16(DS_Game_Maker.SettingsLib.GetSetting("DEFAULT_ROOM_WIDTH")); - short DH = Convert.ToInt16(DS_Game_Maker.SettingsLib.GetSetting("DEFAULT_ROOM_HEIGHT")); + short DW = Convert.ToInt16(SettingsLib.GetSetting("DEFAULT_ROOM_WIDTH")); + short DH = Convert.ToInt16(SettingsLib.GetSetting("DEFAULT_ROOM_HEIGHT")); @@ -209,18 +209,18 @@ public void GenerateShite(string DisplayResult) - DS_Game_Maker.DSGMlib.CurrentXDS = "ROOM Room_1," + DW.ToString() + "," + DH.ToString() + ",1,," + DW.ToString() + "," + DH.ToString() + ",1," + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "BOOTROOM Room_1" + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "SCORE 0" + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "LIVES 3" + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "HEALTH 100" + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "PROJECTNAME " + DisplayResult + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "TEXT2 " + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "TEXT3 " + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "FAT_CALL 0" + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "NITROFS_CALL 1" + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "MIDPOINT_COLLISIONS 0" + Constants.vbCrLf; - DS_Game_Maker.DSGMlib.CurrentXDS += "INCLUDE_WIFI_LIB 0" + Constants.vbCrLf; + DSGMlib.CurrentXDS = "ROOM Room_1," + DW.ToString() + "," + DH.ToString() + ",1,," + DW.ToString() + "," + DH.ToString() + ",1," + Constants.vbCrLf; + DSGMlib.CurrentXDS += "BOOTROOM Room_1" + Constants.vbCrLf; + DSGMlib.CurrentXDS += "SCORE 0" + Constants.vbCrLf; + DSGMlib.CurrentXDS += "LIVES 3" + Constants.vbCrLf; + DSGMlib.CurrentXDS += "HEALTH 100" + Constants.vbCrLf; + DSGMlib.CurrentXDS += "PROJECTNAME " + DisplayResult + Constants.vbCrLf; + DSGMlib.CurrentXDS += "TEXT2 " + Constants.vbCrLf; + DSGMlib.CurrentXDS += "TEXT3 " + Constants.vbCrLf; + DSGMlib.CurrentXDS += "FAT_CALL 0" + Constants.vbCrLf; + DSGMlib.CurrentXDS += "NITROFS_CALL 1" + Constants.vbCrLf; + DSGMlib.CurrentXDS += "MIDPOINT_COLLISIONS 0" + Constants.vbCrLf; + DSGMlib.CurrentXDS += "INCLUDE_WIFI_LIB 0" + Constants.vbCrLf; } private void NewProject_Click(object sender, EventArgs e) @@ -277,16 +277,16 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e) public void InternalSave() { - DS_Game_Maker.DSGMlib.CleanInternalXDS(); + DSGMlib.CleanInternalXDS(); SaveButton.Enabled = false; SaveButtonTool.Enabled = false; - File.WriteAllText(DS_Game_Maker.SessionsLib.SessionPath + "XDS.xds", DS_Game_Maker.DSGMlib.CurrentXDS); + File.WriteAllText(SessionsLib.SessionPath + "XDS.xds", DSGMlib.CurrentXDS); string MyBAT = "zip.exe a save.zip Sprites Backgrounds Sounds Scripts IncludeFiles NitroFSFiles XDS.xds" + Constants.vbCrLf + "exit"; - DS_Game_Maker.DSGMlib.RunBatchString(MyBAT, DS_Game_Maker.SessionsLib.SessionPath, true); + DSGMlib.RunBatchString(MyBAT, SessionsLib.SessionPath, true); // File.Delete(ProjectPath) - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "save.zip", DS_Game_Maker.DSGMlib.ProjectPath, true); - File.Delete(DS_Game_Maker.SessionsLib.SessionPath + "save.bat"); - File.Delete(DS_Game_Maker.SessionsLib.SessionPath + "save.zip"); + File.Copy(SessionsLib.SessionPath + "save.zip", DSGMlib.ProjectPath, true); + File.Delete(SessionsLib.SessionPath + "save.bat"); + File.Delete(SessionsLib.SessionPath + "save.zip"); SaveButton.Enabled = true; SaveButtonTool.Enabled = true; } @@ -294,56 +294,56 @@ public void InternalSave() private void SaveButton_Click(object sender, EventArgs e) { // If it's a new project, call Save As instead. - if (DS_Game_Maker.DSGMlib.IsNewProject) + if (DSGMlib.IsNewProject) { SaveAsButton_Click(new object(), new EventArgs()); return; } InternalSave(); - DS_Game_Maker.DSGMlib.IsNewProject = false; + DSGMlib.IsNewProject = false; } private void AddSpriteButton_Click(object sender, EventArgs e) { - string NewName = DS_Game_Maker.DSGMlib.MakeResourceName("Sprite", "SPRITE"); - File.Copy(Constants.AppDirectory + "DefaultResources/Sprite.png", DS_Game_Maker.SessionsLib.SessionPath + "Sprites/0_" + NewName + ".png"); - DS_Game_Maker.DSGMlib.XDSAddLine("SPRITE " + NewName + ",32,32"); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Sprite; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, NewName, "SpriteNode", true); + string NewName = DSGMlib.MakeResourceName("Sprite", "SPRITE"); + File.Copy(Constants.AppDirectory + "DefaultResources/Sprite.png", SessionsLib.SessionPath + "Sprites/0_" + NewName + ".png"); + DSGMlib.XDSAddLine("SPRITE " + NewName + ",32,32"); + byte argResourceID = (byte)DSGMlib.ResourceIDs.Sprite; + DSGMlib.AddResourceNode(ref argResourceID, NewName, "SpriteNode", true); foreach (Form X in MdiChildren) { - if (!DS_Game_Maker.DSGMlib.IsObject(X.Text)) + if (!DSGMlib.IsObject(X.Text)) continue; - ((DS_Game_Maker.DObject)X).AddSprite(NewName); + ((DObject)X).AddSprite(NewName); } - DS_Game_Maker.DSGMlib.RedoSprites = true; + DSGMlib.RedoSprites = true; } private void AddObjectButton_Click(object sender, EventArgs e) { - byte ObjectCount = (byte)DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ").Length; - string NewName = DS_Game_Maker.DSGMlib.MakeResourceName("Object", "OBJECT"); - DS_Game_Maker.DSGMlib.XDSAddLine("OBJECT " + NewName + ",None,0"); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.DObject; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, NewName, "ObjectNode", true); + byte ObjectCount = (byte)DSGMlib.GetXDSFilter("OBJECT ").Length; + string NewName = DSGMlib.MakeResourceName("Object", "OBJECT"); + DSGMlib.XDSAddLine("OBJECT " + NewName + ",None,0"); + byte argResourceID = (byte)DSGMlib.ResourceIDs.DObject; + DSGMlib.AddResourceNode(ref argResourceID, NewName, "ObjectNode", true); foreach (Form X in MdiChildren) { if (!(X.Name == "Room")) continue; - ((DS_Game_Maker.Room)X).AddObjectToDropper(NewName); + ((Room)X).AddObjectToDropper(NewName); } } private void AddBackgroundButton_Click(object sender, EventArgs e) { - string NewName = DS_Game_Maker.DSGMlib.MakeResourceName("Background", "BACKGROUND"); - File.Copy(Constants.AppDirectory + "DefaultResources/Background.png", DS_Game_Maker.SessionsLib.SessionPath + "Backgrounds/" + NewName + ".png"); - DS_Game_Maker.DSGMlib.XDSAddLine("BACKGROUND " + NewName); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Background; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, NewName, "BackgroundNode", true); + string NewName = DSGMlib.MakeResourceName("Background", "BACKGROUND"); + File.Copy(Constants.AppDirectory + "DefaultResources/Background.png", SessionsLib.SessionPath + "Backgrounds/" + NewName + ".png"); + DSGMlib.XDSAddLine("BACKGROUND " + NewName); + byte argResourceID = (byte)DSGMlib.ResourceIDs.Background; + DSGMlib.AddResourceNode(ref argResourceID, NewName, "BackgroundNode", true); foreach (Form X in MdiChildren) { - if (!DS_Game_Maker.DSGMlib.IsRoom(X.Text)) + if (!DSGMlib.IsRoom(X.Text)) continue; foreach (Control Y in X.Controls) { @@ -364,27 +364,27 @@ private void AddBackgroundButton_Click(object sender, EventArgs e) } } } - DS_Game_Maker.DSGMlib.BGsToRedo.Add(NewName); + DSGMlib.BGsToRedo.Add(NewName); } private void AddSoundButton_Click(object sender, EventArgs e) { - string NewName = DS_Game_Maker.DSGMlib.MakeResourceName("Sound", "SOUND"); + string NewName = DSGMlib.MakeResourceName("Sound", "SOUND"); Program.Forms.soundType_Form.ShowDialog(); bool SB = Program.Forms.soundType_Form.IsSoundEffect; - File.Copy(Constants.AppDirectory + "DefaultResources/Sound." + (SB ? "wav" : "mp3"), DS_Game_Maker.SessionsLib.SessionPath + "Sounds/" + NewName + "." + (SB ? "wav" : "mp3")); - DS_Game_Maker.DSGMlib.XDSAddLine("SOUND " + NewName + "," + (SB ? "0" : "1")); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Sound; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, NewName, "SoundNode", true); - DS_Game_Maker.DSGMlib.SoundsToRedo.Add(NewName); + File.Copy(Constants.AppDirectory + "DefaultResources/Sound." + (SB ? "wav" : "mp3"), SessionsLib.SessionPath + "Sounds/" + NewName + "." + (SB ? "wav" : "mp3")); + DSGMlib.XDSAddLine("SOUND " + NewName + "," + (SB ? "0" : "1")); + byte argResourceID = (byte)DSGMlib.ResourceIDs.Sound; + DSGMlib.AddResourceNode(ref argResourceID, NewName, "SoundNode", true); + DSGMlib.SoundsToRedo.Add(NewName); } private void AddRoomButton_Click(object sender, EventArgs e) { - byte RoomCount = (byte)DS_Game_Maker.DSGMlib.GetXDSFilter("ROOM ").Length; - string NewName = DS_Game_Maker.DSGMlib.MakeResourceName("Room", "ROOM"); - short DW = Convert.ToInt16(DS_Game_Maker.SettingsLib.GetSetting("DEFAULT_ROOM_WIDTH")); - short DH = Convert.ToInt16(DS_Game_Maker.SettingsLib.GetSetting("DEFAULT_ROOM_HEIGHT")); + byte RoomCount = (byte)DSGMlib.GetXDSFilter("ROOM ").Length; + string NewName = DSGMlib.MakeResourceName("Room", "ROOM"); + short DW = Convert.ToInt16(SettingsLib.GetSetting("DEFAULT_ROOM_WIDTH")); + short DH = Convert.ToInt16(SettingsLib.GetSetting("DEFAULT_ROOM_HEIGHT")); if (DW < 256) DW = 256; if (DW > 4096) @@ -393,26 +393,26 @@ private void AddRoomButton_Click(object sender, EventArgs e) DW = 192; if (DH > 4096) DH = 4096; - DS_Game_Maker.DSGMlib.XDSAddLine("ROOM " + NewName + "," + DW.ToString() + "," + DH.ToString() + ",1,," + DW.ToString() + "," + DH.ToString() + ",1,"); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Room; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, NewName, "RoomNode", true); + DSGMlib.XDSAddLine("ROOM " + NewName + "," + DW.ToString() + "," + DH.ToString() + ",1,," + DW.ToString() + "," + DH.ToString() + ",1,"); + byte argResourceID = (byte)DSGMlib.ResourceIDs.Room; + DSGMlib.AddResourceNode(ref argResourceID, NewName, "RoomNode", true); } private void AddPathButton_Click(object sender, EventArgs e) { - string NewName = DS_Game_Maker.DSGMlib.MakeResourceName("Path", "PATH"); - DS_Game_Maker.DSGMlib.XDSAddLine("PATH " + NewName); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Path; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, NewName, "PathNode", true); + string NewName = DSGMlib.MakeResourceName("Path", "PATH"); + DSGMlib.XDSAddLine("PATH " + NewName); + byte argResourceID = (byte)DSGMlib.ResourceIDs.Path; + DSGMlib.AddResourceNode(ref argResourceID, NewName, "PathNode", true); } private void AddScriptButton_Click(object sender, EventArgs e) { - string NewName = DS_Game_Maker.DSGMlib.MakeResourceName("Script", "SCRIPT"); - File.CreateText(DS_Game_Maker.SessionsLib.SessionPath + "Scripts/" + NewName + ".dbas").Dispose(); - DS_Game_Maker.DSGMlib.XDSAddLine("SCRIPT " + NewName + ",1"); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Script; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, NewName, "ScriptNode", true); + string NewName = DSGMlib.MakeResourceName("Script", "SCRIPT"); + File.CreateText(SessionsLib.SessionPath + "Scripts/" + NewName + ".dbas").Dispose(); + DSGMlib.XDSAddLine("SCRIPT " + NewName + ",1"); + byte argResourceID = (byte)DSGMlib.ResourceIDs.Script; + DSGMlib.AddResourceNode(ref argResourceID, NewName, "ScriptNode", true); } public bool OpenWarn() @@ -437,34 +437,34 @@ public bool OpenWarn() private void OpenProjectButton_Click(object sender, EventArgs e) { - if (DS_Game_Maker.DSGMlib.BeingUsed) + if (DSGMlib.BeingUsed) { if (!OpenWarn()) { return; } } - string Result = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, Application.ProductName + " Projects|*.dsgm"); + string Result = DSGMlib.OpenFile(string.Empty, Application.ProductName + " Projects|*.dsgm"); if (Result.Length == 0) return; - DS_Game_Maker.DSGMlib.OpenProject(Result); + DSGMlib.OpenProject(Result); } public void LoadLastProject(bool Automatic) { // IsNewProject = False - string LastPath = DS_Game_Maker.SettingsLib.GetSetting("LAST_PROJECT"); + string LastPath = SettingsLib.GetSetting("LAST_PROJECT"); if (Automatic) { if (File.Exists(LastPath)) { - DS_Game_Maker.DSGMlib.OpenProject(LastPath); + DSGMlib.OpenProject(LastPath); } return; } - if (DS_Game_Maker.DSGMlib.BeingUsed) + if (DSGMlib.BeingUsed) { - if ((LastPath ?? "") == (DS_Game_Maker.DSGMlib.ProjectPath ?? "")) + if ((LastPath ?? "") == (DSGMlib.ProjectPath ?? "")) { // Same Project - Reload job DialogResult Result = MessageBox.Show("Do you want to reload the current Project?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); @@ -484,7 +484,7 @@ public void LoadLastProject(bool Automatic) // Yes load a new file if (File.Exists(LastPath)) { - DS_Game_Maker.DSGMlib.OpenProject(LastPath); + DSGMlib.OpenProject(LastPath); return; } else @@ -496,7 +496,7 @@ public void LoadLastProject(bool Automatic) // Fresh session else if (File.Exists(LastPath)) { - DS_Game_Maker.DSGMlib.OpenProject(LastPath); + DSGMlib.OpenProject(LastPath); } else { @@ -511,34 +511,34 @@ private void OpenLastProjectButton_Click(object sender, EventArgs e) private void SaveAsButton_Click(object sender, EventArgs e) { - string Directory = DS_Game_Maker.DSGMlib.ProjectPath; + string Directory = DSGMlib.ProjectPath; Directory = Directory.Substring(0, Directory.IndexOf("/")); string Result = string.Empty; - if (DS_Game_Maker.DSGMlib.IsNewProject) + if (DSGMlib.IsNewProject) { - Result = DS_Game_Maker.DSGMlib.SaveFile(Directory, Application.ProductName + " Projects|*.dsgm", "New Project.dsgm"); + Result = DSGMlib.SaveFile(Directory, Application.ProductName + " Projects|*.dsgm", "New Project.dsgm"); } else { - Result = DS_Game_Maker.DSGMlib.SaveFile(Directory, Application.ProductName + " Projects|*.dsgm", DS_Game_Maker.DSGMlib.CacheProjectName + ".dsgm"); + Result = DSGMlib.SaveFile(Directory, Application.ProductName + " Projects|*.dsgm", DSGMlib.CacheProjectName + ".dsgm"); } if (Result.Length == 0) return; - DS_Game_Maker.DSGMlib.CleanInternalXDS(); + DSGMlib.CleanInternalXDS(); SaveButton.Enabled = false; SaveButtonTool.Enabled = false; - File.WriteAllText(DS_Game_Maker.SessionsLib.SessionPath + "XDS.xds", DS_Game_Maker.DSGMlib.CurrentXDS); + File.WriteAllText(SessionsLib.SessionPath + "XDS.xds", DSGMlib.CurrentXDS); string MyBAT = "zip.exe a save.zip Sprites Backgrounds Sounds Scripts IncludeFiles NitroFSFiles XDS.xds" + Constants.vbCrLf + "exit"; - DS_Game_Maker.DSGMlib.RunBatchString(MyBAT, DS_Game_Maker.SessionsLib.SessionPath, true); + DSGMlib.RunBatchString(MyBAT, SessionsLib.SessionPath, true); // File.Delete(ProjectPath) - DS_Game_Maker.DSGMlib.ProjectPath = Result; - File.Copy(DS_Game_Maker.SessionsLib.SessionPath + "save.zip", DS_Game_Maker.DSGMlib.ProjectPath, true); - File.Delete(DS_Game_Maker.SessionsLib.SessionPath + "save.bat"); - File.Delete(DS_Game_Maker.SessionsLib.SessionPath + "save.zip"); + DSGMlib.ProjectPath = Result; + File.Copy(SessionsLib.SessionPath + "save.zip", DSGMlib.ProjectPath, true); + File.Delete(SessionsLib.SessionPath + "save.bat"); + File.Delete(SessionsLib.SessionPath + "save.zip"); SaveButton.Enabled = true; SaveButtonTool.Enabled = true; - DS_Game_Maker.DSGMlib.IsNewProject = false; - Text = DS_Game_Maker.DSGMlib.TitleDataWorks(); + DSGMlib.IsNewProject = false; + Text = DSGMlib.TitleDataWorks(); } private void OptionsButton_Click(object sender, EventArgs e) @@ -550,7 +550,7 @@ private void ResourcesTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouse { if (e.Node.Parent is not null) { - DS_Game_Maker.DSGMlib.OpenResource(e.Node.Text, (byte)e.Node.Parent.Index, false); + DSGMlib.OpenResource(e.Node.Text, (byte)e.Node.Parent.Index, false); } } @@ -568,11 +568,11 @@ private void TestGameButton_Click(object sender, EventArgs e) Program.Forms.main_Form.compileForm.ShowDialog(); if (Program.Forms.main_Form.compileForm.Success) { - DS_Game_Maker.DSGMlib.NOGBAShizzle(); + DSGMlib.NOGBAShizzle(); } else { - DS_Game_Maker.DSGMlib.CompileFail(); + DSGMlib.CompileFail(); } } @@ -587,15 +587,15 @@ private void CompileGameButton_Click(object sender, EventArgs e) { { var withBlock = Program.Forms.compiled_Form; - withBlock.Text = DS_Game_Maker.DSGMlib.CacheProjectName; - withBlock.MainLabel.Text = DS_Game_Maker.DSGMlib.CacheProjectName; + withBlock.Text = DSGMlib.CacheProjectName; + withBlock.MainLabel.Text = DSGMlib.CacheProjectName; withBlock.SubLabel.Text = "Compiled by " + Environment.UserName + " at " + DSGMlib.GetTime(); withBlock.ShowDialog(); } } else { - DS_Game_Maker.DSGMlib.CompileFail(); + DSGMlib.CompileFail(); } } @@ -624,7 +624,7 @@ public void ActuallyCleanUp() { foreach (string X in Directory.GetDirectories(Constants.AppDirectory)) { - if ((X ?? "") == (DS_Game_Maker.SessionsLib.CompilePath.Substring(0, DS_Game_Maker.SessionsLib.CompilePath.Length - 1) ?? "")) + if ((X ?? "") == (SessionsLib.CompilePath.Substring(0, SessionsLib.CompilePath.Length - 1) ?? "")) continue; try { @@ -637,7 +637,7 @@ public void ActuallyCleanUp() } foreach (string X in Directory.GetDirectories(Constants.AppDirectory + "ProjectTemp")) { - if ((X ?? "") == (DS_Game_Maker.SessionsLib.SessionPath.Substring(0, DS_Game_Maker.SessionsLib.SessionPath.Length - 1) ?? "")) + if ((X ?? "") == (SessionsLib.SessionPath.Substring(0, SessionsLib.SessionPath.Length - 1) ?? "")) continue; try { @@ -656,9 +656,9 @@ public void ActuallyCleanUp() private void CleanUpButton_Click(object sender, EventArgs e) { // If ProjectPath.Length > 0 Then MsgError("You have a project loaded, so temporary data may not be cleared.") : Exit Sub - DS_Game_Maker.DSGMlib.MsgWarn("This will clean up all unused data created by the sessions system." + Constants.vbCrLf + Constants.vbCrLf + "Ensure you do not have other instances of the application open."); + DSGMlib.MsgWarn("This will clean up all unused data created by the sessions system." + Constants.vbCrLf + Constants.vbCrLf + "Ensure you do not have other instances of the application open."); ActuallyCleanUp(); - DS_Game_Maker.DSGMlib.MsgInfo("The process completed successfully."); + DSGMlib.MsgInfo("The process completed successfully."); } private void ProjectStatisticsButton_Click(object sender, EventArgs e) @@ -668,39 +668,39 @@ private void ProjectStatisticsButton_Click(object sender, EventArgs e) private void OpenCompileTempButton_Click(object sender, EventArgs e) { - Process.Start("explorer", DS_Game_Maker.SessionsLib.CompilePath); + Process.Start("explorer", SessionsLib.CompilePath); } private void OpenProjectTempButton_Click(object sender, EventArgs e) { - Process.Start("explorer", DS_Game_Maker.SessionsLib.SessionPath); + Process.Start("explorer", SessionsLib.SessionPath); } private void WebsiteButton_Click() { - DS_Game_Maker.DSGMlib.URL(DS_Game_Maker.DSGMlib.Domain); + DSGMlib.URL(DSGMlib.Domain); } private void ForumButton_Click() { - DS_Game_Maker.DSGMlib.URL(DS_Game_Maker.DSGMlib.Domain + "dsgmforum"); + DSGMlib.URL(DSGMlib.Domain + "dsgmforum"); } private void EditInternalXDSButton_Click(object sender, EventArgs e) { if (MdiChildren.Count() > 0) { - DS_Game_Maker.DSGMlib.MsgWarn("You must close all open windows to continue."); + DSGMlib.MsgWarn("You must close all open windows to continue."); return; } - var Thing = new DS_Game_Maker.EditCode(); - Thing.CodeMode = (byte)DS_Game_Maker.DSGMlib.CodeMode.XDS; + var Thing = new EditCode(); + Thing.CodeMode = (byte)DSGMlib.CodeMode.XDS; Thing.ImportExport = false; - Thing.ReturnableCode = DS_Game_Maker.DSGMlib.CurrentXDS; + Thing.ReturnableCode = DSGMlib.CurrentXDS; Thing.StartPosition = FormStartPosition.CenterParent; Thing.Text = "Edit Internal XDS"; Thing.ShowDialog(); - DS_Game_Maker.DSGMlib.CurrentXDS = Thing.MainTextBox.Text; + DSGMlib.CurrentXDS = Thing.MainTextBox.Text; } private void FontViewerButton_Click(object sender, EventArgs e) @@ -733,14 +733,14 @@ private void AboutDSGMButton_Click(object sender, EventArgs e) private void MainForm_Shown(object sender, EventArgs e) { bool BlankNew = true; - if (DS_Game_Maker.DSGMlib.UpdateVersion > DS_Game_Maker.DSGMlib.IDVersion) + if (DSGMlib.UpdateVersion > DSGMlib.IDVersion) { Program.Forms.dUpdate_Form.ShowDialog(); } if (!Directory.Exists(Constants.AppDirectory + "devkitPro")) { - //DS_Game_Maker.DSGMlib.MsgInfo("Thank you for installing " + Application.ProductName + "." + Constants.vbCrLf + Constants.vbCrLf + "The toolchain will now be installed to compile your games."); - //DS_Game_Maker.Toolchain.RundevkitProUpdater(); + //DSGMlib.MsgInfo("Thank you for installing " + Application.ProductName + "." + Constants.vbCrLf + Constants.vbCrLf + "The toolchain will now be installed to compile your games."); + //Toolchain.RundevkitProUpdater(); DSGMlib.MsgInfo("Thank you for installing " + Application.ProductName + "." + Constants.vbCrLf + Constants.vbCrLf + "The ds toolchain should of came pre configured but is missing, the application will now exit."); Application.Exit(); @@ -758,17 +758,17 @@ private void MainForm_Shown(object sender, EventArgs e) } if (Args.Count > 1) { - DS_Game_Maker.DSGMlib.MsgWarn("You can only open one Project with " + Application.ProductName + " at once."); + DSGMlib.MsgWarn("You can only open one Project with " + Application.ProductName + " at once."); } else if (Args.Count == 1) { if (File.Exists(Args[0])) - DS_Game_Maker.DSGMlib.OpenProject(Args[0]); + DSGMlib.OpenProject(Args[0]); BlankNew = false; } else if (!SkipAuto) { - if ((int)Convert.ToByte(DS_Game_Maker.SettingsLib.GetSetting("OPEN_LAST_PROJECT_STARTUP")) == 1) + if ((int)Convert.ToByte(SettingsLib.GetSetting("OPEN_LAST_PROJECT_STARTUP")) == 1) { LoadLastProject(true); BlankNew = false; @@ -776,7 +776,7 @@ private void MainForm_Shown(object sender, EventArgs e) } if (BlankNew) { - DS_Game_Maker.DSGMlib.BeingUsed = true; + DSGMlib.BeingUsed = true; string SessionName = string.Empty; for (byte Looper = 0; Looper <= 10; Looper++) { @@ -784,53 +784,53 @@ private void MainForm_Shown(object sender, EventArgs e) if (!Directory.Exists(Constants.AppDirectory + "ProjectTemp/" + SessionName)) break; } - DS_Game_Maker.SessionsLib.FormSession(SessionName); - DS_Game_Maker.SessionsLib.FormSessionFS(); - DS_Game_Maker.DSGMlib.IsNewProject = true; - DS_Game_Maker.DSGMlib.ProjectPath = Constants.AppDirectory + "NewProjects/" + SessionName + ".dsgm"; - Text = DS_Game_Maker.DSGMlib.TitleDataWorks(); + SessionsLib.FormSession(SessionName); + SessionsLib.FormSessionFS(); + DSGMlib.IsNewProject = true; + DSGMlib.ProjectPath = Constants.AppDirectory + "NewProjects/" + SessionName + ".dsgm"; + Text = DSGMlib.TitleDataWorks(); GenerateShite(""); - DS_Game_Maker.DSGMlib.RedoAllGraphics = true; - DS_Game_Maker.DSGMlib.RedoSprites = true; - DS_Game_Maker.DSGMlib.BGsToRedo.Clear(); - byte argResourceID = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Room; - DS_Game_Maker.DSGMlib.AddResourceNode(ref argResourceID, "Room_1", "RoomNode", false); + DSGMlib.RedoAllGraphics = true; + DSGMlib.RedoSprites = true; + DSGMlib.BGsToRedo.Clear(); + byte argResourceID = (byte)DSGMlib.ResourceIDs.Room; + DSGMlib.AddResourceNode(ref argResourceID, "Room_1", "RoomNode", false); InternalSave(); } } private void DeleteButton_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.DeleteResource(ActiveMdiChild.Text, ActiveMdiChild.Name); + DSGMlib.DeleteResource(ActiveMdiChild.Text, ActiveMdiChild.Name); } private void CompilesToNitroFSButton_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.RedoAllGraphics = true; - DS_Game_Maker.DSGMlib.RedoSprites = true; - DS_Game_Maker.DSGMlib.BGsToRedo.Clear(); + DSGMlib.RedoAllGraphics = true; + DSGMlib.RedoSprites = true; + DSGMlib.BGsToRedo.Clear(); string ResourceName = ResourcesTreeView.SelectedNode.Text; - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + ".c"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Map.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Tiles.bin"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin")) + if (File.Exists(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin"); + File.Delete(SessionsLib.CompilePath + "nitrofiles/" + ResourceName + "_Pal.bin"); } - string OldLine = DS_Game_Maker.DSGMlib.GetXDSLine(ResourcesTreeView.SelectedNode.Parent.Text.ToUpper().Substring(0, ResourcesTreeView.SelectedNode.Parent.Text.Length - 1) + " " + ResourcesTreeView.SelectedNode.Text); - string NewLine = DS_Game_Maker.DSGMlib.GetXDSLine(ResourcesTreeView.SelectedNode.Parent.Text.ToUpper().Substring(0, ResourcesTreeView.SelectedNode.Parent.Text.Length - 1) + " " + ResourcesTreeView.SelectedNode.Text); + string OldLine = DSGMlib.GetXDSLine(ResourcesTreeView.SelectedNode.Parent.Text.ToUpper().Substring(0, ResourcesTreeView.SelectedNode.Parent.Text.Length - 1) + " " + ResourcesTreeView.SelectedNode.Text); + string NewLine = DSGMlib.GetXDSLine(ResourcesTreeView.SelectedNode.Parent.Text.ToUpper().Substring(0, ResourcesTreeView.SelectedNode.Parent.Text.Length - 1) + " " + ResourcesTreeView.SelectedNode.Text); if (ResourcesTreeView.SelectedNode.Parent.Text == "Sprites") { - if (DS_Game_Maker.DSGMlib.iGet(NewLine, (byte)3, ",") == "NoNitro") + if (DSGMlib.iGet(NewLine, (byte)3, ",") == "NoNitro") { NewLine = NewLine.Replace(",NoNitro", ",Nitro"); } @@ -838,14 +838,14 @@ private void CompilesToNitroFSButton_Click(object sender, EventArgs e) { NewLine = NewLine.Replace(",Nitro", ",NoNitro"); } - if (string.IsNullOrEmpty(DS_Game_Maker.DSGMlib.iGet(NewLine, (byte)3, ","))) + if (string.IsNullOrEmpty(DSGMlib.iGet(NewLine, (byte)3, ","))) { NewLine += ",Nitro"; } } if (ResourcesTreeView.SelectedNode.Parent.Text == "Backgrounds") { - if (DS_Game_Maker.DSGMlib.iGet(NewLine, (byte)1, ",") == "NoNitro") + if (DSGMlib.iGet(NewLine, (byte)1, ",") == "NoNitro") { NewLine = NewLine.Replace(",NoNitro", ",Nitro"); } @@ -853,12 +853,12 @@ private void CompilesToNitroFSButton_Click(object sender, EventArgs e) { NewLine = NewLine.Replace(",Nitro", ",NoNitro"); } - if (string.IsNullOrEmpty(DS_Game_Maker.DSGMlib.iGet(NewLine, (byte)1, ","))) + if (string.IsNullOrEmpty(DSGMlib.iGet(NewLine, (byte)1, ","))) { NewLine += ",Nitro"; } } - DS_Game_Maker.DSGMlib.XDSChangeLine(OldLine, NewLine); + DSGMlib.XDSChangeLine(OldLine, NewLine); // MsgBox(ResourcesTreeView.SelectedNode.Parent.Text.ToUpper.Substring(0, ResourcesTreeView.SelectedNode.Parent.Text.Length - 1) + " " + ResourcesTreeView.SelectedNode.Text) } @@ -869,7 +869,7 @@ private void ManualButton_Click(object sender, EventArgs e) private void TutorialsButton_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.URL(DS_Game_Maker.DSGMlib.Domain + "dsgmforum/viewforum.php?f=6"); + DSGMlib.URL(DSGMlib.Domain + "dsgmforum/viewforum.php?f=6"); } private void GlobalStructuresButton_Click(object sender, EventArgs e) @@ -879,14 +879,14 @@ private void GlobalStructuresButton_Click(object sender, EventArgs e) private void RunDevkitProUpdaterButton(object sender, EventArgs e) { - //DS_Game_Maker.Toolchain.RundevkitProUpdater(); - DS_Game_Maker.DSGMlib.MsgWarn("The toolchain is now updated manually, please use that method instead."); + //Toolchain.RundevkitProUpdater(); + DSGMlib.MsgWarn("The toolchain is now updated manually, please use that method instead."); } private void EditMenu_DropDownOpening(object sender, EventArgs e) { GoToLastFoundButton.Enabled = false; - if (DS_Game_Maker.DSGMlib.LastResourceFound.Length > 0) + if (DSGMlib.LastResourceFound.Length > 0) GoToLastFoundButton.Enabled = true; bool OuiOui = ActiveMdiChild is not null; DeleteButton.Enabled = OuiOui; @@ -899,14 +899,14 @@ private void CompileChangeButton_Click(object sender, EventArgs e) { case "GraphicsChangeButton": { - DS_Game_Maker.DSGMlib.RedoAllGraphics = true; - DS_Game_Maker.DSGMlib.RedoSprites = true; - DS_Game_Maker.DSGMlib.BGsToRedo.Clear(); + DSGMlib.RedoAllGraphics = true; + DSGMlib.RedoSprites = true; + DSGMlib.BGsToRedo.Clear(); break; } case "SoundChangeButton": { - DS_Game_Maker.DSGMlib.BuildSoundsRedoFromFile(); + DSGMlib.BuildSoundsRedoFromFile(); break; } } @@ -914,7 +914,7 @@ private void CompileChangeButton_Click(object sender, EventArgs e) private void RunNOGBAButton_Click() { - Process.Start(DS_Game_Maker.DSGMlib.FormNOGBAPath() + "/NO$GBA.exe"); + Process.Start(DSGMlib.FormNOGBAPath() + "/NO$GBA.exe"); } private void ResRightClickMenu_Opening(object sender, System.ComponentModel.CancelEventArgs e) @@ -1005,14 +1005,14 @@ private void ResRightClickMenu_Opening(object sender, System.ComponentModel.Canc { if (ToWorkFrom.Text.Substring(0, ToWorkFrom.Text.Length - 1) == "Sprite") { - if (DS_Game_Maker.DSGMlib.iGet(DS_Game_Maker.DSGMlib.GetXDSLine("SPRITE " + ResourcesTreeView.SelectedNode.Text), (byte)3, ",") == "Nitro") + if (DSGMlib.iGet(DSGMlib.GetXDSLine("SPRITE " + ResourcesTreeView.SelectedNode.Text), (byte)3, ",") == "Nitro") { withBlock1.Image = Properties.Resources.AcceptIcon; } } if (ToWorkFrom.Text.Substring(0, ToWorkFrom.Text.Length - 1) == "Background") { - if (DS_Game_Maker.DSGMlib.iGet(DS_Game_Maker.DSGMlib.GetXDSLine("BACKGROUND " + ResourcesTreeView.SelectedNode.Text), (byte)1, ",") == "Nitro") + if (DSGMlib.iGet(DSGMlib.GetXDSLine("BACKGROUND " + ResourcesTreeView.SelectedNode.Text), (byte)1, ",") == "Nitro") { withBlock1.Image = Properties.Resources.AcceptIcon; } @@ -1032,12 +1032,12 @@ private void DeleteResourceRightClickButton_Click(object sender, EventArgs e) if (Type == "Object") Type = "DObject"; Type = Type.Replace(" ", string.Empty); - DS_Game_Maker.DSGMlib.DeleteResource(ResourcesTreeView.SelectedNode.Text, Type); + DSGMlib.DeleteResource(ResourcesTreeView.SelectedNode.Text, Type); } private void OpenResourceRightClickButton_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.OpenResource(ResourcesTreeView.SelectedNode.Text, (byte)ResourcesTreeView.SelectedNode.Parent.Index, false); + DSGMlib.OpenResource(ResourcesTreeView.SelectedNode.Text, (byte)ResourcesTreeView.SelectedNode.Parent.Index, false); } private void AddResourceRightClickButton_Click(object sender, EventArgs e) @@ -1086,29 +1086,29 @@ private void AddResourceRightClickButton_Click(object sender, EventArgs e) private void DuplicateResourceRightClickButton_Click(object sender, EventArgs e) { string TheName = ResourcesTreeView.SelectedNode.Text; - DS_Game_Maker.DSGMlib.CopyResource(TheName, DS_Game_Maker.DSGMlib.GenerateDuplicateResourceName(TheName), (byte)ResourcesTreeView.SelectedNode.Parent.Index); + DSGMlib.CopyResource(TheName, DSGMlib.GenerateDuplicateResourceName(TheName), (byte)ResourcesTreeView.SelectedNode.Parent.Index); } private void FindResourceButton_Click(object sender, EventArgs e) { - string Result = DS_Game_Maker.DSGMlib.GetInput("Which resource are you looking for?", DS_Game_Maker.DSGMlib.LastResourceFound, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.None); - DS_Game_Maker.DSGMlib.FindResource(Result); + string Result = DSGMlib.GetInput("Which resource are you looking for?", DSGMlib.LastResourceFound, (byte)DSGMlib.ValidateLevel.None); + DSGMlib.FindResource(Result); } private void GoToLastFoundButton_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.FindResource(DS_Game_Maker.DSGMlib.LastResourceFound); + DSGMlib.FindResource(DSGMlib.LastResourceFound); } private void FindInScriptsButton_Click(object sender, EventArgs e) { - string Result = DS_Game_Maker.DSGMlib.GetInput("Search term:", DS_Game_Maker.DSGMlib.LastScriptTermFound, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.None); - var Shower = new DS_Game_Maker.FoundInScripts(); + string Result = DSGMlib.GetInput("Search term:", DSGMlib.LastScriptTermFound, (byte)DSGMlib.ValidateLevel.None); + var Shower = new FoundInScripts(); Shower.Term = Result; Shower.Text = "Searching Scripts for '" + Result + "'"; object argInstance = (object)Shower; - DS_Game_Maker.DSGMlib.ShowInternalForm(ref argInstance); - Shower = (DS_Game_Maker.FoundInScripts)argInstance; + DSGMlib.ShowInternalForm(ref argInstance); + Shower = (FoundInScripts)argInstance; } private void DuplicateButton_Click(object sender, EventArgs e) @@ -1121,41 +1121,41 @@ private void DuplicateButton_Click(object sender, EventArgs e) { case "Sprite": { - ResT = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Sprite; + ResT = (byte)DSGMlib.ResourceIDs.Sprite; break; } case "Background": { - ResT = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Background; + ResT = (byte)DSGMlib.ResourceIDs.Background; break; } case "DObject": { - ResT = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.DObject; + ResT = (byte)DSGMlib.ResourceIDs.DObject; break; } case "Room": { - ResT = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Room; + ResT = (byte)DSGMlib.ResourceIDs.Room; break; } case "Path": { - ResT = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Path; + ResT = (byte)DSGMlib.ResourceIDs.Path; break; } case "Script": { - ResT = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Script; + ResT = (byte)DSGMlib.ResourceIDs.Script; break; } case "Sound": { - ResT = (byte)DS_Game_Maker.DSGMlib.ResourceIDs.Sound; + ResT = (byte)DSGMlib.ResourceIDs.Sound; break; } } - DS_Game_Maker.DSGMlib.CopyResource(TheName, DS_Game_Maker.DSGMlib.GenerateDuplicateResourceName(TheName), ResT); + DSGMlib.CopyResource(TheName, DSGMlib.GenerateDuplicateResourceName(TheName), ResT); } private void WebsiteButton_Click(object sender, EventArgs e) => WebsiteButton_Click(); diff --git a/Options.cs b/Options.cs index 27a1716..238b521 100644 --- a/Options.cs +++ b/Options.cs @@ -15,7 +15,7 @@ private void DOkayButton_Click(object sender, EventArgs e) { if (DefaultRoomWidthTB.Text.Length == 0 | DefaultRoomHeightTB.Text.Length == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("You must enter values for the Default Room Width and Height."); + DSGMlib.MsgWarn("You must enter values for the Default Room Width and Height."); if (DefaultRoomHeightTB.Text.Length == 0) DefaultRoomHeightTB.Focus(); if (DefaultRoomWidthTB.Text.Length == 0) @@ -35,7 +35,7 @@ private void DOkayButton_Click(object sender, EventArgs e) if (!IsNumber) { - DS_Game_Maker.DSGMlib.MsgWarn("Default Room Width must be a number."); + DSGMlib.MsgWarn("Default Room Width must be a number."); DefaultRoomWidthTB.Focus(); return; } @@ -52,40 +52,40 @@ private void DOkayButton_Click(object sender, EventArgs e) if (!IsNumber) { - DS_Game_Maker.DSGMlib.MsgWarn("Default Room Height must be a number."); + DSGMlib.MsgWarn("Default Room Height must be a number."); DefaultRoomHeightTB.Focus(); return; } if (Convert.ToInt16(DefaultRoomWidthTB.Text) < 256 | Convert.ToInt16(DefaultRoomWidthTB.Text) > 4096) { - DS_Game_Maker.DSGMlib.MsgWarn("Default Room Width must be between 256 and 4096."); + DSGMlib.MsgWarn("Default Room Width must be between 256 and 4096."); DefaultRoomWidthTB.Focus(); return; } if (Convert.ToInt16(DefaultRoomHeightTB.Text) < 192 | Convert.ToInt16(DefaultRoomWidthTB.Text) > 4096) { - DS_Game_Maker.DSGMlib.MsgWarn("Default Room Height must be between 192 and 4096."); + DSGMlib.MsgWarn("Default Room Height must be between 192 and 4096."); DefaultRoomHeightTB.Focus(); return; } - DS_Game_Maker.SettingsLib.SetSetting("CLOSE_NEWS", CloseNewslineCheckBox.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("OPEN_LAST_PROJECT_STARTUP", OpenLastProjectCheckBox.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("SHOW_NEWS", ShowNewsCheckBox.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("TRANSPARENT_ANIMATIONS", TransparentAnimationsCheckBox.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("USE_NOGBA", UseNOGBARadioButton.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("IMAGE_EDITOR_PATH", ImageEditorTextBox.Text); - DS_Game_Maker.SettingsLib.SetSetting("SOUND_EDITOR_PATH", SoundEditorTextBox.Text); - DS_Game_Maker.SettingsLib.SetSetting("USE_EXTERNAL_SCRIPT_EDITOR", UseExternalScriptEditorRadioButton.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("HIGHLIGHT_CURRENT_LINE", HighlightCurrentLineCheckBox.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("MATCH_BRACES", MatchBracesCheckBox.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("HIDE_OLD_ACTIONS", HideOldActionsChecker.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("SHRINK_ACTIONS_LIST", ShrinkActionsListChecker.Checked ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("SCRIPT_EDITOR_PATH", ScriptEditorTextBox.Text); - DS_Game_Maker.SettingsLib.SetSetting("DEFAULT_ROOM_WIDTH", DefaultRoomWidthTB.Text); - DS_Game_Maker.SettingsLib.SetSetting("DEFAULT_ROOM_HEIGHT", DefaultRoomHeightTB.Text); - DS_Game_Maker.SettingsLib.SetSetting("EMULATOR_PATH", CustomEmulatorTextBox.Text); - DS_Game_Maker.SettingsLib.SaveSettings(); + SettingsLib.SetSetting("CLOSE_NEWS", CloseNewslineCheckBox.Checked ? "1" : "0"); + SettingsLib.SetSetting("OPEN_LAST_PROJECT_STARTUP", OpenLastProjectCheckBox.Checked ? "1" : "0"); + SettingsLib.SetSetting("SHOW_NEWS", ShowNewsCheckBox.Checked ? "1" : "0"); + SettingsLib.SetSetting("TRANSPARENT_ANIMATIONS", TransparentAnimationsCheckBox.Checked ? "1" : "0"); + SettingsLib.SetSetting("USE_NOGBA", UseNOGBARadioButton.Checked ? "1" : "0"); + SettingsLib.SetSetting("IMAGE_EDITOR_PATH", ImageEditorTextBox.Text); + SettingsLib.SetSetting("SOUND_EDITOR_PATH", SoundEditorTextBox.Text); + SettingsLib.SetSetting("USE_EXTERNAL_SCRIPT_EDITOR", UseExternalScriptEditorRadioButton.Checked ? "1" : "0"); + SettingsLib.SetSetting("HIGHLIGHT_CURRENT_LINE", HighlightCurrentLineCheckBox.Checked ? "1" : "0"); + SettingsLib.SetSetting("MATCH_BRACES", MatchBracesCheckBox.Checked ? "1" : "0"); + SettingsLib.SetSetting("HIDE_OLD_ACTIONS", HideOldActionsChecker.Checked ? "1" : "0"); + SettingsLib.SetSetting("SHRINK_ACTIONS_LIST", ShrinkActionsListChecker.Checked ? "1" : "0"); + SettingsLib.SetSetting("SCRIPT_EDITOR_PATH", ScriptEditorTextBox.Text); + SettingsLib.SetSetting("DEFAULT_ROOM_WIDTH", DefaultRoomWidthTB.Text); + SettingsLib.SetSetting("DEFAULT_ROOM_HEIGHT", DefaultRoomHeightTB.Text); + SettingsLib.SetSetting("EMULATOR_PATH", CustomEmulatorTextBox.Text); + SettingsLib.SaveSettings(); foreach (Form X in Program.Forms.main_Form.MdiChildren) { string TheText = X.Text; @@ -93,7 +93,7 @@ private void DOkayButton_Click(object sender, EventArgs e) { TheText = TheText.Substring(24); } - if (!DS_Game_Maker.DSGMlib.DoesXDSLineExist("SCRIPT " + TheText)) + if (!DSGMlib.DoesXDSLineExist("SCRIPT " + TheText)) continue; foreach (Control SC in X.Controls) { @@ -109,17 +109,17 @@ private void DOkayButton_Click(object sender, EventArgs e) private void Options_Load(object sender, EventArgs e) { - CloseNewslineCheckBox.Checked = DS_Game_Maker.SettingsLib.GetSetting("CLOSE_NEWS") == "1"; - OpenLastProjectCheckBox.Checked = DS_Game_Maker.SettingsLib.GetSetting("OPEN_LAST_PROJECT_STARTUP") == "1"; - ShowNewsCheckBox.Checked = DS_Game_Maker.SettingsLib.GetSetting("SHOW_NEWS") == "1"; - HighlightCurrentLineCheckBox.Checked = DS_Game_Maker.SettingsLib.GetSetting("HIGHLIGHT_CURRENT_LINE") == "1"; - MatchBracesCheckBox.Checked = DS_Game_Maker.SettingsLib.GetSetting("MATCH_BRACES") == "1"; - TransparentAnimationsCheckBox.Checked = DS_Game_Maker.SettingsLib.GetSetting("TRANSPARENT_ANIMATIONS") == "1"; - UseNOGBARadioButton.Checked = DS_Game_Maker.SettingsLib.GetSetting("USE_NOGBA") == "1"; - ImageEditorTextBox.Text = DS_Game_Maker.SettingsLib.GetSetting("IMAGE_EDITOR_PATH"); - SoundEditorTextBox.Text = DS_Game_Maker.SettingsLib.GetSetting("SOUND_EDITOR_PATH"); - CustomEmulatorTextBox.Text = DS_Game_Maker.SettingsLib.GetSetting("EMULATOR_PATH"); - if (DS_Game_Maker.SettingsLib.GetSetting("USE_EXTERNAL_SCRIPT_EDITOR") == "1") + CloseNewslineCheckBox.Checked = SettingsLib.GetSetting("CLOSE_NEWS") == "1"; + OpenLastProjectCheckBox.Checked = SettingsLib.GetSetting("OPEN_LAST_PROJECT_STARTUP") == "1"; + ShowNewsCheckBox.Checked = SettingsLib.GetSetting("SHOW_NEWS") == "1"; + HighlightCurrentLineCheckBox.Checked = SettingsLib.GetSetting("HIGHLIGHT_CURRENT_LINE") == "1"; + MatchBracesCheckBox.Checked = SettingsLib.GetSetting("MATCH_BRACES") == "1"; + TransparentAnimationsCheckBox.Checked = SettingsLib.GetSetting("TRANSPARENT_ANIMATIONS") == "1"; + UseNOGBARadioButton.Checked = SettingsLib.GetSetting("USE_NOGBA") == "1"; + ImageEditorTextBox.Text = SettingsLib.GetSetting("IMAGE_EDITOR_PATH"); + SoundEditorTextBox.Text = SettingsLib.GetSetting("SOUND_EDITOR_PATH"); + CustomEmulatorTextBox.Text = SettingsLib.GetSetting("EMULATOR_PATH"); + if (SettingsLib.GetSetting("USE_EXTERNAL_SCRIPT_EDITOR") == "1") { UseExternalScriptEditorRadioButton.Checked = true; UseInternalScriptEditorRadioButton.Checked = false; @@ -129,31 +129,31 @@ private void Options_Load(object sender, EventArgs e) UseExternalScriptEditorRadioButton.Checked = false; UseInternalScriptEditorRadioButton.Checked = true; } - ScriptEditorTextBox.Text = DS_Game_Maker.SettingsLib.GetSetting("SCRIPT_EDITOR_PATH"); - DefaultRoomWidthTB.Text = DS_Game_Maker.SettingsLib.GetSetting("DEFAULT_ROOM_WIDTH"); - DefaultRoomHeightTB.Text = DS_Game_Maker.SettingsLib.GetSetting("DEFAULT_ROOM_HEIGHT"); - HideOldActionsChecker.Checked = DS_Game_Maker.SettingsLib.GetSetting("HIDE_OLD_ACTIONS") == "1"; - ShrinkActionsListChecker.Checked = DS_Game_Maker.SettingsLib.GetSetting("SHRINK_ACTIONS_LIST") == "1"; + ScriptEditorTextBox.Text = SettingsLib.GetSetting("SCRIPT_EDITOR_PATH"); + DefaultRoomWidthTB.Text = SettingsLib.GetSetting("DEFAULT_ROOM_WIDTH"); + DefaultRoomHeightTB.Text = SettingsLib.GetSetting("DEFAULT_ROOM_HEIGHT"); + HideOldActionsChecker.Checked = SettingsLib.GetSetting("HIDE_OLD_ACTIONS") == "1"; + ShrinkActionsListChecker.Checked = SettingsLib.GetSetting("SHRINK_ACTIONS_LIST") == "1"; } private void ImageEditorBrowseButton_Click(object sender, EventArgs e) { - ImageEditorTextBox.Text = DS_Game_Maker.DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); + ImageEditorTextBox.Text = DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); } private void SoundEditorBowseButton_Click(object sender, EventArgs e) { - SoundEditorTextBox.Text = DS_Game_Maker.DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); + SoundEditorTextBox.Text = DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); } private void ScriptEditorBowseButton_Click(object sender, EventArgs e) { - ScriptEditorTextBox.Text = DS_Game_Maker.DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); + ScriptEditorTextBox.Text = DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); } private void CustomEmulatorBrowseButton_Click(object sender, EventArgs e) { - CustomEmulatorTextBox.Text = DS_Game_Maker.DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); + CustomEmulatorTextBox.Text = DSGMlib.OpenFile(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Executables|*.exe"); } } } \ No newline at end of file diff --git a/Preview.cs b/Preview.cs index 47d7362..45fc4f0 100644 --- a/Preview.cs +++ b/Preview.cs @@ -23,8 +23,8 @@ public Bitmap GetFrame(short FrameNumber) var NewGFX = Graphics.FromImage(Returnable); NewGFX.DrawImage(TheImage, new Point(0, FrameNumber * ImageSize.Height * -1)); NewGFX.Dispose(); - if ((int)Convert.ToByte(DS_Game_Maker.SettingsLib.GetSetting("TRANSPARENT_ANIMATIONS")) == 1) - Returnable = (Bitmap)DS_Game_Maker.DSGMlib.MakeBMPTransparent(Returnable, Color.Magenta); + if ((int)Convert.ToByte(SettingsLib.GetSetting("TRANSPARENT_ANIMATIONS")) == 1) + Returnable = (Bitmap)DSGMlib.MakeBMPTransparent(Returnable, Color.Magenta); return Returnable; } diff --git a/Room.cs b/Room.cs index 2d07676..fb8a258 100644 --- a/Room.cs +++ b/Room.cs @@ -68,7 +68,7 @@ public void ClearObjects() public Bitmap GetBGImage(string BackgroundName) { - return (Bitmap)DS_Game_Maker.DSGMlib.MakeBMPTransparent(DS_Game_Maker.DSGMlib.PathToImage(DS_Game_Maker.SessionsLib.SessionPath + @"Backgrounds\" + BackgroundName + ".png"), Color.Magenta); + return (Bitmap)DSGMlib.MakeBMPTransparent(DSGMlib.PathToImage(SessionsLib.SessionPath + @"Backgrounds\" + BackgroundName + ".png"), Color.Magenta); } public Bitmap MakeRoomImage(bool WhichScreen) @@ -278,18 +278,18 @@ public void RefreshRoom(bool WhichScreen) private void Room_Load(object sender, EventArgs e) { - SnapToGrid = DS_Game_Maker.SettingsLib.GetSetting("SNAP_OBJECTS") == "1"; - ShowGrid = DS_Game_Maker.SettingsLib.GetSetting("SHOW_GRID") == "1"; + SnapToGrid = SettingsLib.GetSetting("SNAP_OBJECTS") == "1"; + ShowGrid = SettingsLib.GetSetting("SHOW_GRID") == "1"; - UseRightClickMenuChecker.Checked = DS_Game_Maker.SettingsLib.GetSetting("RIGHT_CLICK") == "1"; + UseRightClickMenuChecker.Checked = SettingsLib.GetSetting("RIGHT_CLICK") == "1"; - SnapX = Convert.ToByte(DS_Game_Maker.SettingsLib.GetSetting("SNAP_X")); - SnapY = Convert.ToByte(DS_Game_Maker.SettingsLib.GetSetting("SNAP_Y")); + SnapX = Convert.ToByte(SettingsLib.GetSetting("SNAP_X")); + SnapY = Convert.ToByte(SettingsLib.GetSetting("SNAP_Y")); - string ColorString = DS_Game_Maker.SettingsLib.GetSetting("GRID_COLOR"); - byte R = Convert.ToByte(DS_Game_Maker.DSGMlib.iGet(ColorString, (byte)0, ",")); - byte G = Convert.ToByte(DS_Game_Maker.DSGMlib.iGet(ColorString, (byte)1, ",")); - byte B = Convert.ToByte(DS_Game_Maker.DSGMlib.iGet(ColorString, (byte)2, ",")); + string ColorString = SettingsLib.GetSetting("GRID_COLOR"); + byte R = Convert.ToByte(DSGMlib.iGet(ColorString, (byte)0, ",")); + byte G = Convert.ToByte(DSGMlib.iGet(ColorString, (byte)1, ",")); + byte B = Convert.ToByte(DSGMlib.iGet(ColorString, (byte)2, ",")); ShowGridChecker.Checked = ShowGrid; SnapToGridChecker.Checked = SnapToGrid; @@ -299,14 +299,14 @@ private void Room_Load(object sender, EventArgs e) GridColor = Color.FromArgb(R, G, B); - ObjectRightClickMenu.Renderer = new DS_Game_Maker.clsMenuRenderer(); - string XDSLine = DS_Game_Maker.DSGMlib.GetXDSLine("ROOM " + RoomName + ","); + ObjectRightClickMenu.Renderer = new clsMenuRenderer(); + string XDSLine = DSGMlib.GetXDSLine("ROOM " + RoomName + ","); XDSLine = XDSLine.Substring(6 + RoomName.Length); - TopWidth = Convert.ToInt16(DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)0, ",")); - TopHeight = Convert.ToInt16(DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)1, ",")); - BottomWidth = Convert.ToInt16(DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)4, ",")); + TopWidth = Convert.ToInt16(DSGMlib.iGet(XDSLine, (byte)0, ",")); + TopHeight = Convert.ToInt16(DSGMlib.iGet(XDSLine, (byte)1, ",")); + BottomWidth = Convert.ToInt16(DSGMlib.iGet(XDSLine, (byte)4, ",")); // MsgError("Extracted BottomWidth is " + BottomWidth.ToString) - BottomHeight = Convert.ToInt16(DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)5, ",")); + BottomHeight = Convert.ToInt16(DSGMlib.iGet(XDSLine, (byte)5, ",")); short MidWidth = TopWidth; if (BottomWidth > MidWidth) MidWidth = BottomWidth; @@ -319,37 +319,37 @@ private void Room_Load(object sender, EventArgs e) // Dim DoBottomScroll As Boolean = If(BottomWidth > BottomScreen.Width, True, False) // If DoTopScroll Then Me.Height += 36 // If DoBottomScroll Then Me.Height += 36 - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); NameTextBox.Text = RoomName; Text = RoomName; TopScreenBGDropper.Items.Clear(); TopScreenBGDropper.Items.Add(string.Empty); BottomScreenBGDropper.Items.Clear(); BottomScreenBGDropper.Items.Add(string.Empty); - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("BACKGROUND ")) + foreach (string X_ in DSGMlib.GetXDSFilter("BACKGROUND ")) { string X = X_; X = X.Substring(11); - TopScreenBGDropper.Items.Add(DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ",")); - BottomScreenBGDropper.Items.Add(DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ",")); + TopScreenBGDropper.Items.Add(DSGMlib.iGet(X, (byte)0, ",")); + BottomScreenBGDropper.Items.Add(DSGMlib.iGet(X, (byte)0, ",")); } ObjectDropper.Items.Clear(); - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ")) + foreach (string X_ in DSGMlib.GetXDSFilter("OBJECT ")) { string X = X_; X = X.Substring(7); - ObjectDropper.Items.Add(DS_Game_Maker.DSGMlib.iGet(X, (byte)0, ",")); + ObjectDropper.Items.Add(DSGMlib.iGet(X, (byte)0, ",")); } - TopScroll = DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)2, ",") == "1"; - TopBG = DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)3, ","); + TopScroll = DSGMlib.iGet(XDSLine, (byte)2, ",") == "1"; + TopBG = DSGMlib.iGet(XDSLine, (byte)3, ","); BottomWidthDropper.Value = BottomWidth; // MsgError(BottomHeight.ToString) BottomHeightDropper.Value = BottomHeight; TopWidthDropper.Value = TopWidth; TopHeightDropper.Value = TopHeight; TopScreenScrollChecker.Checked = TopScroll; - BottomScroll = DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)6, ",") == "1"; - BottomBG = DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)7, ","); + BottomScroll = DSGMlib.iGet(XDSLine, (byte)6, ",") == "1"; + BottomBG = DSGMlib.iGet(XDSLine, (byte)7, ","); Width = MidWidth + 194; Height = (int)Math.Round((TopHeight + BottomHeight) / 2d + 259d); TopScreen.Width = 256 + (Width - BackupWidth); @@ -358,16 +358,16 @@ private void Room_Load(object sender, EventArgs e) TopScreenBGDropper.Text = TopBG; BottomScreenBGDropper.Text = BottomBG; ClearObjects(); - foreach (string TheLine_ in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECTPLOT ")) + foreach (string TheLine_ in DSGMlib.GetXDSFilter("OBJECTPLOT ")) { string TheLine = TheLine_; TheLine = TheLine.Substring(11); - if (!((DS_Game_Maker.DSGMlib.iGet(TheLine, (byte)1, ",") ?? "") == (RoomName ?? ""))) + if (!((DSGMlib.iGet(TheLine, (byte)1, ",") ?? "") == (RoomName ?? ""))) continue; - string ObjectName = DS_Game_Maker.DSGMlib.iGet(TheLine, (byte)0, ","); - bool Screen = DS_Game_Maker.DSGMlib.iGet(TheLine, (byte)2, ",") == "1"; - short X = Convert.ToInt16(DS_Game_Maker.DSGMlib.iGet(TheLine, (byte)3, ",")); - short Y = Convert.ToInt16(DS_Game_Maker.DSGMlib.iGet(TheLine, (byte)4, ",")); + string ObjectName = DSGMlib.iGet(TheLine, (byte)0, ","); + bool Screen = DSGMlib.iGet(TheLine, (byte)2, ",") == "1"; + short X = Convert.ToInt16(DSGMlib.iGet(TheLine, (byte)3, ",")); + short Y = Convert.ToInt16(DSGMlib.iGet(TheLine, (byte)4, ",")); PlotObject(ObjectName, Screen, X, Y); } RefreshRoom(true); @@ -380,20 +380,20 @@ private void DAcceptButton_Click(object sender, EventArgs e) string NewName = NameTextBox.Text; if (!((NewName ?? "") == (RoomName ?? ""))) { - if (DS_Game_Maker.DSGMlib.GUIResNameChecker(NewName)) + if (DSGMlib.GUIResNameChecker(NewName)) return; } - string OldLine = DS_Game_Maker.DSGMlib.GetXDSLine("ROOM " + RoomName + ","); + string OldLine = DSGMlib.GetXDSLine("ROOM " + RoomName + ","); string NewLine = "ROOM " + NewName + ","; NewLine += TopWidthDropper.Value.ToString() + "," + TopHeightDropper.Value.ToString() + "," + (TopScreenScrollChecker.Checked ? "1" : "0") + "," + TopBG + ","; NewLine += BottomWidthDropper.Value.ToString() + "," + BottomHeightDropper.Value.ToString() + "," + (BottomScreenScrollChecker.Checked ? "1" : "0") + "," + BottomBG; - DS_Game_Maker.DSGMlib.XDSChangeLine(OldLine, NewLine); - DS_Game_Maker.DSGMlib.UpdateArrayActionsName("Room", RoomName, NewName, false); - DS_Game_Maker.DSGMlib.CurrentXDS = DS_Game_Maker.DSGMlib.UpdateActionsName(DS_Game_Maker.DSGMlib.CurrentXDS, "Room", RoomName, NewName, false); - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECTPLOT ")) + DSGMlib.XDSChangeLine(OldLine, NewLine); + DSGMlib.UpdateArrayActionsName("Room", RoomName, NewName, false); + DSGMlib.CurrentXDS = DSGMlib.UpdateActionsName(DSGMlib.CurrentXDS, "Room", RoomName, NewName, false); + foreach (string X in DSGMlib.GetXDSFilter("OBJECTPLOT ")) { - if ((DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",") ?? "") == (RoomName ?? "")) - DS_Game_Maker.DSGMlib.XDSRemoveLine(X); + if ((DSGMlib.iGet(X, (byte)1, ",") ?? "") == (RoomName ?? "")) + DSGMlib.XDSRemoveLine(X); } foreach (AnObject X in Objects) { @@ -405,23 +405,23 @@ private void DAcceptButton_Click(object sender, EventArgs e) else TheLine += "0"; TheLine += "," + X.X.ToString() + "," + X.Y.ToString(); - DS_Game_Maker.DSGMlib.XDSAddLine(TheLine); + DSGMlib.XDSAddLine(TheLine); } if (!((NewName ?? "") == (RoomName ?? ""))) { - if ((DS_Game_Maker.DSGMlib.GetXDSLine("BOOTROOM ").Substring(9) ?? "") == (RoomName ?? "")) + if ((DSGMlib.GetXDSLine("BOOTROOM ").Substring(9) ?? "") == (RoomName ?? "")) { - DS_Game_Maker.DSGMlib.XDSChangeLine("BOOTROOM " + RoomName, "BOOTROOM " + NewName); + DSGMlib.XDSChangeLine("BOOTROOM " + RoomName, "BOOTROOM " + NewName); } } - foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DS_Game_Maker.DSGMlib.ResourceIDs.Room].Nodes) + foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DSGMlib.ResourceIDs.Room].Nodes) { if ((X.Text ?? "") == (RoomName ?? "")) X.Text = NewName; } - DS_Game_Maker.SettingsLib.SetSetting("SNAP_OBJECTS", SnapToGrid ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("SHOW_GRID", ShowGrid ? "1" : "0"); - DS_Game_Maker.SettingsLib.SetSetting("RIGHT_CLICK", UseRightClickMenuChecker.Checked ? "1" : "0"); + SettingsLib.SetSetting("SNAP_OBJECTS", SnapToGrid ? "1" : "0"); + SettingsLib.SetSetting("SHOW_GRID", ShowGrid ? "1" : "0"); + SettingsLib.SetSetting("RIGHT_CLICK", UseRightClickMenuChecker.Checked ? "1" : "0"); Close(); } @@ -433,7 +433,7 @@ public void PlotObject(string ObjectName, bool Screen, short X, short Y) ToAdd.Y = Y; ToAdd.Screen = Screen; ToAdd.ObjectName = ObjectName; - ToAdd.CacheImage = DS_Game_Maker.DSGMlib.ObjectGetImage(ObjectName); + ToAdd.CacheImage = DSGMlib.ObjectGetImage(ObjectName); Objects[InstanceOn] = ToAdd; InstanceOn = (byte)(InstanceOn + 1); RefreshRoom(Screen); @@ -463,7 +463,7 @@ private void TopScreen_MouseClick(object sender, MouseEventArgs e) } if (PlottedCount >= 128) { - DS_Game_Maker.DSGMlib.MsgError("You can only plot 128 instances."); + DSGMlib.MsgError("You can only plot 128 instances."); return; } short X = (short)e.Location.X; @@ -666,19 +666,19 @@ private void BottomScreen_Scroll() private void Snappers_TextChanged(object sender, EventArgs e) { string TheValue = ((TextBox)sender).Text; - if (!DS_Game_Maker.DSGMlib.IsNumeric(TheValue, System.Globalization.NumberStyles.Integer)) + if (!DSGMlib.IsNumeric(TheValue, System.Globalization.NumberStyles.Integer)) return; if (Convert.ToInt16(TheValue) == 0 | Convert.ToInt16(TheValue) > 255) return; if (((dynamic)sender).name.ToString().Contains("X")) { SnapX = Convert.ToByte(TheValue); - DS_Game_Maker.SettingsLib.SetSetting("SNAP_X", TheValue); + SettingsLib.SetSetting("SNAP_X", TheValue); } else { SnapY = Convert.ToByte(TheValue); - DS_Game_Maker.SettingsLib.SetSetting("SNAP_Y", TheValue); + SettingsLib.SetSetting("SNAP_Y", TheValue); } if (ShowGrid) { @@ -708,13 +708,13 @@ private void GridColorButton_Click(object sender, EventArgs e) // DOn += 1 // End If // Next - GridColor = DS_Game_Maker.DSGMlib.SelectColor(GridColor); + GridColor = DSGMlib.SelectColor(GridColor); if (ShowGrid) { TopScreen.Refresh(); BottomScreen.Refresh(); } - DS_Game_Maker.SettingsLib.SetSetting("GRID_COLOR", GridColor.R.ToString() + "," + GridColor.G.ToString() + "," + GridColor.B.ToString()); + SettingsLib.SetSetting("GRID_COLOR", GridColor.R.ToString() + "," + GridColor.G.ToString() + "," + GridColor.B.ToString()); } private void Screens_MouseMove(object sender, MouseEventArgs e) @@ -838,11 +838,11 @@ private void OpenObjectButton_Click(object sender, EventArgs e) } if (DoShow) { - var ObjectForm = new DS_Game_Maker.DObject(); + var ObjectForm = new DObject(); ObjectForm.ObjectName = X; object argInstance = (object)ObjectForm; - DS_Game_Maker.DSGMlib.ShowInternalForm(ref argInstance); - ObjectForm = (DS_Game_Maker.DObject)argInstance; + DSGMlib.ShowInternalForm(ref argInstance); + ObjectForm = (DObject)argInstance; } } } diff --git a/Script.cs b/Script.cs index 4a432ff..07251ae 100644 --- a/Script.cs +++ b/Script.cs @@ -31,17 +31,17 @@ public void SaveChanges() { if (!((ScriptName ?? "") == (NameTextBox.Text ?? ""))) { - File.Move(DS_Game_Maker.SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas", DS_Game_Maker.SessionsLib.SessionPath + @"Scripts\" + NameTextBox.Text + ".dbas"); + File.Move(SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas", SessionsLib.SessionPath + @"Scripts\" + NameTextBox.Text + ".dbas"); } - DS_Game_Maker.DSGMlib.XDSChangeLine(DS_Game_Maker.DSGMlib.GetXDSLine("SCRIPT " + ScriptName + ","), "SCRIPT " + NameTextBox.Text + "," + (ParseDBASChecker.Checked ? "1" : "0")); - DS_Game_Maker.DSGMlib.XDSRemoveFilter("SCRIPTARG " + ScriptName + ","); + DSGMlib.XDSChangeLine(DSGMlib.GetXDSLine("SCRIPT " + ScriptName + ","), "SCRIPT " + NameTextBox.Text + "," + (ParseDBASChecker.Checked ? "1" : "0")); + DSGMlib.XDSRemoveFilter("SCRIPTARG " + ScriptName + ","); if (ArgumentNames.Count > 0) { for (byte P = 0, loopTo = (byte)(ArgumentNames.Count - 1); P <= loopTo; P++) - DS_Game_Maker.DSGMlib.XDSAddLine("SCRIPTARG " + NameTextBox.Text + "," + ArgumentNames[P] + "," + ArgumentTypes[P]); + DSGMlib.XDSAddLine("SCRIPTARG " + NameTextBox.Text + "," + ArgumentNames[P] + "," + ArgumentTypes[P]); } - File.WriteAllText(DS_Game_Maker.SessionsLib.SessionPath + @"Scripts\" + NameTextBox.Text + ".dbas", MainTextBox.Text); - foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DS_Game_Maker.DSGMlib.ResourceIDs.Script].Nodes) + File.WriteAllText(SessionsLib.SessionPath + @"Scripts\" + NameTextBox.Text + ".dbas", MainTextBox.Text); + foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DSGMlib.ResourceIDs.Script].Nodes) { if ((X.Text ?? "") == (ScriptName ?? "")) X.Text = NameTextBox.Text; @@ -85,22 +85,22 @@ private void Script_Load(object sender, EventArgs e) // '.SingleLineAccept = False // '.StopCharacters = String.Empty // End With - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); //MainTextBox.AcceptsTab = true; - //MainTextBox.Caret.HighlightCurrentLine = (int)Convert.ToByte(DS_Game_Maker.SettingsLib.GetSetting("HIGHLIGHT_CURRENT_LINE")) == 1; + //MainTextBox.Caret.HighlightCurrentLine = (int)Convert.ToByte(SettingsLib.GetSetting("HIGHLIGHT_CURRENT_LINE")) == 1; // MsgError("""" + ScriptName + """") - ScriptContent = DS_Game_Maker.DSGMlib.PathToString(DS_Game_Maker.SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas"); + ScriptContent = DSGMlib.PathToString(SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas"); MainTextBox.Text = ScriptContent; Text = ScriptName; NameTextBox.Text = ScriptName; TidyUp(); - string XDSLine = DS_Game_Maker.DSGMlib.GetXDSLine("SCRIPT " + ScriptName + ","); + string XDSLine = DSGMlib.GetXDSLine("SCRIPT " + ScriptName + ","); XDSLine = XDSLine.Substring(XDSLine.LastIndexOf(",") + 1); ParseDBASChecker.Checked = XDSLine == "1"; - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("SCRIPTARG " + ScriptName + ",")) + foreach (string X in DSGMlib.GetXDSFilter("SCRIPTARG " + ScriptName + ",")) { - string TheName = DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ","); - string TheType = DS_Game_Maker.DSGMlib.iGet(X, (byte)2, ","); + string TheName = DSGMlib.iGet(X, (byte)1, ","); + string TheType = DSGMlib.iGet(X, (byte)2, ","); ArgumentNames.Add(TheName); ArgumentTypes.Add(TheType); } @@ -115,7 +115,7 @@ private void DAcceptButton_Click(object sender, EventArgs e) string NewName = NameTextBox.Text; if (!((ScriptName ?? "") == (NewName ?? ""))) { - if (DS_Game_Maker.DSGMlib.GUIResNameChecker(NameTextBox.Text)) + if (DSGMlib.GUIResNameChecker(NameTextBox.Text)) return; } SaveChanges(); @@ -134,7 +134,7 @@ private void NameTextBox_TextChanged(object sender, EventArgs e) if (DoIt) { string NewText = ((TextBox)sender).Text; - NewText = DS_Game_Maker.DSGMlib.ResurrectResourceName(NewText); + NewText = DSGMlib.ResurrectResourceName(NewText); short LengthDifference = (short)(((TextBox)sender).Text.Length - NewText.Length); byte BackupCaret = (byte)NameTextBox.SelectionStart; ((TextBox)sender).Text = NewText; @@ -207,13 +207,13 @@ private void LoadInButton_Click(object sender, EventArgs e) byte MsgResponse = (byte)MessageBox.Show("Importing a Script will erase and replace the current code." + Constants.vbCrLf + Constants.vbCrLf + "Would you like to Continue?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (!(MsgResponse == (int)MsgBoxResult.Yes)) return; - string Response = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, "Dynamic Basic Files|*.dbas"); + string Response = DSGMlib.OpenFile(string.Empty, "Dynamic Basic Files|*.dbas"); if (Response.Length == 0) return; - string Content = DS_Game_Maker.DSGMlib.PathToString(Response); + string Content = DSGMlib.PathToString(Response); string FinalContent = string.Empty; TidyUp(); - foreach (string X_ in DS_Game_Maker.DSGMlib.StringToLines(Content)) + foreach (string X_ in DSGMlib.StringToLines(Content)) { string X = X_; if (X.StartsWith("SCRIPTARG ")) @@ -236,7 +236,7 @@ private void LoadInButton_Click(object sender, EventArgs e) private void SaveOutButton_Click(object sender, EventArgs e) { - string Response = DS_Game_Maker.DSGMlib.SaveFile(string.Empty, "Dynamic Basic Files|*.dbas", ScriptName + ".dbas"); + string Response = DSGMlib.SaveFile(string.Empty, "Dynamic Basic Files|*.dbas", ScriptName + ".dbas"); if (Response.Length == 0) return; string ToWrite = MainTextBox.Text + Constants.vbCrLf; @@ -293,7 +293,7 @@ private void InsertIntoCodeButton_Click(object sender, EventArgs e) private void AddArgumentButton_Click(object sender, EventArgs e) { - var ArgumentForm = new DS_Game_Maker.Argument(); + var ArgumentForm = new Argument(); ArgumentForm.ArgumentName = string.Empty; ArgumentForm.ArgumentType = "Integer"; ArgumentForm.Text = "Add Argument"; @@ -305,14 +305,14 @@ private void AddArgumentButton_Click(object sender, EventArgs e) string NewName = ArgumentForm.ArgumentName; string NewType = ArgumentForm.ArgumentType; ArgumentForm.Dispose(); - if (!DS_Game_Maker.DSGMlib.ValidateSomething(NewName, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.Tight)) + if (!DSGMlib.ValidateSomething(NewName, (byte)DSGMlib.ValidateLevel.Tight)) { - DS_Game_Maker.DSGMlib.MsgWarn("You must enter a valid name for the new Argument."); + DSGMlib.MsgWarn("You must enter a valid name for the new Argument."); return; } - if (!DS_Game_Maker.DSGMlib.ValidateSomething(NewName, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.NumberStart)) + if (!DSGMlib.ValidateSomething(NewName, (byte)DSGMlib.ValidateLevel.NumberStart)) { - DS_Game_Maker.DSGMlib.MsgWarn("An Argument name may not start with a number."); + DSGMlib.MsgWarn("An Argument name may not start with a number."); return; } bool AlreadyDone = false; @@ -323,7 +323,7 @@ private void AddArgumentButton_Click(object sender, EventArgs e) } if (AlreadyDone) { - DS_Game_Maker.DSGMlib.MsgError("There is already an Argument called '" + NewName + "'." + Constants.vbCrLf + Constants.vbCrLf + "You must choose another name."); + DSGMlib.MsgError("There is already an Argument called '" + NewName + "'." + Constants.vbCrLf + Constants.vbCrLf + "You must choose another name."); return; } ArgumentNames.Add(NewName); @@ -336,7 +336,7 @@ private void EditArgumentButton_Click(object sender, EventArgs e) if (ArgumentsList.SelectedIndices.Count == 0) return; byte ID = (byte)ArgumentsList.SelectedIndex; - var ArgumentForm = new DS_Game_Maker.Argument(); + var ArgumentForm = new Argument(); ArgumentForm.ArgumentName = ArgumentNames[ID]; ArgumentForm.ArgumentType = ArgumentTypes[ID]; ArgumentForm.Text = "Edit Argument"; @@ -348,9 +348,9 @@ private void EditArgumentButton_Click(object sender, EventArgs e) string NewName = ArgumentForm.ArgumentName; string NewType = ArgumentForm.ArgumentType; ArgumentForm.Dispose(); - if (!DS_Game_Maker.DSGMlib.ValidateSomething(NewName, (byte)DS_Game_Maker.DSGMlib.ValidateLevel.Tight)) + if (!DSGMlib.ValidateSomething(NewName, (byte)DSGMlib.ValidateLevel.Tight)) { - DS_Game_Maker.DSGMlib.MsgWarn("You must enter a valid name for the Argument."); + DSGMlib.MsgWarn("You must enter a valid name for the Argument."); return; } if (!((NewName ?? "") == (ArgumentNames[ID] ?? ""))) @@ -363,14 +363,14 @@ private void EditArgumentButton_Click(object sender, EventArgs e) } if (AlreadyDone) { - DS_Game_Maker.DSGMlib.MsgError("There is already an Argument called '" + NewName + "'." + Constants.vbCrLf + Constants.vbCrLf + "You must choose another name."); + DSGMlib.MsgError("There is already an Argument called '" + NewName + "'." + Constants.vbCrLf + Constants.vbCrLf + "You must choose another name."); return; } } ArgumentNames[ID] = NewName; ArgumentTypes[ID] = NewType; ArgumentsList.Refresh(); - DS_Game_Maker.DSGMlib.MsgInfo(Application.ProductName + " cannot update your code to use the new Argument name." + Constants.vbCrLf + Constants.vbCrLf + "You must do this yourself."); + DSGMlib.MsgInfo(Application.ProductName + " cannot update your code to use the new Argument name." + Constants.vbCrLf + Constants.vbCrLf + "You must do this yourself."); } private void DeleteArgumentButton_Click(object sender, EventArgs e) @@ -389,7 +389,7 @@ private void MainTextBox_CharAdded(object sender, ScintillaNET.CharAddedEventArg //if (!(e.Ch == '\r')) // return; ScintillaNET.Scintilla argTheControl = (ScintillaNET.Scintilla)sender; - DS_Game_Maker.DSGMlib.IntelliSense(ref argTheControl); + DSGMlib.IntelliSense(ref argTheControl); sender = argTheControl; // Dim pos As Int32 = MainTextBox.NativeInterface.GetCurrentPos() // Dim length As Int32 = pos - MainTextBox.NativeInterface.WordStartPosition(pos, True) diff --git a/ScriptsLib.cs b/ScriptsLib.cs index 78abff2..6efbe7a 100644 --- a/ScriptsLib.cs +++ b/ScriptsLib.cs @@ -16,13 +16,13 @@ public static string ScriptParseFromContent(string ScriptName, string ScriptCont { FinalString = "int " + ScriptName + "("; string ArgumentString = string.Empty; - byte CommaCount = (byte)DS_Game_Maker.DSGMlib.HowManyChar(Arguments, ","); + byte CommaCount = (byte)DSGMlib.HowManyChar(Arguments, ","); if (Arguments.Length > 0) { for (byte i = 0, loopTo = CommaCount; i <= loopTo; i++) { - string ArgumentType = ScriptsLib.GenerateCType(DS_Game_Maker.DSGMlib.iGet(ArgumentTypes, i, ",")); - string ArgumentName = DS_Game_Maker.DSGMlib.iGet(Arguments, i, ","); + string ArgumentType = ScriptsLib.GenerateCType(DSGMlib.iGet(ArgumentTypes, i, ",")); + string ArgumentName = DSGMlib.iGet(Arguments, i, ","); ArgumentString += ArgumentType + " "; if (ArgumentType == "char") ArgumentString += "*"; @@ -39,11 +39,11 @@ public static string ScriptParseFromContent(string ScriptName, string ScriptCont } if (IsC) { - foreach (string P in DS_Game_Maker.DSGMlib.StringToLines(ScriptContent)) + foreach (string P in DSGMlib.StringToLines(ScriptContent)) { if (P.Length == 0) continue; - FinalString = Conversions.ToString(FinalString + Operators.AddObject(Operators.AddObject(DS_Game_Maker.DSGMlib.MakeSpaces((byte)2), P), Constants.vbCrLf)); + FinalString = Conversions.ToString(FinalString + Operators.AddObject(Operators.AddObject(DSGMlib.MakeSpaces((byte)2), P), Constants.vbCrLf)); } FinalString += " return 0;" + Constants.vbCrLf; FinalString += "}"; @@ -52,7 +52,7 @@ public static string ScriptParseFromContent(string ScriptName, string ScriptCont byte IndentChange = 0; byte CurrentIndent = (byte)(IsLocal ? 0 : 1); var StringVariables = new List(); - foreach (string X_ in DS_Game_Maker.DSGMlib.StringToLines(ScriptContent)) + foreach (string X_ in DSGMlib.StringToLines(ScriptContent)) { string X = X_; if (X.Length == 0) @@ -319,19 +319,19 @@ public static string ScriptParse(string ScriptName, bool IsC) { string ArgumentsString = string.Empty; string ArgumentTypesString = string.Empty; - foreach (string X_ in DS_Game_Maker.DSGMlib.GetXDSFilter("SCRIPTARG " + ScriptName + ",")) + foreach (string X_ in DSGMlib.GetXDSFilter("SCRIPTARG " + ScriptName + ",")) { string X = X_; X = X.Substring(10); - ArgumentsString += DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",") + ","; - ArgumentTypesString += DS_Game_Maker.DSGMlib.iGet(X, (byte)2, ",") + ","; + ArgumentsString += DSGMlib.iGet(X, (byte)1, ",") + ","; + ArgumentTypesString += DSGMlib.iGet(X, (byte)2, ",") + ","; } if (ArgumentsString.Length > 0) { ArgumentsString = ArgumentsString.Substring(0, ArgumentsString.Length - 1); ArgumentTypesString = ArgumentTypesString.Substring(0, ArgumentTypesString.Length - 1); } - return ScriptsLib.ScriptParseFromContent(ScriptName, DS_Game_Maker.DSGMlib.PathToString(DS_Game_Maker.SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas"), ArgumentsString, ArgumentTypesString, false, false, IsC); + return ScriptsLib.ScriptParseFromContent(ScriptName, DSGMlib.PathToString(SessionsLib.SessionPath + @"Scripts\" + ScriptName + ".dbas"), ArgumentsString, ArgumentTypesString, false, false, IsC); } public static string ActionTypeToString(byte ActionType) diff --git a/SetCoOrdinates.cs b/SetCoOrdinates.cs index 90988cc..6277e1d 100644 --- a/SetCoOrdinates.cs +++ b/SetCoOrdinates.cs @@ -36,10 +36,10 @@ private void TextBoxs_TextChanged(object sender, EventArgs e) return; byte XCount = 0; byte YCount = 0; - foreach (string X in DS_Game_Maker.DSGMlib.Numbers) - XCount = (byte)(XCount + DS_Game_Maker.DSGMlib.HowManyChar(XTextBox.Text, X)); - foreach (string Y in DS_Game_Maker.DSGMlib.Numbers) - YCount = (byte)(YCount + DS_Game_Maker.DSGMlib.HowManyChar(YTextBox.Text, Y)); + foreach (string X in DSGMlib.Numbers) + XCount = (byte)(XCount + DSGMlib.HowManyChar(XTextBox.Text, X)); + foreach (string Y in DSGMlib.Numbers) + YCount = (byte)(YCount + DSGMlib.HowManyChar(YTextBox.Text, Y)); if (!(XCount == XTextBox.Text.Length)) Enabled = false; if (!(YCount == YTextBox.Text.Length)) diff --git a/Sound.cs b/Sound.cs index 85e690f..1b337c2 100644 --- a/Sound.cs +++ b/Sound.cs @@ -30,16 +30,16 @@ public Sound() private void Sound_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); Text = SoundName; NameTextBox.Text = SoundName; - XDSLine = DS_Game_Maker.DSGMlib.GetXDSLine("SOUND " + SoundName + ","); - if (DS_Game_Maker.DSGMlib.iGet(XDSLine, (byte)1, ",") == "1") + XDSLine = DSGMlib.GetXDSLine("SOUND " + SoundName + ","); + if (DSGMlib.iGet(XDSLine, (byte)1, ",") == "1") SoundType = true; else SoundType = false; SoundTypeString = "." + (SoundType ? "mp3" : "wav"); - OldPath = DS_Game_Maker.SessionsLib.SessionPath + @"Sounds\" + SoundName + SoundTypeString; + OldPath = SessionsLib.SessionPath + @"Sounds\" + SoundName + SoundTypeString; NewPath = OldPath; InfoLabel.Text = SoundType ? "Background Sound" : "Sound Effect"; if (!SoundType) @@ -59,7 +59,7 @@ private void DAcceptButton_Click(object sender, EventArgs e) string NewName = NameTextBox.Text; if (!((NewName ?? "") == (SoundName ?? ""))) { - if (DS_Game_Maker.DSGMlib.GUIResNameChecker(NewName)) + if (DSGMlib.GUIResNameChecker(NewName)) return; } if (!SoundType) @@ -75,7 +75,7 @@ private void DAcceptButton_Click(object sender, EventArgs e) if (!((NewName ?? "") == (SoundName ?? ""))) { string NewLine = "SOUND " + NewName + "," + (SoundType ? "1" : "0"); - DS_Game_Maker.DSGMlib.XDSChangeLine(XDSLine, NewLine); + DSGMlib.XDSChangeLine(XDSLine, NewLine); } if (!((OldPath ?? "") == (NewPath ?? ""))) { @@ -85,25 +85,25 @@ private void DAcceptButton_Click(object sender, EventArgs e) string SoundTypeString = "." + (SoundType ? "mp3" : "wav"); if (!((NewName ?? "") == (SoundName ?? ""))) { - File.Move(DS_Game_Maker.SessionsLib.SessionPath + @"Sounds\" + SoundName + SoundTypeString, DS_Game_Maker.SessionsLib.SessionPath + @"Sounds\" + NewName + SoundTypeString); + File.Move(SessionsLib.SessionPath + @"Sounds\" + SoundName + SoundTypeString, SessionsLib.SessionPath + @"Sounds\" + NewName + SoundTypeString); if (SoundType) { - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"nitrofiles\" + SoundName + ".mp3")) + if (File.Exists(SessionsLib.CompilePath + @"nitrofiles\" + SoundName + ".mp3")) { - File.Move(DS_Game_Maker.SessionsLib.CompilePath + @"nitrofiles\" + SoundName + ".mp3", DS_Game_Maker.SessionsLib.CompilePath + @"nitrofiles\" + NewName + ".mp3"); + File.Move(SessionsLib.CompilePath + @"nitrofiles\" + SoundName + ".mp3", SessionsLib.CompilePath + @"nitrofiles\" + NewName + ".mp3"); } } - else if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + @"data\" + SoundName + ".raw")) + else if (File.Exists(SessionsLib.CompilePath + @"data\" + SoundName + ".raw")) { - File.Move(DS_Game_Maker.SessionsLib.CompilePath + @"data\" + SoundName + ".raw", DS_Game_Maker.SessionsLib.CompilePath + @"nitrofiles\" + NewName + ".raw"); + File.Move(SessionsLib.CompilePath + @"data\" + SoundName + ".raw", SessionsLib.CompilePath + @"nitrofiles\" + NewName + ".raw"); } - if (DS_Game_Maker.DSGMlib.SoundsToRedo.Contains(SoundName)) + if (DSGMlib.SoundsToRedo.Contains(SoundName)) { - DS_Game_Maker.DSGMlib.SoundsToRedo.Remove(SoundName); - DS_Game_Maker.DSGMlib.SoundsToRedo.Add(NewName); + DSGMlib.SoundsToRedo.Remove(SoundName); + DSGMlib.SoundsToRedo.Add(NewName); } } - foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DS_Game_Maker.DSGMlib.ResourceIDs.Sound].Nodes) + foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DSGMlib.ResourceIDs.Sound].Nodes) { if ((X.Text ?? "") == (SoundName ?? "")) X.Text = NewName; @@ -114,13 +114,13 @@ private void DAcceptButton_Click(object sender, EventArgs e) private void LoadButton_Click(object sender, EventArgs e) { string Filter = (SoundType ? "MP3" : "WAV") + " Files|*." + (SoundType ? "mp3" : "wav"); - string Result = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, Filter); + string Result = DSGMlib.OpenFile(string.Empty, Filter); if (Result.Length == 0) return; NewPath = Result; if (!SoundType) P.SoundLocation = Result; - DS_Game_Maker.DSGMlib.AddSoundToRedo(SoundName); + DSGMlib.AddSoundToRedo(SoundName); if (SoundType) { SProc.Arguments = "\"" + NewPath + "\""; @@ -129,19 +129,19 @@ private void LoadButton_Click(object sender, EventArgs e) private void EditButton_Click(object sender, EventArgs e) { - string FinalEXE = DS_Game_Maker.SettingsLib.GetSetting("SOUND_EDITOR_PATH"); + string FinalEXE = SettingsLib.GetSetting("SOUND_EDITOR_PATH"); if (FinalEXE.Length == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("No Sound Editor has been defined. See 'Options'."); + DSGMlib.MsgWarn("No Sound Editor has been defined. See 'Options'."); return; } if (!File.Exists(FinalEXE)) { - DS_Game_Maker.DSGMlib.MsgWarn("Your Sound Editor EXE is not present. See 'Options'."); + DSGMlib.MsgWarn("Your Sound Editor EXE is not present. See 'Options'."); return; } - string ThePath = DS_Game_Maker.SessionsLib.SessionPath + @"Sounds\" + SoundName + SoundTypeString; - string CopyPath = DS_Game_Maker.SessionsLib.SessionPath + @"Sounds\" + SoundName + "_Copy" + SoundTypeString; + string ThePath = SessionsLib.SessionPath + @"Sounds\" + SoundName + SoundTypeString; + string CopyPath = SessionsLib.SessionPath + @"Sounds\" + SoundName + "_Copy" + SoundTypeString; try { if (File.Exists(CopyPath)) @@ -150,17 +150,17 @@ private void EditButton_Click(object sender, EventArgs e) } catch (Exception ex) { - DS_Game_Maker.DSGMlib.MsgError("This sound cannot be edited because its file is locked." + Constants.vbCrLf + Constants.vbCrLf + "(" + ex.Message + ")"); + DSGMlib.MsgError("This sound cannot be edited because its file is locked." + Constants.vbCrLf + Constants.vbCrLf + "(" + ex.Message + ")"); return; } - if (!DS_Game_Maker.DSGMlib.EditSound(CopyPath, SoundName)) + if (!DSGMlib.EditSound(CopyPath, SoundName)) { File.Delete(CopyPath); return; } File.Delete(ThePath); File.Move(CopyPath, ThePath); - DS_Game_Maker.DSGMlib.AddSoundToRedo(SoundName); + DSGMlib.AddSoundToRedo(SoundName); } private void PlayButton_Click(object sender, EventArgs e) diff --git a/Sprite.cs b/Sprite.cs index 7a34aea..315c872 100644 --- a/Sprite.cs +++ b/Sprite.cs @@ -24,10 +24,10 @@ public Sprite() private void Sprite_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); Text = SpriteName; NameTextBox.Text = SpriteName; - TheLine = DS_Game_Maker.DSGMlib.GetXDSLine("SPRITE " + SpriteName + ","); + TheLine = DSGMlib.GetXDSLine("SPRITE " + SpriteName + ","); short ImageCount = 0; MainImageList.Images.Clear(); foreach (string X_ in Directory.GetFiles(SessionsLib.SessionPath + "Sprites")) @@ -42,16 +42,16 @@ private void Sprite_Load(object sender, EventArgs e) if (ImageCount == 0) { // First image! Grab the size.... - MainImageList.ImageSize = DS_Game_Maker.DSGMlib.PathToImage(X_).Size; + MainImageList.ImageSize = DSGMlib.PathToImage(X_).Size; } ImageCount = (short)(ImageCount + 1); } } for (short X = 0, loopTo = (short)(ImageCount - 1); X <= loopTo; X++) { - string ThePath = DS_Game_Maker.SessionsLib.SessionPath + "Sprites/" + X.ToString() + "_" + SpriteName + ".png"; + string ThePath = SessionsLib.SessionPath + "Sprites/" + X.ToString() + "_" + SpriteName + ".png"; string Key = "Frame_" + X.ToString(); - MainImageList.Images.Add(Key, DS_Game_Maker.DSGMlib.PathToImage(ThePath)); + MainImageList.Images.Add(Key, DSGMlib.PathToImage(ThePath)); MainListView.Items.Add("Frame " + X.ToString(), X); } } @@ -60,7 +60,7 @@ private void PreviewButton_Click(object sender, EventArgs e) { if (FPSTextBox.Text.Length == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("Please enter a Speed."); + DSGMlib.MsgWarn("Please enter a Speed."); return; } bool CanProceed = false; @@ -68,7 +68,7 @@ private void PreviewButton_Click(object sender, EventArgs e) { bool Okay1 = false; bool Okay2 = false; - foreach (var X in DS_Game_Maker.DSGMlib.Numbers) + foreach (var X in DSGMlib.Numbers) { if ((FPSTextBox.Text.Substring(0, 1) ?? "") == (X ?? "")) Okay1 = true; @@ -80,7 +80,7 @@ private void PreviewButton_Click(object sender, EventArgs e) } else if (FPSTextBox.Text.Length == 1) { - foreach (string X in DS_Game_Maker.DSGMlib.Numbers) + foreach (string X in DSGMlib.Numbers) { if ((FPSTextBox.Text ?? "") == (X ?? "")) { @@ -93,7 +93,7 @@ private void PreviewButton_Click(object sender, EventArgs e) CanProceed = false; if (!CanProceed) { - DS_Game_Maker.DSGMlib.MsgError("You must enter a valid value for FPS between 1 and 60."); + DSGMlib.MsgError("You must enter a valid value for FPS between 1 and 60."); return; } @@ -127,13 +127,13 @@ private void LoadFrameButton_Click(object sender, EventArgs e) { if (MainListView.SelectedIndices.Count == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("You must select a Frame into which to copy an existing image file."); + DSGMlib.MsgWarn("You must select a Frame into which to copy an existing image file."); return; } - string Result = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, DS_Game_Maker.DSGMlib.ImageFilter); + string Result = DSGMlib.OpenFile(string.Empty, DSGMlib.ImageFilter); if (Result.Length == 0) return; - var NIS = DS_Game_Maker.DSGMlib.PathToImage(Result).Size; + var NIS = DSGMlib.PathToImage(Result).Size; if (!this.IsSpriteSizeOkay(NIS)) { Program.Forms.badSpriteSize_Form.ShowDialog(); @@ -181,11 +181,11 @@ private void AddBlankFrameButton_Click(object sender, EventArgs e) private void AddFrameFromFileButton_Click(object sender, EventArgs e) { - string Response = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, DS_Game_Maker.DSGMlib.ImageFilter); + string Response = DSGMlib.OpenFile(string.Empty, DSGMlib.ImageFilter); if (Response.Length == 0) return; string TheKey = "Frame_" + MainImageList.Images.Count.ToString(); - var NIS = DS_Game_Maker.DSGMlib.PathToImage(Response).Size; + var NIS = DSGMlib.PathToImage(Response).Size; short CW = (short)MainImageList.ImageSize.Width; short CH = (short)MainImageList.ImageSize.Height; if (NIS.Width == (int)CW & NIS.Height == (int)CH) @@ -222,15 +222,15 @@ private void EditFrameButton_Click(object sender, EventArgs e) return; if (MainListView.SelectedIndices.Count > 1) { - DS_Game_Maker.DSGMlib.MsgWarn("You may only edit one Frame at once."); + DSGMlib.MsgWarn("You may only edit one Frame at once."); return; } short ID = (short)MainListView.SelectedIndices[0]; - string CopyPath = DS_Game_Maker.SessionsLib.SessionPath + "Sprite_Edit.png"; - MainImageList.Images[ID].Save(DS_Game_Maker.SessionsLib.SessionPath + "Sprite_Edit.png"); - if (DS_Game_Maker.DSGMlib.EditImage(CopyPath, SpriteName, false)) + string CopyPath = SessionsLib.SessionPath + "Sprite_Edit.png"; + MainImageList.Images[ID].Save(SessionsLib.SessionPath + "Sprite_Edit.png"); + if (DSGMlib.EditImage(CopyPath, SpriteName, false)) { - MainImageList.Images[ID] = DS_Game_Maker.DSGMlib.PathToImage(CopyPath); + MainImageList.Images[ID] = DSGMlib.PathToImage(CopyPath); File.Delete(CopyPath); DataChanged = true; } @@ -242,12 +242,12 @@ private void DeleteFrameButton_Click(object sender, EventArgs e) return; if (MainListView.Items.Count == 1) { - DS_Game_Maker.DSGMlib.MsgWarn("A Sprite must have at least one Frame."); + DSGMlib.MsgWarn("A Sprite must have at least one Frame."); return; } if (MainListView.Items.Count == MainListView.SelectedIndices.Count) { - DS_Game_Maker.DSGMlib.MsgWarn("You cannot delete all of the Frames at once: at least one frame must remain."); + DSGMlib.MsgWarn("You cannot delete all of the Frames at once: at least one frame must remain."); return; } short ID = (short)MainListView.SelectedIndices[0]; @@ -281,8 +281,8 @@ private void DeleteFrameButton_Click(object sender, EventArgs e) private void ExportDSSpriteStripButton_Click(object sender, EventArgs e) { - Image ToSave = DS_Game_Maker.DSGMlib.GenerateDSSprite(SpriteName); - string Response = DS_Game_Maker.DSGMlib.SaveFile(string.Empty, DS_Game_Maker.DSGMlib.ImageFilter, SpriteName + "_DS"); + Image ToSave = DSGMlib.GenerateDSSprite(SpriteName); + string Response = DSGMlib.SaveFile(string.Empty, DSGMlib.ImageFilter, SpriteName + "_DS"); if (Response.Length == 0) return; ToSave.Save(Response); @@ -300,7 +300,7 @@ private void PasteButton_Click(object sender, EventArgs e) } catch (Exception ex) { - DS_Game_Maker.DSGMlib.MsgWarn("There is no image on the clipboard." + Constants.vbCrLf + Constants.vbCrLf + "(" + ex.Message + ")"); + DSGMlib.MsgWarn("There is no image on the clipboard." + Constants.vbCrLf + Constants.vbCrLf + "(" + ex.Message + ")"); } } @@ -308,12 +308,12 @@ private void CopyButton_Click(object sender, EventArgs e) { if (MainListView.SelectedIndices.Count == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("You must select a Frame to Copy."); + DSGMlib.MsgWarn("You must select a Frame to Copy."); return; } if (MainListView.SelectedIndices.Count > 1) { - DS_Game_Maker.DSGMlib.MsgWarn("You may only copy on Frame at a time."); + DSGMlib.MsgWarn("You may only copy on Frame at a time."); return; } Clipboard.SetImage(MainImageList.Images[MainListView.SelectedIndices[0]]); @@ -323,12 +323,12 @@ private void CutButton_Click(object sender, EventArgs e) { if (MainListView.SelectedIndices.Count == 0) { - DS_Game_Maker.DSGMlib.MsgWarn("You must select a Frame to Copy."); + DSGMlib.MsgWarn("You must select a Frame to Copy."); return; } if (MainListView.SelectedIndices.Count > 1) { - DS_Game_Maker.DSGMlib.MsgWarn("You may only copy on Frame at a time."); + DSGMlib.MsgWarn("You may only copy on Frame at a time."); return; } Clipboard.SetImage(MainImageList.Images[MainListView.SelectedIndices[0]]); @@ -349,7 +349,7 @@ private void TransformButton_Click(object sender, EventArgs e) // TransformSprite.MainTabControl.TabPages(0).Text += If(MainListView.SelectedIndices.Count > 1, "s", String.Empty) Program.Forms.transformSprite_Form.ImagePaths.Clear(); foreach (byte X in MainListView.SelectedIndices) - Program.Forms.transformSprite_Form.ImagePaths.Add(DS_Game_Maker.SessionsLib.SessionPath + "Sprites/" + X.ToString() + "_" + SpriteName + ".png"); + Program.Forms.transformSprite_Form.ImagePaths.Add(SessionsLib.SessionPath + "Sprites/" + X.ToString() + "_" + SpriteName + ".png"); Program.Forms.transformSprite_Form.ShowDialog(); DataChanged = true; } @@ -359,10 +359,10 @@ private void FromSheetButton_Click(object sender, EventArgs e) byte MSResponse = (byte)MessageBox.Show("Importing from a Sheet will remove all existing frames." + Constants.vbCrLf + Constants.vbCrLf + "Would you like to Continue?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (!(MSResponse == (int)MsgBoxResult.Yes)) return; - string Response = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, DS_Game_Maker.DSGMlib.ImageFilter); + string Response = DSGMlib.OpenFile(string.Empty, DSGMlib.ImageFilter); if (Response.Length == 0) return; - string ThePath = DS_Game_Maker.SessionsLib.SessionPath + "Sprites/" + SpriteName + "_Import"; + string ThePath = SessionsLib.SessionPath + "Sprites/" + SpriteName + "_Import"; Directory.CreateDirectory(ThePath); @@ -384,14 +384,14 @@ private void FromSheetButton_Click(object sender, EventArgs e) foreach (string X in Directory.GetFiles(ThePath)) { if (ImageCount == 0) - MainImageList.ImageSize = DS_Game_Maker.DSGMlib.PathToImage(X).Size; + MainImageList.ImageSize = DSGMlib.PathToImage(X).Size; ImageCount = (short)(ImageCount + 1); } TimesChanged = 0; for (short X = 0, loopTo = (short)(ImageCount - 1); X <= loopTo; X++) { string TheKey = "Frame_" + MainImageList.Images.Count.ToString(); - MainImageList.Images.Add(TheKey, DS_Game_Maker.DSGMlib.PathToImage(ThePath + @"\" + X.ToString() + ".png")); + MainImageList.Images.Add(TheKey, DSGMlib.PathToImage(ThePath + @"\" + X.ToString() + ".png")); MainListView.Items.Add(TheKey.Replace("_", " "), MainImageList.Images.Count - 1); File.Delete(ThePath + @"\" + X.ToString() + ".png"); // File.Move(ThePath + "\" + X.ToString + ".png", SessionPath + "Sprites\" + X.ToString + "_" + SpriteName + ".png") @@ -436,25 +436,25 @@ private void DAcceptButton_Click(object sender, EventArgs e) string NewName = NameTextBox.Text; if (NewName == "None") { - DS_Game_Maker.DSGMlib.MsgWarn("'None' is not a valid name."); + DSGMlib.MsgWarn("'None' is not a valid name."); return; } if (!((SpriteName ?? "") == (NewName ?? ""))) { - if (DS_Game_Maker.DSGMlib.GUIResNameChecker(NewName)) + if (DSGMlib.GUIResNameChecker(NewName)) return; - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + SpriteName + ".png")) + if (File.Exists(SessionsLib.CompilePath + "gfx/" + SpriteName + ".png")) { - DS_Game_Maker.DSGMlib.SilentMoveFile(DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + SpriteName + ".png", DS_Game_Maker.SessionsLib.CompilePath + "gfx/" + NewName + ".png"); + DSGMlib.SilentMoveFile(SessionsLib.CompilePath + "gfx/" + SpriteName + ".png", SessionsLib.CompilePath + "gfx/" + NewName + ".png"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + SpriteName + "_Sprite.bin")) + if (File.Exists(SessionsLib.CompilePath + "gfx/bin/" + SpriteName + "_Sprite.bin")) { - DS_Game_Maker.DSGMlib.SilentMoveFile(DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + SpriteName + "_Sprite.bin", DS_Game_Maker.SessionsLib.CompilePath + "gfx/bin/" + NewName + "_Sprite.bin"); + DSGMlib.SilentMoveFile(SessionsLib.CompilePath + "gfx/bin/" + SpriteName + "_Sprite.bin", SessionsLib.CompilePath + "gfx/bin/" + NewName + "_Sprite.bin"); } - var BackupDate = File.GetLastWriteTime(DS_Game_Maker.SessionsLib.CompilePath + "gfx/dsgm_gfx.h"); + var BackupDate = File.GetLastWriteTime(SessionsLib.CompilePath + "gfx/dsgm_gfx.h"); string FinalString = string.Empty; string ToAdd = string.Empty; - foreach (string X in DS_Game_Maker.DSGMlib.StringToLines(DS_Game_Maker.DSGMlib.PathToString(DS_Game_Maker.SessionsLib.CompilePath + "gfx/dsgm_gfx.h"))) + foreach (string X in DSGMlib.StringToLines(DSGMlib.PathToString(SessionsLib.CompilePath + "gfx/dsgm_gfx.h"))) { ToAdd = X; if (X.Contains(" char " + SpriteName + "_Sprite[")) @@ -463,35 +463,35 @@ private void DAcceptButton_Click(object sender, EventArgs e) } FinalString += ToAdd + Constants.vbCrLf; } - File.WriteAllText(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\dsgm_gfx.h", FinalString); - File.SetLastWriteTime(DS_Game_Maker.SessionsLib.CompilePath + @"gfx\dsgm_gfx.h", BackupDate); + File.WriteAllText(SessionsLib.CompilePath + @"gfx\dsgm_gfx.h", FinalString); + File.SetLastWriteTime(SessionsLib.CompilePath + @"gfx\dsgm_gfx.h", BackupDate); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.h")) + if (File.Exists(SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.h")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.h"); + File.Delete(SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.h"); } - if (File.Exists(DS_Game_Maker.SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.o")) + if (File.Exists(SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.o")) { - File.Delete(DS_Game_Maker.SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.o"); + File.Delete(SessionsLib.CompilePath + "build/" + SpriteName + "_Sprite.o"); } - string OldLine = DS_Game_Maker.DSGMlib.GetXDSLine("SPRITE " + SpriteName + ","); + string OldLine = DSGMlib.GetXDSLine("SPRITE " + SpriteName + ","); string NewLine = "SPRITE " + NewName + "," + MainImageList.ImageSize.Width.ToString() + "," + MainImageList.ImageSize.Height.ToString(); - DS_Game_Maker.DSGMlib.XDSChangeLine(OldLine, NewLine); + DSGMlib.XDSChangeLine(OldLine, NewLine); var AffectedObjects = new List(); - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ")) + foreach (string X in DSGMlib.GetXDSFilter("OBJECT ")) { - if ((DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",") ?? "") == (SpriteName ?? "")) - AffectedObjects.Add(DS_Game_Maker.DSGMlib.iGet(X.Substring(7), (byte)0, ",")); + if ((DSGMlib.iGet(X, (byte)1, ",") ?? "") == (SpriteName ?? "")) + AffectedObjects.Add(DSGMlib.iGet(X.Substring(7), (byte)0, ",")); } - foreach (string X in DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ")) + foreach (string X in DSGMlib.GetXDSFilter("OBJECT ")) { - if (!((DS_Game_Maker.DSGMlib.iGet(X, (byte)1, ",") ?? "") == (SpriteName ?? ""))) + if (!((DSGMlib.iGet(X, (byte)1, ",") ?? "") == (SpriteName ?? ""))) continue; - string ObjectName = DS_Game_Maker.DSGMlib.iGet(X.Substring(7), (byte)0, ","); - string ObjectFrame = DS_Game_Maker.DSGMlib.iGet(X.Substring(7), (byte)2, ","); - DS_Game_Maker.DSGMlib.XDSChangeLine(X, "OBJECT " + ObjectName + "," + NewName + "," + ObjectFrame); + string ObjectName = DSGMlib.iGet(X.Substring(7), (byte)0, ","); + string ObjectFrame = DSGMlib.iGet(X.Substring(7), (byte)2, ","); + DSGMlib.XDSChangeLine(X, "OBJECT " + ObjectName + "," + NewName + "," + ObjectFrame); } - foreach (string X_ in Directory.GetFiles(DS_Game_Maker.SessionsLib.SessionPath + "Sprites")) + foreach (string X_ in Directory.GetFiles(SessionsLib.SessionPath + "Sprites")) { string X = X_; string Backup = X; @@ -504,18 +504,18 @@ private void DAcceptButton_Click(object sender, EventArgs e) File.Delete(Backup); } for (short X = 0, loopTo = (short)(MainImageList.Images.Count - 1); X <= loopTo; X++) - MainImageList.Images[X].Save(DS_Game_Maker.SessionsLib.SessionPath + "Sprites/" + X.ToString() + "_" + NewName + ".png"); + MainImageList.Images[X].Save(SessionsLib.SessionPath + "Sprites/" + X.ToString() + "_" + NewName + ".png"); foreach (Form X in Program.Forms.main_Form.MdiChildren) { if (X.Name == "DObject") { - DS_Game_Maker.DObject DForm = (DS_Game_Maker.DObject)X; + DObject DForm = (DObject)X; // MsgError(DForm.SpriteDropper.Text) DForm.ChangeSprite(SpriteName, NewName); } else if (X.Name == "Room") { - DS_Game_Maker.Room DForm = (DS_Game_Maker.Room)X; + Room DForm = (Room)X; byte TopAffected = 0; byte BottomAffected = 0; for (byte DOn = 0, loopTo1 = (byte)(DForm.Objects.Count() - 1); DOn <= loopTo1; DOn++) @@ -526,7 +526,7 @@ private void DAcceptButton_Click(object sender, EventArgs e) TopAffected = (byte)(TopAffected + 1); else BottomAffected = (byte)(BottomAffected + 1); - DForm.Objects[(int)DOn].CacheImage = DS_Game_Maker.DSGMlib.ObjectGetImage(DForm.Objects[(int)DOn].ObjectName); + DForm.Objects[(int)DOn].CacheImage = DSGMlib.ObjectGetImage(DForm.Objects[(int)DOn].ObjectName); } } if (TopAffected > 0) @@ -535,20 +535,20 @@ private void DAcceptButton_Click(object sender, EventArgs e) DForm.RefreshRoom(false); } } - DS_Game_Maker.DSGMlib.UpdateArrayActionsName("Sprite", SpriteName, NewName, false); - DS_Game_Maker.DSGMlib.CurrentXDS = DS_Game_Maker.DSGMlib.UpdateActionsName(DS_Game_Maker.DSGMlib.CurrentXDS, "Sprite", SpriteName, NewName, false); - foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DS_Game_Maker.DSGMlib.ResourceIDs.Sprite].Nodes) + DSGMlib.UpdateArrayActionsName("Sprite", SpriteName, NewName, false); + DSGMlib.CurrentXDS = DSGMlib.UpdateActionsName(DSGMlib.CurrentXDS, "Sprite", SpriteName, NewName, false); + foreach (TreeNode X in Program.Forms.main_Form.ResourcesTreeView.Nodes[(int)DSGMlib.ResourceIDs.Sprite].Nodes) { if ((X.Text ?? "") == (SpriteName ?? "")) X.Text = NewName; } - DS_Game_Maker.DSGMlib.RedoSprites = DataChanged; + DSGMlib.RedoSprites = DataChanged; Close(); } public Bitmap GetMagentaedBMP(string Path) { - Bitmap TMP = (Bitmap)DS_Game_Maker.DSGMlib.PathToImage(Path); + Bitmap TMP = (Bitmap)DSGMlib.PathToImage(Path); for (byte x = 0, loopTo = (byte)(TMP.Width - 1); x <= loopTo; x++) { for (byte y = 0, loopTo1 = (byte)(TMP.Height - 1); y <= loopTo1; y++) @@ -571,10 +571,10 @@ private void FromFileButton_Click(object sender, EventArgs e) { MainImageList.Images.Clear(); MainListView.Items.Clear(); - string Result = DS_Game_Maker.DSGMlib.OpenFile(string.Empty, DS_Game_Maker.DSGMlib.ImageFilter); + string Result = DSGMlib.OpenFile(string.Empty, DSGMlib.ImageFilter); if (Result.Length == 0) return; - Bitmap TMP = (Bitmap)DS_Game_Maker.DSGMlib.PathToImage(Result); + Bitmap TMP = (Bitmap)DSGMlib.PathToImage(Result); if (!IsSpriteSizeOkay(TMP.Size)) { Program.Forms.badSpriteSize_Form.ShowDialog(); diff --git a/SpriteSize.cs b/SpriteSize.cs index a80b664..4c09902 100644 --- a/SpriteSize.cs +++ b/SpriteSize.cs @@ -22,7 +22,7 @@ private void OpenEditorButton_Click(object sender, EventArgs e) string X = SpritePath; X = X.Substring(X.LastIndexOf(@"\") + 1); X = X.Substring(0, X.IndexOf(".")); - DS_Game_Maker.DSGMlib.EditImage(SpritePath, X, false); + DSGMlib.EditImage(SpritePath, X, false); Close(); } diff --git a/Statistics.cs b/Statistics.cs index 40f9487..6aca636 100644 --- a/Statistics.cs +++ b/Statistics.cs @@ -22,23 +22,23 @@ private void DAcceptButton_Click(object sender, EventArgs e) private void Statistics_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); var ResSentences = new List(); var LogicSentences = new List(); - string ToAdd = "You have " + DS_Game_Maker.DSGMlib.GetXDSFilter("ROOM ").Length.ToString() + " rooms, encompassing " + DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECTPOS ").Length.ToString() + " instances"; - ToAdd += " of " + DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ").Length.ToString() + " objects which are using " + DS_Game_Maker.DSGMlib.GetXDSFilter("SPRITE ").Length.ToString() + " sprites"; + string ToAdd = "You have " + DSGMlib.GetXDSFilter("ROOM ").Length.ToString() + " rooms, encompassing " + DSGMlib.GetXDSFilter("OBJECTPOS ").Length.ToString() + " instances"; + ToAdd += " of " + DSGMlib.GetXDSFilter("OBJECT ").Length.ToString() + " objects which are using " + DSGMlib.GetXDSFilter("SPRITE ").Length.ToString() + " sprites"; ResSentences.Add(ToAdd); - ToAdd = "There are also " + DS_Game_Maker.DSGMlib.GetXDSFilter("SCRIPT ").Length.ToString() + " scripts, " + DS_Game_Maker.DSGMlib.GetXDSFilter("PATH ").Length.ToString() + " paths,"; - ToAdd += " " + DS_Game_Maker.DSGMlib.GetXDSFilter("SOUND ").Length.ToString() + " sounds and " + DS_Game_Maker.DSGMlib.GetXDSFilter("BACKGROUND ").Length.ToString() + " backgrounds"; + ToAdd = "There are also " + DSGMlib.GetXDSFilter("SCRIPT ").Length.ToString() + " scripts, " + DSGMlib.GetXDSFilter("PATH ").Length.ToString() + " paths,"; + ToAdd += " " + DSGMlib.GetXDSFilter("SOUND ").Length.ToString() + " sounds and " + DSGMlib.GetXDSFilter("BACKGROUND ").Length.ToString() + " backgrounds"; ResSentences.Add(ToAdd); string ResourcesText = string.Empty; foreach (string X in ResSentences) ResourcesText += X + ". "; ResourcesText = ResourcesText.Substring(0, ResourcesText.Length - 1); // Efficient Defines - short EventCount = (short)DS_Game_Maker.DSGMlib.GetXDSFilter("EVENT ").Length; - short ObjectCount = (short)DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ").Length; - int ActionsCount = DS_Game_Maker.DSGMlib.GetXDSFilter("ACT ").Length; + short EventCount = (short)DSGMlib.GetXDSFilter("EVENT ").Length; + short ObjectCount = (short)DSGMlib.GetXDSFilter("OBJECT ").Length; + int ActionsCount = DSGMlib.GetXDSFilter("ACT ").Length; // Defines short EventAverage = 0; short ActionAverage = 0; @@ -50,10 +50,10 @@ private void Statistics_Load(object sender, EventArgs e) } if (ActionsCount > 0 & EventCount > 0) ActionAverage = (short)Math.Round(ActionsCount / (double)EventCount); - ToAdd = "In your " + DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ").Length.ToString() + " objects there is a total of " + DS_Game_Maker.DSGMlib.GetXDSFilter("EVENT ").Length.ToString(); + ToAdd = "In your " + DSGMlib.GetXDSFilter("OBJECT ").Length.ToString() + " objects there is a total of " + DSGMlib.GetXDSFilter("EVENT ").Length.ToString(); ToAdd += " events (an average of " + EventAverage.ToString() + " events per object)"; LogicSentences.Add(ToAdd); - ToAdd = "There is a total of " + DS_Game_Maker.DSGMlib.GetXDSFilter("OBJECT ").Length.ToString() + " actions (phew!). That's an average of " + ActionAverage.ToString() + " actions per event, or "; + ToAdd = "There is a total of " + DSGMlib.GetXDSFilter("OBJECT ").Length.ToString() + " actions (phew!). That's an average of " + ActionAverage.ToString() + " actions per event, or "; ToAdd += ActionAverage2.ToString() + " actions per object"; LogicSentences.Add(ToAdd); string LogicText = string.Empty; @@ -83,11 +83,11 @@ private void CopytoClipboardButton_Click(object sender, EventArgs e) private void CalculateUsageButton_Click(object sender, EventArgs e) { - ProjectCoolness += Convert.ToInt16((double)DS_Game_Maker.DSGMlib.GetXDSFilter("ACT ").Length / 2d); - ProjectCoolness += Convert.ToInt16(DS_Game_Maker.DSGMlib.GetXDSFilter("SCRIPT ").Length * 10); - ProjectCoolness += Convert.ToInt16(DS_Game_Maker.DSGMlib.GetXDSFilter("EVENT ").Length * 2); - ProjectCoolness += Convert.ToInt16(DS_Game_Maker.DSGMlib.GetXDSFilter("EVENT ").Length * 2); - ProjectCoolness -= Convert.ToInt16(DS_Game_Maker.DSGMlib.GetXDSFilter("SPRITE ").Length * 5); + ProjectCoolness += Convert.ToInt16((double)DSGMlib.GetXDSFilter("ACT ").Length / 2d); + ProjectCoolness += Convert.ToInt16(DSGMlib.GetXDSFilter("SCRIPT ").Length * 10); + ProjectCoolness += Convert.ToInt16(DSGMlib.GetXDSFilter("EVENT ").Length * 2); + ProjectCoolness += Convert.ToInt16(DSGMlib.GetXDSFilter("EVENT ").Length * 2); + ProjectCoolness -= Convert.ToInt16(DSGMlib.GetXDSFilter("SPRITE ").Length * 5); if (ProjectCoolness > 1000) ProjectCoolness = (short)Math.Round(ProjectCoolness / 10d); if (ProjectCoolness > 11) diff --git a/StructureItem.cs b/StructureItem.cs index 49ce2c1..bd997a6 100644 --- a/StructureItem.cs +++ b/StructureItem.cs @@ -19,10 +19,10 @@ public StructureItem() private void StructureItem_Load(object sender, EventArgs e) { - MainToolStrip.Renderer = new DS_Game_Maker.clsToolstripRenderer(); + MainToolStrip.Renderer = new clsToolstripRenderer(); TypeDropper.Items.Clear(); - for (byte X = 0, loopTo = (byte)(DS_Game_Maker.ScriptsLib.VariableTypes.Count - 1); X <= loopTo; X++) - TypeDropper.Items.Add(DS_Game_Maker.ScriptsLib.VariableTypes[(int)X]); + for (byte X = 0, loopTo = (byte)(ScriptsLib.VariableTypes.Count - 1); X <= loopTo; X++) + TypeDropper.Items.Add(ScriptsLib.VariableTypes[(int)X]); NameTextBox.Text = MemberName; TypeDropper.Text = MemberType; ValueTextBox.Text = MemberValue; diff --git a/TransformSprite.cs b/TransformSprite.cs index 44942cf..a19270b 100644 --- a/TransformSprite.cs +++ b/TransformSprite.cs @@ -16,26 +16,26 @@ public TransformSprite() private void OriginalColorButton_Click(object sender, EventArgs e) { - OriginalColorButton.BackColor = DS_Game_Maker.DSGMlib.SelectColor(OriginalColorButton.BackColor); + OriginalColorButton.BackColor = DSGMlib.SelectColor(OriginalColorButton.BackColor); } private void ReplaceButtonColor_Click(object sender, EventArgs e) { - ReplaceColorButton.BackColor = DS_Game_Maker.DSGMlib.SelectColor(ReplaceColorButton.BackColor); + ReplaceColorButton.BackColor = DSGMlib.SelectColor(ReplaceColorButton.BackColor); } private void DOkayButton_Click(object sender, EventArgs e) { foreach (string X in ImagePaths) { - Bitmap TheImage = (Bitmap)DS_Game_Maker.DSGMlib.PathToImage(X); + Bitmap TheImage = (Bitmap)DSGMlib.PathToImage(X); if (MainTabControl.SelectedIndex == 1) { - var TheSize = DS_Game_Maker.DSGMlib.PathToImage(X).Size; + var TheSize = DSGMlib.PathToImage(X).Size; TheImage = new Bitmap(TheSize.Width, TheSize.Height); var GFX = Graphics.FromImage(TheImage); GFX.Clear(ReplaceColorButton.BackColor); - GFX.DrawImage(DS_Game_Maker.DSGMlib.MakeBMPTransparent(DS_Game_Maker.DSGMlib.PathToImage(X), OriginalColorButton.BackColor), new Point(0, 0)); + GFX.DrawImage(DSGMlib.MakeBMPTransparent(DSGMlib.PathToImage(X), OriginalColorButton.BackColor), new Point(0, 0)); GFX.Dispose(); TheImage.Save(X); continue; diff --git a/Update.cs b/Update.cs index 9ff33ce..2b3e801 100644 --- a/Update.cs +++ b/Update.cs @@ -21,8 +21,8 @@ private void NeverMindButton_Click(object sender, EventArgs e) private void InstallButton_Click(object sender, EventArgs e) { - DS_Game_Maker.DSGMlib.URL(DS_Game_Maker.DSGMlib.Domain + "downloads/Install" + DS_Game_Maker.DSGMlib.UpdateVersion.ToString() + ".exe"); - DS_Game_Maker.DSGMlib.MsgInfo("Thanks for choosing to keep " + Application.ProductName + " up to date." + Constants.vbCrLf + Constants.vbCrLf + "The program will now exit so that the update may install."); + DSGMlib.URL(DSGMlib.Domain + "downloads/Install" + DSGMlib.UpdateVersion.ToString() + ".exe"); + DSGMlib.MsgInfo("Thanks for choosing to keep " + Application.ProductName + " up to date." + Constants.vbCrLf + Constants.vbCrLf + "The program will now exit so that the update may install."); Environment.Exit(0); } @@ -31,13 +31,13 @@ private void Update_Shown(object sender, EventArgs e) if (HasShown) return; InstallButton.Focus(); - MainWebBrowser.Navigate(DS_Game_Maker.DSGMlib.Domain + "DSGM5RegClient/" + DS_Game_Maker.DSGMlib.UpdateVersion.ToString() + ".php"); + MainWebBrowser.Navigate(DSGMlib.Domain + "DSGM5RegClient/" + DSGMlib.UpdateVersion.ToString() + ".php"); HasShown = true; } private void Update_Load(object sender, EventArgs e) { - string VersionString = DS_Game_Maker.DSGMlib.UpdateVersion.ToString(); + string VersionString = DSGMlib.UpdateVersion.ToString(); TitleLabel.Text = "Version " + VersionString.Substring(0, 1) + "." + VersionString.Substring(1, 2) + " is Available"; } @@ -45,7 +45,7 @@ private void MainWebBrowser_Navigating(object sender, WebBrowserNavigatingEventA { if (e.Url.ToString().Contains("dsgmforum")) { - DS_Game_Maker.DSGMlib.URL(e.Url.ToString()); + DSGMlib.URL(e.Url.ToString()); e.Cancel = true; } } From 8c72e4c4079f5f5a2b8b44e941607cbafe8e4c4a Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 12:25:15 -0500 Subject: [PATCH 05/10] Add a WebClient Replacement, fixing various warnings --- Action.cs | 5 ++- DSGMlib.cs | 69 ++++++++++++++++------------- MainForm.cs | 5 ++- WebClientReplacement.cs | 96 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+), 33 deletions(-) create mode 100644 WebClientReplacement.cs diff --git a/Action.cs b/Action.cs index 04906f1..892854b 100644 --- a/Action.cs +++ b/Action.cs @@ -1,8 +1,9 @@ -using System; +using Microsoft.VisualBasic; +using System; +using System.Diagnostics.CodeAnalysis; using System.Drawing; using System.IO; using System.Windows.Forms; -using Microsoft.VisualBasic; namespace DS_Game_Maker { diff --git a/DSGMlib.cs b/DSGMlib.cs index 87169ec..b1987ed 100644 --- a/DSGMlib.cs +++ b/DSGMlib.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Drawing; using System.Net; namespace DS_Game_Maker @@ -15,7 +16,6 @@ static class DSGMlib public static Bitmap ActionBG = new Bitmap(32, 32); public static Bitmap ActionConditionalBG = new Bitmap(32, 32); - public static WebClient WC = new WebClient(); public static string ProjectPath = string.Empty; @@ -119,13 +119,13 @@ public static string ResurrectResourceName(string ResourceName) public static Bitmap GenerateDSSprite(string TheSpriteName) { - string Folder = SessionsLib.SessionPath + @"Sprites\"; + string Folder = SessionsLib.SessionPath + "Sprites/"; byte ImageCount = 0; var Images = new List(); foreach (string X_ in Directory.GetFiles(Folder)) { string X = X_; - X = X.Substring(X.LastIndexOf(@"\") + 1); + X = X.Substring(X.LastIndexOf("/") + 1); X = X.Substring(0, X.IndexOf(".png")); X = X.Substring(X.IndexOf("_") + 1); if ((X ?? "") == (TheSpriteName ?? "")) @@ -146,26 +146,6 @@ public static Bitmap GenerateDSSprite(string TheSpriteName) return Returnable; } - public static bool HasInternetConnection(string URL) - { - var uri = new Uri(URL); - var request = WebRequest.Create(uri); - WebResponse response; - try - { - response = request.GetResponse(); - response.Close(); - request = null; - response.Close(); - request = null; - return true; - } - catch - { - return false; - } - } - public static object MakeSpaces(byte HowMany) { string Returnable = string.Empty; @@ -2165,8 +2145,10 @@ public static void IntelliSense(ref ScintillaNET.Scintilla TheControl) bool IsOne = false; foreach (string D in Enders) { - if ((F ?? "") == (D ?? "")) + if (F == D) + { IsOne = true; + } } if (F.StartsWith("next ")) IsOne = true; @@ -2351,15 +2333,20 @@ public static void DeleteResource(string ResourceName, string Type) { if (Y.InUse & (Y.ObjectName == ResourceName)) { - DForm.Objects[(int)DOn].CacheImage = (Bitmap)null; - DForm.Objects[(int)DOn].InUse = false; - DForm.Objects[(int)DOn].ObjectName = string.Empty; - DForm.Objects[(int)DOn].X = (short)0; - DForm.Objects[(int)DOn].Y = (short)0; - if (DForm.Objects[(int)DOn].Screen) + DForm.Objects[DOn].CacheImage = EmptyBitmap(); + DForm.Objects[DOn].InUse = false; + DForm.Objects[DOn].ObjectName = string.Empty; + DForm.Objects[DOn].X = 0; + DForm.Objects[DOn].Y = 0; + + if (DForm.Objects[DOn].Screen) + { TopAffected = (byte)(TopAffected + 1); + } else + { BottomAffected = (byte)(BottomAffected + 1); + } } DOn = (short)(DOn + 1); } @@ -2562,6 +2549,28 @@ public static void DeleteResource(string ResourceName, string Type) } } + public static Bitmap EmptyBitmap(int width = 16, int height = 16) + { + int _width = width; + int _height = height; + int _size = height/16; + + Graphics bitmap = Graphics.FromImage(new Bitmap(_width, height)); + + int x = 0; + int y = _size; + + while (y <= height) + { + bitmap.FillRectangle(Brushes.Red, 0, x, _width, _size); + x += _size; + + bitmap.FillRectangle(Brushes.Black, 0, y, _width, _size); + y += _size; + } + return new Bitmap(_width, _height, bitmap); + } + public static void CopyResource(string OldName, string NewName, byte ResourceType) { switch (ResourceType) diff --git a/MainForm.cs b/MainForm.cs index ad1114e..b481dd0 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -624,8 +624,11 @@ public void ActuallyCleanUp() { foreach (string X in Directory.GetDirectories(Constants.AppDirectory)) { - if ((X ?? "") == (SessionsLib.CompilePath.Substring(0, SessionsLib.CompilePath.Length - 1) ?? "")) + if (X == SessionsLib.CompilePath.Substring(0, SessionsLib.CompilePath.Length - 1)) + { continue; + } + try { if (X.StartsWith(Constants.AppDirectory + "DSGMTemp")) diff --git a/WebClientReplacement.cs b/WebClientReplacement.cs new file mode 100644 index 0000000..357a699 --- /dev/null +++ b/WebClientReplacement.cs @@ -0,0 +1,96 @@ +using System.Net; +using System.Text; + +namespace DS_Game_Maker +{ + public class WebClientReplacement + { + private readonly HttpClient httpClient; + public const byte NoTimeOut = 0; + + public WebClientReplacement() + { + HttpClientHandler httpClientHandler = new() + { + AutomaticDecompression = DecompressionMethods.All + }; + + httpClient = new HttpClient(httpClientHandler); + } + + public async Task GetAsync(string uri, int timeoutInMilliseconds = 15000) + { + if (timeoutInMilliseconds != NoTimeOut) + { + httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutInMilliseconds); + } + + try + { + using HttpResponseMessage response = await httpClient.GetAsync(uri); + string responseBody = await response.Content.ReadAsStringAsync(); + bool success = response.StatusCode == HttpStatusCode.OK; + + return new HTTP + { + Success = success, + Response = success ? responseBody : "" + }; + } + catch (Exception ex) + { + return new HTTP + { + Success = false, + Response = ex.Message + }; + } + + } + + public async Task PostAsync(string uri, string data, string contentType, int timeoutInMilliseconds = 15000) + { + if (timeoutInMilliseconds != NoTimeOut) + { + httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutInMilliseconds); + } + + try + { + using HttpContent content = new StringContent(data, Encoding.UTF8, contentType); + + HttpRequestMessage requestMessage = new HttpRequestMessage() + { + Content = content, + Method = HttpMethod.Post, + RequestUri = new Uri(uri) + }; + + using HttpResponseMessage response = await httpClient.SendAsync(requestMessage); + + string responseBody = await response.Content.ReadAsStringAsync(); + bool success = response.StatusCode == HttpStatusCode.OK; + + return new HTTP + { + Success = success, + Response = success ? responseBody : "" + }; + } + catch (Exception ex) + { + return new HTTP + { + Success = false, + Response = ex.Message + }; + } + } + + public struct HTTP + { + public bool Success; + public string Response; + } + } +} From e9ec08b6386804d6655bfdaf3c718990e225fb60 Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 13:40:29 -0500 Subject: [PATCH 06/10] Update SpriteSize.cs --- SpriteSize.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpriteSize.cs b/SpriteSize.cs index 4c09902..97af8e9 100644 --- a/SpriteSize.cs +++ b/SpriteSize.cs @@ -20,7 +20,7 @@ private void DOkayButton_Click(object sender, EventArgs e) private void OpenEditorButton_Click(object sender, EventArgs e) { string X = SpritePath; - X = X.Substring(X.LastIndexOf(@"\") + 1); + X = X.Substring(X.LastIndexOf("/") + 1); X = X.Substring(0, X.IndexOf(".")); DSGMlib.EditImage(SpritePath, X, false); Close(); From 75c803ae7b851dccdd5a668cc4f6d350e39c2e7d Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 13:41:20 -0500 Subject: [PATCH 07/10] Update DSGMlib.cs Fixed custom paint editor, mspaint by default if not found. --- DSGMlib.cs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/DSGMlib.cs b/DSGMlib.cs index b1987ed..e757a47 100644 --- a/DSGMlib.cs +++ b/DSGMlib.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.Drawing; using System.Net; +using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrayNotify; namespace DS_Game_Maker { @@ -1821,26 +1822,29 @@ public static short ImageCountColors(Bitmap TheImage) public static bool EditImage(string FilePath, string ResourceName, bool CustomMessage) { - string FinalName = string.Empty; - string FinalEXE = string.Empty; - FinalEXE = SettingsLib.GetSetting("IMAGE_EDITOR_PATH"); + string FinalEXE = SettingsLib.GetSetting("IMAGE_EDITOR_PATH"); + FinalEXE = File.Exists(FinalEXE) ? FinalEXE : Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "mspaint.exe"); - if (File.Exists(FinalEXE)) + ProcessStartInfo startInfo = new() { - Process.Start(FinalEXE, "\"" + FilePath + "\""); - } - else - { - Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.System) + "/mspaint.exe", "\"" + FilePath + "\""); - } + FileName = FinalEXE, + Arguments = $"\"{FilePath}\"", + WorkingDirectory = Path.GetDirectoryName(FilePath) ?? string.Empty, + UseShellExecute = true + }; + + Process.Start(startInfo); + + //Process.Start(FinalEXE, "\"" + FilePath + ".png\""); + string Message = "'" + ResourceName + "' has been opened. When you are finished, click 'OK'." + Constants.vbCrLf + Constants.vbCrLf + "To reverse any changes, please click 'Cancel'."; if (CustomMessage) { Message = "'" + ResourceName + "' has been opened. When you are finished, click 'OK'." + Constants.vbCrLf + Constants.vbCrLf + "You should then re-add the Frame to the Sprite."; } - byte Response = (byte)MessageBox.Show(Message, Application.ProductName, CustomMessage ? MessageBoxButtons.OK : MessageBoxButtons.OKCancel, MessageBoxIcon.Information); + DialogResult Response = MessageBox.Show(Message, Application.ProductName, CustomMessage ? MessageBoxButtons.OK : MessageBoxButtons.OKCancel, MessageBoxIcon.Information); - if (MessageBox.Show(Message, "DSGMLib: Compile") == DialogResult.OK) + if (Response == DialogResult.OK) { return true; } @@ -1922,7 +1926,7 @@ public static string OpenFile(string Directory, string Filter) if (!(OFD.ShowDialog() == DialogResult.OK)) Returnable = string.Empty; else - Returnable = OFD.FileName; + Returnable = OFD.FileName.Replace('\\', '/'); OFD.Dispose(); if (Returnable.Length > 0) { From 58a031e6a62502278dbf5a22ac7d2428623b9b5f Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 16:01:27 -0500 Subject: [PATCH 08/10] Update dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 60 ++++++++-------------------- 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 45e8077..53aa2db 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -56,60 +56,34 @@ jobs: # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on env: - Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. - Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. - Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. + Solution_Name: DS Game Maker.sln # Replace with your solution name, i.e. MyWpfApp.sln. + Test_Project_Path: dsgamemaker_csharp\Game Maker.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - # Install the .NET Core workload - - name: Install .NET Core + # Install the .NET 9 workload + - name: Setup .NET 9.0 uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v2 + # Pull packages and restore from nuget + - name: Restore dependencies + # Runs the dotnet restore command + run: dotnet restore - # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test - # Restore the application to populate the obj folder with RuntimeIdentifiers - - name: Restore the application - run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration - env: - Configuration: ${{ matrix.configuration }} + - name: Publish application + # Publishes the application to a folder, ready for artifact upload + run: dotnet publish --configuration Release --no-build --output ./publish_output - # Decode the base 64 encoded pfx and save the Signing_Certificate - - name: Decode the pfx - run: | - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") - $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx - [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) - - # Create the app package by building and packaging the Windows Application Packaging project - - name: Create the app package - run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} - env: - Appx_Bundle: Always - Appx_Bundle_Platforms: x86|x64 - Appx_Package_Build_Mode: StoreUpload - Configuration: ${{ matrix.configuration }} - - # Remove the pfx - - name: Remove the pfx - run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx - - # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact - - name: Upload build artifacts + - name: Upload a build artifact + # Uploads the published application as an artifact uses: actions/upload-artifact@v4 with: - name: MSIX Package - path: ${{ env.Wap_Project_Directory }}\AppPackages + name: DS Game Maker + path: ./publish_output From ae3efca8f08c989d4dfc87f4834cd89efb9b4107 Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 16:05:04 -0500 Subject: [PATCH 09/10] Update dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 53aa2db..b60069b 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -57,7 +57,7 @@ jobs: env: Solution_Name: DS Game Maker.sln # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: dsgamemaker_csharp\Game Maker.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. + Test_Project_Path: Game Maker.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. steps: - name: Checkout repository From a042dbeef1b6df7720f65b46ca20f2a388539760 Mon Sep 17 00:00:00 2001 From: latenightbuddha Date: Thu, 12 Feb 2026 16:25:13 -0500 Subject: [PATCH 10/10] Update dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 68 +++++----------------------- 1 file changed, 11 insertions(+), 57 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index b60069b..2b0f4d5 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -1,41 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will build, test, sign and package a WPF or Windows Forms desktop application -# built on .NET Core. -# To learn how to migrate your existing application to .NET Core, -# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework -# -# To configure this workflow: -# -# 1. Configure environment variables -# GitHub sets default environment variables for every workflow run. -# Replace the variables relative to your project in the "env" section below. -# -# 2. Signing -# Generate a signing certificate in the Windows Application -# Packaging Project or add an existing signing certificate to the project. -# Next, use PowerShell to encode the .pfx file using Base64 encoding -# by running the following Powershell script to generate the output string: -# -# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte -# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' -# -# Open the output file, SigningCertificate_Encoded.txt, and copy the -# string inside. Then, add the string to the repo as a GitHub secret -# and name it "Base64_Encoded_Pfx." -# For more information on how to configure your signing certificate for -# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing -# -# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". -# See "Build the Windows Application Packaging project" below to see how the secret is used. -# -# For more information on GitHub Actions, refer to https://github.com/features/actions -# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, -# refer to https://github.com/microsoft/github-actions-for-desktop-apps - name: .NET Core Desktop on: @@ -45,19 +7,13 @@ on: branches: [ "main" ] jobs: - build: - - strategy: - matrix: - configuration: [Debug, Release] - - runs-on: windows-latest # For a list of available runner types, refer to - # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + runs-on: windows-latest env: - Solution_Name: DS Game Maker.sln # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: Game Maker.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. + Solution_Name: "DS Game Maker.sln" + # Configuration is set to Release for the final artifact + Configuration: Release steps: - name: Checkout repository @@ -65,25 +21,23 @@ jobs: with: fetch-depth: 0 - # Install the .NET 9 workload - name: Setup .NET 9.0 uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.x - # Pull packages and restore from nuget - name: Restore dependencies - # Runs the dotnet restore command - run: dotnet restore + run: dotnet restore "${{ env.Solution_Name }}" + - name: Build application + run: dotnet build "${{ env.Solution_Name }}" --configuration ${{ env.Configuration }} --no-restore - name: Publish application - # Publishes the application to a folder, ready for artifact upload - run: dotnet publish --configuration Release --no-build --output ./publish_output + # We use --no-build here because we just built it in the previous step + run: dotnet publish "${{ env.Solution_Name }}" --configuration ${{ env.Configuration }} --no-build --output ./publish_output - name: Upload a build artifact - # Uploads the published application as an artifact uses: actions/upload-artifact@v4 with: - name: DS Game Maker - path: ./publish_output + name: DS-Game-Maker-Snapshot + path: ./publish_output \ No newline at end of file