Skip to content

Commit

Permalink
Merge pull request #406 from BUTR/dev
Browse files Browse the repository at this point in the history
v2.9.10
  • Loading branch information
Aragas authored Jul 2, 2024
2 parents 0ac12e1 + ffba101 commit 3e1616e
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
shell: pwsh

- name: ReportGenerator
uses: danielpalme/[email protected].6
uses: danielpalme/[email protected].7
with:
reports: '*.xml'
targetdir: 'coveragereport'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
shell: pwsh

- name: ReportGenerator
uses: danielpalme/[email protected].6
uses: danielpalme/[email protected].7
with:
reports: 'coverage_butterlib_stable_debug.xml;coverage_butterlib_stable_release.xml;coverage_butterlib_impl_stable_debug.xml;coverage_butterlib_impl_stable_release.xml;coverage_butterlib_impl_beta_debug.xml;coverage_butterlib_impl_beta_release.xml;'
targetdir: 'coveragereport'
Expand Down
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 @@ -51,9 +51,9 @@ public override IReadOnlyList<HotKeyBase> Build()

var hotKeyCategoryContainer = new HotKeyCategoryContainer(_modName, _categoryName, _instanceHotKeys);

#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
TWHotKeyManager.RegisterInitialContexts(new[] { hotKeyCategoryContainer }, true);
#elif v120 || v121 || v122 || v123 || v124 || v125 || v126 || v127 || v128 || v129
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
TWHotKeyManager.RegisterInitialContexts(new[] { hotKeyCategoryContainer }, true);
#elif v120 || v121 || v122 || v123 || v124 || v125 || v126 || v127 || v128 || v129 || v1210
TWHotKeyManager.RegisterInitialContexts(TWHotKeyManager.GetAllCategories().ToList().Concat(new[] { hotKeyCategoryContainer }), true);
#else
#error DEFINE
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 @@ -81,7 +81,7 @@ public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructio
}
else
{
codes.InsertRange(finallyIndex + 1, new CodeInstruction[] {
codes.InsertRange(finallyIndex + 1, new CodeInstruction[] {
new CodeInstruction(opcode: OpCodes.Ldarg_0),
new CodeInstruction(opcode: OpCodes.Call, operand: miDelayedScreenAsRootEventCaller)
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ private sealed record DataKey([field: SaveableField(0)] MBGUID ObjectId, [field:
public override string ToString() => $"{ObjectId}::{Key}";
}

#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
private sealed class SavedTypeDefiner : SaveableCampaignBehaviorTypeDefiner
#elif v120 || v121 || v122 || v123 || v124 || v125 || v126 || v127 || v128 || v129
#elif v120 || v121 || v122 || v123 || v124 || v125 || v126 || v127 || v128 || v129 || v1210
private sealed class SavedTypeDefiner : SaveableTypeDefiner
#else
#error DEFINE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class MBObjectFinder : IMBObjectFinder
foreach (var cot in CampaignObjectTypeObjects?.Invoke(Campaign.Current.CampaignObjectManager) ?? [])
{
if (cot is null) continue;

if (ObjectClassGetter?.Invoke(cot, []) is Type objType && objType == type && cot is IEnumerable<MBObjectBase> en && en.FirstOrDefault(o => o.Id == id) is { } result)
{
return result;
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
1 change: 1 addition & 0 deletions supported-game-versions.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
v1.2.10
v1.2.9
v1.2.8
v1.2.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<ModuleId>$(MSBuildProjectName)</ModuleId>
<ModuleName>$(MSBuildProjectName)</ModuleName>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>


<ModuleId>$(MSBuildProjectName)</ModuleId>
<ModuleName>$(MSBuildProjectName)</ModuleName>
</PropertyGroup>

Expand Down

0 comments on commit 3e1616e

Please sign in to comment.