Skip to content

Commit

Permalink
Fixed double key press issue
Browse files Browse the repository at this point in the history
SubSystems will not be enabled/disabled multiple times now
  • Loading branch information
Aragas committed Jul 2, 2024
1 parent 73f6b49 commit ffba101
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<BaseGameVersion>1.0.0</BaseGameVersion>
<!--Module Version-->
<Version>2.9.9</Version>
<Version>2.9.10</Version>
<!--Harmony Version-->
<HarmonyVersion>2.2.2</HarmonyVersion>
<HarmonyExtensionsVersion>3.2.0.77</HarmonyExtensionsVersion>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---------------------------------------------------------------------------------------------------
Version: 2.9.10
Game Versions: v1.0.x,v1.1.x,v1.2.x
* Fixed double key press issue
---------------------------------------------------------------------------------------------------
Version: 2.9.9
Game Versions: v1.0.x,v1.1.x,v1.2.x
* Fixed SyncAsJson not serializing game types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ public DistanceMatrixSubSystem()

public void Enable()
{
if (GameInitialized)
return;
if (IsEnabled) return;

if (GameInitialized) return;

IsEnabled = true;
}

public void Disable()
{
if (GameInitialized)
return;
if (!IsEnabled) return;

if (GameInitialized) return;

IsEnabled = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public HotKeySubSystem()

public void Enable()
{
if (IsEnabled) return;
IsEnabled = true;

if (ButterLibSubModule.Instance is { } instance)
Expand All @@ -43,6 +44,7 @@ public void Enable()

public void Disable()
{
if (!IsEnabled) return;
IsEnabled = false;

if (ButterLibSubModule.Instance is { } instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public MBSubModuleBaseExSubSystem()
}
public void Enable()
{
if (IsEnabled) return;
IsEnabled = true;

ModulePatch.Enable(_harmony);
Expand All @@ -40,7 +41,9 @@ public void Enable()
}
public void Disable()
{
if (!IsEnabled) return;
IsEnabled = false;

ModulePatch.Disable(_harmony);
MBGameManagerPatch.Disable(_harmony);
// Think about DelayedSubModuleManager.Unregister
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ public ObjectSystemSubSystem()

public void Enable()
{
if (IsEnabled) return;
IsEnabled = true;

CampaignBehaviorManagerPatch.Enable(_harmony);
}

public void Disable()
{
if (!IsEnabled) return;
IsEnabled = false;

CampaignBehaviorManagerPatch.Disable(_harmony);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public SaveSystemSubSystem()

public void Enable()
{
if (IsEnabled) return;
IsEnabled = true;

BehaviourNamePatch.Enable(_harmony); // Fixes possible collision with save names
Expand All @@ -38,6 +39,7 @@ public void Enable()

public void Disable()
{
if (!IsEnabled) return;
IsEnabled = false;

BehaviourNamePatch.Disable(_harmony);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ public CrashUploaderSubSystem()

public void Enable()
{
if (IsEnabled) return;
IsEnabled = true;
}

public void Disable()
{
if (!IsEnabled) return;
IsEnabled = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public ExceptionHandlerSubSystem()

public void Enable()
{
if (IsEnabled) return;
IsEnabled = true;

if (!BEWPatch.IsDebuggerAttached())
Expand All @@ -87,6 +88,7 @@ public void Enable()

public void Disable()
{
if (!IsEnabled) return;
IsEnabled = false;

UnsubscribeToUnhandledException();
Expand Down

0 comments on commit ffba101

Please sign in to comment.