Skip to content

Commit

Permalink
Finish update for 2024.6.18
Browse files Browse the repository at this point in the history
Co-authored-by: js6pak <me@6pak.dev>
  • Loading branch information
Pietrodjaowjao and js6pak committed Jun 21, 2024
1 parent 72937c4 commit 9486591
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Reactor.Debugger/Patches/GameOptionsPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public static void Initialize()
[HarmonyPrefix]
public static void UnlockAllOptions(GameSettingMenu __instance)
{
__instance.HideForOnline = new Il2CppReferenceArray<Transform>(0);
__instance.GameSettingsTab.HideForOnline = new Il2CppReferenceArray<Transform>(0);
}

[HarmonyPatch(typeof(NumberOption), nameof(NumberOption.OnEnable))]
[HarmonyPatch(typeof(NumberOption), nameof(NumberOption.SetUpFromData))]
[HarmonyPostfix]
public static void UnlockOptionRange(NumberOption __instance)
{
Expand Down
10 changes: 6 additions & 4 deletions Reactor.Debugger/Window/Tabs/GameTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ public override void OnGUI()

private static void SpawnDummy()
{
var playerControl = Object.Instantiate(TutorialManager.Instance.PlayerPrefab);
var playerControl = Object.Instantiate(AmongUsClient.Instance.PlayerPrefab);
var playerId = playerControl.PlayerId = (byte) GameData.Instance.GetAvailableId();

GameData.Instance.AddPlayer(playerControl);
var data = GameData.Instance.AddDummy(playerControl);
AmongUsClient.Instance.Spawn(data);
AmongUsClient.Instance.Spawn(playerControl);
playerControl.isDummy = true;

playerControl.transform.position = PlayerControl.LocalPlayer.transform.position;
playerControl.GetComponent<DummyBehaviour>().enabled = true;
Expand All @@ -88,8 +90,8 @@ private static void SpawnDummy()
playerControl.SetSkin(HatManager.Instance.allSkins[playerId % HatManager.Instance.allSkins.Count].ProdId, color);
playerControl.SetVisor(HatManager.Instance.allVisors[playerId % HatManager.Instance.allVisors.Count].ProdId, color);
playerControl.SetNamePlate(HatManager.Instance.allNamePlates[playerId % HatManager.Instance.allNamePlates.Count].ProdId);
playerControl.Data.PlayerLevel = playerId;
data.PlayerLevel = playerId;

GameData.Instance.RpcSetTasks(playerControl.PlayerId, new Il2CppStructArray<byte>(0));
data.RpcSetTasks(new Il2CppStructArray<byte>(0));
}
}
19 changes: 5 additions & 14 deletions Reactor/Networking/Patches/HttpPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ public static void Postfix(UnityWebRequest __instance, UnityWebRequestAsyncOpera
}
}

// HACK

/* [HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))]
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))]
private static class GameStartManagerPatch
{
public static void Postfix(GameStartManager __instance)
Expand All @@ -108,17 +106,10 @@ public static void Postfix(GameStartManager __instance)
{
Warning("Vanilla region, locking public toggle");

__instance.MakePublicButtonBehaviour.enabled = false;
var actionMapGlyphDisplay = __instance.MakePublicButton.GetComponentInChildren<ActionMapGlyphDisplay>(includeInactive: true);
if (actionMapGlyphDisplay)
{
actionMapGlyphDisplay.gameObject.SetActive(value: false);
}
__instance.HostPublicButton.enabled = false;
__instance.HostPrivateButton.transform.FindChild("Inactive").GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0.5f);

__instance.MakePublicButton.color = new Color(1, 1, 1, 0.5f);
__instance.MakePublicButton.sprite = __instance.PrivateGameImage;
var onClick = __instance.MakePublicButton.GetComponent<PassiveButton>().OnClick = new Button.ButtonClickedEvent();
var onClick = __instance.HostPrivateButton.OnClick = new Button.ButtonClickedEvent();
onClick.AddListener((Action) MakePublicDisallowedPopup.Show);

if (AmongUsClient.Instance.AmHost && AmongUsClient.Instance.IsGamePublic)
Expand All @@ -127,5 +118,5 @@ public static void Postfix(GameStartManager __instance)
}
}
}
}*/
}
}

0 comments on commit 9486591

Please sign in to comment.