Skip to content

Commit

Permalink
add key overrides to tas menu
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Jan 2, 2022
1 parent 42c4550 commit b34a4e6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
22 changes: 21 additions & 1 deletion addons/sourcemod/scripting/shavit-tas.sp
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,15 @@ void OpenTasSettingsMenu(int client)
bool tastype_editable = (tastype == TASType_Any);
tastype = (tastype == TASType_Any) ? gI_Type[client] : tastype;

FormatEx(display, sizeof(display), "%T: %T", "Autostrafer_type", client,
FormatEx(display, sizeof(display), "%T: %T\n ", "Autostrafer_type", client,
(tastype == TASType_1Tick ? "Autostrafer_1tick" : "Autostrafer_autogain"), client);
menu.AddItem("type", display, (tastype_editable ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED));

TASOverride ov = gI_Override[client];
FormatEx(display, sizeof(display), "%T: %T", "TASOverride", client,
(ov == TASOverride_Normal ? "TASOverride_Normal" : (ov == TASOverride_Surf ? "TASOverride_Surf" : "TASOverride_All")), client);
menu.AddItem("override", display);

if (Shavit_GetStyleSettingBool(Shavit_GetBhopStyle(client), "segments"))
{
menu.ExitBackButton = true;
Expand Down Expand Up @@ -506,6 +511,21 @@ public int MenuHandler_TasSettings(Menu menu, MenuAction action, int param1, int
gI_Type[param1] = (gI_Type[param1] == TASType_1Tick ? TASType_Autogain : TASType_1Tick);
}
}
else if (StrEqual(info, "override"))
{
if (gI_Override[param1] == TASOverride_Normal)
{
gI_Override[param1] = TASOverride_Surf;
}
else if (gI_Override[param1] == TASOverride_Surf)
{
gI_Override[param1] = TASOverride_All;
}
else
{
gI_Override[param1] = TASOverride_Normal;
}
}

OpenTasSettingsMenu(param1);
}
Expand Down
16 changes: 16 additions & 0 deletions addons/sourcemod/translations/shavit-misc.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@
{
"en" "Velocity (oblivious)"
}
"TASOverride"
{
"en" "Key Override"
}
"TASOverride_Normal"
{
"en" "W/S"
}
"TASOverride_Surf"
{
"en" "W/S (and A/D on surf ramps)"
}
"TASOverride_All"
{
"en" "W/S A/D"
}
// ---------- Misc ---------- //
"BHStartZoneDisallowed"
{
Expand Down

0 comments on commit b34a4e6

Please sign in to comment.