mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Show gamemode description in options
This commit is contained in:
1 parent
3cd8db1f04
commit
cd97fab3a2
3 files changed
+14
-2
No files matched your search
@@ -12,5 +12,5 @@ public class ClassicMode : AbstractGameMode
|
||||
public override string Name => "Classic";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string Description => "The classic Among Us experience";
|
||||
public override string Description => "The classic Among Us experience!\nFind the Impostors or deceive the Crew.";
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class HideAndSeekMode : AbstractGameMode
|
||||
public override string Name => "Hide n Seek";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string Description => "You can run, but you can't hide!";
|
||||
public override string Description => "You can run, but you can't hide!\nOutlive the timer or eliminate the crew.";
|
||||
|
||||
public override Color Color { get; } = new Color32(255, 88, 90, 255);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ internal static class GameOptionsMenuPatch
|
||||
private static System.Collections.Generic.Dictionary<AbstractGameMode, System.Collections.Generic.List<AbstractOptionGroup>> _gameModeGroups = new();
|
||||
private static System.Collections.Generic.Dictionary<AbstractGameMode, System.Collections.Generic.List<OptionBehaviour>> _gameModeOptions = new();
|
||||
private static System.Collections.Generic.Dictionary<AbstractGameMode, System.Collections.Generic.List<CategoryHeaderMasked>> _gameModeHeaders = new();
|
||||
private static TextMeshPro _gamemodeDescription = null!;
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(nameof(GameOptionsMenu.Initialize))]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
@@ -83,6 +84,7 @@ internal static class GameOptionsMenuPatch
|
||||
{
|
||||
instance.Children.Add(opt);
|
||||
}
|
||||
_gamemodeDescription.text = gameMode.Description;
|
||||
if (gameMode.ShowNormalGameSettings)
|
||||
{
|
||||
foreach (var opt in _vanillaHeaders)
|
||||
@@ -195,6 +197,16 @@ internal static class GameOptionsMenuPatch
|
||||
GameModeOption.Values.ElementAt(i).Value);
|
||||
}
|
||||
|
||||
var gamemodeTextObj = Object.Instantiate(GameModeOption.OptionBehaviour.transform.GetChild(1).gameObject, Vector3.zero, Quaternion.identity, container);
|
||||
gamemodeTextObj.transform.localPosition = new Vector3(1, -0.675f, -2f);
|
||||
gamemodeTextObj.transform.localScale = new Vector3(2.6f, 2.6f, 1);
|
||||
_gamemodeDescription = gamemodeTextObj.GetComponentInChildren<TextMeshPro>();
|
||||
_gamemodeDescription.fontSizeMin = 0.5f;
|
||||
_gamemodeDescription.fontSizeMax = 1;
|
||||
|
||||
var gamemodeBg = Object.Instantiate(GameModeOption.OptionBehaviour.transform.GetChild(0).gameObject, Vector3.zero, Quaternion.identity, gamemodeTextObj.transform);
|
||||
gamemodeBg.transform.localPosition = new Vector3(0, 0, 0.01f);
|
||||
gamemodeBg.transform.localScale = new Vector3(0.61f, 0.375f, 1);
|
||||
num -= 1.3f;
|
||||
AdditionalVanillaScrollNum = 0f;
|
||||
foreach (RulesCategory rulesCategory in GameManager.Instance.GameSettingsList.AllCategories)
|
||||
|
||||
Reference in new issue
Block a user