introduced newmenu_dotiny() from D2X to show menus with GAME_FONT; extended Help-menu and removed D1X-Help-menu
This commit is contained in:
parent
add8710081
commit
85873c29f6
|
@ -1,5 +1,9 @@
|
|||
D1X-Rebirth Changelog
|
||||
|
||||
20070230
|
||||
--------
|
||||
main/game.c, main/newmenu.c, main/newmenu.h: introduced newmenu_dotiny() from D2X to show menus with GAME_FONT; extended Help-menu and removed D1X-Help-menu
|
||||
|
||||
20070329
|
||||
--------
|
||||
main/automap.c, main/game.c, main/newmenu.c: palette-related fixes for Doublebuffered menus; fixes for SDL-build
|
||||
|
|
87
main/game.c
87
main/game.c
|
@ -1469,21 +1469,6 @@ void advance_sound()
|
|||
|
||||
void test_anim_states();
|
||||
|
||||
void show_d1x_help()
|
||||
{
|
||||
newmenu_item m[14];
|
||||
|
||||
m[ 0].type = NM_TYPE_TEXT; m[ 0].text = "SHIFT-F3\t Toggle Radar";
|
||||
m[ 1].type = NM_TYPE_TEXT; m[ 1].text = "SHIFT-F5\t (un)Pause demo recording";
|
||||
m[ 2].type = NM_TYPE_TEXT; m[ 2].text = "CTRL-ALT-`\t Start/Stop Hud-Logging";
|
||||
m[ 3].type = NM_TYPE_TEXT; m[ 3].text = "";
|
||||
m[ 4].type = NM_TYPE_TEXT; m[ 4].text = "Multiplayer:";
|
||||
m[ 6].type = NM_TYPE_TEXT; m[ 6].text = "ALT-F6\t Accept new player";
|
||||
m[ 7].type = NM_TYPE_TEXT; m[ 7].text = "CTRL-N\t Game-Master Menu";
|
||||
|
||||
newmenu_do( NULL, TXT_KEYS, 8, m, NULL );
|
||||
}
|
||||
|
||||
//put up the help message
|
||||
void do_show_help()
|
||||
{
|
||||
|
@ -1806,43 +1791,36 @@ int do_game_pause(int allow_menu)
|
|||
return key;
|
||||
}
|
||||
|
||||
|
||||
void show_help()
|
||||
{
|
||||
newmenu_item m[14];
|
||||
|
||||
if ( VR_render_mode != VR_NONE ) {
|
||||
m[ 0].type = NM_TYPE_TEXT; m[ 0].text = TXT_HELP_ESC;
|
||||
m[ 1].type = NM_TYPE_TEXT; m[ 1].text = TXT_HELP_ALT_F2;
|
||||
m[ 2].type = NM_TYPE_TEXT; m[ 2].text = TXT_HELP_ALT_F3;
|
||||
m[ 3].type = NM_TYPE_TEXT; m[ 3].text = TXT_HELP_F2;
|
||||
m[ 4].type = NM_TYPE_TEXT; m[ 4].text = TXT_HELP_F4;
|
||||
m[ 5].type = NM_TYPE_TEXT; m[ 5].text = TXT_HELP_F5;
|
||||
m[ 6].type = NM_TYPE_TEXT; m[ 6].text = TXT_HELP_PAUSE;
|
||||
m[ 7].type = NM_TYPE_TEXT; m[ 7].text = TXT_HELP_1TO5;
|
||||
m[ 8].type = NM_TYPE_TEXT; m[ 8].text = TXT_HELP_6TO10;
|
||||
m[ 9].type = NM_TYPE_TEXT; m[ 9].text = "";
|
||||
m[10].type = NM_TYPE_TEXT; m[10].text = TXT_HELP_TO_VIEW;
|
||||
newmenu_do( NULL, TXT_KEYS, 11, m, NULL );
|
||||
} else {
|
||||
m[ 0].type = NM_TYPE_TEXT; m[ 0].text = TXT_HELP_ESC;
|
||||
m[ 1].type = NM_TYPE_TEXT; m[ 1].text = TXT_HELP_ALT_F2;
|
||||
m[ 2].type = NM_TYPE_TEXT; m[ 2].text = TXT_HELP_ALT_F3;
|
||||
m[ 3].type = NM_TYPE_TEXT; m[ 3].text = TXT_HELP_F2;
|
||||
m[ 4].type = NM_TYPE_TEXT; m[ 4].text = TXT_HELP_F3;
|
||||
// m[ 5].type = NM_TYPE_TEXT; m[ 5].text = TXT_HELP_F4;
|
||||
m[ 5].type = NM_TYPE_TEXT; m[ 5].text = TXT_HELP_F5;
|
||||
m[ 6].type = NM_TYPE_TEXT; m[ 6].text = TXT_HELP_PAUSE;
|
||||
m[ 7].type = NM_TYPE_TEXT; m[ 7].text = "ALT-F9/F10\t change screen size"; // ZICO - we changed keys - old: TXT_HELP_MINUSPLUS;
|
||||
m[ 8].type = NM_TYPE_TEXT; m[ 8].text = TXT_HELP_PRTSCN;
|
||||
m[ 9].type = NM_TYPE_TEXT; m[ 9].text = TXT_HELP_1TO5;
|
||||
m[10].type = NM_TYPE_TEXT; m[10].text = TXT_HELP_6TO10;
|
||||
m[11].type = NM_TYPE_TEXT; m[11].text = "SHIFT-F1\t SHOW D1X HELP";
|
||||
m[12].type = NM_TYPE_TEXT; m[12].text = "";
|
||||
m[13].type = NM_TYPE_TEXT; m[13].text = TXT_HELP_TO_VIEW;
|
||||
newmenu_do( NULL, TXT_KEYS, 14, m, NULL );
|
||||
}
|
||||
newmenu_item m[25];
|
||||
int mc = 0;
|
||||
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_ESC; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_ALT_F2; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_ALT_F3; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_F2; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_F3; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "SHIFT-F3\t TOGGLE RADAR"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_F5; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "SHIFT-F5\t (UN)PAUSE DEMO RECORDING"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "ALT-F7\t switch hud-mode"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "ALT-F9/F10\t change screen size"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_PAUSE; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_PRTSCN; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_1TO5; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = TXT_HELP_6TO10; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = ""; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "MULTIPLAYER:"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "CTRL-N\t GAME-MASTER MENU"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "F7\t SHOW KILL LIST"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "CTRL-F7\t SHOW PING STATS"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "F8\t SEND MESSAGE"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "ALT-F6\t ACCEPT JOINING PLAYER"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "SHIFT-ALT-F6\t DUMP JOINING PLAYER"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "F8 to F12\t SEND MACRO"; mc++;
|
||||
m[mc].type = NM_TYPE_TEXT; m[mc].text = "SHIFT-F8 to SHIFT-F12\t DEFINE MACRO"; mc++;
|
||||
newmenu_dotiny( NULL, TXT_KEYS, mc, m, NULL );
|
||||
}
|
||||
|
||||
//temp function until Matt cleans up game sequencing
|
||||
|
@ -2444,7 +2422,6 @@ void HandleGameKey(int key)
|
|||
}
|
||||
break;
|
||||
case KEY_F1: do_show_help(); break;
|
||||
case KEY_SHIFTED+KEY_F1: show_d1x_help(); break;
|
||||
case KEY_F2: Config_menu_flag = 1; break;
|
||||
case KEY_F3: toggle_cockpit(); break;
|
||||
case KEY_SHIFTED+KEY_F3: if(!(Game_mode & GM_MULTI)||Network_allow_radar||I_am_observer)
|
||||
|
@ -2536,11 +2513,8 @@ void HandleGameKey(int key)
|
|||
#endif
|
||||
break; // redefine taunt macros
|
||||
case KEY_PAUSE: do_game_pause(1); break;
|
||||
case KEY_CTRLED + KEY_F12:
|
||||
case KEY_PRINT_SCREEN: save_screen_shot(0); break;
|
||||
|
||||
case KEY_SHIFTED+KEY_MINUS:
|
||||
case KEY_MINUS:
|
||||
case KEY_ALTED+KEY_F9:
|
||||
#ifdef GP2X
|
||||
digi_set_digi_volume( digi_volume-2048 );
|
||||
|
@ -2548,8 +2522,6 @@ void HandleGameKey(int key)
|
|||
shrink_window();
|
||||
#endif
|
||||
break;
|
||||
case KEY_SHIFTED+KEY_EQUAL:
|
||||
case KEY_EQUAL:
|
||||
case KEY_ALTED+KEY_F10:
|
||||
#ifdef GP2X
|
||||
digi_set_digi_volume( digi_volume+2048 );
|
||||
|
@ -2557,11 +2529,6 @@ void HandleGameKey(int key)
|
|||
grow_window();
|
||||
#endif
|
||||
break;
|
||||
case KEY_CTRLED+KEY_SHIFTED+KEY_PADMULTIPLY:
|
||||
case KEY_ALTED+KEY_CTRLED+KEY_PADMULTIPLY:
|
||||
case KEY_ALTED+KEY_SHIFTED+KEY_PADMULTIPLY:
|
||||
change_res();
|
||||
break;
|
||||
case KEYS_GR_TOGGLE_FULLSCREEN:
|
||||
gr_toggle_fullscreen_game();
|
||||
break;
|
||||
|
|
191
main/newmenu.c
191
main/newmenu.c
|
@ -340,68 +340,79 @@ void nm_string_inputbox( bkg *b, int w, int x, int y, char * text, int current )
|
|||
}
|
||||
}
|
||||
|
||||
void draw_item( bkg * b, newmenu_item *item, int is_current )
|
||||
void draw_item( bkg * b, newmenu_item *item, int is_current, int tiny )
|
||||
{
|
||||
if (is_current)
|
||||
grd_curcanv->cv_font = CURRENT_FONT;
|
||||
if (tiny)
|
||||
{
|
||||
if (is_current)
|
||||
gr_set_fontcolor(gr_find_closest_color_current(57,49,20),-1);
|
||||
else
|
||||
gr_set_fontcolor(gr_find_closest_color_current(29,29,47),-1);
|
||||
|
||||
if (item->text[0]=='\t')
|
||||
gr_set_fontcolor (gr_find_closest_color_current(63,63,63),-1);
|
||||
}
|
||||
else
|
||||
grd_curcanv->cv_font = NORMAL_FONT;
|
||||
{
|
||||
if (is_current)
|
||||
grd_curcanv->cv_font = CURRENT_FONT;
|
||||
else
|
||||
grd_curcanv->cv_font = NORMAL_FONT;
|
||||
}
|
||||
|
||||
switch( item->type ) {
|
||||
case NM_TYPE_TEXT:
|
||||
grd_curcanv->cv_font=TEXT_FONT;
|
||||
// fall through on purpose
|
||||
case NM_TYPE_MENU:
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
break;
|
||||
case NM_TYPE_SLIDER: {
|
||||
int i,j;
|
||||
if (item->value < item->min_value) item->value=item->min_value;
|
||||
if (item->value > item->max_value) item->value=item->max_value;
|
||||
i = sprintf( item->saved_text, "%s\t%s", item->text, SLIDER_LEFT );
|
||||
for (j=0; j<(item->max_value-item->min_value+1); j++ ) {
|
||||
i += sprintf( item->saved_text + i, "%s", SLIDER_MIDDLE );
|
||||
}
|
||||
sprintf( item->saved_text + i, "%s", SLIDER_RIGHT );
|
||||
|
||||
item->saved_text[item->value+1+strlen(item->text)+1] = SLIDER_MARKER[0];
|
||||
|
||||
nm_string_slider( b, item->w, item->x, item->y, item->saved_text );
|
||||
}
|
||||
break;
|
||||
case NM_TYPE_INPUT_MENU:
|
||||
if ( item->group==0 ) {
|
||||
case NM_TYPE_TEXT:
|
||||
case NM_TYPE_MENU:
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
} else {
|
||||
break;
|
||||
case NM_TYPE_SLIDER: {
|
||||
int i,j;
|
||||
if (item->value < item->min_value) item->value=item->min_value;
|
||||
if (item->value > item->max_value) item->value=item->max_value;
|
||||
i = sprintf( item->saved_text, "%s\t%s", item->text, SLIDER_LEFT );
|
||||
for (j=0; j<(item->max_value-item->min_value+1); j++ ) {
|
||||
i += sprintf( item->saved_text + i, "%s", SLIDER_MIDDLE );
|
||||
}
|
||||
sprintf( item->saved_text + i, "%s", SLIDER_RIGHT );
|
||||
|
||||
item->saved_text[item->value+1+strlen(item->text)+1] = SLIDER_MARKER[0];
|
||||
|
||||
nm_string_slider( b, item->w, item->x, item->y, item->saved_text );
|
||||
}
|
||||
break;
|
||||
case NM_TYPE_INPUT_MENU:
|
||||
if ( item->group==0 ) {
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
} else {
|
||||
nm_string_inputbox( b, item->w, item->x, item->y, item->text, is_current );
|
||||
}
|
||||
break;
|
||||
case NM_TYPE_INPUT:
|
||||
nm_string_inputbox( b, item->w, item->x, item->y, item->text, is_current );
|
||||
}
|
||||
break;
|
||||
case NM_TYPE_INPUT:
|
||||
nm_string_inputbox( b, item->w, item->x, item->y, item->text, is_current );
|
||||
break;
|
||||
case NM_TYPE_CHECK:
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
if (item->value)
|
||||
nm_rstring( b,item->right_offset,item->x, item->y, CHECKED_CHECK_BOX );
|
||||
else
|
||||
nm_rstring( b,item->right_offset,item->x, item->y, NORMAL_CHECK_BOX );
|
||||
break;
|
||||
case NM_TYPE_RADIO:
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
if (item->value)
|
||||
nm_rstring( b,item->right_offset, item->x, item->y, CHECKED_RADIO_BOX );
|
||||
else
|
||||
nm_rstring( b,item->right_offset, item->x, item->y, NORMAL_RADIO_BOX );
|
||||
break;
|
||||
case NM_TYPE_NUMBER: {
|
||||
char text[10];
|
||||
if (item->value < item->min_value) item->value=item->min_value;
|
||||
if (item->value > item->max_value) item->value=item->max_value;
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
sprintf( text, "%d", item->value );
|
||||
nm_rstring( b,item->right_offset,item->x, item->y, text );
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case NM_TYPE_CHECK:
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
if (item->value)
|
||||
nm_rstring( b,item->right_offset,item->x, item->y, CHECKED_CHECK_BOX );
|
||||
else
|
||||
nm_rstring( b,item->right_offset,item->x, item->y, NORMAL_CHECK_BOX );
|
||||
break;
|
||||
case NM_TYPE_RADIO:
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
if (item->value)
|
||||
nm_rstring( b,item->right_offset, item->x, item->y, CHECKED_RADIO_BOX );
|
||||
else
|
||||
nm_rstring( b,item->right_offset, item->x, item->y, NORMAL_RADIO_BOX );
|
||||
break;
|
||||
case NM_TYPE_NUMBER: {
|
||||
char text[10];
|
||||
if (item->value < item->min_value) item->value=item->min_value;
|
||||
if (item->value > item->max_value) item->value=item->max_value;
|
||||
nm_string( b, item->w, item->x, item->y, item->text );
|
||||
sprintf( text, "%d", item->value );
|
||||
nm_rstring( b,item->right_offset,item->x, item->y, text );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -486,6 +497,8 @@ void draw_close_box(int x,int y)
|
|||
gr_rect(x + CLOSE_X + (1), y + CLOSE_Y + (1), x + CLOSE_X + CLOSE_SIZE - (1), y + CLOSE_Y + CLOSE_SIZE - (1));
|
||||
}
|
||||
|
||||
int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height, int TinyMode);
|
||||
|
||||
int newmenu_do( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem) )
|
||||
{
|
||||
return newmenu_do3( title, subtitle, nitems, item, subfunction, 0, NULL, -1, -1 );
|
||||
|
@ -502,8 +515,23 @@ int newmenu_do2( char * title, char * subtitle, int nitems, newmenu_item * item,
|
|||
return newmenu_do3( title, subtitle, nitems, item, subfunction, citem, filename, -1, -1 );
|
||||
}
|
||||
|
||||
int newmenu_do_fixedfont( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height){
|
||||
set_screen_mode(SCREEN_MENU);//hafta set the screen mode before calling or fonts might get changed/freed up if screen res changes
|
||||
return newmenu_do3_real( title, subtitle, nitems, item, subfunction, citem, filename, width,height, 0);
|
||||
}
|
||||
|
||||
int newmenu_do3( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height){
|
||||
set_screen_mode(SCREEN_MENU);//hafta set the screen mode before calling or fonts might get changed/freed up if screen res changes
|
||||
return newmenu_do3_real( title, subtitle, nitems, item, subfunction, citem, filename, width,height, 0);
|
||||
}
|
||||
|
||||
int newmenu_dotiny( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem) )
|
||||
{
|
||||
return newmenu_do3_real( title, subtitle, nitems, item, subfunction, 0, NULL, -1, -1, 1 );
|
||||
}
|
||||
|
||||
//Edited 2000/10/27 Matthew Mueller - made newmenu_do3 allow you to set the fonts used, thus allowing newmenu_do_fixedfont to be removed, saving a lot of duplication.
|
||||
int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height, grs_font *title_font, grs_font *subtitle_font, grs_font *menu_font, grs_font *normal_font)
|
||||
int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height, int TinyMode)
|
||||
{
|
||||
int old_keyd_repeat, done;
|
||||
int choice,old_choice,i,j,x,y,w,h,aw, tw, th, twidth,fm,right_offset;
|
||||
|
@ -542,13 +570,13 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
tw = th = 0;
|
||||
|
||||
if ( title ) {
|
||||
grd_curcanv->cv_font = title_font;
|
||||
grd_curcanv->cv_font = TITLE_FONT;
|
||||
gr_get_string_size(title,&string_width,&string_height,&average_width );
|
||||
tw = string_width;
|
||||
th = string_height;
|
||||
}
|
||||
if ( subtitle ) {
|
||||
grd_curcanv->cv_font = subtitle_font;
|
||||
grd_curcanv->cv_font = SUBTITLE_FONT;
|
||||
gr_get_string_size(subtitle,&string_width,&string_height,&average_width );
|
||||
if (string_width > tw )
|
||||
tw = string_width;
|
||||
|
@ -558,7 +586,10 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
|
||||
th += 8*MENSCALE_Y; //put some space between titles & body
|
||||
|
||||
grd_curcanv->cv_font = normal_font;
|
||||
if (TinyMode)
|
||||
grd_curcanv->cv_font = GAME_FONT;
|
||||
else
|
||||
grd_curcanv->cv_font = NORMAL_FONT;
|
||||
|
||||
w = aw = 0;
|
||||
h = th;
|
||||
|
@ -736,7 +767,7 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
}
|
||||
|
||||
if ( title ) {
|
||||
grd_curcanv->cv_font = title_font;
|
||||
grd_curcanv->cv_font = TITLE_FONT;
|
||||
gr_set_fontcolor( GR_GETCOLOR(31,31,31), -1 );
|
||||
gr_get_string_size(title,&string_width,&string_height,&average_width );
|
||||
tw = string_width;
|
||||
|
@ -745,16 +776,20 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
}
|
||||
|
||||
if ( subtitle ) {
|
||||
grd_curcanv->cv_font = subtitle_font;
|
||||
grd_curcanv->cv_font = SUBTITLE_FONT;
|
||||
gr_set_fontcolor( GR_GETCOLOR(21,21,21), -1 );
|
||||
gr_get_string_size(subtitle,&string_width,&string_height,&average_width );
|
||||
tw = string_width;
|
||||
th = (title?th:0);
|
||||
gr_printf( 0x8000, ty+th, subtitle );
|
||||
}
|
||||
|
||||
if (TinyMode)
|
||||
grd_curcanv->cv_font = GAME_FONT;
|
||||
else
|
||||
grd_curcanv->cv_font = NORMAL_FONT;
|
||||
#endif
|
||||
grd_curcanv->cv_font = normal_font;
|
||||
|
||||
|
||||
// Update all item's x & y values.
|
||||
for (i=0; i<nitems; i++ ) {
|
||||
item[i].x = (15*MENSCALE_X) + twidth + right_offset;
|
||||
|
@ -824,7 +859,7 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
gr_set_current_canvas( bg.menu_canvas );
|
||||
|
||||
if ( title ) {
|
||||
grd_curcanv->cv_font = title_font;
|
||||
grd_curcanv->cv_font = TITLE_FONT;
|
||||
gr_set_fontcolor( GR_GETCOLOR(31,31,31), -1 );
|
||||
gr_get_string_size(title,&string_width,&string_height,&average_width );
|
||||
tw = string_width;
|
||||
|
@ -833,7 +868,7 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
}
|
||||
|
||||
if ( subtitle ) {
|
||||
grd_curcanv->cv_font = subtitle_font;
|
||||
grd_curcanv->cv_font = SUBTITLE_FONT;
|
||||
gr_set_fontcolor( GR_GETCOLOR(21,21,21), -1 );
|
||||
gr_get_string_size(subtitle,&string_width,&string_height,&average_width );
|
||||
tw = string_width;
|
||||
|
@ -841,7 +876,12 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
gr_printf( 0x8000, ty+th, subtitle );
|
||||
}
|
||||
|
||||
if (TinyMode)
|
||||
grd_curcanv->cv_font = GAME_FONT;
|
||||
else
|
||||
grd_curcanv->cv_font = NORMAL_FONT;
|
||||
#endif
|
||||
|
||||
if (filename == NULL) {
|
||||
draw_close_box(0,0);
|
||||
close_box = 1;
|
||||
|
@ -895,7 +935,7 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
#ifndef __WINDOWS__
|
||||
case KEY_V + KEY_CTRLED:
|
||||
case KEY_INSERT + KEY_SHIFTED:
|
||||
if(item[choice].type==NM_TYPE_INPUT)
|
||||
if(item[choice].type==NM_TYPE_INPUT)
|
||||
{
|
||||
char cbtext[MAX_PASTE_SIZE+1];
|
||||
memset(cbtext,0,MAX_PASTE_SIZE+1);
|
||||
|
@ -1288,12 +1328,11 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
}
|
||||
|
||||
gr_set_current_canvas(bg.menu_canvas);
|
||||
|
||||
#ifndef OGL
|
||||
// Redraw everything...
|
||||
for (i=0; i<nitems; i++ ) {
|
||||
if (item[i].redraw) {
|
||||
draw_item( &bg, &item[i], (i==choice && !all_text) );
|
||||
draw_item( &bg, &item[i], (i==choice && !all_text), TinyMode );
|
||||
item[i].redraw=0;
|
||||
#ifdef NEWMENU_MOUSE
|
||||
newmenu_show_cursor();
|
||||
|
@ -1305,7 +1344,7 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
#else
|
||||
// Redraw everything...
|
||||
for (i=0; i<nitems; i++ ) {
|
||||
draw_item( &bg, &item[i], (i==choice && !all_text) );
|
||||
draw_item( &bg, &item[i], (i==choice && !all_text), TinyMode );
|
||||
#ifdef NEWMENU_MOUSE
|
||||
newmenu_show_cursor();
|
||||
#endif
|
||||
|
@ -1359,18 +1398,6 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item *
|
|||
|
||||
}
|
||||
|
||||
int newmenu_do_fixedfont( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height){
|
||||
set_screen_mode(SCREEN_MENU);//hafta set the screen mode before calling or fonts might get changed/freed up if screen res changes
|
||||
return newmenu_do3_real( title, subtitle, nitems, item, subfunction, citem, filename, width,height, GAME_FONT, GAME_FONT, GAME_FONT, GAME_FONT);
|
||||
}
|
||||
|
||||
int newmenu_do3( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height){
|
||||
set_screen_mode(SCREEN_MENU);//hafta set the screen mode before calling or fonts might get changed/freed up if screen res changes
|
||||
return newmenu_do3_real( title, subtitle, nitems, item, subfunction, citem, filename, width,height, TITLE_FONT, SUBTITLE_FONT, MENU_FONT, NORMAL_FONT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int nm_messagebox1( char *title, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int nchoices, ... )
|
||||
{
|
||||
int i;
|
||||
|
|
100
main/newmenu.h
100
main/newmenu.h
|
@ -11,107 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|||
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||
*/
|
||||
/*
|
||||
* $Source: /cvsroot/dxx-rebirth/d1x-rebirth/main/newmenu.h,v $
|
||||
* $Revision: 1.1.1.1 $
|
||||
* $Author: zicodxx $
|
||||
* $Date: 2006/03/17 19:44:43 $
|
||||
*
|
||||
* Routines for menus.
|
||||
*
|
||||
* $Log: newmenu.h,v $
|
||||
* Revision 1.1.1.1 2006/03/17 19:44:43 zicodxx
|
||||
* initial import
|
||||
*
|
||||
* Revision 1.1.1.1 1999/06/14 22:12:48 donut
|
||||
* Import of d1x 1.37 source.
|
||||
*
|
||||
* Revision 2.0 1995/02/27 11:32:28 john
|
||||
* New version 2.0, which has no anonymous unions, builds with
|
||||
* Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
|
||||
*
|
||||
* Revision 1.24 1995/02/11 16:20:05 john
|
||||
* Added code to make the default mission be the one last played.
|
||||
*
|
||||
* Revision 1.23 1995/01/31 10:21:41 john
|
||||
* Added code to specify width, height.
|
||||
*
|
||||
* Revision 1.22 1995/01/28 17:09:21 john
|
||||
* *** empty log message ***
|
||||
*
|
||||
* Revision 1.21 1995/01/23 18:38:43 john
|
||||
* Added listbox function.
|
||||
*
|
||||
* Revision 1.20 1994/11/26 15:29:55 matt
|
||||
* Allow escape out of change pilot menu
|
||||
*
|
||||
* Revision 1.19 1994/11/26 14:17:05 matt
|
||||
* Player can now only enter valid chars for his name
|
||||
*
|
||||
* Revision 1.18 1994/11/18 16:17:13 mike
|
||||
* prototype Max_linear_depth_objects.
|
||||
*
|
||||
* Revision 1.17 1994/11/08 14:51:17 john
|
||||
* Added nm_messagebox1, (like the original, only you can pass a function).
|
||||
*
|
||||
* Revision 1.16 1994/11/05 14:31:45 john
|
||||
* Added a new menu function for the background.
|
||||
*
|
||||
* Revision 1.15 1994/11/05 14:05:46 john
|
||||
* Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
|
||||
* track of whether the palette is faded in or not. Then, wherever the code needs to fade out,
|
||||
* it just calls gr_palette_fade_out and it will fade out if it isn't already. The same with fade_in.
|
||||
* This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
|
||||
*
|
||||
* Revision 1.14 1994/11/03 19:37:35 john
|
||||
* Added scrolling file list box
|
||||
*
|
||||
* Revision 1.13 1994/10/13 11:34:03 john
|
||||
* Made Thrustmaster FCS Hat work. Put a background behind the
|
||||
* keyboard configure. Took out turn_sensitivity. Changed sound/config
|
||||
* menu to new menu. Made F6 be calibrate joystick.
|
||||
*
|
||||
* Revision 1.12 1994/10/11 17:08:32 john
|
||||
* Added sliders for volume controls.
|
||||
*
|
||||
* Revision 1.11 1994/10/04 10:26:23 matt
|
||||
* Changed fade in to happen every time a global var is set
|
||||
*
|
||||
* Revision 1.10 1994/10/03 14:43:56 john
|
||||
* Added newmenu_do1, which allows you to pass the starting
|
||||
* item to the menu system
|
||||
*
|
||||
* Revision 1.9 1994/09/30 11:51:33 john
|
||||
* Added Matt's NM_TYPE_INPUT_MENU
|
||||
*
|
||||
* Revision 1.8 1994/08/30 20:38:28 john
|
||||
* Passed citem in newmenu sub.
|
||||
*
|
||||
* Revision 1.7 1994/08/12 03:11:00 john
|
||||
* Made network be default off; Moved network options into
|
||||
* main menu. Made starting net game check that mines are the
|
||||
* same.
|
||||
*
|
||||
* Revision 1.6 1994/08/11 13:47:05 john
|
||||
* Made newmenu have subtitles, passed key through to
|
||||
* the newmenu subfunctions.
|
||||
*
|
||||
* Revision 1.5 1994/07/27 16:12:24 john
|
||||
* Changed newmenu system to have a callback function.
|
||||
* /.
|
||||
*
|
||||
* Revision 1.4 1994/07/24 17:41:38 john
|
||||
* *** empty log message ***
|
||||
*
|
||||
* Revision 1.3 1994/07/24 17:33:01 john
|
||||
* Added percent item. Also neatend up a bit.
|
||||
*
|
||||
* Revision 1.2 1994/07/22 17:48:12 john
|
||||
* Added new menuing system.
|
||||
*
|
||||
* Revision 1.1 1994/07/22 13:55:51 john
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
@ -163,6 +65,8 @@ extern int newmenu_do2( char * title, char * subtitle, int nitems, newmenu_item
|
|||
// Same as above, only you can pass through the width & height
|
||||
extern int newmenu_do3( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height );
|
||||
|
||||
// Tiny menu with GAME_FONT
|
||||
int newmenu_dotiny( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem) );
|
||||
|
||||
// Sample Code:
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue