Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Utilla/Behaviours/ConductBoardManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using GorillaNetworking;
using GorillaTag;
using GorillaTag;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
Expand Down
2 changes: 1 addition & 1 deletion Utilla/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Constants

internal const string Name = "Utilla";

internal const string Version = "1.6.24";
internal const string Version = "1.6.25";

public const string GamemodePrefix = "MODDED_";

Expand Down
2 changes: 1 addition & 1 deletion Utilla/Models/Gamemode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public Gamemode(string id, string displayName, GameModeType? game_mode_type = nu
{
BaseGamemode = game_mode_type;

ID = game_mode_type.HasValue && !id.EndsWith(game_mode_type.Value.ToString()) ? string.Concat(id, game_mode_type) : id;
ID = game_mode_type.HasValue && !id.EndsWith(game_mode_type.Value.ToString()) ? string.Concat(id, "|", game_mode_type) : id;
DisplayName = displayName;

Logging.Message($"Constructed custom gamemode: {id} based on {(game_mode_type.HasValue ? game_mode_type.Value : "no")} type");
Expand Down
27 changes: 27 additions & 0 deletions Utilla/Patches/EnumUtilExtPatches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Reflection;
using GorillaGameModes;
using HarmonyLib;
using Utilla.Utils;

namespace Utilla.Patches;

[HarmonyPatch]
public class EnumUtilExtPatches
{
public static MethodBase TargetMethod()
{
return typeof(EnumUtilExt)
.GetMethod(nameof(EnumUtilExt.GetName), BindingFlags.Public | BindingFlags.Static)
?.MakeGenericMethod(typeof(GameModeType));
}

public static bool Prefix(GameModeType e, ref string __result) {
if (int.TryParse(e.ToString(), out _)) {
string a = GameModeUtils.GetGameModeInstance(e).GameTypeName();
__result = a;
return false;
}

return true;
}
}
17 changes: 17 additions & 0 deletions Utilla/Patches/GameModePatches.cs
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont kill this patch this time plz, its needed so that the game does not throw a fit that the gamemode string does not end with some random int.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Fusion;
using HarmonyLib;

namespace Utilla.Patches;

[HarmonyPatch(typeof(GorillaGameManager)), HarmonyWrapSafe]
public class GameModePatches
{
[HarmonyPatch("GameTypeName"), HarmonyPrefix]
public static bool GameTypeNamePatch(GorillaGameManager __instance, ref string __result) {
if (int.TryParse(__instance.GameType().ToString(), out _)) {
__result = __instance.GameModeName();
return false;
}
return true;
}
}
4 changes: 2 additions & 2 deletions Utilla/Utilla.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
<HintPath>$(GameAssemblyPath)\Cinemachine.dll</HintPath>
</Reference>
<Reference Include="Fusion.Runtime">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Fusion.Runtime.dll</HintPath>
<HintPath>$(GameAssemblyPath)\Fusion.Runtime.dll</HintPath>
</Reference>
<Reference Include="Mono.Security">
<HintPath>$(GameAssemblyPath)\Mono.Security.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Newtonsoft.Json.dll</HintPath>
<HintPath>$(GameAssemblyPath)\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Oculus.Platform">
<HintPath>$(GameAssemblyPath)\Oculus.Platform.dll</HintPath>
Expand Down