Merge pull request #92 from Peter0x44/betties_controller_glyph

CLIENT: Draw controller glyphs properly for bouncing betties prompt
This commit is contained in:
cypress 2024-11-29 22:45:15 -08:00 committed by GitHub
commit 4f94067bd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1198,12 +1198,22 @@ void(float width, float height) HUD_Weaponstring =
void(float width, float height) HUD_BouncingBetty =
{
float top_x, bot_x, but_x;
string betty_key;
string betty_key = "";
string betty_space = "";
string activate_string, activate_string2;
tokenize(findkeysforcommandex("impulse 33"));
betty_key = strtoupper(argv(0));
float argc = tokenize(findkeysforcommandex("impulse 33"));
for (int i = 0; i < argc; ++i)
{
betty_key = strtoupper(argv(i));
float bind_is_gamepad = Key_IsControllerGlyph(betty_key);
if (bind_is_gamepad && last_input_was_gamepad)
break;
else if (!bind_is_gamepad && !last_input_was_gamepad)
break;
}
// If this is a gamepad button, the space we want to reserve
// in the betty string should be a fixed width.
@ -1231,7 +1241,7 @@ void(float width, float height) HUD_BouncingBetty =
but_x = top_x + getTextWidth("Press ", 12);
if (Key_IsControllerGlyph(betty_key))
Key_DrawControllerGlyph([but_x - 5, g_height - 308], betty_key, [22, 22]);
Key_DrawControllerGlyph([but_x - 5, g_height - 308], betty_key, [18, 18]);
else
Draw_String([but_x, g_height - 303], betty_key, [12, 12], [1, 1, 0], 1, 0);
}