mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Automate the silly joystick menu items definition
This commit is contained in:
parent
c5effff659
commit
cf14b6257c
1 changed files with 14 additions and 8 deletions
22
src/m_menu.c
22
src/m_menu.c
|
|
@ -1118,14 +1118,7 @@ static menuitem_t OP_Joystick2Menu[] =
|
||||||
{IT_STRING | IT_CVAR, NULL, "Third-Person Vert-Look", &cv_chasefreelook2, 130},
|
{IT_STRING | IT_CVAR, NULL, "Third-Person Vert-Look", &cv_chasefreelook2, 130},
|
||||||
};
|
};
|
||||||
|
|
||||||
static menuitem_t OP_JoystickSetMenu[] =
|
static menuitem_t OP_JoystickSetMenu[1+MAX_JOYSTICKS];
|
||||||
{
|
|
||||||
{IT_CALL | IT_NOTHING, "None", NULL, M_AssignJoystick, '0'},
|
|
||||||
{IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '1'},
|
|
||||||
{IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '2'},
|
|
||||||
{IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '3'},
|
|
||||||
{IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '4'},
|
|
||||||
};
|
|
||||||
|
|
||||||
static menuitem_t OP_MouseOptionsMenu[] =
|
static menuitem_t OP_MouseOptionsMenu[] =
|
||||||
{
|
{
|
||||||
|
|
@ -3550,6 +3543,8 @@ void M_Ticker(void)
|
||||||
//
|
//
|
||||||
void M_Init(void)
|
void M_Init(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
CV_RegisterVar(&cv_nextmap);
|
CV_RegisterVar(&cv_nextmap);
|
||||||
CV_RegisterVar(&cv_newgametype);
|
CV_RegisterVar(&cv_newgametype);
|
||||||
CV_RegisterVar(&cv_chooseskin);
|
CV_RegisterVar(&cv_chooseskin);
|
||||||
|
|
@ -3599,6 +3594,17 @@ void M_Init(void)
|
||||||
OP_ScreenshotOptionsMenu[op_screenshot_colorprofile].status = IT_GRAYEDOUT;
|
OP_ScreenshotOptionsMenu[op_screenshot_colorprofile].status = IT_GRAYEDOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
Well the menu sucks for forcing us to have an item set
|
||||||
|
at all if every item just calls the same function, and
|
||||||
|
nothing more. Now just automate the definition.
|
||||||
|
*/
|
||||||
|
for (i = 0; i <= MAX_JOYSTICKS; ++i)
|
||||||
|
{
|
||||||
|
OP_JoystickSetMenu[i].status = ( IT_NOTHING|IT_CALL );
|
||||||
|
OP_JoystickSetMenu[i].itemaction = M_AssignJoystick;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
#ifndef NONET
|
||||||
CV_RegisterVar(&cv_serversort);
|
CV_RegisterVar(&cv_serversort);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue