Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
Add hotkeys: quit to menu, move up, move down, toggle no death
Browse files Browse the repository at this point in the history
Fix hotkey back color looking weird sometimes
  • Loading branch information
JKAnderson committed Apr 11, 2018
1 parent b6755ae commit d15023f
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 34 deletions.
12 changes: 12 additions & 0 deletions DS Gadget/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@
<setting name="HotkeyTest2" serializeAs="String">
<value>221</value>
</setting>
<setting name="HotkeyMenu" serializeAs="String">
<value>106</value>
</setting>
<setting name="HotkeyUp" serializeAs="String">
<value>107</value>
</setting>
<setting name="HotkeyDown" serializeAs="String">
<value>109</value>
</setting>
<setting name="HotkeyDeath" serializeAs="String">
<value>111</value>
</setting>
</DS_Gadget.Properties.Settings>
</userSettings>
</configuration>
6 changes: 6 additions & 0 deletions DS Gadget/DSOffsets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,11 @@ public enum Unknown2
{
DeathCam = 0x40,
}

public const int Unknown3Ptr = 0x13784A4;
public enum Unknown3
{
MenuKick = 0x0,
}
}
}
9 changes: 8 additions & 1 deletion DS Gadget/DSProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void ReplaceBytes(byte[] victim, int value, int index)
}

#region Pointer loading
private int charData1, charMapData, animData, charPosData, charData2, graphicsData, worldState, chrFollowCam, unknown1, unknown2;
private int charData1, charMapData, animData, charPosData, charData2, graphicsData, worldState, chrFollowCam, unknown1, unknown2, unknown3;

public void LoadPointers()
{
Expand All @@ -123,6 +123,8 @@ public void LoadPointers()
unknown1 = dsInterface.ReadInt32(DSOffsets.Unknown1Ptr);

unknown2 = dsInterface.ReadInt32(DSOffsets.Unknown2Ptr);

unknown3 = dsInterface.ReadInt32(DSOffsets.Unknown3Ptr);
}

// Also used to check if game is loaded
Expand Down Expand Up @@ -659,6 +661,11 @@ public void DropItem(int category, int itemID, int count)
#endregion

#region Hotkeys Tab
public void MenuKick()
{
dsInterface.WriteInt32(unknown3 + (int)DSOffsets.Unknown3.MenuKick, 2);
}

public void MoveSwap()
{
dsInterface.WriteInt64(charData2 + (int)DSOffsets.CharData2.Stance, 2);
Expand Down
2 changes: 1 addition & 1 deletion DS Gadget/GadgetHotkey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private void enter(object sender, EventArgs e)

private void leave(object sender, EventArgs e)
{
hotkeyTextBox.BackColor = Color.White;
hotkeyTextBox.BackColor = SystemColors.Window;
}

private void keyUp(object sender, KeyEventArgs e)
Expand Down
1 change: 1 addition & 0 deletions DS Gadget/MainForm Tabs/TabCheats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ private void updateCheats()
if (checkBoxPlayerDeadMode.Checked)
dsProcess.SetPlayerDeadMode(true);
}


private void checkBoxPlayerDeadMode_CheckedChanged(object sender, EventArgs e)
{
Expand Down
35 changes: 35 additions & 0 deletions DS Gadget/MainForm Tabs/TabHotkeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,41 @@ private void initHotkeys()
checkBoxSpeed.Checked = !checkBoxSpeed.Checked;
}));

hotkeys.Add(new GadgetHotkey("HotkeyMenu", textBoxHotkeyMenu, tabPageHotkeys, () =>
{
dsProcess.MenuKick();
}));

hotkeys.Add(new GadgetHotkey("HotkeyUp", textBoxHotkeyUp, tabPageHotkeys, () =>
{
float x = dsProcess.GetPosX();
float y = dsProcess.GetPosY();
float z = dsProcess.GetPosZ();
float angle = dsProcess.GetPosAngle();
dsProcess.PosWarp(x, y + 5, z, angle);
}));

hotkeys.Add(new GadgetHotkey("HotkeyDown", textBoxHotkeyDown, tabPageHotkeys, () =>
{
float x = dsProcess.GetPosX();
float y = dsProcess.GetPosY();
float z = dsProcess.GetPosZ();
float angle = dsProcess.GetPosAngle();
dsProcess.PosWarp(x, y - 5, z, angle);
}));

hotkeys.Add(new GadgetHotkey("HotkeyDeath", textBoxHotkeyDeath, tabPageHotkeys, () =>
{
checkBoxPlayerDeadMode.Checked = !checkBoxPlayerDeadMode.Checked;
}));

/*
hotkeys.Add(new GadgetHotkey("Hotkey", textBoxHotkey, tabPageHotkeys, () =>
{
}));
*/

#if DEBUG
hotkeys.Add(new GadgetHotkey("HotkeyTest1", textBoxHotkeyTest1, tabPageHotkeys, () =>
{
Expand Down
Loading

0 comments on commit d15023f

Please sign in to comment.