Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions AboutDSGM.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;


namespace DS_Game_Maker
{
public partial class AboutDSGM
Expand Down
10 changes: 2 additions & 8 deletions Action.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using Microsoft.VisualBasic;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.IO;
using System.Windows.Forms;


namespace DS_Game_Maker
{
public partial class Action
Expand Down Expand Up @@ -140,7 +134,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.Split('\\')[1] + ".action"))
{
string X = X_;
if (X.StartsWith("ARG "))
Expand Down
4 changes: 2 additions & 2 deletions ActionEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,12 @@ private void DeleteActionButton_Click(object sender, EventArgs e)
string ActionName = ActionsTreeView.SelectedNode.Text;

DialogResult Response = MessageBox.Show("Are you sure you want to delete '" + ActionName + "'?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (Response != DialogResult.No)
if (Response == DialogResult.No)
{
return;
}

File.Delete(Constants.AppDirectory + "Actions/" + ActionName + ".action");
File.Delete(Constants.AppDirectory + "Actions/" + ActionName.Split('\\')[1] + ".action");
ActionsTreeView.SelectedNode.Remove();
if (ActionsTreeView.Nodes.Count == 0)
{
Expand Down
8 changes: 3 additions & 5 deletions ActionsLib.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Drawing;
using System.IO;


namespace DS_Game_Maker
{
static class ActionsLib
Expand All @@ -9,7 +7,7 @@ static class ActionsLib
public static string ActionEquateDisplay(string ActionName, string ActionArguments)
{
string Returnable = string.Empty;
foreach (string Y in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName + ".action"))
foreach (string Y in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName.Split('\\')[1] + ".action"))
{
if (Y.StartsWith("DISPLAY "))
{
Expand All @@ -19,7 +17,7 @@ public static string ActionEquateDisplay(string ActionName, string ActionArgumen
}
if (Returnable.Length == 0)
return ActionName;
foreach (string Y in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName + ".action"))
foreach (string Y in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName.Split('\\')[1] + ".action"))
{
for (int Z = 0, loopTo = (int)DSGMlib.HowManyChar(ActionArguments, ";"); Z <= loopTo; Z++)
{
Expand Down
8 changes: 2 additions & 6 deletions Argument.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Linq;
using System.Windows.Forms;
using Microsoft.VisualBasic.CompilerServices;


namespace DS_Game_Maker
{
public partial class Argument
Expand All @@ -24,7 +20,7 @@ private void Argument_Load(object sender, EventArgs e)
{
for (byte X = 1; X <= 16; X++)
TypeDropper.Items.Add(ScriptsLib.ArgumentTypeToString(X));
TypeDropper.Text = ScriptsLib.ArgumentTypeToString(Conversions.ToByte(ArgumentType));
TypeDropper.Text = ScriptsLib.ArgumentTypeToString(Convert.ToByte(ArgumentType));
}
else
{
Expand Down
8 changes: 1 addition & 7 deletions Background.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Linq;
using Microsoft.VisualBasic;


namespace DS_Game_Maker
{

Expand Down
3 changes: 1 addition & 2 deletions BadSpriteSize.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;


namespace DS_Game_Maker
{
public partial class BadSpriteSize
Expand Down
3 changes: 1 addition & 2 deletions Compile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;


namespace DS_Game_Maker
{
public partial class Compile
Expand Down
15 changes: 8 additions & 7 deletions Compiled.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using System.Diagnostics;

namespace DS_Game_Maker
{
Expand Down Expand Up @@ -53,10 +49,15 @@ private void SavetoKitButton_Click(object sender, EventArgs e)
DSGMlib.MsgWarn("There is no USB Reader for a DS Homebrew Kit connected.");
return;
}

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))

DialogResult Response = MessageBox.Show("'" + DSGMlib.CacheProjectName + "' was copied successfully." + Constants.vbCrLf + Constants.vbCrLf + "Safely disconnect USB Reader now?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (Response == DialogResult.No)
{
return;
}

DSGMlib.RunBatchString("EjectMedia " + HBKitDrive + Constants.vbCrLf + "RemoveDrive " + HBKitDrive, Constants.AppDirectory, false);
}
}
Expand Down
11 changes: 5 additions & 6 deletions DEvent.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;


namespace DS_Game_Maker
{
public partial class DEvent
Expand Down Expand Up @@ -77,7 +74,9 @@ public void EquateDropper()
}
}
foreach (string X in NewItems)
{
Dropper.Items.Add(X);
}
}

private void EventButtons_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -105,8 +104,8 @@ private void EventDropper_ItemClicked(object sender, ToolStripItemClickedEventAr

private void DEvent_FormClosing(object sender, FormClosingEventArgs e)
{
// MainClass = "NoData"
// SubClass = "NoData"
// MainClass = "NoData";
// SubClass = "NoData";
}

private void DCancelButton_Click(object sender, EventArgs e) => DCancelButton_Click();
Expand Down
59 changes: 49 additions & 10 deletions DObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void ActionMouseEnter(object sender, EventArgs e)
ArgumentsListLabel.Text = string.Empty;
byte ArgumentCount = 0;

foreach (string X_ in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName + ".action"))
foreach (string X_ in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName.Split('\\')[1] + ".action"))
{
string X = X_;
if (X.StartsWith("ARG "))
Expand Down Expand Up @@ -123,7 +123,7 @@ public void ActionMouseUp(object sender, MouseEventArgs e)
return;
byte ArgCount = 0;
bool NoAppliesTo = false;
foreach (string X in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName + ".action"))
foreach (string X in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName.Split('\\')[1] + ".action"))
{
if (X.StartsWith("ARG "))
ArgCount = (byte)(ArgCount + 1);
Expand Down Expand Up @@ -264,7 +264,7 @@ public void GenerateIndentIndices()
{
string ActionName = Actions[X];
byte IndentChange = 0;
foreach (string Y in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName + ".action"))
foreach (string Y in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName.Split('\\')[1] + ".action"))
{
if (Y == "INDENT")
{
Expand Down Expand Up @@ -329,16 +329,55 @@ public void RenderSprite()
{
ImagePath = SessionsLib.SessionPath + "Sprites/" + Frame.ToString() + "_" + SpriteDropper.Text + ".png";
}
var Drawable = DSGMlib.PathToImage(ImagePath);
Drawable = DSGMlib.MakeBMPTransparent(Drawable, Color.Magenta);

Image NormalImage = DSGMlib.PathToImage(ImagePath);
Image TransparentImage = DSGMlib.MakeBMPTransparent(NormalImage, Color.Magenta);

int calculateX = (int)Math.Round(32d - Drawable.Width / 2d);
int calculateY = (int)Math.Round(32d - Drawable.Height / 2d);

Point XY = new Point(calculateX, calculateY);
int calculateWidth = -1;
int calculateHeight = -1;

FinalGFX.DrawImage(Drawable, XY);
try
{
calculateWidth = (int)Math.Round(Convert.ToDecimal(32 - NormalImage.Width / 2));
calculateHeight = (int)Math.Round(Convert.ToDecimal(32d - NormalImage.Height / 2d));
}
catch
{
if ((calculateWidth == -1) || (calculateWidth <= 16))
{
calculateWidth = 16;
}
if ((calculateHeight == -1) || (calculateHeight <= 16))
{
calculateHeight = 16;
}
}

Point WH = new Point(calculateWidth, calculateHeight);

bool displayGenerated = false;

if (TransparentImage != null)
{
try
{
FinalGFX.DrawImage(TransparentImage, WH);
}
catch
{
displayGenerated = true;
}
}
else
{
displayGenerated = true;
}

if (displayGenerated == true)
{
FinalGFX.DrawImage(DSGMlib.EmptyBitmap(16, 16), WH);
}

SpritePanel.BackgroundImage = Final;
}
Expand Down Expand Up @@ -1247,7 +1286,7 @@ public bool ShouldAllowDialog(string ActionName)
{
bool NoAppliesTo = false;
byte ArgCount = 0;
foreach (string X in File.ReadAllLines(Constants.AppDirectory + "Actions/" + Actions[ActionsList.SelectedIndices[0]] + ".action"))
foreach (string X in File.ReadAllLines(Constants.AppDirectory + "Actions/" + ActionName.Split('\\')[1] /*Actions[ActionsList.SelectedIndices[0]]*/ + ".action"))
{
if (X == "NOAPPLIES")
NoAppliesTo = true;
Expand Down
Loading
Loading