mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Keyboard label fuckapalooza
This commit is contained in:
parent
5c5ab934b3
commit
9edeaaf0ba
7 changed files with 92 additions and 34 deletions
|
|
@ -879,6 +879,7 @@ INT32 G_PlayerInputAnalog(UINT8 p, INT32 gc, UINT8 menuPlayers)
|
|||
// This is only intended for P1.
|
||||
if (main_player == true)
|
||||
{
|
||||
showgamepadprompts[p] = false;
|
||||
return value;
|
||||
}
|
||||
else
|
||||
|
|
@ -898,6 +899,7 @@ INT32 G_PlayerInputAnalog(UINT8 p, INT32 gc, UINT8 menuPlayers)
|
|||
value = G_GetValueFromControlTable(deviceID, deadzone, &(gamecontrol[p][gc][0]));
|
||||
if (value > 0)
|
||||
{
|
||||
showgamepadprompts[p] = (deviceID != KEYBOARD_MOUSE_DEVICE);
|
||||
return value;
|
||||
}
|
||||
if (value != NO_BINDS_REACHABLE)
|
||||
|
|
@ -911,6 +913,7 @@ INT32 G_PlayerInputAnalog(UINT8 p, INT32 gc, UINT8 menuPlayers)
|
|||
value = G_GetValueFromControlTable(KEYBOARD_MOUSE_DEVICE, deadzone, &(gamecontrol[p][gc][0]));
|
||||
if (value > 0)
|
||||
{
|
||||
showgamepadprompts[p] = true;
|
||||
return value;
|
||||
}
|
||||
if (value != NO_BINDS_REACHABLE)
|
||||
|
|
@ -951,6 +954,7 @@ INT32 G_PlayerInputAnalog(UINT8 p, INT32 gc, UINT8 menuPlayers)
|
|||
value = G_GetValueFromControlTable(tryDevice, deadzone, &(gamecontrol[p][gc][0]));
|
||||
if (value > 0)
|
||||
{
|
||||
showgamepadprompts[p] = (tryDevice != KEYBOARD_MOUSE_DEVICE);
|
||||
return value;
|
||||
}
|
||||
if (value != NO_BINDS_REACHABLE)
|
||||
|
|
@ -967,6 +971,7 @@ INT32 G_PlayerInputAnalog(UINT8 p, INT32 gc, UINT8 menuPlayers)
|
|||
value = G_GetValueFromControlTable(deviceID, deadzone, &(gamecontroldefault[gc][0]));
|
||||
if (value > 0)
|
||||
{
|
||||
showgamepadprompts[p] = (deviceID != KEYBOARD_MOUSE_DEVICE);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ INT32 gamekeydown[MAXDEVICES][NUMINPUTS];
|
|||
// two key codes (or virtual key) per game control
|
||||
INT32 gamecontrol[MAXSPLITSCREENPLAYERS][num_gamecontrols][MAXINPUTMAPPING];
|
||||
UINT8 gamecontrolflags[MAXSPLITSCREENPLAYERS];
|
||||
UINT8 showgamepadprompts[MAXSPLITSCREENPLAYERS];
|
||||
INT32 gamecontroldefault[num_gamecontrols][MAXINPUTMAPPING]; // default control storage
|
||||
INT32 menucontrolreserved[num_gamecontrols][MAXINPUTMAPPING];
|
||||
|
||||
|
|
@ -1274,9 +1275,12 @@ INT32 G_FindPlayerBindForGameControl(INT32 player, gamecontrols_e control)
|
|||
if (ourProfile == NULL)
|
||||
ourProfile = PR_GetLocalPlayerProfile(0);
|
||||
|
||||
#if 0
|
||||
INT32 device = G_GetDeviceForPlayer(player); // TODO: Respond to what device player is CURRENTLY using
|
||||
if (device == -1) // No registered device = you can't possibly be using a gamepad
|
||||
device = KEYBOARD_MOUSE_DEVICE;
|
||||
#endif
|
||||
INT32 device = showgamepadprompts[player] ? 1 : KEYBOARD_MOUSE_DEVICE;
|
||||
|
||||
INT32 bestbind = -1; // Bind that matches our input device
|
||||
INT32 anybind = -1; // Bind that doesn't match, but is at least for this control
|
||||
|
|
@ -1305,6 +1309,8 @@ INT32 G_FindPlayerBindForGameControl(INT32 player, gamecontrols_e control)
|
|||
}
|
||||
}
|
||||
|
||||
// DUMBASS. Default controls aren't necessarily in use!
|
||||
#if 0
|
||||
// PASS 2: Binds that are in the default controls.
|
||||
if (bestbind == -1)
|
||||
{
|
||||
|
|
@ -1330,6 +1336,7 @@ INT32 G_FindPlayerBindForGameControl(INT32 player, gamecontrols_e control)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// PASS 3: "Safety" binds that are reserved by the menu system.
|
||||
if (bestbind == -1)
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ extern INT32 gamekeydown[MAXDEVICES][NUMINPUTS];
|
|||
// several key codes (or virtual key) per game control
|
||||
extern INT32 gamecontrol[MAXSPLITSCREENPLAYERS][num_gamecontrols][MAXINPUTMAPPING];
|
||||
extern UINT8 gamecontrolflags[MAXSPLITSCREENPLAYERS];
|
||||
extern UINT8 showgamepadprompts[MAXSPLITSCREENPLAYERS];
|
||||
extern INT32 gamecontroldefault[num_gamecontrols][MAXINPUTMAPPING]; // default control storage
|
||||
extern INT32 menucontrolreserved[num_gamecontrols][MAXINPUTMAPPING];
|
||||
|
||||
|
|
|
|||
|
|
@ -257,6 +257,10 @@ patch_t *gen_button_back[2];
|
|||
patch_t *gen_button_ls[2];
|
||||
patch_t *gen_button_rs[2];
|
||||
|
||||
patch_t *gen_button_keyleft[2];
|
||||
patch_t *gen_button_keyright[2];
|
||||
patch_t *gen_button_keycenter[2];
|
||||
|
||||
static void K_LoadButtonGraphics(patch_t *kp[2], int letter)
|
||||
{
|
||||
HU_UpdatePatch(&kp[0], "TLB_%c", letter);
|
||||
|
|
@ -999,10 +1003,17 @@ void K_LoadKartHUDGraphics(void)
|
|||
K_LoadGenericButtonGraphics(gen_button_rt, 'F');
|
||||
|
||||
K_LoadGenericButtonGraphics(gen_button_start, 'G');
|
||||
K_LoadGenericButtonGraphics(gen_button_back, 'G'); // FIXME
|
||||
K_LoadGenericButtonGraphics(gen_button_back, 'V'); // FIXME
|
||||
|
||||
K_LoadGenericButtonGraphics(gen_button_ls, 'T');
|
||||
K_LoadGenericButtonGraphics(gen_button_rs, 'U');
|
||||
|
||||
HU_UpdatePatch(&gen_button_keyleft[0], "TLK_L");
|
||||
HU_UpdatePatch(&gen_button_keyleft[1], "TLK_R");
|
||||
HU_UpdatePatch(&gen_button_keyright[0], "TLK_R");
|
||||
HU_UpdatePatch(&gen_button_keyright[1], "TLK_RB");
|
||||
HU_UpdatePatch(&gen_button_keycenter[0], "TLK_M");
|
||||
HU_UpdatePatch(&gen_button_keycenter[1], "TLK_MB");
|
||||
}
|
||||
|
||||
// For the item toggle menu
|
||||
|
|
@ -6498,15 +6509,17 @@ void K_drawKartHUD(void)
|
|||
}
|
||||
|
||||
|
||||
if (0)
|
||||
if (1)
|
||||
{
|
||||
Draw::TextElement text = Draw::TextElement().parse("\xEELEFTSPACE\xEE\n\xEESPC\xEE \xEETAB\xEE\nA \xEF\xA0 A\nB \xEF\xA1 B\nX \xEF\xA2 X\nY \xEF\xA3 Y\nLB \xEF\xA4 LB\nRB \xEF\xA5 RB\nLT \xEF\xA6 LT\nRT \xEF\xA7 RT\nST \xEF\xA8 ST\nBK \xEF\xA9 BK\nLS \xEF\xAA LS\nRS \xEF\xAB RS\n");
|
||||
|
||||
UINT8 offset = 0;
|
||||
|
||||
player_t *oldstplyr = stplyr;
|
||||
stplyr = &players[0];
|
||||
Draw(160, 5).align((srb2::Draw::Align)0).font(Draw::Font::kMenu).text(text);
|
||||
Draw(160+offset, 5).align((srb2::Draw::Align)1).font(Draw::Font::kThin).text(text);
|
||||
stplyr = &players[1];
|
||||
Draw(55, 5).align((srb2::Draw::Align)0).font(Draw::Font::kThin).text(text);
|
||||
Draw(55+offset, 5).align((srb2::Draw::Align)1).font(Draw::Font::kMenu).text(text);
|
||||
stplyr = oldstplyr;
|
||||
}
|
||||
|
||||
|
|
@ -6937,15 +6950,15 @@ void K_DrawMarginSticker(INT32 x, INT32 y, INT32 width, INT32 flags, boolean isS
|
|||
V_DrawFixedPatch((x + width)*FRACUNIT, y*FRACUNIT, FRACUNIT, flags|V_FLIP, stickerEnd, NULL);
|
||||
}
|
||||
|
||||
INT32 K_DrawGameControl(UINT16 x, UINT16 y, UINT8 player, const char *str, UINT8 alignment)
|
||||
INT32 K_DrawGameControl(UINT16 x, UINT16 y, UINT8 player, const char *str, UINT8 alignment, UINT8 font)
|
||||
{
|
||||
using srb2::Draw;
|
||||
|
||||
Draw::TextElement text = Draw::TextElement().as(player).parse(str).font(Draw::Font::kMenu);
|
||||
Draw::TextElement text = Draw::TextElement().as(player).parse(str).font((Draw::Font)font);
|
||||
|
||||
INT32 width = text.width();
|
||||
|
||||
Draw(x, y).align((srb2::Draw::Align)alignment).text(text);
|
||||
|
||||
return width;
|
||||
}
|
||||
}
|
||||
|
|
@ -116,6 +116,10 @@ extern patch_t *gen_button_back[2];
|
|||
extern patch_t *gen_button_ls[2];
|
||||
extern patch_t *gen_button_rs[2];
|
||||
|
||||
extern patch_t *gen_button_keyleft[2];
|
||||
extern patch_t *gen_button_keyright[2];
|
||||
extern patch_t *gen_button_keycenter[2];
|
||||
|
||||
extern patch_t *kp_eggnum[6];
|
||||
extern patch_t *kp_facenum[MAXPLAYERS+1];
|
||||
|
||||
|
|
@ -146,7 +150,7 @@ INT32 K_GetMinimapTransFlags(const boolean usingProgressBar);
|
|||
INT32 K_GetMinimapSplitFlags(const boolean usingProgressBar);
|
||||
position_t K_GetKartObjectPosToMinimapPos(fixed_t objx, fixed_t objy);
|
||||
|
||||
INT32 K_DrawGameControl(UINT16 x, UINT16 y, UINT8 player, const char *str, UINT8 alignment);
|
||||
INT32 K_DrawGameControl(UINT16 x, UINT16 y, UINT8 player, const char *str, UINT8 alignment, UINT8 font);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
|||
|
|
@ -833,8 +833,9 @@ void M_DrawMenuMessage(void)
|
|||
if (standardbuttons)
|
||||
{
|
||||
workx -= K_DrawGameControl(
|
||||
workx+2, worky,
|
||||
0, "<b_animated> <x_animated> ", 2
|
||||
workx+2, worky+2,
|
||||
0, "<b_animated> <x_animated> ",
|
||||
2, 8
|
||||
);
|
||||
}
|
||||
else
|
||||
|
|
@ -863,8 +864,9 @@ void M_DrawMenuMessage(void)
|
|||
if (standardbuttons)
|
||||
{
|
||||
workx -= K_DrawGameControl(
|
||||
workx+2, worky,
|
||||
0, "<a_animated> ", 2
|
||||
workx+2, worky+2,
|
||||
0, "<a_animated> ",
|
||||
2, 8
|
||||
);
|
||||
}
|
||||
else
|
||||
|
|
@ -2458,17 +2460,22 @@ void M_DrawCharacterSelect(void)
|
|||
|
||||
if (!optionsmenu.profile) // Does nothing on this screen
|
||||
{
|
||||
x += 22;
|
||||
// x += 22;
|
||||
//K_drawButton((x += 22) * FRACUNIT, (kTop - 3) * FRACUNIT, 0, kp_button_r, M_MenuButtonPressed(pid, MBT_R));
|
||||
x += K_DrawGameControl(x, kTop, 0, "<r>", 0);
|
||||
V_DrawThinString((x), kTop, 0, "Info");
|
||||
// x += K_DrawGameControl(x, kTop, 0, "<r>", 0);
|
||||
// V_DrawThinString((x), kTop, 0, "Info");
|
||||
K_DrawGameControl(BASEVIDWIDTH/2, kTop, 0, "<r> Info <c> Default", 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
K_DrawGameControl(BASEVIDWIDTH/2, kTop, 0, "<a> Accept <x> Back <c> Default", 1, 0);
|
||||
}
|
||||
|
||||
x += 58;
|
||||
|
||||
// K_drawButton((x += 58) * FRACUNIT, (kTop - 1) * FRACUNIT, 0, kp_button_c[1], M_MenuButtonPressed(pid, MBT_C));
|
||||
x += K_DrawGameControl(x, kTop, 0, "<c>", 0);
|
||||
V_DrawThinString((x), kTop, 0, "Default");
|
||||
// x += K_DrawGameControl(x, kTop, 0, "<c>", 0);
|
||||
// V_DrawThinString((x), kTop, 0, "Default");
|
||||
}
|
||||
|
||||
// We have to loop twice -- first time to draw the drop shadows, a second time to draw the icons.
|
||||
|
|
@ -2578,6 +2585,11 @@ void M_DrawCharacterSelect(void)
|
|||
// Draw the priority player over the other ones
|
||||
M_DrawCharSelectCursor(priority);
|
||||
}
|
||||
|
||||
if (setup_numplayers > 1)
|
||||
{
|
||||
V_DrawCenteredThinString(BASEVIDWIDTH/2, BASEVIDHEIGHT-12, V_30TRANS, "\x85""Double-input problems?\x80 Close Steam, DS4Windows, and other controller wrappers!");
|
||||
}
|
||||
}
|
||||
|
||||
// DIFFICULTY SELECT
|
||||
|
|
|
|||
|
|
@ -2592,9 +2592,6 @@ void V_DrawStringScaled(
|
|||
INT32 dupx;
|
||||
INT32 dupy;
|
||||
|
||||
const UINT8 outerbox = 26;
|
||||
const UINT8 innerbox = 16;
|
||||
|
||||
fixed_t right;
|
||||
fixed_t bot;
|
||||
|
||||
|
|
@ -2602,7 +2599,7 @@ void V_DrawStringScaled(
|
|||
|
||||
boolean uppercase;
|
||||
boolean notcolored;
|
||||
boolean boxed;
|
||||
int boxed = 0;
|
||||
boolean descriptive = false;
|
||||
|
||||
boolean dance;
|
||||
|
|
@ -2610,6 +2607,9 @@ void V_DrawStringScaled(
|
|||
INT32 dancecounter;
|
||||
|
||||
fixed_t cx, cy;
|
||||
fixed_t cxsave;
|
||||
|
||||
const char *ssave;
|
||||
|
||||
fixed_t cxoff, cyoff;
|
||||
fixed_t cw;
|
||||
|
|
@ -2696,6 +2696,8 @@ void V_DrawStringScaled(
|
|||
switch (c)
|
||||
{
|
||||
case '\n':
|
||||
if (boxed)
|
||||
continue;
|
||||
cy += fontspec.lfh;
|
||||
if (cy >= bot)
|
||||
return;
|
||||
|
|
@ -2705,18 +2707,34 @@ void V_DrawStringScaled(
|
|||
descriptive = true;
|
||||
break;
|
||||
case '\xEE':
|
||||
boxed = !boxed;
|
||||
if (boxed) // draw caps
|
||||
if (boxed == 0) // Save our position and start no-op drawing
|
||||
{
|
||||
V_DrawFill((cx)/FRACUNIT-2, (cy)/FRACUNIT-2, (fontspec.right_outline)+2, fontspec.lfh/FRACUNIT, flags|outerbox);
|
||||
V_DrawFill((cx)/FRACUNIT-1, (cy)/FRACUNIT-1, (fontspec.right_outline)+1, fontspec.lfh/FRACUNIT-2, flags|innerbox);
|
||||
// TODO animate
|
||||
Draw(FixedToFloat(cx), FixedToFloat(cy)-3).patch(gen_button_keyleft[0]);
|
||||
cx += 3*FRACUNIT;
|
||||
ssave = s;
|
||||
cxsave = cx;
|
||||
boxed = 1;
|
||||
}
|
||||
else
|
||||
else if (boxed == 1) // Draw box from saved pos to current pos and roll back
|
||||
{
|
||||
cx += 2*scale;
|
||||
//V_DrawFill((cx)/FRACUNIT+(fontspec.right_outline), (cy)/FRACUNIT-2, 2, fontspec.lfh/FRACUNIT, flags|outerbox);
|
||||
//V_DrawFill((cx)/FRACUNIT+(fontspec.right_outline), (cy)/FRACUNIT-1, 1, fontspec.lfh/FRACUNIT-2, flags|innerbox);
|
||||
cx += (fontspec.right_outline)*FRACUNIT;
|
||||
fixed_t working = cxsave - 1*FRACUNIT;
|
||||
// TODO animate
|
||||
Draw(FixedToFloat(working), FixedToFloat(cy)-3)
|
||||
.width(FixedToFloat(cx - working))
|
||||
.stretch(Draw::Stretch::kWidth).patch(gen_button_keycenter[0]);
|
||||
Draw(FixedToFloat(cx), FixedToFloat(cy)-3).patch(gen_button_keyright[0]);
|
||||
s = ssave;
|
||||
cx = cxsave;
|
||||
boxed = 2;
|
||||
}
|
||||
else // Meeting the ending tag the second time, noop
|
||||
{
|
||||
boxed = 0;
|
||||
cx += (4)*FRACUNIT;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if (( c & 0xF0 ) == 0x80)
|
||||
|
|
@ -2948,14 +2966,12 @@ void V_DrawStringScaled(
|
|||
cw = SHORT (font->font[c]->width) * dupx;
|
||||
cxoff = (*fontspec.dim_fn)(scale, fontspec.chw, hchw, dupx, &cw);
|
||||
|
||||
if (boxed)
|
||||
if (boxed != 1)
|
||||
{
|
||||
V_DrawFill((cx)/FRACUNIT+(fontspec.right_outline), (cy)/FRACUNIT-2, (font->font[c]->width)-(fontspec.right_outline)+2, fontspec.lfh/FRACUNIT, flags|outerbox);
|
||||
V_DrawFill((cx)/FRACUNIT+(fontspec.right_outline), (cy)/FRACUNIT-1, (font->font[c]->width)-(fontspec.right_outline)+1, fontspec.lfh/FRACUNIT-2, flags|innerbox);
|
||||
V_DrawFixedPatch(cx + cxoff + patchxofs, cy + cyoff, scale,
|
||||
flags | ((boxed == 2) ? V_20TRANS : 0), font->font[c], colormap);
|
||||
}
|
||||
|
||||
V_DrawFixedPatch(cx + cxoff + patchxofs, cy + cyoff, scale,
|
||||
flags, font->font[c], colormap);
|
||||
cx += cw;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue