Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiWorm0 committed Jun 6, 2024
1 parent d947c47 commit f4d543a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
10 changes: 10 additions & 0 deletions LevelImposter/Core/Patches/Triggers/ConsolePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ public static bool Prefix(MonoBehaviour __instance)
if (LIShipStatus.Instance == null)
return true;

// Get IUsable
var usable = __instance.TryCast<IUsable>();
if (usable == null)
return true;

// Check if the player can use the console
usable.CanUse(PlayerControl.LocalPlayer.Data, out bool canUse, out _);
if (!canUse)
return true;

// Update Last Console
MinigamePatch.LastConsole = __instance.gameObject;

Expand Down
6 changes: 3 additions & 3 deletions LevelImposter/LevelImposter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

<PropertyGroup>
<AmongUs>C:\Program Files (x86)\Steam\steamapps\common\Among Us</AmongUs>
<GameVersion>2024.3.5</GameVersion>
<GameVersion>2024.6.4</GameVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.674" PrivateAssets="all" />
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.691" PrivateAssets="all" />
<PackageReference Include="AmongUs.GameLibs.Steam" Version="$(GameVersion)" PrivateAssets="all" />
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="6.0.7" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="6.0.9" PrivateAssets="all" />
<PackageReference Include="Reactor" Version="2.2.0" />
</ItemGroup>

Expand Down
20 changes: 9 additions & 11 deletions LevelImposter/Shop/Patches/PingPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,26 @@ public static void Postfix(PingTracker __instance)

StringBuilder pingBuilder = new();

// Shrink all to fit
pingBuilder.Append("<size=2.5>");

// LevelImposter "Logo"
if (isInLobby)
pingBuilder.Append($"<color=#1a95d8>Level</color><color=#cb2828>Imposter</color> v{LevelImposter.DisplayVersion}\n");

// Existing Ping/Mods
pingBuilder.Append(__instance.text.text);
if (!__instance.text.text.EndsWith("\n"))
pingBuilder.Append("\n");

// LevelImposter "Logo"
if (isInLobby)
pingBuilder.Append($"<size=2><color=#1a95d8>Level</color><color=#cb2828>Imposter</color> v{LevelImposter.DisplayVersion}</size>\n");

// Map Name
pingBuilder.Append($"<color=#1a95d8>{mapName}\n");
pingBuilder.Append($"<size=2><color=#1a95d8><b>{mapName}</b></color></size>");

// Map Author
if (isFallback && isInLobby)
pingBuilder.Append($"<size=2>by ???</size></color>");
pingBuilder.Append("");
else if (isPublished)
pingBuilder.Append($"<size=2>by {currentMap.authorName}</size></color>");
pingBuilder.Append($"\n<size=2><color=#2e7296>by {currentMap.authorName}</color></size>");
else
pingBuilder.Append($"<size=2><i>(Freeplay Only)</i></size></color>");
pingBuilder.Append($"\n<size=2><i>(Freeplay Only)</i></size>");


__instance.text.text = pingBuilder.ToString();
}
Expand Down

0 comments on commit f4d543a

Please sign in to comment.