Update menu
This commit is contained in:
parent
b773e670b1
commit
cbaaeae012
|
@ -718,12 +718,19 @@ void UI_DrawMenu( menuFramework_s *menu )
|
|||
UI_DefaultKey
|
||||
=================
|
||||
*/
|
||||
extern bool ignore;
|
||||
const char *UI_DefaultKey( menuFramework_s *menu, int key, int down )
|
||||
{
|
||||
const char *sound = NULL;
|
||||
menuCommon_s *item;
|
||||
int cursorPrev;
|
||||
|
||||
if( ignore )
|
||||
{
|
||||
ignore = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// menu system key
|
||||
if( down && key == K_ESCAPE )
|
||||
{
|
||||
|
|
|
@ -22,6 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "basemenu.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "menu_btnsbmp_table.h"
|
||||
|
||||
#define ART_BANNER "gfx/shell/head_saveload"
|
||||
|
||||
#define ID_BACKGROUND 0
|
||||
|
@ -36,13 +38,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
typedef struct
|
||||
{
|
||||
menuFramework_s menu;
|
||||
menuFramework_s fake;
|
||||
|
||||
menuBitmap_s background;
|
||||
menuBitmap_s banner;
|
||||
|
||||
menuAction_s record;
|
||||
menuAction_s play;
|
||||
menuAction_s done;
|
||||
menuPicButton_s record;
|
||||
menuPicButton_s play;
|
||||
menuPicButton_s done;
|
||||
|
||||
menuAction_s hintMessage;
|
||||
char hintText[MAX_HINT_TEXT];
|
||||
|
@ -50,6 +53,7 @@ typedef struct
|
|||
|
||||
static uiPlayRec_t uiPlayRec;
|
||||
static const char *uiEmptyString = "";
|
||||
bool ignore = false;
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -72,6 +76,7 @@ static void UI_PlayRec_Callback( void *self, int event )
|
|||
UI_RecDemo_Menu();
|
||||
break;
|
||||
case ID_DONE:
|
||||
ignore = true;
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -111,20 +111,20 @@ static void UI_GameOptions_UpdateConfig( void )
|
|||
uiGameOptions.cl_corpsestay.generic.name = corpseStayText;
|
||||
|
||||
|
||||
CVAR_SET_FLOAT( "hand", uiGameOptions.hand.enabled );
|
||||
CVAR_SET_FLOAT( "hand", !uiGameOptions.hand.enabled );
|
||||
CVAR_SET_FLOAT( "cl_corpsestay", uiGameOptions.cl_corpsestay.curValue );
|
||||
CVAR_SET_FLOAT( "mp_decals", uiGameOptions.mp_decals.curValue );
|
||||
CVAR_SET_FLOAT( "mp_decals", uiGameOptions.mp_decals.curValue );
|
||||
//CVAR_SET_FLOAT( "") maxshells
|
||||
//CVAR_SET_FLOAT( "") max_smoke_puffs;
|
||||
CVAR_SET_FLOAT( "cl_fastsmoke", uiGameOptions.fast_smoke_gas.enabled );
|
||||
CVAR_SET_FLOAT( "_vgui_menus", uiGameOptions.oldstylemenu.enabled );
|
||||
CVAR_SET_FLOAT( "cl_fastsmoke", uiGameOptions.fast_smoke_gas.enabled );
|
||||
CVAR_SET_FLOAT( "_vgui_menus", !uiGameOptions.oldstylemenu.enabled );
|
||||
CVAR_SET_FLOAT( "_extended_menus", uiGameOptions.extendedmenus.enabled );
|
||||
CVAR_SET_FLOAT( "_cl_autowepswitch", uiGameOptions.cl_autowepswitch.enabled );
|
||||
CVAR_SET_FLOAT( "hud_centerid", uiGameOptions.hud_centerid.enabled );
|
||||
CVAR_SET_FLOAT( "_ah", uiGameOptions.auto_help.enabled );
|
||||
//CVAR_SET_FLOAT( "_extended_menus", uiGameOptions.endgame_screenshot.enabled );
|
||||
CVAR_SET_FLOAT( "hud_centerid", uiGameOptions.hud_centerid.enabled );
|
||||
CVAR_SET_FLOAT( "_ah", uiGameOptions.auto_help.enabled );
|
||||
//CVAR_SET_FLOAT( "", uiGameOptions.endgame_screenshot.enabled );
|
||||
//CVAR_SET_FLOAT( "", uiGameOptions.observer_crosshair.enabled );
|
||||
CVAR_SET_FLOAT( "cl_radartype", uiGameOptions.radar_type.enabled );
|
||||
CVAR_SET_FLOAT( "cl_radartype", uiGameOptions.radar_type.enabled );
|
||||
|
||||
}
|
||||
|
||||
|
@ -135,20 +135,20 @@ UI_GameOptions_DiscardChanges
|
|||
*/
|
||||
static void UI_GameOptions_DiscardChanges( void )
|
||||
{
|
||||
CVAR_SET_FLOAT( "hand", uiGameInitial.hand );
|
||||
CVAR_SET_FLOAT( "hand", !uiGameInitial.hand );
|
||||
CVAR_SET_FLOAT( "cl_corpsestay", uiGameInitial.cl_corpsestay );
|
||||
CVAR_SET_FLOAT( "mp_decals", uiGameInitial.mp_decals );
|
||||
CVAR_SET_FLOAT( "mp_decals", uiGameInitial.mp_decals );
|
||||
//CVAR_SET_FLOAT( "") maxshells
|
||||
//CVAR_SET_FLOAT( "") max_smoke_puffs;
|
||||
CVAR_SET_FLOAT( "cl_fastsmoke", uiGameInitial.fast_smoke_gas );
|
||||
CVAR_SET_FLOAT( "_vgui_menus", uiGameInitial.oldstylemenu );
|
||||
CVAR_SET_FLOAT( "cl_fastsmoke", uiGameInitial.fast_smoke_gas );
|
||||
CVAR_SET_FLOAT( "_vgui_menus", !uiGameInitial.oldstylemenu );
|
||||
CVAR_SET_FLOAT( "_extended_menus", uiGameInitial.extendedmenus );
|
||||
CVAR_SET_FLOAT( "_cl_autowepswitch", uiGameInitial.cl_autowepswitch );
|
||||
CVAR_SET_FLOAT( "hud_centerid", uiGameInitial.hud_centerid );
|
||||
CVAR_SET_FLOAT( "_ah", uiGameInitial.auto_help );
|
||||
CVAR_SET_FLOAT( "hud_centerid", uiGameInitial.hud_centerid );
|
||||
CVAR_SET_FLOAT( "_ah", uiGameInitial.auto_help );
|
||||
//CVAR_SET_FLOAT( "_extended_menus", uiGameOptions.endgame_screenshot.enabled );
|
||||
//CVAR_SET_FLOAT( "", uiGameInitial.observer_crosshair );
|
||||
CVAR_SET_FLOAT( "cl_radartype", uiGameInitial.radar_type );
|
||||
CVAR_SET_FLOAT( "cl_radartype", uiGameInitial.radar_type );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -177,12 +177,11 @@ static void UI_GameOptions_GetConfig( void )
|
|||
uiGameOptions.cl_corpsestay.curValue = uiGameInitial.cl_corpsestay = CVAR_GET_FLOAT( "cl_corpsestay" );
|
||||
uiGameOptions.mp_decals.curValue = uiGameInitial.mp_decals = CVAR_GET_FLOAT( "mp_decals" );
|
||||
|
||||
if( CVAR_GET_FLOAT( "hand" ))
|
||||
uiGameInitial.hand = uiGameOptions.hand.enabled = true;
|
||||
uiGameInitial.hand = uiGameOptions.hand.enabled = !CVAR_GET_FLOAT( "hand" );
|
||||
uiGameInitial.oldstylemenu = uiGameOptions.oldstylemenu.enabled = !CVAR_GET_FLOAT( "_vgui_menus" );
|
||||
|
||||
if( CVAR_GET_FLOAT( "cl_fastsmoke" ))
|
||||
uiGameInitial.fast_smoke_gas = uiGameOptions.fast_smoke_gas.enabled = true;
|
||||
if( CVAR_GET_FLOAT( "_vgui_menus" ))
|
||||
uiGameInitial.oldstylemenu = uiGameOptions.oldstylemenu.enabled = true;
|
||||
if( CVAR_GET_FLOAT( "_extended_menus" ))
|
||||
uiGameInitial.extendedmenus = uiGameOptions.extendedmenus.enabled = true;
|
||||
if( CVAR_GET_FLOAT( "_cl_autowepswitch" ))
|
||||
|
@ -302,7 +301,7 @@ static void UI_GameOptions_Init( void )
|
|||
UI_GenItemInit( uiGameOptions.auto_help.generic, ID_AUTOHELP, QMTYPE_CHECKBOX, iTypicalFlags,
|
||||
x, y += gap, "Auto-help", "Do you need to know how to play Counter-Strike?" );
|
||||
UI_GenItemInit( uiGameOptions.radar_type.generic, ID_TRANSPARENTRADAR, QMTYPE_CHECKBOX, iTypicalFlags,
|
||||
x, y += gap, "Transparent radar", "Draw gun at left side" );
|
||||
x, y += gap, "Opaque radar", "Opaque or transparent radar. Useful for slow devices." );
|
||||
|
||||
|
||||
UI_GenItemInit( uiGameOptions.cl_corpsestay_message.generic, 10000, QMTYPE_ACTION, QMF_SMALLFONT| QMF_INACTIVE|QMF_DROPSHADOW,
|
||||
|
|
|
@ -86,7 +86,7 @@ static void UI_MultiPlayer_Callback( void *self, int event )
|
|||
UI_PopMenu();
|
||||
break;
|
||||
case ID_DEMOS:
|
||||
//UI_PlayRec_Menu();
|
||||
UI_PlayRec_Menu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -177,15 +177,13 @@ static void UI_MultiPlayer_Init( void )
|
|||
|
||||
uiMultiPlayer.demos.generic.id = ID_DEMOS;
|
||||
uiMultiPlayer.demos.generic.type = QMTYPE_BM_BUTTON;
|
||||
uiMultiPlayer.demos.generic.flags = QMF_HIGHLIGHTIFFOCUS|QMF_DROPSHADOW|QMF_NOTIFY|QMF_GRAYED;
|
||||
uiMultiPlayer.demos.generic.flags = QMF_HIGHLIGHTIFFOCUS|QMF_DROPSHADOW|QMF_NOTIFY;
|
||||
uiMultiPlayer.demos.generic.x = 72;
|
||||
uiMultiPlayer.demos.generic.y = 480;
|
||||
uiMultiPlayer.demos.generic.name = "Demos";
|
||||
uiMultiPlayer.demos.generic.statusText = "Play or record the demos";
|
||||
uiMultiPlayer.demos.generic.callback = UI_MultiPlayer_Callback;
|
||||
|
||||
//UI_UtilSetupPicButton( &uiMultiPlayer.demos, PC_DONE );
|
||||
|
||||
uiMultiPlayer.done.generic.id = ID_DONE;
|
||||
uiMultiPlayer.done.generic.type = QMTYPE_BM_BUTTON;
|
||||
uiMultiPlayer.done.generic.flags = QMF_HIGHLIGHTIFFOCUS|QMF_DROPSHADOW|QMF_NOTIFY;
|
||||
|
|
|
@ -50,7 +50,7 @@ enum
|
|||
|
||||
#define MAX_SPRAYDECALS 50
|
||||
|
||||
typedef struct
|
||||
struct uiPlayerSetup_t
|
||||
{
|
||||
menuFramework_s menu;
|
||||
menuBitmap_s background;
|
||||
|
@ -74,7 +74,9 @@ typedef struct
|
|||
menuSpinControl_s sprayDecals;
|
||||
menuSpinControl_s sprayColor;
|
||||
#endif
|
||||
} uiPlayerSetup_t;
|
||||
|
||||
HIMAGE uiWhite;
|
||||
};
|
||||
|
||||
static uiPlayerSetup_t uiPlayerSetup;
|
||||
|
||||
|
@ -300,14 +302,16 @@ static void UI_Crosshair_Ownerdraw( void *self )
|
|||
else l = 10;
|
||||
}
|
||||
|
||||
l *= ScreenHeight / 768.0f;
|
||||
|
||||
int x = item->generic.x, // xpos
|
||||
y = item->generic.y, // ypos
|
||||
w = item->generic.width, // width
|
||||
h = item->generic.height, // height
|
||||
// delta distance
|
||||
d = (item->generic.width / 2 - l) * 0.5,
|
||||
// alpha. Simulate non-additive.
|
||||
a = uiPlayerSetup.crosshairTranslucent.enabled ? 180 : 255,
|
||||
// alpha
|
||||
a = 180,
|
||||
// red
|
||||
r = g_iCrosshairAvailColors[(int)uiPlayerSetup.crosshairColor.curValue][0],
|
||||
// green
|
||||
|
@ -315,6 +319,40 @@ static void UI_Crosshair_Ownerdraw( void *self )
|
|||
// blue
|
||||
b = g_iCrosshairAvailColors[(int)uiPlayerSetup.crosshairColor.curValue][2];
|
||||
|
||||
if( uiPlayerSetup.crosshairTranslucent.enabled )
|
||||
{
|
||||
// verical
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawTrans(x + w / 2, y + d, 1, l );
|
||||
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawTrans(x + w / 2, y + h / 2 + d, 1, l );
|
||||
|
||||
// horizontal
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawTrans(x + d, y + h / 2, l, 1 );
|
||||
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawTrans(x + w / 2 + d, y + h / 2, l, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// verical
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawAdditive(x + w / 2, y + d, 1, l );
|
||||
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawAdditive(x + w / 2, y + h / 2 + d, 1, l );
|
||||
|
||||
// horizontal
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawAdditive(x + d, y + h / 2, l, 1 );
|
||||
|
||||
PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
|
||||
PIC_DrawAdditive(x + w / 2 + d, y + h / 2, l, 1 );
|
||||
}
|
||||
|
||||
#if 0
|
||||
// verical
|
||||
FillRGBA(x + w / 2, y + d, 1, l, r, g, b, a);
|
||||
FillRGBA(x + w / 2, y + h / 2 + d, 1, l, r, g, b, a);
|
||||
|
@ -322,6 +360,7 @@ static void UI_Crosshair_Ownerdraw( void *self )
|
|||
// horizontal
|
||||
FillRGBA(x + d, y + h / 2, l, 1, r, g, b, a);
|
||||
FillRGBA(x + w / 2 + d, y + h / 2, l, 1, r, g, b, a);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -335,6 +374,8 @@ static void UI_PlayerSetup_Init( void )
|
|||
|
||||
uiPlayerSetup.menu.vidInitFunc = UI_PlayerSetup_Init;
|
||||
|
||||
uiPlayerSetup.uiWhite = PIC_Load("*white");
|
||||
|
||||
uiPlayerSetup.background.generic.id = ID_BACKGROUND;
|
||||
uiPlayerSetup.background.generic.type = QMTYPE_BITMAP;
|
||||
uiPlayerSetup.background.generic.flags = QMF_INACTIVE;
|
||||
|
|
Loading…
Reference in New Issue