-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a23647d
commit 685ef96
Showing
20 changed files
with
408 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
using BepInEx; | ||
using BepInEx.Configuration; | ||
using BepInEx.IL2CPP; | ||
using System; | ||
using System.Linq; | ||
using HarmonyLib; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using UnityEngine; | ||
using UnhollowerBaseLib; | ||
using Hazel; | ||
using Il2CppSystem.Collections.Generic; | ||
using Il2CppSystem.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace TownOfPlus | ||
{ | ||
[HarmonyPatch(typeof(GameSettingMenu), nameof(GameSettingMenu.InitializeOptions))] | ||
public static class GameSettingMenuPatch | ||
{ | ||
public static void Prefix(GameSettingMenu __instance) | ||
{ | ||
if (!main.RoomOption.Value) return; | ||
// オンラインモードで部屋を立て直さなくてもマップを変更できるように変更 | ||
__instance.HideForOnline = new Il2CppReferenceArray<Transform>(0); | ||
} | ||
} | ||
|
||
[HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.Start))] | ||
[HarmonyPriority(Priority.First)] | ||
public static class GameOptionsMenuPatch | ||
{ | ||
public static void Postfix(GameOptionsMenu __instance) | ||
{ | ||
if (!main.RoomOption.Value) return; | ||
foreach (var ob in __instance.Children) | ||
{ | ||
switch (ob.Title) | ||
{ | ||
case StringNames.GameShortTasks: | ||
case StringNames.GameLongTasks: | ||
case StringNames.GameCommonTasks: | ||
ob.Cast<NumberOption>().ValidRange = new FloatRange(0, 99); | ||
break; | ||
case StringNames.GameKillCooldown: | ||
ob.Cast<NumberOption>().ValidRange = new FloatRange(0, 180); | ||
break; | ||
case StringNames.GameRecommendedSettings: | ||
ob.enabled = false; | ||
ob.gameObject.SetActive(false); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Update))] | ||
public static class KillCoolDown | ||
{ | ||
public static bool flag = false; | ||
public static void Prefix(GameStartManager __instance) | ||
{ | ||
if (AmongUsClient.Instance.AmHost) | ||
{ | ||
if (main.NokillCool.Value) | ||
{ | ||
PlayerControl.GameOptions.KillCooldown = 0.00001f; | ||
flag = true; | ||
Helpers.SyncSettings(); | ||
} | ||
else | ||
{ | ||
if (flag) | ||
{ | ||
PlayerControl.GameOptions.KillCooldown = 0f; | ||
Helpers.SyncSettings(); | ||
flag = false; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
using BepInEx; | ||
using BepInEx.Configuration; | ||
using BepInEx.IL2CPP; | ||
using System; | ||
using System.Linq; | ||
using HarmonyLib; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using UnityEngine; | ||
using UnhollowerBaseLib; | ||
using Hazel; | ||
using Il2CppSystem.Collections.Generic; | ||
using Il2CppSystem.Linq; | ||
using Il2CppSystem; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Collections; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using UnityEngine.UI; | ||
|
||
namespace TownOfPlus | ||
{ | ||
[HarmonyPatch(typeof(HudManager), nameof(HudManager.Update))] | ||
public static class CPS | ||
{ | ||
private static SpriteRenderer CPSUnderlay; | ||
private static TMPro.TextMeshPro CPStext; | ||
private static int count = 0; | ||
|
||
public static void Postfix(HudManager __instance) | ||
{ | ||
if (!initializeOverlays()) return; | ||
|
||
HudManager hudManager = DestroyableSingleton<HudManager>.Instance; | ||
if (PlayerControl.LocalPlayer == null || hudManager == null) | ||
return; | ||
|
||
Transform parent; | ||
parent = hudManager.transform; | ||
|
||
CPStext.transform.parent = parent; | ||
CPSUnderlay.transform.parent = parent; | ||
CPSUnderlay.color = new Color(0.1f, 0.1f, 0.1f, 0.88f); | ||
CPSUnderlay.transform.localScale = new Vector3(1f, 0.25f, 0.5f); | ||
CPSUnderlay.transform.localPosition = new Vector3(main.CPSpositionX.Value, main.CPSpositionY.Value, -900f); | ||
|
||
CPStext.transform.localPosition = new Vector3(main.CPSpositionX.Value, main.CPSpositionY.Value, -900f); | ||
CPStext.text = count.ToString() + " CPS"; | ||
if (main.CPS.Value) | ||
{ | ||
if (Input.GetKeyDown(KeyCode.Mouse0)) | ||
{ | ||
count += 1; | ||
new Timer(() => | ||
{ | ||
count -= 1; | ||
},1f); | ||
} | ||
if (main.SettingCPS) | ||
{ | ||
if (Input.GetKey(KeyCode.RightArrow)) | ||
{ | ||
main.CPSpositionX.Value += 0.05f; | ||
} | ||
if (Input.GetKey(KeyCode.LeftArrow)) | ||
{ | ||
main.CPSpositionX.Value -= 0.05f; | ||
} | ||
if (Input.GetKey(KeyCode.DownArrow)) | ||
{ | ||
main.CPSpositionY.Value -= 0.05f; | ||
} | ||
if (Input.GetKey(KeyCode.UpArrow)) | ||
{ | ||
main.CPSpositionY.Value += 0.05f; | ||
} | ||
} | ||
CPStext.enabled = true; | ||
CPSUnderlay.enabled = true; | ||
|
||
} | ||
else | ||
{ | ||
count = 0; | ||
CPSUnderlay.enabled = false; | ||
CPStext.enabled = false; | ||
} | ||
} | ||
public static bool initializeOverlays() | ||
{ | ||
HudManager hudManager = DestroyableSingleton<HudManager>.Instance; | ||
if (hudManager == null) return false; | ||
if (CPSUnderlay == null) | ||
{ | ||
CPSUnderlay = UnityEngine.Object.Instantiate(hudManager.FullScreen, hudManager.transform); | ||
CPSUnderlay.transform.localPosition = new Vector3(main.CPSpositionX.Value, main.CPSpositionY.Value, -900f); | ||
CPSUnderlay.gameObject.SetActive(true); | ||
CPSUnderlay.enabled = false; | ||
} | ||
if (CPStext == null) | ||
{ | ||
CPStext = UnityEngine.Object.Instantiate(hudManager.TaskText, hudManager.transform); | ||
CPStext.fontSize = CPStext.fontSizeMin = CPStext.fontSizeMax = 1.15f; | ||
CPStext.autoSizeTextContainer = false; | ||
CPStext.enableWordWrapping = false; | ||
CPStext.alignment = TMPro.TextAlignmentOptions.Center; | ||
CPStext.transform.localPosition = new Vector3(main.CPSpositionX.Value, main.CPSpositionY.Value, -900f); | ||
CPStext.transform.localScale = Vector3.one * 1.5f; | ||
CPStext.color = Palette.White; | ||
CPStext.enabled = false; | ||
} | ||
return true; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.