mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add kickstartaccel on profile controls
This commit is contained in:
parent
82bab536c7
commit
ed5005cb05
5 changed files with 33 additions and 2 deletions
|
|
@ -665,6 +665,7 @@ extern INT16 controlleroffsets[][2];
|
|||
|
||||
extern consvar_t cv_dummyprofilename;
|
||||
extern consvar_t cv_dummyprofileplayername;
|
||||
extern consvar_t cv_dummyprofilekickstart;
|
||||
|
||||
void M_InitOptions(INT32 choice); // necessary for multiplayer since there's some options we won't want to access
|
||||
void M_OptionsTick(void);
|
||||
|
|
|
|||
|
|
@ -531,6 +531,12 @@ menuitem_t OPTIONS_ProfileControls[] = {
|
|||
|
||||
{IT_CONTROL, "LUA/C", "May be used by add-ons.",
|
||||
NULL, M_ProfileSetControl, gc_luac, 0},
|
||||
|
||||
{IT_HEADER, "TOGGLES", "For per-player commands",
|
||||
NULL, NULL, 0, 0},
|
||||
|
||||
{IT_CONTROL | IT_CVAR, "KICKSTART ACCEL", "Hold A to auto-accel. Tap it to cancel.",
|
||||
NULL, &cv_dummyprofilekickstart, 0, 0},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2352,7 +2352,7 @@ void M_DrawProfileControls(void)
|
|||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUHINT", PU_CACHE), NULL);
|
||||
if (currentMenu->menuitems[itemOn].tooltip != NULL)
|
||||
{
|
||||
V_DrawCenteredThinString(BASEVIDWIDTH*2/3, 12, V_ALLOWLOWERCASE|V_6WIDTHSPACE, currentMenu->menuitems[itemOn].tooltip);
|
||||
V_DrawCenteredThinString(229, 12, V_ALLOWLOWERCASE|V_6WIDTHSPACE, currentMenu->menuitems[itemOn].tooltip);
|
||||
}
|
||||
|
||||
V_DrawFill(0, 0, 138, 200, 31); // Black border
|
||||
|
|
@ -2390,7 +2390,20 @@ void M_DrawProfileControls(void)
|
|||
else
|
||||
V_DrawString(x, y+1, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text);
|
||||
|
||||
if (currentMenu->menuitems[i].status & IT_CONTROL)
|
||||
if (currentMenu->menuitems[i].status & IT_CVAR) // not the proper way to check but this menu only has normal onoff cvars.
|
||||
{
|
||||
INT32 w;
|
||||
consvar_t *cv = (consvar_t *)currentMenu->menuitems[i].itemaction;
|
||||
|
||||
w = V_StringWidth(cv->string, 0);
|
||||
V_DrawString(x + 12, y + 12, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string);
|
||||
if (i == itemOn)
|
||||
{
|
||||
V_DrawCharacter(x - (skullAnimCounter/5), y+12, '\x1C' | highlightflags, false); // left arrow
|
||||
V_DrawCharacter(x + 12 + w + 2 + (skullAnimCounter/5) , y+12, '\x1D' | highlightflags, false); // right arrow
|
||||
}
|
||||
}
|
||||
else if (currentMenu->menuitems[i].status & IT_CONTROL)
|
||||
{
|
||||
// Draw what the controls are mapped to
|
||||
for (k = 0; k < MAXINPUTMAPPING; k++)
|
||||
|
|
@ -2426,6 +2439,7 @@ void M_DrawProfileControls(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
y += spacing;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ consvar_t cv_dummyspectate = CVAR_INIT ("dummyspectate", "Spectator", CV_HIDDEN,
|
|||
|
||||
consvar_t cv_dummyprofilename = CVAR_INIT ("dummyprofilename", "", CV_HIDDEN, NULL, NULL);
|
||||
consvar_t cv_dummyprofileplayername = CVAR_INIT ("dummyprofileplayername", "", CV_HIDDEN, NULL, NULL);
|
||||
consvar_t cv_dummyprofilekickstart = CVAR_INIT ("dummyprofilekickstart", "Off", CV_HIDDEN, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_dummygpdifficulty = CVAR_INIT ("dummygpdifficulty", "Normal", CV_HIDDEN, dummygpdifficulty_cons_t, NULL);
|
||||
consvar_t cv_dummykartspeed = CVAR_INIT ("dummykartspeed", "Auto", CV_HIDDEN, dummykartspeed_cons_t, NULL);
|
||||
|
|
@ -1689,6 +1690,7 @@ void M_Init(void)
|
|||
|
||||
CV_RegisterVar(&cv_dummyprofilename);
|
||||
CV_RegisterVar(&cv_dummyprofileplayername);
|
||||
CV_RegisterVar(&cv_dummyprofilekickstart);
|
||||
|
||||
CV_RegisterVar(&cv_dummygpdifficulty);
|
||||
CV_RegisterVar(&cv_dummykartspeed);
|
||||
|
|
@ -3734,11 +3736,13 @@ void M_HandleProfileSelect(INT32 ch)
|
|||
{
|
||||
CV_StealthSet(&cv_dummyprofilename, optionsmenu.profile->profilename);
|
||||
CV_StealthSet(&cv_dummyprofileplayername, optionsmenu.profile->playername);
|
||||
CV_StealthSetValue(&cv_dummyprofilekickstart, optionsmenu.profile->kickstartaccel);
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_StealthSet(&cv_dummyprofilename, "");
|
||||
CV_StealthSet(&cv_dummyprofileplayername, "");
|
||||
CV_StealthSetValue(&cv_dummyprofilekickstart, 0); // off
|
||||
}
|
||||
|
||||
M_SetupNextMenu(&OPTIONS_EditProfileDef, false);
|
||||
|
|
@ -4013,6 +4017,9 @@ boolean M_ProfileControlsInputs(INT32 ch)
|
|||
M_SetMenuDelay(pid);
|
||||
return true;
|
||||
}
|
||||
else if (M_MenuButtonPressed(pid, MBT_B) || M_MenuButtonPressed(pid, MBT_Y))
|
||||
optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value; // Make sure to save kickstart accel.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,6 +151,9 @@ void PR_ApplyProfile(UINT8 profilenum, UINT8 playernum)
|
|||
CV_StealthSet(&cv_playername[playernum], p->playername);
|
||||
// @TODO followers
|
||||
|
||||
// toggles
|
||||
CV_StealthSetValue(&cv_kickstartaccel[playernum], p->kickstartaccel);
|
||||
|
||||
// set controls...
|
||||
memcpy(&gamecontrol[playernum], p->controls, sizeof(gamecontroldefault));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue