Skip to content

Commit

Permalink
Misc Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MuxaJlbl4 committed Dec 2, 2024
1 parent 2e8165b commit 6913014
Show file tree
Hide file tree
Showing 10 changed files with 11,892 additions and 8,453 deletions.
2,178 changes: 1,186 additions & 992 deletions Taz trainer/Form1.Designer.cs

Large diffs are not rendered by default.

199 changes: 184 additions & 15 deletions Taz trainer/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using Newtonsoft.Json;
using System.Security.Principal;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;

namespace Taz_trainer
{
Expand Down Expand Up @@ -148,6 +149,8 @@ public form()
autoFillVideo(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
textBoxRegistry.Text = getPathFromRegistry();
langComboBox.SelectedIndex = 0;
catComboBox.SelectedIndex = 0;
levelComboBox.SelectedIndex = 0;
apiComboBox.SelectedIndex = 0;
layoutComboBox.SelectedIndex = 0;
fogComboBox.SelectedIndex = 0;
Expand All @@ -159,18 +162,22 @@ public form()
autoFillVideo(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
textBoxRegistry.Text = getPathFromRegistry();
langComboBox.SelectedIndex = 0;
catComboBox.SelectedIndex = 0;
levelComboBox.SelectedIndex = 0;
apiComboBox.SelectedIndex = 0;
layoutComboBox.SelectedIndex = 0;
fogComboBox.SelectedIndex = 0;
}

// Lock speedrun options
SpdInitOptions();

// Repacking tab init
string RepackingHTML = Properties.Resources.Repacking;
webBrowserRepacking.DocumentText = RepackingHTML;

// Usage tab init
//string html = Properties.Resources.README;
//webBrowser.DocumentText = html;
webBrowserReadMe.DocumentText = Resources.ReadMe;

// Welcome Message
this.statusField.Text = "v4.0";
Expand All @@ -192,6 +199,15 @@ void gkh_KeyUp(object sender, KeyEventArgs e)

void gkh_KeyDown(object sender, KeyEventArgs e)
{
if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.F4)
{
this.kill_Click(sender, e);
}

//Disable trainer cheats with speedrun mode
if (speedrunMode.Checked == true)
return;

if (e.KeyCode == Keys.F1)
{
this.invisibility.Checked = !this.invisibility.Checked;
Expand Down Expand Up @@ -371,11 +387,6 @@ void gkh_KeyDown(object sender, KeyEventArgs e)
decFPScap(sender, e);
sendKey(Keys.Divide, "{/}");
}
if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.F4)
{
this.kill_Click(sender, e);
//sendKey(Keys.F4, "%{F4}");
}
if (e.KeyCode == Keys.Add)
{
this.incFOV(sender, e);
Expand Down Expand Up @@ -544,7 +555,8 @@ private void width_TextChanged(object sender, EventArgs e)
width = "0";
if (height == "")
height = "0";
autoAspect(UInt16.Parse(width), UInt16.Parse(height));
if(speedrunMode.Checked == false)
autoAspect(UInt16.Parse(width), UInt16.Parse(height));
windowed.Checked = true;
}
catch (Exception ex)
Expand All @@ -563,7 +575,8 @@ private void height_TextChanged(object sender, EventArgs e)
width = "0";
if (height == "")
height = "0";
autoAspect(UInt16.Parse(width), UInt16.Parse(height));
if (speedrunMode.Checked == false)
autoAspect(UInt16.Parse(width), UInt16.Parse(height));
windowed.Checked = true;
}
catch (Exception ex)
Expand Down Expand Up @@ -693,14 +706,14 @@ private void superBelchCan_CheckedChanged(object sender, EventArgs e)
byte[] bytes = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
checkAndWrite((IntPtr)0x00482FE2, bytes, bytes.Length, new IntPtr());

message("Burp Soda Mode: On (Press Rant)");
message("Rant Hack Mode: On");
}
else
{
byte[] bytes = { 0x0F, 0x85, 0x95, 0x00, 0x00, 0x00 };
checkAndWrite((IntPtr)0x00482FE2, bytes, bytes.Length, new IntPtr());

message("Burp Soda Mode: Off");
message("Rant Hack Mode: Off");
}
}

Expand Down Expand Up @@ -3239,7 +3252,7 @@ private void githubLink_Click(object sender, EventArgs e)
}
private void gamebananaLink_Click(object sender, EventArgs e)
{
Process.Start("https://gamebanana.com/games/21253");
Process.Start("https://gamebanana.com/mods/games/21253");
}
private void discordLink_Click(object sender, EventArgs e)
{
Expand All @@ -3259,7 +3272,8 @@ private void ingamecheatsButton_Click(object sender, EventArgs e)
}
private void speedrunLink_Click(object sender, EventArgs e)
{
Process.Start("https://github.com/MilkGames/Taz_Wanted_Speedrunning_Patcher");
Process.Start("https://github.com/MilkGames/TWASV");
//Process.Start("https://github.com/MilkGames/Taz_Wanted_Speedrunning_Patcher");
}

/*
Expand Down Expand Up @@ -3832,6 +3846,7 @@ private void resetSettings_Click(object sender, EventArgs e)
{
try
{
trainerAutoSave.Checked = false;
// Delete xml
File.Delete(TazFolderPath + @"\Patcher.xml");
}
Expand All @@ -3842,7 +3857,7 @@ private void resetSettings_Click(object sender, EventArgs e)
this.statusField.ForeColor = System.Drawing.Color.DarkRed;
}
}
Application.Restart();
Program.Restart();
}

private void trainerAutoSave_CheckedChanged(object sender, EventArgs e)
Expand All @@ -3859,6 +3874,12 @@ private void form_FormClosed(object sender, FormClosedEventArgs e)
}
}

private void form_FormClosing(object sender, FormClosingEventArgs e)
{
if (ModifierKeys == Keys.Alt)
e.Cancel = true;
}

private void updateWrappers_Click(object sender, EventArgs e)
{
try
Expand Down Expand Up @@ -4251,7 +4272,7 @@ private void AdvancedActorCheat()
byte[] code = { 0x6A, 0x01, 0x68, 0x87, 0x13, 0x73, 0x00, 0xE8, 0xF4, 0x9D, 0xEA, 0xFF, 0x83, 0xC4, 0x08, 0x6A, 0x00, 0x68, 0x87, 0x13, 0x73, 0x00, 0xE8, 0xB5, 0xD7, 0xED, 0xFF, 0x83, 0xC4, 0x08, 0x6A, 0x01, 0x68, 0x80, 0x13, 0x73, 0x00, 0xE8, 0xD6, 0x9D, 0xEA, 0xFF, 0x83, 0xC4, 0x08, 0x6A, 0x00, 0x68, 0x80, 0x13, 0x73, 0x00, 0x68, 0x94, 0x13, 0x73, 0x00, 0xE8, 0x72, 0xC0, 0xE7, 0xFF, 0x83, 0xC4, 0x0C, 0x6A, 0x00, 0x68, 0x80, 0x13, 0x73, 0x00, 0x68, 0xAE, 0x13, 0x73, 0x00, 0xE8, 0x5E, 0xC0, 0xE7, 0xFF, 0x83, 0xC4, 0x0C, 0x6A, 0x00, 0x68, 0x80, 0x13, 0x73, 0x00, 0x68, 0xC5, 0x13, 0x73, 0x00, 0xE8, 0x4A, 0xC0, 0xE7, 0xFF, 0x83, 0xC4, 0x0C, 0x8B, 0x05, 0xC0, 0x8B, 0x6C, 0x00, 0x8B, 0x88, 0xCC, 0x01, 0x00, 0x00, 0x31, 0xD2, 0x8A, 0x91, 0x0C, 0x01, 0x00, 0x00, 0x6A, 0x05, 0x50, 0xE8, 0x7B, 0x99, 0xE3, 0xFF, 0x83, 0xC4, 0x08, 0xE8, 0x63, 0x39, 0xEE, 0xFF, 0xC3 };
checkAndWrite((IntPtr)0x005F6900, code, code.Length, new IntPtr());
}
else if (actor == "Swat")
else if (actor == "SWAT")
{
// CostumeSwat.CEA
byte[] data = { 0x63, 0x68, 0x65, 0x61, 0x74, 0x73, 0x00, 0x63, 0x68, 0x65, 0x61, 0x74, 0x73, 0x73, 0x6F, 0x75, 0x6E, 0x64, 0x73, 0x00, 0x63, 0x6F, 0x73, 0x74, 0x75, 0x6D, 0x65, 0x5C, 0x73, 0x77, 0x61, 0x74, 0x74, 0x61, 0x7A, 0x2E, 0x6F, 0x62, 0x65, 0x00, 0x63, 0x6F, 0x73, 0x74, 0x75, 0x6D, 0x65, 0x5C, 0x73, 0x77, 0x61, 0x74, 0x63, 0x61, 0x70, 0x2E, 0x6F, 0x62, 0x65, 0x00, 0x63, 0x6F, 0x73, 0x74, 0x75, 0x6D, 0x65, 0x5C, 0x73, 0x77, 0x61, 0x74, 0x62, 0x61, 0x63, 0x6B, 0x70, 0x61, 0x63, 0x6B, 0x2E, 0x6F, 0x62, 0x65, 0x00, 0x63, 0x6F, 0x73, 0x74, 0x75, 0x6D, 0x65, 0x5C, 0x73, 0x77, 0x61, 0x74, 0x73, 0x68, 0x61, 0x64, 0x65, 0x73, 0x2E, 0x6F, 0x62, 0x65, 0x00, 0x63, 0x6F, 0x73, 0x74, 0x75, 0x6D, 0x65, 0x5C, 0x73, 0x77, 0x61, 0x74, 0x65, 0x6C, 0x62, 0x6F, 0x77, 0x70, 0x61, 0x64, 0x6C, 0x2E, 0x6F, 0x62, 0x65, 0x00, 0x63, 0x6F, 0x73, 0x74, 0x75, 0x6D, 0x65, 0x5C, 0x73, 0x77, 0x61, 0x74, 0x65, 0x6C, 0x62, 0x6F, 0x77, 0x70, 0x61, 0x64, 0x72, 0x2E, 0x6F, 0x62, 0x65, 0x00, 0x63, 0x6F, 0x73, 0x74, 0x75, 0x6D, 0x65, 0x5C, 0x73, 0x77, 0x61, 0x74, 0x63, 0x68, 0x65, 0x65, 0x73, 0x65, 0x67, 0x75, 0x6E, 0x2E, 0x6F, 0x62, 0x65, 0x00 };
Expand Down Expand Up @@ -4677,6 +4698,154 @@ private void pictureTaz_DoubleClick(object sender, EventArgs e)
{
injections.Visible = !injections.Visible;
}
private void SpdInitOptions()
{
if (speedrunMode.Checked)
{
SpdLockOptions();
}
}
private void SpdLockOptions()
{
// Locking options
mods.Enabled = false;
cutsceneSubtitles.Enabled = false;
extraDebug.Enabled = false;
injections.Enabled = false;
level.Enabled = false;
levelComboBox.Enabled = false;

windowed.Enabled = false;
aspectRatio.Enabled = false;
aspect1.Enabled = false;
aspect2.Enabled = false;
pointsLabel.Enabled = false;
aspectSwap.Visible = true;

windowed.Enabled = false;
limitFPS.Enabled = false;
numericFpsCap.Enabled = false;
checkBoxFoV.Enabled = false;
numericFoV.Enabled = false;
disableDrawDistance.Enabled = false;
fog.Enabled = false;
fogComboBox.Enabled = false;

trainerTab.Enabled = false;

advancedTab.Enabled = false;

// Change options
mods.Checked = false;
cutsceneSubtitles.Checked = false;
extraDebug.Checked = false;
injections.Checked = false;
levelComboBox.SelectedIndex = 0;

int ind = apiComboBox.SelectedIndex;
apiComboBox.Items.Clear();
apiComboBox.Items.Add("d3d8 · vanilla");
apiComboBox.Items.Add("d3d9 · d3d8to9");
if (ind >= 1)
apiComboBox.SelectedIndex = 1;
else
apiComboBox.SelectedIndex = 0;

windowed.Checked = false;
aspectRatio.Checked = true;
if (!(aspect1.Text == "16" && aspect2.Text == "9"))
{
aspect1.Text = "4";
aspect2.Text = "3";
}

limitFPS.Checked = false;
checkBoxFoV.Checked = false;
disableDrawDistance.Checked = false;
fogComboBox.SelectedIndex = 0;

}
private void SpdUnockOptions()
{
// Unlocking options
mods.Enabled = true;
cutsceneSubtitles.Enabled = true;
extraDebug.Enabled = true;
injections.Enabled = true;
level.Enabled = true;
levelComboBox.Enabled = true;

windowed.Enabled = true;
aspectRatio.Enabled = true;
aspect1.Enabled = true;
aspect2.Enabled = true;
pointsLabel.Enabled = true;
aspectSwap.Visible = false;

limitFPS.Enabled = true;
numericFpsCap.Enabled = true;
checkBoxFoV.Enabled = true;
numericFoV.Enabled = true;
disableDrawDistance.Enabled = true;
fog.Enabled = true;
fogComboBox.Enabled = true;

trainerTab.Enabled = true;

advancedTab.Enabled = true;

// Change options
if (width.Text == "" || height.Text == "")
autoFillVideo(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
autoAspect(Int32.Parse(width.Text), Int32.Parse(height.Text));

int ind = apiComboBox.SelectedIndex;
apiComboBox.Items.Clear();
apiComboBox.Items.Add("d3d8 · vanilla");
apiComboBox.Items.Add("d3d9 · d3d8to9");
apiComboBox.Items.Add("d3d11 · dgVoodoo2");
apiComboBox.Items.Add("vulkan · dxvk");
if (ind == 1)
apiComboBox.SelectedIndex = 1;
else
apiComboBox.SelectedIndex = 0;
}

private void speedrunMode_Click(object sender, EventArgs e)
{
if (speedrunMode.Checked)
{
var result = MessageBox.Show("This will overwrite your settings and terminate game process. All trainer features will be deactivated. Continue?", "Speedrun Mode", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
this.kill_Click(sender, e);
SpdLockOptions();
}
else
{
speedrunMode.Checked = false;
}
}
else
{
this.kill_Click(sender, e);
SpdUnockOptions();
}
}

private void aspectSwap_Click(object sender, EventArgs e)
{
if (aspect1.Text == "4" && aspect2.Text == "3")
{
aspect1.Text = "16";
aspect2.Text = "9";
}
else
{
aspect1.Text = "4";
aspect2.Text = "3";
}
}
}
}

Loading

0 comments on commit 6913014

Please sign in to comment.