Skip to content

Commit

Permalink
Added Pause When Inactive toggle.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-fadely committed Jan 25, 2016
1 parent 9bee6a9 commit a396ec8
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 43 deletions.
6 changes: 6 additions & 0 deletions SA2ModLoader/dllmain.cpp
Expand Up @@ -760,6 +760,12 @@ void __cdecl InitMods(void)
WriteJump(PrintDebug, SA2DebugOutput);
PrintDebug("SA2 Mod Loader version %d, built %s", ModLoaderVer, __TIMESTAMP__);
}

if (!settings->getBool("PauseWhenInactive", true))
{
// JNE -> JMP
WriteData((Uint8*)0x00401897, (Uint8)0xEB);
}

// Unprotect the .rdata section.
// TODO: Get .rdata address and length dynamically.
Expand Down
115 changes: 74 additions & 41 deletions SA2ModManager/MainForm.Designer.cs

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

9 changes: 7 additions & 2 deletions SA2ModManager/MainForm.cs
Expand Up @@ -6,6 +6,7 @@
using System.Windows.Forms;
using System.Xml.Serialization;
using IniSerializer;
using System.ComponentModel;

namespace SA2ModManager
{
Expand Down Expand Up @@ -80,6 +81,7 @@ private void MainForm_Load(object sender, EventArgs e)

consoleCheckBox.Checked = loaderini.DebugConsole;
fileCheckBox.Checked = loaderini.DebugFile;
pauseWhenInactiveCheckBox.Checked = loaderini.PauseWhenInactive;
if (!File.Exists(datadllpath))
{
MessageBox.Show(this, "Data_DLL.dll could not be found.\n\nCannot determine state of installation.", Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
Expand Down Expand Up @@ -172,6 +174,7 @@ private void Save()
loaderini.Mods.Add((string)item.Tag);
loaderini.DebugConsole = consoleCheckBox.Checked;
loaderini.DebugFile = fileCheckBox.Checked;
loaderini.PauseWhenInactive = pauseWhenInactiveCheckBox.Checked;
IniFile.Serialize(loaderini, loaderinipath);
List<Code> codes = new List<Code>();
List<Code> patches = new List<Code>();
Expand Down Expand Up @@ -417,6 +420,8 @@ class LoaderInfo
public bool DebugScreen { get; set; }
public bool DebugFile { get; set; }
public bool? ShowConsole { get { return null; } set { if (value.HasValue) DebugConsole = value.Value; } }
[DefaultValue(true)]
public bool PauseWhenInactive { get; set; }
[IniName("Mod")]
[IniCollection(IniCollectionMode.NoSquareBrackets, StartIndex = 1)]
public List<string> Mods { get; set; }
Expand All @@ -439,8 +444,8 @@ class ModInfo
public string Description { get; set; }
public string EXEFile { get; set; }
public string DLLFile { get; set; }
public bool RedirectMainSave { get; set; }
public bool RedirectChaoSave { get; set; }
public bool RedirectMainSave { get; set; }
public bool RedirectChaoSave { get; set; }
public string Codes { get; set; }
}

Expand Down

0 comments on commit a396ec8

Please sign in to comment.