Skip to content

Commit 1e98400

Browse files
Button aliases
1 parent a4e7494 commit 1e98400

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

Classes/Menu/ButtonInfo.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ namespace iiMenu.Classes.Menu
2525
{
2626
public class ButtonInfo
2727
{
28-
public string buttonText = "-";
29-
public string overlapText;
28+
public string buttonText = "-"; // Button code name, displayed in menu if overlapText is null
29+
public string overlapText; // Button text displayed on menu, overrides buttonText
3030

31-
public string toolTip = "This button doesn't have a tooltip/tutorial.";
31+
public string[] aliases; // Other terms a button can go by for searching, not displayed in menu
3232

33-
public Action method; // Every frame before GTPlayer.LateUpdate is called
34-
public Action postMethod; // Every frame after GTPlayer.LateUpdate is called
33+
public string toolTip = "This button doesn't have a tooltip/tutorial."; // Tooltip of button, a short description
3534

36-
public Action enableMethod; // Once before method on enable
37-
public Action disableMethod; // Once on disable
35+
public Action method; // Every frame before GTPlayer.LateUpdate is called
36+
public Action postMethod; // Every frame after GTPlayer.LateUpdate is called
37+
38+
public Action enableMethod; // Once before method on enable
39+
public Action disableMethod; // Once on disable
3840

3941
public bool enabled;
4042
public bool isTogglable = true;

Menu/Buttons.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ public static class Buttons
595595
new ButtonInfo { buttonText = "Platform Spam <color=grey>[</color><color=green>G</color><color=grey>]</color>", method = Movement.PlatformSpam, toolTip = "Spawns legacy platforms rapidly at your hand for those who have networked platforms."},
596596
new ButtonInfo { buttonText = "Platform Gun", method = Movement.PlatformGun, toolTip = "Spawns legacy platforms rapidly wherever your hand desires for those who have networked platforms."},
597597

598-
new ButtonInfo { buttonText = "Fly <color=grey>[</color><color=green>A</color><color=grey>]</color>", method = Movement.Fly, toolTip = "Sends your character forwards when holding <color=green>A</color>."},
598+
new ButtonInfo { buttonText = "Fly <color=grey>[</color><color=green>A</color><color=grey>]</color>", aliases = new[] { "Super Monke" }, method = Movement.Fly, toolTip = "Sends your character forwards when holding <color=green>A</color>."},
599599
new ButtonInfo { buttonText = "Trigger Fly <color=grey>[</color><color=green>T</color><color=grey>]</color>", method = Movement.TriggerFly, toolTip = "Sends your character forwards when holding <color=green>trigger</color>."},
600600
new ButtonInfo { buttonText = "Noclip Fly <color=grey>[</color><color=green>A</color><color=grey>]</color>", method = Movement.NoclipFly, toolTip = "Sends your character forwards and makes you go through objects when holding <color=green>A</color>."},
601601
new ButtonInfo { buttonText = "Joystick Fly <color=grey>[</color><color=green>J</color><color=grey>]</color>", method = Movement.JoystickFly, toolTip = "Sends your character in whatever direction you are pointing your <color=green>joystick</color> in."},
@@ -610,12 +610,12 @@ public static class Buttons
610610
new ButtonInfo { buttonText = "Dash <color=grey>[</color><color=green>A</color><color=grey>]</color>", method = Movement.Dash, toolTip = "Flings your character forwards when pressing <color=green>A</color>."},
611611
new ButtonInfo { buttonText = "Reverse Velocity <color=grey>[</color><color=green>A</color><color=grey>]</color>", method = Movement.ReverseVelocity, toolTip = "Reverses your current velocity when you press <color=green>A</color>."},
612612
new ButtonInfo { buttonText = "Bird Fly", method = Movement.BirdFly, toolTip = "Makes you fly like a bird when you flap your wings."},
613-
new ButtonInfo { buttonText = "Iron Man", method = Movement.IronMan, toolTip = "Turns you into iron man, rotate your hands around to change direction."},
614-
new ButtonInfo { buttonText = "Spider Man", method = Movement.SpiderMan, disableMethod = Movement.DisableSpiderMan, toolTip = "Turns you into spider man, use your <color=green>grips</color> to shoot webs."},
613+
new ButtonInfo { buttonText = "Iron Man", aliases = new[] { "Iron Monke" }, method = Movement.IronMan, toolTip = "Turns you into iron man, rotate your hands around to change direction."},
614+
new ButtonInfo { buttonText = "Spider Man", aliases = new[] { "Spider Monke" }, method = Movement.SpiderMan, disableMethod = Movement.DisableSpiderMan, toolTip = "Turns you into spider man, use your <color=green>grips</color> to shoot webs."},
615615
new ButtonInfo { buttonText = "Grappling Hooks", method = Movement.GrapplingHooks, disableMethod = Movement.DisableSpiderMan, toolTip = "Gives you grappling hooks, use your <color=green>grips</color> to shoot them."},
616616
new ButtonInfo { buttonText = "Portal Gun", method = Movement.PortalGun, disableMethod = Movement.DisablePortalGun, toolTip = "Gives you a gun to spawn portals that can be seen and walked through."},
617617

618-
new ButtonInfo { buttonText = "Drive <color=grey>[</color><color=green>J</color><color=grey>]</color>", method = Movement.Drive, toolTip = "Lets you drive around in your invisible car. Use the <color=green>joystick</color> to move."},
618+
new ButtonInfo { buttonText = "Drive <color=grey>[</color><color=green>J</color><color=grey>]</color>", aliases = new[] { "Car Monke" }, method = Movement.Drive, toolTip = "Lets you drive around in your invisible car. Use the <color=green>joystick</color> to move."},
619619
new ButtonInfo { buttonText = "Hard Drive <color=grey>[</color><color=green>J</color><color=grey>]</color>", overlapText = "Sticky Drive <color=grey>[</color><color=green>J</color><color=grey>]</color>", method = Movement.HardDrive, toolTip = "Similar to drive, but locks you to the ground."},
620620

621621
new ButtonInfo { buttonText = "Noclip <color=grey>[</color><color=green>T</color><color=grey>]</color>", method = Movement.Noclip, toolTip = "Makes you go through objects when holding <color=green>trigger</color>."},
@@ -661,7 +661,7 @@ public static class Buttons
661661
new ButtonInfo { buttonText = "Safety Bubble", method = Movement.SafetyBubble, toolTip = "Moves you away from players if they get too close to you."},
662662
new ButtonInfo { buttonText = "Solid Players", method = Movement.SolidPlayers, disableMethod = Movement.DisableSolidPlayers, toolTip = "Lets you walk on top of other players."},
663663
new ButtonInfo { buttonText = "Pull Mod <color=grey>[</color><color=green>G</color><color=grey>]</color>", method = Movement.PullMod, toolTip = "Pulls you more whenever you walk to simulate speed without modifying your velocity."},
664-
new ButtonInfo { buttonText = "Long Jump <color=grey>[</color><color=green>A</color><color=grey>]</color>", overlapText = "Playspace Abuse <color=grey>[</color><color=green>A</color><color=grey>]</color>", method = Movement.PlayspaceAbuse, toolTip = "Makes you look like you're legitimately long jumping when holding <color=green>A</color>."},
664+
new ButtonInfo { buttonText = "Long Jump <color=grey>[</color><color=green>A</color><color=grey>]</color>", overlapText = "Playspace Abuse <color=grey>[</color><color=green>A</color><color=grey>]</color>", aliases = new[] { "Long Jump" }, method = Movement.PlayspaceAbuse, toolTip = "Makes you look like you're legitimately long jumping when holding <color=green>A</color>."},
665665
new ButtonInfo { buttonText = "Velocity Long Arms", overlapText = "Predictions", enableMethod = Movement.CreateVelocityTrackers, method = Movement.VelocityLongArms, disableMethod = Movement.DestroyVelocityTrackers, toolTip = "Moves your arms farther depending on how fast you move them."},
666666

667667
new ButtonInfo { buttonText = "Timer", enableMethod =() => TimerPatch.enabled = true, method = Movement.Timer, disableMethod =() => { TimerPatch.enabled = false; Time.timeScale = 1f; GTPlayer.Instance.debugMovement = false; }, toolTip = "Speeds up or slows down the time of your game."},

Menu/Main.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,9 +1642,10 @@ private static void UpdateKeyboard()
16421642
{
16431643
try
16441644
{
1645-
string buttonText = v.overlapText ?? v.buttonText;
1645+
List<string> texts = v.aliases == null ? new List<string>() : v.aliases.ToList();
1646+
texts.Add(v.overlapText ?? v.buttonText);
16461647

1647-
if (buttonText.ClearTags().Replace(" ", "").ToLower().Contains(keyboardInput.Replace(" ", "").ToLower()))
1648+
if (texts.Any(buttonText => buttonText.ClearTags().Replace(" ", "").ToLower().Contains(keyboardInput.Replace(" ", "").ToLower())))
16481649
searchedMods.Add(v);
16491650
}
16501651
catch { }
@@ -2916,11 +2917,10 @@ public static GameObject CreateMenu()
29162917
{
29172918
try
29182919
{
2919-
string buttonText = v.buttonText;
2920-
if (v.overlapText != null)
2921-
buttonText = v.overlapText;
2920+
List<string> texts = v.aliases == null ? new List<string>() : v.aliases.ToList();
2921+
texts.Add(v.overlapText ?? v.buttonText);
29222922

2923-
if (buttonText.ClearTags().Replace(" ", "").ToLower().Contains(keyboardInput.Replace(" ", "").ToLower()))
2923+
if (texts.Any(buttonText => buttonText.ClearTags().Replace(" ", "").ToLower().Contains(keyboardInput.Replace(" ", "").ToLower())))
29242924
searchedMods.Add(v);
29252925
}
29262926
catch { }
@@ -6594,9 +6594,10 @@ public static int DisplayedItemCount
65946594
{
65956595
try
65966596
{
6597-
string buttonText = v.overlapText ?? v.buttonText;
6597+
List<string> texts = v.aliases == null ? new List<string>() : v.aliases.ToList();
6598+
texts.Add(v.overlapText ?? v.buttonText);
65986599

6599-
if (buttonText.ClearTags().Replace(" ", "").ToLower().Contains(keyboardInput.Replace(" ", "").ToLower()))
6600+
if (texts.Any(buttonText => buttonText.ClearTags().Replace(" ", "").ToLower().Contains(keyboardInput.Replace(" ", "").ToLower())))
66006601
searchedMods.Add(v);
66016602
}
66026603
catch { }

0 commit comments

Comments
 (0)