Skip to content

Commit

Permalink
Implement collision cell viewing
Browse files Browse the repository at this point in the history
  • Loading branch information
aglab2 committed Apr 9, 2023
1 parent e2097b2 commit ef02d4f
Show file tree
Hide file tree
Showing 20 changed files with 1,438 additions and 62 deletions.
5 changes: 3 additions & 2 deletions Hacktice/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public class Config
public byte[] customText;

// since version 1.5
public byte _pad1;
public byte _pad0;
public byte showCollision;
public byte softReset;
public byte showCustomText;

Expand Down Expand Up @@ -143,7 +143,8 @@ public bool Equals(Config o)
&& warpWheel == o.warpWheel
&& Enumerable.SequenceEqual(customText, o.customText)
&& softReset == o.softReset
&& showCustomText == o.showCustomText;
&& showCustomText == o.showCustomText
&& showCollision == o.showCollision;
}
}
}
4 changes: 2 additions & 2 deletions Hacktice/Emulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ public Config ReadConfig()
Marshal.FreeHGlobal(ptr);

int hackticeConfigSize = BitConverter.ToInt32(configBytes, 4);
if (hackticeConfigSize <= (int) Marshal.OffsetOf<Config>("_pad1"))
if (hackticeConfigSize <= (int) Marshal.OffsetOf<Config>("showCustomText"))
{
config.SetCustomText("PRACTICE");
config._pad1 = 0;
config._pad0 = 0;
config.showCollision = 0;
config.softReset = 0;
config.showCustomText = 0;
}
Expand Down
108 changes: 62 additions & 46 deletions Hacktice/Tool.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Hacktice/Tool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ private Config MakeConfig()
warpWheel = Convert.ToByte(checkBoxWarpWheel.Checked),
softReset = Convert.ToByte(checkBoxSoftReset.Checked),
showCustomText = Convert.ToByte(checkBoxShowCustomText.Checked),
showCollision = Convert.ToByte(checkBoxShowCollision.Checked),

checkpointWallkick = Convert.ToByte(checkBoxMTWallkick.Checked),
checkpointDoor = Convert.ToByte(checkBoxMTDoor.Checked),
Expand Down Expand Up @@ -597,6 +598,7 @@ private void UpdateUIFromConfig(Config config)
checkBoxWarpWheel.Checked = 0 != config.warpWheel;
checkBoxSoftReset.Checked = 0 != config.softReset;
checkBoxShowCustomText.Checked = 0 != config.showCustomText;
checkBoxShowCollision.Checked = 0 != config.showCollision;
if (config.customText is object)
textBoxCustomText.Text = config.GetCustomText();

Expand Down
3 changes: 0 additions & 3 deletions Hacktice/Tool.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="labelExpl.ToolTip" xml:space="preserve">
<value>Act Select - resets to the act select.
Level Reset - resets the level to the last taken warp
Expand Down
Loading

0 comments on commit ef02d4f

Please sign in to comment.