Seperated help screens for game, netgame and demo; Also show them in Controls menu; Small Menu UI fix for ScrollOffset when calling menus in a scrolled area of a menu
This commit is contained in:
parent
9df5d7fde4
commit
4bf841f3c9
|
@ -1,5 +1,9 @@
|
|||
D2X-Rebirth Changelog
|
||||
|
||||
20081213
|
||||
--------
|
||||
main/game.c, main/game.h, main/gamecntl.c, main/menu.c: Seperated help screens for game, netgame and demo; Also show them in Controls menu; Small Menu UI fix for ScrollOffset when calling menus in a scrolled area of a menu
|
||||
|
||||
20081212
|
||||
--------
|
||||
main/multi.c: Added /KillReactor command to blow up the reactor in Multiplayer games
|
||||
|
|
78
main/game.c
78
main/game.c
|
@ -953,10 +953,11 @@ extern int newmenu_dotiny2( char * title, char * subtitle, int nitems, newmenu_i
|
|||
void show_help()
|
||||
{
|
||||
int nitems = 0;
|
||||
newmenu_item m[33];
|
||||
newmenu_item m[25];
|
||||
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = TXT_HELP_ESC;
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "SHIFT-ESC\t SHOW GAME LOG";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F1\t THIS SCREEN";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = TXT_HELP_F2;
|
||||
#if !(defined(__APPLE__) || defined(macintosh))
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "Alt-F2/F3\t SAVE/LOAD GAME";
|
||||
|
@ -989,14 +990,6 @@ void show_help()
|
|||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "\x85-Up/Down\t Play/Pause " EXT_MUSIC_TEXT;
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "\x85-Left/Right\t Previous/Next Song";
|
||||
#endif
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "MULTIPLAYER:";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "ALT-0\t DROP FLAG";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "ALT-F4\t SHOW RETICLE NAMES";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F7\t TOGGLE KILL LIST";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F8\t SEND MESSAGE";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "(SHIFT-)F8 to F12\t (DEFINE)SEND MACRO";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "PAUSE\t SHOW NETGAME INFORMATION";
|
||||
#if (defined(__APPLE__) || defined(macintosh))
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "(Use \x85-# for F#. e.g. \x85-1 for F1)";
|
||||
|
@ -1009,29 +1002,62 @@ void show_help()
|
|||
palette_restore();
|
||||
}
|
||||
|
||||
void show_netgame_help()
|
||||
{
|
||||
int nitems = 0;
|
||||
newmenu_item m[17];
|
||||
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F1\t THIS SCREEN";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "ALT-0\t DROP FLAG";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "ALT-F4\t SHOW RETICLE NAMES";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F7\t TOGGLE KILL LIST";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F8\t SEND MESSAGE";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "(SHIFT-)F8 to F12\t (DEFINE)SEND MACRO";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "PAUSE\t SHOW NETGAME INFORMATION";
|
||||
#if (defined(__APPLE__) || defined(macintosh))
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "(Use \x85-# for F#. e.g. \x85-1 for F1)";
|
||||
#endif
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "MULTIPLAYER MESSAGE COMMANDS:";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "!Names\t TOGGLE NAMES RETURN";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "Handicap: (*)\t SET YOUR STARTING SHIELDS TO (*) [10-100]";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "NoBombs\t TOGGLE SMART BOMBS (Host-only)";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "move: (*)\t MOVE PLAYER (*) TO OTHER TEAM (Host-only)";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "kick: (*)\t KICK PLAYER (*) FROM GAME (Host-only)";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "KillReactor\t BLOW UP THE MINE (Host-only)";
|
||||
|
||||
full_palette_save();
|
||||
|
||||
newmenu_dotiny2( NULL, TXT_KEYS, nitems, m, NULL );
|
||||
|
||||
palette_restore();
|
||||
}
|
||||
|
||||
void show_newdemo_help()
|
||||
{
|
||||
newmenu_item m[14];
|
||||
int mc = 0;
|
||||
newmenu_item m[15];
|
||||
int nitems = 0;
|
||||
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "ESC\t QUIT DEMO PLAYBACK"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_F2; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "F3\t SWITCH COCKPIT MODES"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "F4\t TOGGLE PERCENTAGE DISPLAY"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "UP\t PLAY"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "DOWN\t PAUSE"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "RIGHT\t ONE FRAME FORWARD"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "LEFT\t ONE FRAME BACKWARD"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "SHIFT-RIGHT\t FAST FORWARD"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "SHIFT-LEFT\t FAST BACKWARD"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "CTRL-RIGHT\t JUMP TO END"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "CTRL-LEFT\t JUMP TO START"; mc++;
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "ESC\t QUIT DEMO PLAYBACK";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F1\t THIS SCREEN";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = TXT_HELP_F2;
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F3\t SWITCH COCKPIT MODES";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "F4\t TOGGLE PERCENTAGE DISPLAY";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "UP\t PLAY";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "DOWN\t PAUSE";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "RIGHT\t ONE FRAME FORWARD";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "LEFT\t ONE FRAME BACKWARD";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "SHIFT-RIGHT\t FAST FORWARD";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "SHIFT-LEFT\t FAST BACKWARD";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "CTRL-RIGHT\t JUMP TO END";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "CTRL-LEFT\t JUMP TO START";
|
||||
#if (defined(__APPLE__) || defined(macintosh))
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = ""; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "(Use \x85-# for F#. e.g. \x85-1 for F1)"; mc++;
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "";
|
||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "(Use \x85-# for F#. e.g. \x85-1 for F1)";
|
||||
#endif
|
||||
full_palette_save();
|
||||
newmenu_dotiny2( NULL, "DEMO PLAYBACK CONTROLS", mc, m, NULL );
|
||||
newmenu_dotiny2( NULL, "DEMO PLAYBACK CONTROLS", nitems, m, NULL );
|
||||
palette_restore();
|
||||
}
|
||||
|
||||
|
|
|
@ -183,6 +183,7 @@ void palette_restore(void);
|
|||
|
||||
// put up the help message
|
||||
void show_help();
|
||||
void show_netgame_help();
|
||||
void show_newdemo_help();
|
||||
|
||||
// show a message in a nice little box
|
||||
|
|
|
@ -993,7 +993,7 @@ int HandleSystemKey(int key)
|
|||
}
|
||||
|
||||
MAC(case KEY_COMMAND+KEY_1:)
|
||||
case KEY_F1: show_help(); break;
|
||||
case KEY_F1: if (Game_mode & GM_MULTI) show_netgame_help(); else show_help(); break;
|
||||
|
||||
MAC(case KEY_COMMAND+KEY_2:)
|
||||
case KEY_F2: //Config_menu_flag = 1; break;
|
||||
|
|
18
main/menu.c
18
main/menu.c
|
@ -583,9 +583,9 @@ void input_menuset(int nitems, newmenu_item * items, int *last_key, int citem )
|
|||
|
||||
void input_config()
|
||||
{
|
||||
newmenu_item m[17];
|
||||
newmenu_item m[21];
|
||||
int i, i1 = 5, j;
|
||||
int nitems = 17;
|
||||
int nitems = 21;
|
||||
|
||||
m[0].type = NM_TYPE_RADIO; m[0].text = "KEYBOARD"; m[0].value = 0; m[0].group = 0;
|
||||
m[1].type = NM_TYPE_RADIO; m[1].text = "JOYSTICK"; m[1].value = 0; m[1].group = 0;
|
||||
|
@ -604,7 +604,10 @@ void input_config()
|
|||
m[14].type = NM_TYPE_TEXT; m[14].text = "Mouse";
|
||||
m[15].type = NM_TYPE_SLIDER; m[15].text="X Sensitivity"; m[15].value=PlayerCfg.MouseSensitivityX; m[15].min_value = 0; m[15].max_value = 16;
|
||||
m[16].type = NM_TYPE_SLIDER; m[16].text="Y Sensitivity"; m[16].value=PlayerCfg.MouseSensitivityY; m[16].min_value = 0; m[16].max_value = 16;
|
||||
|
||||
m[17].type = NM_TYPE_TEXT; m[17].text = "";
|
||||
m[18].type = NM_TYPE_MENU; m[18].text = "GAME SYSTEM KEYS";
|
||||
m[19].type = NM_TYPE_MENU; m[19].text = "NETGAME SYSTEM KEYS";
|
||||
m[20].type = NM_TYPE_MENU; m[20].text = "DEMO SYSTEM KEYS";
|
||||
|
||||
do {
|
||||
|
||||
|
@ -640,6 +643,15 @@ void input_config()
|
|||
case 7:
|
||||
kconfig(4, "WEAPON KEYS");
|
||||
break;
|
||||
case 18:
|
||||
show_help();
|
||||
break;
|
||||
case 19:
|
||||
show_netgame_help();
|
||||
break;
|
||||
case 20:
|
||||
show_newdemo_help();
|
||||
break;
|
||||
}
|
||||
|
||||
} while (i1>-1);
|
||||
|
|
|
@ -712,6 +712,14 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item,
|
|||
IsScrollBox=1;
|
||||
h=((MaxOnMenu+(subtitle?1:0))*LINE_SPACING);
|
||||
MaxDisplayable=MaxOnMenu;
|
||||
|
||||
// if our last citem was > MaxOnMenu, make sure we re-scroll when we call this menu again
|
||||
if (citem > MaxOnMenu-4)
|
||||
{
|
||||
ScrollOffset = citem - (MaxOnMenu-4);
|
||||
if (ScrollOffset + MaxOnMenu > nitems)
|
||||
ScrollOffset = nitems - MaxOnMenu;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue