Menus/Controls: button controls use tooltip icons, inline description

This commit is contained in:
James R 2024-02-17 20:24:59 -08:00
parent cbff205edc
commit a902d83dce
2 changed files with 44 additions and 28 deletions

View file

@ -4810,6 +4810,7 @@ void M_DrawProfileControls(void)
for (i = 0; i < currentMenu->numitems; i++)
{
char buf[256];
char buf2[256];
INT32 keys[MAXINPUTMAPPING];
// cursor
@ -4838,7 +4839,8 @@ void M_DrawProfileControls(void)
if (currentMenu->menuitems[i].patch)
{
V_DrawScaledPatch(x+12, y+12, 0, W_CachePatchName(currentMenu->menuitems[i].patch, PU_CACHE));
V_DrawScaledPatch(x-4, y+1, 0, W_CachePatchName(currentMenu->menuitems[i].patch, PU_CACHE));
V_DrawMenuString(x+12, y+2, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text);
drawnpatch = true;
}
else
@ -4884,6 +4886,7 @@ void M_DrawProfileControls(void)
};
buf[0] = '\0';
buf2[0] = '\0';
// Cool as is this, this doesn't actually help show accurate info because of how some players would set inputs with keyboard and controller at once in a volatile way...
@ -4930,6 +4933,7 @@ void M_DrawProfileControls(void)
}
}*/
char *p = buf;
if (buf[0])
;
else if (!set)
@ -4942,17 +4946,29 @@ void M_DrawProfileControls(void)
continue;
if (k > 0)
strcat(buf," / ");
strcat(p," / ");
if (k == 2 && drawnpatch) // hacky...
strcat(buf, "\n");
if (k == 2) // hacky...
p = buf2;
strcat(buf, G_KeynumToString (keys[k]));
strcat(p, G_KeynumToString (keys[k]));
}
}
if (i == itemOn)
{
// Extend yellow wedge down behind
// extra line.
if (buf2[0])
{
for (j=24; j < 34; j++)
V_DrawFill(0, (y)+j, 128+j, 1, 73);
}
}
// don't shift the text if we didn't draw a patch.
V_DrawThinString(x + (drawnpatch ? 32 : 0), y + (drawnpatch ? 2 : 12), vflags, buf);
V_DrawThinString(x + (drawnpatch ? 13 : 1), y + 12, vflags, buf);
V_DrawThinString(x + (drawnpatch ? 13 : 1), y + 22, vflags, buf2);
// controller dest coords:
if (itemOn == i && gc > 0 && gc <= gc_start)

View file

@ -10,44 +10,44 @@ menuitem_t OPTIONS_ProfileControls[] = {
{IT_HEADER, "MAIN CONTROLS", "That's the stuff on the controller!!",
NULL, {NULL}, 0, 0},
{IT_CONTROL, "A", "Accelerate / Confirm",
"PR_BTA", {.routine = M_ProfileSetControl}, gc_a, 0},
{IT_CONTROL, "Accel / Confirm", "Accelerate / Confirm",
"TLB_A", {.routine = M_ProfileSetControl}, gc_a, 0},
{IT_CONTROL, "B", "Look backwards / Back",
"PR_BTB", {.routine = M_ProfileSetControl}, gc_b, 0},
{IT_CONTROL, "Look back", "Look backwards / Go back",
"TLB_B", {.routine = M_ProfileSetControl}, gc_b, 0},
{IT_CONTROL, "C", "Spindash / Extra",
"PR_BTC", {.routine = M_ProfileSetControl}, gc_c, 0},
{IT_CONTROL, "Spindash", "Spindash / Extra",
"TLB_C", {.routine = M_ProfileSetControl}, gc_c, 0},
{IT_CONTROL, "X", "Brake / Back",
"PR_BTX", {.routine = M_ProfileSetControl}, gc_x, 0},
{IT_CONTROL, "Brake / Go back", "Brake / Go back",
"TLB_D", {.routine = M_ProfileSetControl}, gc_x, 0},
{IT_CONTROL, "Y", "Respawn",
"PR_BTY", {.routine = M_ProfileSetControl}, gc_y, 0},
{IT_CONTROL, "Respawn", "Respawn",
"TLB_E", {.routine = M_ProfileSetControl}, gc_y, 0},
{IT_CONTROL, "Z", "Multiplayer quick-chat / quick-vote",
"PR_BTZ", {.routine = M_ProfileSetControl}, gc_z, 0},
{IT_CONTROL, "Action", "Multiplayer quick-chat / quick-vote",
"TLB_F", {.routine = M_ProfileSetControl}, gc_z, 0},
{IT_CONTROL, "L", "Use item",
"PR_BTL", {.routine = M_ProfileSetControl}, gc_l, 0},
{IT_CONTROL, "Use Item", "Use item",
"TLB_H", {.routine = M_ProfileSetControl}, gc_l, 0},
{IT_CONTROL, "R", "Drift",
"PR_BTR", {.routine = M_ProfileSetControl}, gc_r, 0},
{IT_CONTROL, "Drift", "Drift",
"TLB_I", {.routine = M_ProfileSetControl}, gc_r, 0},
{IT_CONTROL, "Turn Left", "Turn left",
"PR_PADL", {.routine = M_ProfileSetControl}, gc_left, 0},
"TLB_M", {.routine = M_ProfileSetControl}, gc_left, 0},
{IT_CONTROL, "Turn Right", "Turn right",
"PR_PADR", {.routine = M_ProfileSetControl}, gc_right, 0},
"TLB_L", {.routine = M_ProfileSetControl}, gc_right, 0},
{IT_CONTROL, "Aim Forward", "Aim forwards",
"PR_PADU", {.routine = M_ProfileSetControl}, gc_up, 0},
"TLB_J", {.routine = M_ProfileSetControl}, gc_up, 0},
{IT_CONTROL, "Aim Backwards", "Aim backwards",
"PR_PADD", {.routine = M_ProfileSetControl}, gc_down, 0},
"TLB_K", {.routine = M_ProfileSetControl}, gc_down, 0},
{IT_CONTROL, "Start", "Open pause menu",
"PR_BTS", {.routine = M_ProfileSetControl}, gc_start, 0},
{IT_CONTROL, "Open pause menu", "Open pause menu",
"TLB_G", {.routine = M_ProfileSetControl}, gc_start, 0},
{IT_HEADER, "OPTIONAL CONTROLS", "Take a screenshot, chat...",
NULL, {NULL}, 0, 0},