Skip to content

Commit a1b0d9b

Browse files
committed
Fix ambiguous match for RadiantDashScreen.BuildBackground - v2.1.7
1 parent d70c788 commit a1b0d9b

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

ModSettings/ModSettings.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ModSettings : ResoniteMod
1515
{
1616
public override string Name => "ResoniteModSettings";
1717
public override string Author => "badhaloninja";
18-
public override string Version => "2.1.6";
18+
public override string Version => "2.1.7";
1919
public override string Link => "https://github.com/badhaloninja/ResoniteModSettings";
2020

2121
[AutoRegisterConfigKey]
@@ -80,7 +80,7 @@ public class ModSettings : ResoniteMod
8080
private static ModSettings Current;
8181
private static ModConfiguration Config;
8282
private static RadiantDashScreen CurrentScreen;
83-
private static readonly Dictionary<string, FoundMod> foundModsDictionary = new();
83+
private static readonly Dictionary<string, FoundMod> foundModsDictionary = [];
8484

8585
private static Slot configKeysRootSlot;
8686
private static Slot modButtonsRoot;
@@ -126,8 +126,8 @@ static class Patches
126126
public static void OnLoading(UserspaceScreensManager __instance) => ModSettingsScreen.GenerateModSettingsScreen(__instance);
127127

128128
[HarmonyReversePatch]
129-
[HarmonyPatch(typeof(RadiantDashScreen), "BuildBackground")] // This method is protected for some reason
130-
public static void BuildScreenBackground(RadiantDashScreen instance, UIBuilder ui) => throw new NotImplementedException("It's a stub");
129+
[HarmonyPatch(typeof(RadiantDashScreen), "BuildBackground", argumentTypes: [typeof(UIBuilder), typeof(bool)])] // This method is protected for some reason
130+
public static void BuildScreenBackground(RadiantDashScreen instance, UIBuilder ui, bool nest = true) => throw new NotImplementedException("It's a stub");
131131
}
132132

133133
static class ModSettingsScreen
@@ -537,7 +537,7 @@ public static void GenerateConfigItems(string SelectedMod = null)
537537
public static Slot GenerateConfigFieldOfType(Type type, UIBuilder ui, string ModName, ModConfiguration config, ModConfigurationKey key)
538538
{ // Generics go brr
539539
var genMethod = generateConfigFieldMethod.MakeGenericMethod(type); // Convert to whatever type requested
540-
object[] args = new object[] { ui, ModName, config, key }; // Pass the arguments
540+
object[] args = [ui, ModName, config, key]; // Pass the arguments
541541

542542
return (Slot)genMethod.Invoke(null, args); // Run the method
543543
}
@@ -878,7 +878,7 @@ private static void ResetConfigKey(ModConfiguration config, ModConfigurationKey
878878
config.Unset(key);
879879

880880
// Unset does not trigger the config changed event
881-
fireConfigurationChangedEventMethod.Invoke(config, new object[] { key, _internalConfigResetLabel });
881+
fireConfigurationChangedEventMethod.Invoke(config, [key, _internalConfigResetLabel]);
882882

883883
// Get default type
884884
if (!key.TryComputeDefault(out object value))

ModSettings/ModSettings.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AssemblyName>$(Product)</AssemblyName>
99

1010

11-
<Version>2.1.6</Version>
11+
<Version>2.1.7</Version>
1212
</PropertyGroup>
1313

1414
<ItemGroup>

ModSettings/UtilityExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static bool TryWriteDynamicValueOfType(this Slot root, Type type, string
7777
if (type == typeof(Type)) return root.TryWriteDynamicType(name, (Type)value);
7878

7979
var genMethod = tryWriteDynamicValueMethod.MakeGenericMethod(type);
80-
object[] args = new object[] { root, name, value };
80+
object[] args = [root, name, value];
8181

8282
return (bool)genMethod.Invoke(null, args);
8383
}

0 commit comments

Comments
 (0)