This commit is contained in:
Gurge44 committed 2024-03-15 09:49:30 +01:00
1 parent 2a9c3efbbc
commit c305ca0a2d
3 files changed
+28 -32

No files matched your search

+1 -2
View File
@@ -43,8 +43,7 @@ internal class MMOnlineManagerStartPatch
if (obj)
{
obj?.SetActive(false);
var parentObj = obj.transform.parent.gameObject;
var textObj = Object.Instantiate(obj.transform.FindChild("Text_TMP").GetComponent<TextMeshPro>());
var textObj = Object.Instantiate(obj?.transform.FindChild("Text_TMP").GetComponent<TextMeshPro>());
textObj.transform.position = new(1f, -0.3f, 0);
textObj.name = "CanNotJoinPublic";
var message = ModUpdater.isBroken ? $"<size=2>{Utils.ColorString(Color.red, GetString("ModBrokenMessage"))}</size>"
+1
View File
@@ -139,6 +139,7 @@ public static class GameOptionsMenuPatch
tohTab.transform.FindChild("Hat Button").FindChild("Icon").GetComponent<SpriteRenderer>().sprite = Utils.LoadSprite($"TOHE.Resources.Images.TabIcon_{tab}.png", 100f);
tabs.Add(tohTab);
var tohTabHighlight = tohTab.transform.FindChild("Hat Button").FindChild("Tab Background").GetComponent<SpriteRenderer>();
tohTabHighlight.color = new(0.1f, 0.1f, 0.1f, 1f);
highlights.Add(tohTabHighlight);
}
+26 -30
View File
@@ -2,47 +2,43 @@ using AmongUs.GameOptions;
using HarmonyLib;
using static TOHE.Translator;
namespace TOHE;
namespace TOHE.Patches;
[HarmonyPatch(typeof(RoleOptionSetting), nameof(RoleOptionSetting.UpdateValuesAndText))]
class ChanceChangePatch
{
public static void Postfix(RoleOptionSetting __instance)
{
bool forced = true;
string DisableText = $" ({GetString("Disabled")})";
if (__instance.Role.Role == RoleTypes.Scientist)
switch (__instance.Role.Role)
{
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.Scientist);
}
if (__instance.Role.Role == RoleTypes.Engineer)
{
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.Engineer);
}
if (__instance.Role.Role == RoleTypes.GuardianAngel)
{
//+-ボタン, 設定値, 詳細設定ボタンを非表示
var tf = __instance.transform;
tf.Find("Count Plus_TMP").gameObject.active
= tf.Find("Chance Minus_TMP").gameObject.active
= tf.Find("Chance Value_TMP").gameObject.active
= tf.Find("Chance Plus_TMP").gameObject.active
= tf.Find("More Options").gameObject.active
= false;
case RoleTypes.Scientist:
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.Scientist);
break;
case RoleTypes.Engineer:
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.Engineer);
break;
case RoleTypes.GuardianAngel:
{
var tf = __instance.transform;
tf.Find("Count Plus_TMP").gameObject.active
= tf.Find("Chance Minus_TMP").gameObject.active
= tf.Find("Chance Value_TMP").gameObject.active
= tf.Find("Chance Plus_TMP").gameObject.active
= tf.Find("More Options").gameObject.active
= false;
if (!__instance.TitleText.text.Contains(DisableText))
__instance.TitleText.text += DisableText;
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.GuardianAngel);
}
if (__instance.Role.Role == RoleTypes.Shapeshifter)
{
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.Shapeshifter);
if (!__instance.TitleText.text.Contains(DisableText))
__instance.TitleText.text += DisableText;
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.GuardianAngel);
break;
}
case RoleTypes.Shapeshifter:
__instance.TitleText.color = Utils.GetRoleColor(CustomRoles.Shapeshifter);
break;
}
if (forced)
{
__instance.ChanceText.text = DisableText;
}
__instance.ChanceText.text = DisableText;
}
}