Tidy menu code in advance of complete redesign.

This replaces all remaining magic numbers with enumerations thereof.

It also tweaks the following, even though most will be irrelevant post-rewrite:
-Remove unused menus
-Properly center the nuke icon in Duke and the star icon in NAM
-Fix the multiplayer macro editing menu:
--Position the currently editing quote its proper spot instead of beneath the first row
--Don't highlight the first quote while editing a different one
--Select the quote just edited when finished editing instead of the first one
-Fix the cursor of a centered text input field (such as the adult mode password)
-Implement proper shade glowing of selected menu entries in Joystick Settings, Joystick Axes, and Joystick Dead Zones
-Shift the the Joystick Axes menu down to avoid overlapping the title bar
-Change the title of mouse digital axis assignment "Digital Axes Setup" instead of "Advanced Mouse"
-Fix the behavior of the Next button in Joystick Dead Zones to not act like a scrollbar

git-svn-id: https://svn.eduke32.com/eduke32@4399 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-03-26 09:14:01 +00:00
parent a13465ed48
commit 69d04171c0
7 changed files with 447 additions and 338 deletions

View file

@ -935,7 +935,7 @@ nextdemo_nomenu:
if (ud.recstat != 2)
M_DisplayMenus();
if ((g_netServer || ud.multimode > 1) && g_currentMenu != 20003 && g_currentMenu != 20005 && g_currentMenu != 210)
if ((g_netServer || ud.multimode > 1) && !M_IsTextInput(g_currentMenu))
{
ControlInfo noshareinfo;
CONTROL_GetInput(&noshareinfo);

View file

@ -3676,7 +3676,7 @@ void G_DisplayRest(int32_t smoothratio)
&& ud.show_help == 0
&& g_player[myconnectindex].ps->newowner == -1)
{
if ((g_player[myconnectindex].ps->gm&MODE_MENU) == MODE_MENU && g_currentMenu < 51)
if ((g_player[myconnectindex].ps->gm&MODE_MENU) == MODE_MENU && g_currentMenu <= MENU_MAIN_INGAME)
{
I_EscapeTriggerClear();
S_PlaySound(EXITMENUSOUND);
@ -8812,7 +8812,7 @@ void G_HandleLocalKeys(void)
if (KB_UnBoundKeyPressed(sc_F1)/* || (ud.show_help && I_AdvanceTrigger())*/)
{
KB_ClearKeyDown(sc_F1);
M_ChangeMenu(400);
M_ChangeMenu(MENU_STORY);
FX_StopAllSounds();
S_ClearSoundLocks();
@ -8859,7 +8859,7 @@ FAKE_F2:
P_DoQuote(QUOTE_SAVE_DEAD,g_player[myconnectindex].ps);
return;
}
M_ChangeMenu(350);
M_ChangeMenu(MENU_SAVE);
g_screenCapture = 1;
G_DrawRooms(myconnectindex,65536);
@ -8884,7 +8884,7 @@ FAKE_F2:
KB_ClearKeyDown(sc_F3);
FAKE_F3:
M_ChangeMenu(300);
M_ChangeMenu(MENU_LOAD);
FX_StopAllSounds();
S_ClearSoundLocks();
@ -8936,7 +8936,7 @@ FAKE_F3:
if (g_lastSaveSlot >= 0)
{
/* inputloc = Bstrlen(&ud.savegame[g_lastSaveSlot][0]);
g_currentMenu = 360+g_lastSaveSlot;
g_currentMenu = MENU_SAVETYPING+g_lastSaveSlot;
probey = g_lastSaveSlot; */
G_SavePlayerMaybeMulti(g_lastSaveSlot);
@ -9005,7 +9005,7 @@ FAKE_F3:
if (KB_UnBoundKeyPressed(sc_F10))
{
KB_ClearKeyDown(sc_F10);
M_ChangeMenu(500);
M_ChangeMenu(MENU_QUIT);
FX_StopAllSounds();
S_ClearSoundLocks();
g_player[myconnectindex].ps->gm |= MODE_MENU;
@ -9071,7 +9071,7 @@ FAKE_F3:
if (KB_UnBoundKeyPressed(sc_F11))
{
KB_ClearKeyDown(sc_F11);
M_ChangeMenu(232);
M_ChangeMenu(MENU_COLCORR_INGAME);
FX_StopAllSounds();
S_ClearSoundLocks();
g_player[myconnectindex].ps->gm |= MODE_MENU;

View file

@ -992,7 +992,7 @@ static int32_t VM_ResetPlayer(int32_t g_p, int32_t g_flags)
{
g_player[g_p].ps->gm |= MODE_MENU;
KB_ClearKeyDown(sc_Space);
M_ChangeMenu(15000);
M_ChangeMenu(MENU_RESETPLAYER);
}
else g_player[g_p].ps->gm = MODE_RESTART;
#if !defined LUNATIC

View file

@ -256,6 +256,7 @@ int32_t _EnterText(int32_t small,int32_t x,int32_t y,char *t,int32_t dalen,int32
{
char ch;
int32_t i;
const int32_t startx = x;
while ((ch = KB_GetCh()) != 0)
{
@ -320,6 +321,9 @@ int32_t _EnterText(int32_t small,int32_t x,int32_t y,char *t,int32_t dalen,int32
y += 8;
}
if (startx == 160) // gametext center
x = startx + ((x - startx)>>1);
if (small&1)
rotatesprite_fs(textsc(x)<<16,(y<<16),32768,0,SPINNINGNUKEICON+((totalclock>>3)%7),c,0,(8|16));
else rotatesprite_fs((x+8)<<16,(y+4)<<16,32768,0,SPINNINGNUKEICON+((totalclock>>3)%7),c,0,2+8);

File diff suppressed because it is too large Load diff

View file

@ -40,13 +40,51 @@ enum MenuIndex_t {
MENU_OPTIONS = 202,
MENU_VIDEOSETUP = 203,
MENU_KEYBOARDSETUP = 204,
MENU_MOUSESETUP = 205,
MENU_JOYSTICKSETUP = 206,
MENU_JOYSTICKBTNS = 207,
MENU_JOYSTICKAXES = 208,
MENU_JOYSTICKAXES2 = 209,
MENU_KEYBOARDASSIGN = 210,
MENU_MOUSEASSIGN = 211,
MENU_MOUSEADVANCED = 212,
MENU_JOYSTICKDEAD = 213,
MENU_JOYSTICKDEAD2 = 214,
MENU_JOYSTICKDEAD3 = 215,
MENU_JOYSTICKDEAD4 = 216,
MENU_JOYSTICKAXES3 = 217,
MENU_JOYSTICKAXES4 = 218,
MENU_JOYSTICKAXES5 = 219,
MENU_JOYSTICKAXES6 = 220,
MENU_JOYSTICKAXES7 = 221,
MENU_JOYSTICKAXES8 = 222,
MENU_RENDERERSETUP = 230,
MENU_COLCORR = 231,
MENU_COLCORR_INGAME = 232,
MENU_LOAD = 300,
MENU_SAVE = 350,
MENU_SAVE_ = 351,
MENU_SAVETYPING = 360,
MENU_SAVETYPING2 = 361,
MENU_SAVETYPING3 = 362,
MENU_SAVETYPING4 = 363,
MENU_SAVETYPING5 = 364,
MENU_SAVETYPING6 = 365,
MENU_SAVETYPING7 = 366,
MENU_SAVETYPING8 = 367,
MENU_SAVETYPING9 = 368,
MENU_SAVETYPING10 = 369,
MENU_STORY = 400,
MENU_F1HELP = 401,
MENU_ORDERING = 402,
MENU_ORDERING2 = 403,
MENU_QUIT = 500,
MENU_QUITTOTITLE = 501,
MENU_QUIT2 = 502,
MENU_NETSETUP = 600,
MENU_NETWAITMASTER = 601,
MENU_PRENETSETUP = 602,
MENU_NETWAITVOTES = 603,
MENU_SOUND = 700,
MENU_SOUND_INGAME = 701,
MENU_CREDITS = 990,
@ -59,9 +97,42 @@ enum MenuIndex_t {
MENU_CREDITS8 = 997,
MENU_CREDITS9 = 998,
MENU_CREDITS10 = 999,
MENU_LOADVERIFY = 1000,
MENU_LOADVERIFY2 = 1001,
MENU_LOADVERIFY3 = 1002,
MENU_LOADVERIFY4 = 1003,
MENU_LOADVERIFY5 = 1004,
MENU_LOADVERIFY6 = 1005,
MENU_LOADVERIFY7 = 1006,
MENU_LOADVERIFY8 = 1007,
MENU_LOADVERIFY9 = 1008,
MENU_LOADVERIFY10 = 1009,
MENU_NEWVERIFY = 1500,
MENU_SAVEVERIFY = 2000,
MENU_SAVEVERIFY2 = 2001,
MENU_SAVEVERIFY3 = 2002,
MENU_SAVEVERIFY4 = 2003,
MENU_SAVEVERIFY5 = 2004,
MENU_SAVEVERIFY6 = 2005,
MENU_SAVEVERIFY7 = 2006,
MENU_SAVEVERIFY8 = 2007,
MENU_SAVEVERIFY9 = 2008,
MENU_SAVEVERIFY10 = 2009,
MENU_ADULTMODE = 10000,
MENU_ADULTPASSWORD = 10001,
MENU_RESETPLAYER = 15000,
MENU_RESETPLAYER2 = 15001,
MENU_BUYDUKE = 20000,
MENU_NETWORK = 20001,
MENU_PLAYER = 20002,
MENU_PLAYERNAME = 20003,
MENU_MACROS = 20004,
MENU_MACROSTYPING = 20005,
MENU_NETHOST = 20010,
MENU_NETOPTIONS = 20011,
MENU_NETJOIN = 20020,
MENU_NETJOINSERVER = 20021,
MENU_NETJOINPORT = 20022,
};
extern char inputloc;
@ -72,6 +143,7 @@ extern int32_t probey;
extern int32_t voting;
int32_t menutext_(int32_t x,int32_t y,int32_t s,int32_t p,char *t,int32_t bits);
void M_ChangeMenu(int32_t cm);
int32_t M_IsTextInput(int32_t cm);
void G_CheckPlayerColor(int32_t *color,int32_t prev_color);
void M_DisplayMenus(void);

View file

@ -137,7 +137,7 @@ static int32_t osdcmd_changelevel(const osdfuncparm_t *parm)
ud.m_noexits = 0;
g_player[myconnectindex].ps->gm |= MODE_MENU;
M_ChangeMenu(603);
M_ChangeMenu(MENU_NETWAITVOTES);
}
*/
return OSDCMD_OK;
@ -273,7 +273,7 @@ static int32_t osdcmd_map(const osdfuncparm_t *parm)
ud.m_noexits = 0;
g_player[myconnectindex].ps->gm |= MODE_MENU;
M_ChangeMenu(603);
M_ChangeMenu(MENU_NETWAITVOTES);
}
*/
return OSDCMD_OK;