Updates to various ui_*.c files

This commit is contained in:
Walter Julius Hennecke 2014-11-07 19:54:16 +01:00
parent 60a8acbe05
commit c3dd592c86
8 changed files with 11153 additions and 11172 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,204 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{c2125bf4-0a9f-479c-af3a-c31894168653}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{7e79d4e7-efa1-47e6-9e49-1f7bf071d9a5}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\game\bg_lib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\bg_misc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\q_math.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\q_shared.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_addbots.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_admin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_atoms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_cdkey.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_confirm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_connect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_controls2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_credits.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_cvars.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_demo2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_emotes.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_fonts.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_gameinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_ingame.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_menu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_mfield.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_mods.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_motd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_playermodel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_players.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_playersettings.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_preferences.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_qmenu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_removebots.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_serverinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_servers2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sound.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sparena.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_specifyserver.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_splevel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sppostgame.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_spskill.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_startserver.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_syscalls.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_team.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_teamorders.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_transporter.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_turbolift.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_video.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_msd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sql.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_logger.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\bg_list.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\game\bg_public.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="keycodes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\game\q_shared.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\qcommon\stv_version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\game\surfaceflags.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cgame\tr_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_local.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_public.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_logger.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\game\bg_list.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="ui.def">
<Filter>Header Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<CustomBuildStep Include="ui.bat" />
<CustomBuildStep Include="ui.q3asm" />
<CustomBuildStep Include="ui_syscalls.asm" />
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{c2125bf4-0a9f-479c-af3a-c31894168653}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{7e79d4e7-efa1-47e6-9e49-1f7bf071d9a5}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\game\bg_lib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\bg_misc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\q_math.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\q_shared.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_admin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_atoms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_cdkey.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_confirm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_connect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_controls2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_credits.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_cvars.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_demo2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_emotes.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_fonts.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_gameinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_ingame.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_menu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_mfield.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_mods.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_motd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_playermodel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_players.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_playersettings.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_preferences.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_qmenu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_removebots.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_serverinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_servers2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sound.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sparena.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_specifyserver.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_splevel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sppostgame.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_spskill.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_startserver.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_syscalls.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_team.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_teamorders.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_transporter.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_turbolift.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_video.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_msd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_sql.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui_logger.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\game\bg_list.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\game\bg_public.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="keycodes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\game\q_shared.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\qcommon\stv_version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\game\surfaceflags.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cgame\tr_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_local.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_public.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_logger.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\game\bg_list.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="ui.def">
<Filter>Header Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<CustomBuildStep Include="ui.bat" />
<CustomBuildStep Include="ui.q3asm" />
<CustomBuildStep Include="ui_syscalls.asm" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -12,9 +12,11 @@ CD KEY MENU
#include "ui_local.h"
#include "ui_logger.h"
#define ID_CDKEY 10
#define ID_ACCEPT 11
#define ID_ACCEPTLATER 12
enum ui_cdleyIDs_e {
ID_CDKEY = 10,
ID_ACCEPT,
ID_ACCEPTLATER
};
typedef struct {
@ -37,24 +39,24 @@ static cdkeyMenuInfo_t cdkeyMenuInfo;
UI_CDKeyMenu_PreValidateKey
=================
*/
static int32_t UI_CDKeyMenu_PreValidateKey( const char *key )
static int32_t UI_CDKeyMenu_PreValidateKey(const char *key)
{
UI_LogFuncBegin();
int32_t cnt, i;
// With dashes can't be more than 21 long
if( strlen( key ) > 22 )
if (strlen(key) > 22)
{
UI_LogFuncEnd();
return -1;
}
cnt = 0;
for(i = 0; i < strlen( key ) && key[i]; i++)
for (i = 0; i < strlen(key) && key[i]; i++)
{
if ( ( key[i] >= '0' && key[i] <= '9' )
|| ( key[i] >= 'a' && key[i] <= 'z' )
|| ( key[i] >= 'A' && key[i] <= 'Z' )
if ((key[i] >= '0' && key[i] <= '9')
|| (key[i] >= 'a' && key[i] <= 'z')
|| (key[i] >= 'A' && key[i] <= 'Z')
)
{
cnt++;
@ -77,26 +79,26 @@ static int32_t UI_CDKeyMenu_PreValidateKey( const char *key )
UI_CDKeyMenu_Event
===============
*/
static void UI_CDKeyMenu_Event( void *ptr, int32_t event )
static void UI_CDKeyMenu_Event(void *ptr, int32_t event)
{
UI_LogFuncBegin();
if( event != QM_ACTIVATED )
if (event != QM_ACTIVATED)
{
UI_LogFuncEnd();
return;
}
switch( ((menucommon_s*)ptr)->id )
switch (((menucommon_s*)ptr)->id)
{
case ID_ACCEPT:
cdkeyMenuInfo.keyResult = UI_CDKeyMenu_PreValidateKey( cdkeyMenuInfo.cdkey.field.buffer);
cdkeyMenuInfo.keyResult = UI_CDKeyMenu_PreValidateKey(cdkeyMenuInfo.cdkey.field.buffer);
if (cdkeyMenuInfo.keyResult == 0)
{//passed quick check, now check for real
if(trap_SetCDKey( cdkeyMenuInfo.cdkey.field.buffer ))
if (trap_SetCDKey(cdkeyMenuInfo.cdkey.field.buffer))
{//success
trap_Cvar_Set( "ui_cdkeychecked", "1" );
trap_Cvar_Set("ui_cdkeychecked", "1");
if (cdkeyMenuInfo.fromMenu)
{
UI_PopMenu();
@ -105,18 +107,18 @@ static void UI_CDKeyMenu_Event( void *ptr, int32_t event )
else
{//failed real check
cdkeyMenuInfo.keyResult = -1;
trap_S_StartLocalSound( menu_buzz_sound, CHAN_MENU1); // WRONG!!!! sound
trap_S_StartLocalSound(menu_buzz_sound, CHAN_MENU1); // WRONG!!!! sound
}
}
else if (cdkeyMenuInfo.keyResult < 0)
{//failed ui quick check
trap_S_StartLocalSound( menu_buzz_sound, CHAN_MENU1); // WRONG!!!! sound
trap_S_StartLocalSound(menu_buzz_sound, CHAN_MENU1); // WRONG!!!! sound
}
break;
case ID_ACCEPTLATER:
if (cdkeyMenuInfo.keyResult != 0) { //not valid or not entered
trap_Cvar_Set( "ui_cdkeychecked", "-1" );
trap_Cvar_Set("ui_cdkeychecked", "-1");
}
UI_PopMenu();
break;
@ -131,7 +133,7 @@ static void UI_CDKeyMenu_Event( void *ptr, int32_t event )
UI_CDKeyMenu_DrawKey
=================
*/
static void UI_CDKeyMenu_DrawKey( void *self )
static void UI_CDKeyMenu_DrawKey(void *self)
{
UI_LogFuncBegin();
menufield_s *f;
@ -145,11 +147,11 @@ static void UI_CDKeyMenu_DrawKey( void *self )
focus = (f->generic.parent->cursor == f->generic.menuPosition);
style = UI_LEFT;
if( focus )
if (focus)
{
color = colorTable[CT_LTGOLD1];
}
else
else
{
color = colorTable[CT_DKGOLD1];
}
@ -157,19 +159,19 @@ static void UI_CDKeyMenu_DrawKey( void *self )
x = cdkeyMenuInfo.cdkey.generic.x;
y = cdkeyMenuInfo.cdkey.generic.y;
UI_FillRect( x, y, cdkeyMenuInfo.cdkey.field.widthInChars * SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, colorTable[CT_BLACK] );
UI_FillRect( x, y, cdkeyMenuInfo.cdkey.field.widthInChars * SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, listbar_color );
UI_DrawString( x, y, f->field.buffer, style, color, qtrue );
UI_FillRect(x, y, cdkeyMenuInfo.cdkey.field.widthInChars * SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, colorTable[CT_BLACK]);
UI_FillRect(x, y, cdkeyMenuInfo.cdkey.field.widthInChars * SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, listbar_color);
UI_DrawString(x, y, f->field.buffer, style, color, qtrue);
// draw cursor if we have focus
if( focus )
if (focus)
{
char c;
if ( trap_Key_GetOverstrikeMode() )
if (trap_Key_GetOverstrikeMode())
{
c = 11;
}
else
}
else
{
c = 10;
}
@ -177,7 +179,7 @@ static void UI_CDKeyMenu_DrawKey( void *self )
style &= ~UI_PULSE;
style |= UI_BLINK;
UI_DrawChar( x + f->field.cursor * SMALLCHAR_WIDTH, y, c, style, color_white );
UI_DrawChar(x + f->field.cursor * SMALLCHAR_WIDTH, y, c, style, color_white);
}
UI_LogFuncEnd();
}
@ -187,41 +189,41 @@ static void UI_CDKeyMenu_DrawKey( void *self )
CDKeyMenu_Graphics
=================
*/
void CDKeyMenu_Graphics (void)
void CDKeyMenu_Graphics(void)
{
UI_LogFuncBegin();
int32_t x,y;
int32_t x, y;
// Draw the basic screen layout
UI_MenuFrame(&cdkeyMenuInfo.menu);
trap_R_SetColor( colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(30,203, 47, 186, uis.whiteShader); // Middle left line of frame
trap_R_SetColor(colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(30, 203, 47, 186, uis.whiteShader); // Middle left line of frame
trap_R_SetColor( colorTable[CT_DKPURPLE1]);
UI_DrawHandlePic( 246, 238, 197, 24, uis.whiteShader);
UI_DrawHandlePic( 227, 238, -16, 32, cdkeyMenuInfo.halfround); // Left round
UI_DrawHandlePic( 446, 238, 16, 32, cdkeyMenuInfo.halfround); // Right round
trap_R_SetColor(colorTable[CT_DKPURPLE1]);
UI_DrawHandlePic(246, 238, 197, 24, uis.whiteShader);
UI_DrawHandlePic(227, 238, -16, 32, cdkeyMenuInfo.halfround); // Left round
UI_DrawHandlePic(446, 238, 16, 32, cdkeyMenuInfo.halfround); // Right round
UI_DrawProportionalString( 74, 66, "557",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 84, "2344",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 188, "89-35",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 206, "32906",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 395, "30-1789",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 66, "557", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 84, "2344", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 188, "89-35", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 206, "32906", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 395, "30-1789", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
x = 344;
y = 279;
if ( cdkeyMenuInfo.keyResult == 0 )
if (cdkeyMenuInfo.keyResult == 0)
{
UI_DrawProportionalString( x, y, menu_normal_text[MNT_VALID_CDKEY], UI_CENTER|UI_SMALLFONT, colorTable[CT_WHITE] );
UI_DrawProportionalString(x, y, menu_normal_text[MNT_VALID_CDKEY], UI_CENTER | UI_SMALLFONT, colorTable[CT_WHITE]);
}
else if( cdkeyMenuInfo.keyResult == 1 )
else if (cdkeyMenuInfo.keyResult == 1)
{
UI_DrawProportionalString( x, y, menu_normal_text[MNT_ENTER_CDKEY], UI_CENTER|UI_SMALLFONT, colorTable[CT_LTGOLD1] );
UI_DrawProportionalString(x, y, menu_normal_text[MNT_ENTER_CDKEY], UI_CENTER | UI_SMALLFONT, colorTable[CT_LTGOLD1]);
}
else
else
{
UI_DrawProportionalString( x, y, menu_normal_text[MNT_CDKEY_INVALID], UI_CENTER|UI_SMALLFONT, colorTable[CT_RED] );
UI_DrawProportionalString(x, y, menu_normal_text[MNT_CDKEY_INVALID], UI_CENTER | UI_SMALLFONT, colorTable[CT_RED]);
}
UI_Setup_MenuButtons();
@ -233,11 +235,11 @@ void CDKeyMenu_Graphics (void)
CDKey_MenuDraw
=================
*/
static void CDKey_MenuDraw (void)
static void CDKey_MenuDraw(void)
{
UI_LogFuncBegin();
CDKeyMenu_Graphics();
Menu_Draw( &cdkeyMenuInfo.menu );
Menu_Draw(&cdkeyMenuInfo.menu);
UI_LogFuncEnd();
}
@ -246,63 +248,64 @@ static void CDKey_MenuDraw (void)
UI_CDKeyMenu_Init
===============
*/
static void UI_CDKeyMenu_Init( void )
static void UI_CDKeyMenu_Init(void)
{
UI_LogFuncBegin();
memset( &cdkeyMenuInfo, 0, sizeof(cdkeyMenuInfo) );
memset(&cdkeyMenuInfo, 0, sizeof(cdkeyMenuInfo));
UI_CDKeyMenu_Cache();
cdkeyMenuInfo.menu.wrapAround = qtrue;
cdkeyMenuInfo.menu.fullscreen = qtrue;
cdkeyMenuInfo.menu.draw = CDKey_MenuDraw;
cdkeyMenuInfo.menu.descX = MENU_DESC_X;
cdkeyMenuInfo.menu.descY = MENU_DESC_Y;
cdkeyMenuInfo.menu.titleX = MENU_TITLE_X;
cdkeyMenuInfo.menu.titleY = MENU_TITLE_Y;
cdkeyMenuInfo.menu.titleI = MNT_CDKEYMENU_TITLE;
cdkeyMenuInfo.menu.footNoteEnum = MNT_CDKEY;
cdkeyMenuInfo.menu.wrapAround = qtrue;
cdkeyMenuInfo.menu.fullscreen = qtrue;
cdkeyMenuInfo.menu.draw = CDKey_MenuDraw;
cdkeyMenuInfo.menu.descX = MENU_DESC_X;
cdkeyMenuInfo.menu.descY = MENU_DESC_Y;
cdkeyMenuInfo.menu.titleX = MENU_TITLE_X;
cdkeyMenuInfo.menu.titleY = MENU_TITLE_Y;
cdkeyMenuInfo.menu.titleI = MNT_CDKEYMENU_TITLE;
cdkeyMenuInfo.menu.footNoteEnum = MNT_CDKEY;
cdkeyMenuInfo.cdkey.generic.type = MTYPE_FIELD;
cdkeyMenuInfo.cdkey.generic.flags = QMF_UPPERCASE;
cdkeyMenuInfo.cdkey.generic.x = 256;
cdkeyMenuInfo.cdkey.generic.y = 242;
cdkeyMenuInfo.cdkey.field.style = UI_SMALLFONT;
cdkeyMenuInfo.cdkey.field.widthInChars = 22;
cdkeyMenuInfo.cdkey.field.maxchars = 22;
cdkeyMenuInfo.cdkey.generic.ownerdraw = UI_CDKeyMenu_DrawKey;
cdkeyMenuInfo.cdkey.field.titleEnum = MNT_CDKEY;
cdkeyMenuInfo.cdkey.field.titlecolor = CT_LTGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor = CT_DKGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor2 = CT_LTGOLD1;
cdkeyMenuInfo.cdkey.generic.type = MTYPE_FIELD;
cdkeyMenuInfo.cdkey.generic.flags = QMF_UPPERCASE;
cdkeyMenuInfo.cdkey.generic.x = 256;
cdkeyMenuInfo.cdkey.generic.y = 242;
cdkeyMenuInfo.cdkey.field.style = UI_SMALLFONT;
cdkeyMenuInfo.cdkey.field.widthInChars = 22;
cdkeyMenuInfo.cdkey.field.maxchars = 22;
cdkeyMenuInfo.cdkey.generic.ownerdraw = UI_CDKeyMenu_DrawKey;
cdkeyMenuInfo.cdkey.field.titleEnum = MNT_CDKEY;
cdkeyMenuInfo.cdkey.field.titlecolor = CT_LTGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor = CT_DKGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor2 = CT_LTGOLD1;
cdkeyMenuInfo.accept.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.accept.generic.name = GRAPHIC_SQUARE;
cdkeyMenuInfo.accept.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
cdkeyMenuInfo.accept.generic.id = ID_ACCEPT;
cdkeyMenuInfo.accept.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.accept.generic.x = 279;
cdkeyMenuInfo.accept.generic.y = 391;
cdkeyMenuInfo.accept.width = MENU_BUTTON_MED_WIDTH;
cdkeyMenuInfo.accept.height = 42;
cdkeyMenuInfo.accept.color = CT_DKPURPLE1;
cdkeyMenuInfo.accept.color2 = CT_LTPURPLE1;
cdkeyMenuInfo.accept.textX = MENU_BUTTON_TEXT_X;
cdkeyMenuInfo.accept.textY = MENU_BUTTON_TEXT_Y;
cdkeyMenuInfo.accept.textEnum = MBT_ACCEPT;
cdkeyMenuInfo.accept.textcolor = CT_BLACK;
cdkeyMenuInfo.accept.textcolor2 = CT_WHITE;
cdkeyMenuInfo.accept.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.accept.generic.name = GRAPHIC_SQUARE;
cdkeyMenuInfo.accept.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
cdkeyMenuInfo.accept.generic.id = ID_ACCEPT;
cdkeyMenuInfo.accept.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.accept.generic.x = 279;
cdkeyMenuInfo.accept.generic.y = 391;
cdkeyMenuInfo.accept.width = MENU_BUTTON_MED_WIDTH;
cdkeyMenuInfo.accept.height = 42;
cdkeyMenuInfo.accept.color = CT_DKPURPLE1;
cdkeyMenuInfo.accept.color2 = CT_LTPURPLE1;
cdkeyMenuInfo.accept.textX = MENU_BUTTON_TEXT_X;
cdkeyMenuInfo.accept.textY = MENU_BUTTON_TEXT_Y;
cdkeyMenuInfo.accept.textEnum = MBT_ACCEPT;
cdkeyMenuInfo.accept.textcolor = CT_BLACK;
cdkeyMenuInfo.accept.textcolor2 = CT_WHITE;
SetupMenu_TopButtons(&cdkeyMenuInfo.menu,MENU_CDKEY,NULL);
SetupMenu_TopButtons(&cdkeyMenuInfo.menu, MENU_CDKEY, NULL);
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.cdkey );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.accept );
Menu_AddItem(&cdkeyMenuInfo.menu, &cdkeyMenuInfo.cdkey);
Menu_AddItem(&cdkeyMenuInfo.menu, &cdkeyMenuInfo.accept);
if (ui_cdkeychecked.integer == 1) {
cdkeyMenuInfo.keyResult = 0; //already got a good one once
} else {
}
else {
cdkeyMenuInfo.keyResult = 1;
}
UI_LogFuncEnd();
@ -314,10 +317,10 @@ static void UI_CDKeyMenu_Init( void )
UI_CDKeyMenu_Cache
=================
*/
void UI_CDKeyMenu_Cache( void )
void UI_CDKeyMenu_Cache(void)
{
UI_LogFuncBegin();
cdkeyMenuInfo.halfround = trap_R_RegisterShaderNoMip( "menu/common/halfround_r_24.tga" );
cdkeyMenuInfo.halfround = trap_R_RegisterShaderNoMip("menu/common/halfround_r_24.tga");
UI_LogFuncEnd();
}
@ -327,11 +330,11 @@ void UI_CDKeyMenu_Cache( void )
UI_CDKeyMenu
===============
*/
void UI_CDKeyMenu( void )
void UI_CDKeyMenu(void)
{
UI_LogFuncBegin();
UI_CDKeyMenu_Init();
UI_PushMenu( &cdkeyMenuInfo.menu );
UI_PushMenu(&cdkeyMenuInfo.menu);
UI_LogFuncEnd();
}
@ -341,7 +344,7 @@ void UI_CDKeyMenu( void )
M_CDKey2Menu_Key
=================
*/
sfxHandle_t M_CDKey2Menu_Key (int32_t key)
sfxHandle_t M_CDKey2Menu_Key(int32_t key)
{
UI_LogFuncBegin();
if (key == K_ESCAPE)
@ -351,7 +354,7 @@ sfxHandle_t M_CDKey2Menu_Key (int32_t key)
}
UI_LogFuncEnd();
return ( Menu_DefaultKey( &cdkeyMenuInfo.menu, key ) );
return (Menu_DefaultKey(&cdkeyMenuInfo.menu, key));
}
/*
@ -359,43 +362,43 @@ sfxHandle_t M_CDKey2Menu_Key (int32_t key)
CDKeyMenu2_Graphics
=================
*/
void CDKeyMenu2_Graphics (void)
void CDKeyMenu2_Graphics(void)
{
UI_LogFuncBegin();
int32_t x,y;
int32_t x, y;
// Draw the basic screen layout
UI_MenuFrame2(&cdkeyMenuInfo.menu);
trap_R_SetColor( colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(30,203, 47, 186, uis.whiteShader); // Middle left line of frame
trap_R_SetColor(colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(30, 203, 47, 186, uis.whiteShader); // Middle left line of frame
// Background for CD Key data
trap_R_SetColor( colorTable[CT_DKPURPLE1]);
UI_DrawHandlePic( 246, 168, 197, 24, uis.whiteShader);
UI_DrawHandlePic( 227, 168, -16, 32, cdkeyMenuInfo.halfround); // Left round
UI_DrawHandlePic( 446, 168, 16, 32, cdkeyMenuInfo.halfround); // Right round
trap_R_SetColor(colorTable[CT_DKPURPLE1]);
UI_DrawHandlePic(246, 168, 197, 24, uis.whiteShader);
UI_DrawHandlePic(227, 168, -16, 32, cdkeyMenuInfo.halfround); // Left round
UI_DrawHandlePic(446, 168, 16, 32, cdkeyMenuInfo.halfround); // Right round
UI_DrawProportionalString( 74, 36, "755",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 132, "4423",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 188, "35-89",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 206, "60932",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 395, "1789-30",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 36, "755", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 132, "4423", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 188, "35-89", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 206, "60932", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 395, "1789-30", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
x = 344;
y = 228;
if ( cdkeyMenuInfo.keyResult == 0 )
if (cdkeyMenuInfo.keyResult == 0)
{
UI_DrawProportionalString( x, y, menu_normal_text[MNT_VALID_CDKEY], UI_CENTER|UI_SMALLFONT, colorTable[CT_WHITE] );
UI_DrawProportionalString(x, y, menu_normal_text[MNT_VALID_CDKEY], UI_CENTER | UI_SMALLFONT, colorTable[CT_WHITE]);
}
else if( cdkeyMenuInfo.keyResult == 1 )
else if (cdkeyMenuInfo.keyResult == 1)
{
UI_DrawProportionalString( x, y, menu_normal_text[MNT_ENTER_CDKEY], UI_CENTER|UI_SMALLFONT, colorTable[CT_LTGOLD1] );
UI_DrawProportionalString(x, y, menu_normal_text[MNT_ENTER_CDKEY], UI_CENTER | UI_SMALLFONT, colorTable[CT_LTGOLD1]);
}
else
else
{
UI_DrawProportionalString( x, y, menu_normal_text[MNT_CDKEY_INVALID], UI_CENTER|UI_SMALLFONT, colorTable[CT_RED] );
UI_DrawProportionalString(x, y, menu_normal_text[MNT_CDKEY_INVALID], UI_CENTER | UI_SMALLFONT, colorTable[CT_RED]);
}
UI_LogFuncEnd();
}
@ -405,11 +408,11 @@ void CDKeyMenu2_Graphics (void)
CDKey2_MenuDraw
=================
*/
static void CDKey2_MenuDraw (void)
static void CDKey2_MenuDraw(void)
{
UI_LogFuncBegin();
CDKeyMenu2_Graphics();
Menu_Draw( &cdkeyMenuInfo.menu );
Menu_Draw(&cdkeyMenuInfo.menu);
UI_LogFuncEnd();
}
@ -419,80 +422,81 @@ static void CDKey2_MenuDraw (void)
UI_CDKeyMenu2_Init
===============
*/
static void UI_CDKeyMenu2_Init( void )
static void UI_CDKeyMenu2_Init(void)
{//initial first time menu
UI_LogFuncBegin();
memset( &cdkeyMenuInfo, 0, sizeof(cdkeyMenuInfo) );
memset(&cdkeyMenuInfo, 0, sizeof(cdkeyMenuInfo));
cdkeyMenuInfo.fromMenu = 1;
UI_CDKeyMenu_Cache();
cdkeyMenuInfo.menu.wrapAround = qtrue;
cdkeyMenuInfo.menu.fullscreen = qtrue;
cdkeyMenuInfo.menu.draw = CDKey2_MenuDraw;
cdkeyMenuInfo.menu.key = M_CDKey2Menu_Key;
cdkeyMenuInfo.menu.descX = MENU_DESC_X;
cdkeyMenuInfo.menu.descY = MENU_DESC_Y;
cdkeyMenuInfo.menu.titleX = MENU_TITLE_X;
cdkeyMenuInfo.menu.titleY = MENU_TITLE_Y;
cdkeyMenuInfo.menu.titleI = MNT_CDKEYMENU_TITLE;
cdkeyMenuInfo.menu.footNoteEnum = MNT_CDKEY;
cdkeyMenuInfo.menu.wrapAround = qtrue;
cdkeyMenuInfo.menu.fullscreen = qtrue;
cdkeyMenuInfo.menu.draw = CDKey2_MenuDraw;
cdkeyMenuInfo.menu.key = M_CDKey2Menu_Key;
cdkeyMenuInfo.menu.descX = MENU_DESC_X;
cdkeyMenuInfo.menu.descY = MENU_DESC_Y;
cdkeyMenuInfo.menu.titleX = MENU_TITLE_X;
cdkeyMenuInfo.menu.titleY = MENU_TITLE_Y;
cdkeyMenuInfo.menu.titleI = MNT_CDKEYMENU_TITLE;
cdkeyMenuInfo.menu.footNoteEnum = MNT_CDKEY;
cdkeyMenuInfo.cdkey.generic.type = MTYPE_FIELD;
cdkeyMenuInfo.cdkey.generic.flags = QMF_UPPERCASE;
cdkeyMenuInfo.cdkey.generic.x = 260;
cdkeyMenuInfo.cdkey.generic.y = 172;
cdkeyMenuInfo.cdkey.field.style = UI_SMALLFONT;
cdkeyMenuInfo.cdkey.field.widthInChars = 22;
cdkeyMenuInfo.cdkey.field.maxchars = 22;
cdkeyMenuInfo.cdkey.generic.ownerdraw = UI_CDKeyMenu_DrawKey;
cdkeyMenuInfo.cdkey.field.titleEnum = MNT_CDKEY;
cdkeyMenuInfo.cdkey.field.titlecolor = CT_LTGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor = CT_DKGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor2 = CT_LTGOLD1;
cdkeyMenuInfo.cdkey.generic.type = MTYPE_FIELD;
cdkeyMenuInfo.cdkey.generic.flags = QMF_UPPERCASE;
cdkeyMenuInfo.cdkey.generic.x = 260;
cdkeyMenuInfo.cdkey.generic.y = 172;
cdkeyMenuInfo.cdkey.field.style = UI_SMALLFONT;
cdkeyMenuInfo.cdkey.field.widthInChars = 22;
cdkeyMenuInfo.cdkey.field.maxchars = 22;
cdkeyMenuInfo.cdkey.generic.ownerdraw = UI_CDKeyMenu_DrawKey;
cdkeyMenuInfo.cdkey.field.titleEnum = MNT_CDKEY;
cdkeyMenuInfo.cdkey.field.titlecolor = CT_LTGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor = CT_DKGOLD1;
cdkeyMenuInfo.cdkey.field.textcolor2 = CT_LTGOLD1;
cdkeyMenuInfo.accept.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.accept.generic.name = GRAPHIC_SQUARE;
cdkeyMenuInfo.accept.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
cdkeyMenuInfo.accept.generic.id = ID_ACCEPT;
cdkeyMenuInfo.accept.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.accept.generic.x = 96;
cdkeyMenuInfo.accept.generic.y = 347;
cdkeyMenuInfo.accept.width = MENU_BUTTON_MED_WIDTH;
cdkeyMenuInfo.accept.height = 42;
cdkeyMenuInfo.accept.color = CT_DKPURPLE1;
cdkeyMenuInfo.accept.color2 = CT_LTPURPLE1;
cdkeyMenuInfo.accept.textX = MENU_BUTTON_TEXT_X;
cdkeyMenuInfo.accept.textY = MENU_BUTTON_TEXT_Y;
cdkeyMenuInfo.accept.textEnum = MBT_ACCEPT;
cdkeyMenuInfo.accept.textcolor = CT_BLACK;
cdkeyMenuInfo.accept.textcolor2 = CT_WHITE;
cdkeyMenuInfo.accept.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.accept.generic.name = GRAPHIC_SQUARE;
cdkeyMenuInfo.accept.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
cdkeyMenuInfo.accept.generic.id = ID_ACCEPT;
cdkeyMenuInfo.accept.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.accept.generic.x = 96;
cdkeyMenuInfo.accept.generic.y = 347;
cdkeyMenuInfo.accept.width = MENU_BUTTON_MED_WIDTH;
cdkeyMenuInfo.accept.height = 42;
cdkeyMenuInfo.accept.color = CT_DKPURPLE1;
cdkeyMenuInfo.accept.color2 = CT_LTPURPLE1;
cdkeyMenuInfo.accept.textX = MENU_BUTTON_TEXT_X;
cdkeyMenuInfo.accept.textY = MENU_BUTTON_TEXT_Y;
cdkeyMenuInfo.accept.textEnum = MBT_ACCEPT;
cdkeyMenuInfo.accept.textcolor = CT_BLACK;
cdkeyMenuInfo.accept.textcolor2 = CT_WHITE;
cdkeyMenuInfo.acceptlater.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.acceptlater.generic.name = GRAPHIC_SQUARE;
cdkeyMenuInfo.acceptlater.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
cdkeyMenuInfo.acceptlater.generic.id = ID_ACCEPTLATER;
cdkeyMenuInfo.acceptlater.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.acceptlater.generic.x = 482;
cdkeyMenuInfo.acceptlater.generic.y = 347;
cdkeyMenuInfo.acceptlater.width = MENU_BUTTON_MED_WIDTH + 20;
cdkeyMenuInfo.acceptlater.height = 42;
cdkeyMenuInfo.acceptlater.color = CT_DKPURPLE1;
cdkeyMenuInfo.acceptlater.color2 = CT_LTPURPLE1;
cdkeyMenuInfo.acceptlater.textX = MENU_BUTTON_TEXT_X;
cdkeyMenuInfo.acceptlater.textY = MENU_BUTTON_TEXT_Y;
cdkeyMenuInfo.acceptlater.textEnum = MBT_CHECKKEYLATER;
cdkeyMenuInfo.acceptlater.textcolor = CT_BLACK;
cdkeyMenuInfo.acceptlater.textcolor2 = CT_WHITE;
cdkeyMenuInfo.acceptlater.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.acceptlater.generic.name = GRAPHIC_SQUARE;
cdkeyMenuInfo.acceptlater.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
cdkeyMenuInfo.acceptlater.generic.id = ID_ACCEPTLATER;
cdkeyMenuInfo.acceptlater.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.acceptlater.generic.x = 482;
cdkeyMenuInfo.acceptlater.generic.y = 347;
cdkeyMenuInfo.acceptlater.width = MENU_BUTTON_MED_WIDTH + 20;
cdkeyMenuInfo.acceptlater.height = 42;
cdkeyMenuInfo.acceptlater.color = CT_DKPURPLE1;
cdkeyMenuInfo.acceptlater.color2 = CT_LTPURPLE1;
cdkeyMenuInfo.acceptlater.textX = MENU_BUTTON_TEXT_X;
cdkeyMenuInfo.acceptlater.textY = MENU_BUTTON_TEXT_Y;
cdkeyMenuInfo.acceptlater.textEnum = MBT_CHECKKEYLATER;
cdkeyMenuInfo.acceptlater.textcolor = CT_BLACK;
cdkeyMenuInfo.acceptlater.textcolor2 = CT_WHITE;
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.cdkey );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.accept );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.acceptlater );
Menu_AddItem(&cdkeyMenuInfo.menu, &cdkeyMenuInfo.cdkey);
Menu_AddItem(&cdkeyMenuInfo.menu, &cdkeyMenuInfo.accept);
Menu_AddItem(&cdkeyMenuInfo.menu, &cdkeyMenuInfo.acceptlater);
if (ui_cdkeychecked.integer == 1) {
cdkeyMenuInfo.keyResult = 0; //already got a good one once
} else {
}
else {
cdkeyMenuInfo.keyResult = 1;
}
UI_LogFuncEnd();
@ -503,11 +507,11 @@ static void UI_CDKeyMenu2_Init( void )
UI_CDKeyMenu
===============
*/
void UI_CDKeyMenu2( void )
void UI_CDKeyMenu2(void)
{
UI_LogFuncBegin();
UI_CDKeyMenu2_Init();
UI_PushMenu( &cdkeyMenuInfo.menu );
UI_PushMenu(&cdkeyMenuInfo.menu);
UI_LogFuncEnd();
}
@ -516,7 +520,7 @@ void UI_CDKeyMenu2( void )
UI_CDKeyMenu_f
===============
*/
void UI_CDKeyMenu_f( void )
void UI_CDKeyMenu_f(void)
{
UI_LogFuncBegin();
UI_CDKeyMenu2();

View file

@ -12,21 +12,22 @@ CONFIRMATION MENU
#include "ui_local.h"
#include "ui_logger.h"
#define ID_CONFIRM_NO 10
#define ID_CONFIRM_YES 11
enum ui_confirmIDs_e {
ID_CONFIRM_NO = 10,
ID_CONFIRM_YES
};
typedef struct
typedef struct
{
menuframework_s menu;
menubitmap_s no;
menubitmap_s yes;
/*const*/ char * question;
void (*draw)( void );
void (*action)( qboolean result );
/*const*/ char * question;
void(*draw)(void);
void(*action)(qboolean result);
qhandle_t cornerPic;
} confirmMenu_t;
@ -39,12 +40,12 @@ static confirmMenu_t s_confirm;
ConfirmMenu_Event
=================
*/
static void ConfirmMenu_Event( void* ptr, int32_t event )
static void ConfirmMenu_Event(void* ptr, int32_t event)
{
UI_LogFuncBegin();
qboolean result;
if( event != QM_ACTIVATED )
if (event != QM_ACTIVATED)
{
UI_LogFuncEnd();
return;
@ -52,18 +53,18 @@ static void ConfirmMenu_Event( void* ptr, int32_t event )
UI_PopMenu();
if( ((menucommon_s*)ptr)->id == ID_CONFIRM_NO )
if (((menucommon_s*)ptr)->id == ID_CONFIRM_NO)
{
result = qfalse;
}
else
else
{
result = qtrue;
}
if( s_confirm.action )
if (s_confirm.action)
{
s_confirm.action( result );
s_confirm.action(result);
}
UI_LogFuncEnd();
}
@ -74,10 +75,10 @@ static void ConfirmMenu_Event( void* ptr, int32_t event )
ConfirmMenu_Key
=================
*/
static sfxHandle_t ConfirmMenu_Key( int32_t key )
static sfxHandle_t ConfirmMenu_Key(int32_t key)
{
UI_LogFuncBegin();
switch ( key )
switch (key)
{
case K_KP_LEFTARROW:
case K_LEFTARROW:
@ -88,17 +89,17 @@ static sfxHandle_t ConfirmMenu_Key( int32_t key )
case 'n':
case 'N':
ConfirmMenu_Event( &s_confirm.no, QM_ACTIVATED );
ConfirmMenu_Event(&s_confirm.no, QM_ACTIVATED);
break;
case 'y':
case 'Y':
ConfirmMenu_Event( &s_confirm.yes, QM_ACTIVATED );
ConfirmMenu_Event(&s_confirm.yes, QM_ACTIVATED);
break;
}
UI_LogFuncEnd();
return Menu_DefaultKey( &s_confirm.menu, key );
return Menu_DefaultKey(&s_confirm.menu, key);
}
@ -107,43 +108,43 @@ static sfxHandle_t ConfirmMenu_Key( int32_t key )
ConfirmMenu_Draw
=================
*/
static void ConfirmMenu_Draw( void )
static void ConfirmMenu_Draw(void)
{
UI_LogFuncBegin();
UI_MenuFrame(&s_confirm.menu);
// End of upper line
trap_R_SetColor( colorTable[CT_LTBROWN1]);
UI_DrawHandlePic( 482, 136, MENU_BUTTON_MED_WIDTH - 22, MENU_BUTTON_MED_HEIGHT, uis.whiteShader);
UI_DrawHandlePic( 460 + MENU_BUTTON_MED_WIDTH -6 , 136, -19, MENU_BUTTON_MED_HEIGHT, uis.graphicButtonLeftEnd); //right
trap_R_SetColor(colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(482, 136, MENU_BUTTON_MED_WIDTH - 22, MENU_BUTTON_MED_HEIGHT, uis.whiteShader);
UI_DrawHandlePic(460 + MENU_BUTTON_MED_WIDTH - 6, 136, -19, MENU_BUTTON_MED_HEIGHT, uis.graphicButtonLeftEnd); //right
trap_R_SetColor( colorTable[CT_DKBLUE2]);
UI_DrawHandlePic( 30, 203, 47, 186, uis.whiteShader); // Left hand column
trap_R_SetColor(colorTable[CT_DKBLUE2]);
UI_DrawHandlePic(30, 203, 47, 186, uis.whiteShader); // Left hand column
UI_DrawProportionalString( 74, 66, "286",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 84, "386",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 188, "486",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 207, "8088",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 395, "12799",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 66, "286", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 84, "386", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 188, "486", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 207, "8088", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 395, "12799", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
trap_R_SetColor( colorTable[CT_LTBLUE1]);
UI_DrawHandlePic( 132, 142, 128, -64, s_confirm.cornerPic); // Top Left corner
UI_DrawHandlePic( 132, 352, 128, 64, s_confirm.cornerPic); // Bottom Left corner
trap_R_SetColor(colorTable[CT_LTBLUE1]);
UI_DrawHandlePic(132, 142, 128, -64, s_confirm.cornerPic); // Top Left corner
UI_DrawHandlePic(132, 352, 128, 64, s_confirm.cornerPic); // Bottom Left corner
UI_DrawHandlePic( 429, 142, -128, -64, s_confirm.cornerPic); // Top Right corner
UI_DrawHandlePic( 429, 352, -128, 64, s_confirm.cornerPic); // Bottom Right corner
UI_DrawHandlePic(429, 142, -128, -64, s_confirm.cornerPic); // Top Right corner
UI_DrawHandlePic(429, 352, -128, 64, s_confirm.cornerPic); // Bottom Right corner
UI_DrawHandlePic(145,175, 395, 18, uis.whiteShader); // Top
UI_DrawHandlePic(132,193, 47, 175, uis.whiteShader); // Left side
UI_DrawHandlePic(510,193, 47, 175, uis.whiteShader); // Right side
UI_DrawHandlePic(147,365, 65, 18, uis.whiteShader); // Bottom Left
UI_DrawHandlePic(477,365, 65, 18, uis.whiteShader); // Bottom Right
UI_DrawHandlePic(145, 175, 395, 18, uis.whiteShader); // Top
UI_DrawHandlePic(132, 193, 47, 175, uis.whiteShader); // Left side
UI_DrawHandlePic(510, 193, 47, 175, uis.whiteShader); // Right side
UI_DrawHandlePic(147, 365, 65, 18, uis.whiteShader); // Bottom Left
UI_DrawHandlePic(477, 365, 65, 18, uis.whiteShader); // Bottom Right
//TiM - if message is a long one, break it up and display it on separate lines
if ( strlen( s_confirm.question ) < 45 )
if (strlen(s_confirm.question) < 45)
{
UI_DrawProportionalString( 345, 269, s_confirm.question, UI_SMALLFONT | UI_CENTER, color_red );
UI_DrawProportionalString(345, 269, s_confirm.question, UI_SMALLFONT | UI_CENTER, color_red);
}
else
{
@ -153,44 +154,44 @@ static void ConfirmMenu_Draw( void )
int32_t height;
int32_t y;
int32_t i, j;
int32_t spacePoint=45;
int32_t spacePoint = 45;
message = s_confirm.question;
numLines = strlen( message ) / 45 + 1;
height = (SMALLCHAR_HEIGHT + 4) * numLines;
y = 277 - (height * 0.5); //269
numLines = strlen(message) / 45 + 1;
height = (SMALLCHAR_HEIGHT + 4) * numLines;
y = 277 - (height * 0.5); //269
//UI_Logger( LL_DEBUG, "numLines: %i\n", numLines );
for ( i = 0; i < numLines; i++ )
for (i = 0; i < numLines; i++)
{
if ( !message )
if (!message)
break;
if (strlen(message) >= 45 )
if (strlen(message) >= 45)
{
for ( j = 1; j <= 45; j++ ) {
if ( message[j] == ' ' )
for (j = 1; j <= 45; j++) {
if (message[j] == ' ')
spacePoint = j;
}
}
else
spacePoint = strlen(message);
Q_strncpyz( buffer, message, spacePoint + 1 );
Q_strncpyz(buffer, message, spacePoint + 1);
//UI_Logger( LL_DEBUG, "%s\n", buffer );
UI_DrawProportionalString( 345, y, buffer, UI_SMALLFONT | UI_CENTER, color_red );
UI_DrawProportionalString(345, y, buffer, UI_SMALLFONT | UI_CENTER, color_red);
y += SMALLCHAR_HEIGHT + 4;
message += spacePoint;
}
}
Menu_Draw( &s_confirm.menu );
if( s_confirm.draw )
Menu_Draw(&s_confirm.menu);
if (s_confirm.draw)
{
s_confirm.draw();
}
@ -203,7 +204,7 @@ static void ConfirmMenu_Draw( void )
ConfirmMenu_Cache
=================
*/
void ConfirmMenu_Cache( void )
void ConfirmMenu_Cache(void)
{
UI_LogFuncBegin();
s_confirm.cornerPic = trap_R_RegisterShaderNoMip("menu/common/corner_ll_47_18.tga");
@ -258,7 +259,7 @@ static const char* TranslateQuestion(const char *question) {
UI_LogFuncEnd();
return menu_normal_text[MNT_LOSTRELIABLECOMMANDS];
}
Q_strncpyz(translatedQuestion, question, sizeof(translatedQuestion));
UI_LogFuncEnd();
return translatedQuestion;
@ -269,12 +270,12 @@ static const char* TranslateQuestion(const char *question) {
UI_ConfirmMenu
=================
*/
void UI_ConfirmMenu( const char *question, void (*draw)( void ), void (*action)( qboolean result ) )
void UI_ConfirmMenu(const char *question, void(*draw)(void), void(*action)(qboolean result))
{
UI_LogFuncBegin();
// zero set all our globals
memset( &s_confirm, 0, sizeof(s_confirm) );
memset(&s_confirm, 0, sizeof(s_confirm));
ConfirmMenu_Cache();
@ -284,59 +285,59 @@ void UI_ConfirmMenu( const char *question, void (*draw)( void ), void (*action)(
s_confirm.draw = draw;
s_confirm.action = action;
s_confirm.menu.draw = ConfirmMenu_Draw;
s_confirm.menu.key = ConfirmMenu_Key;
s_confirm.menu.wrapAround = qtrue;
s_confirm.menu.fullscreen = qtrue;
s_confirm.menu.descX = MENU_DESC_X;
s_confirm.menu.descY = MENU_DESC_Y;
s_confirm.menu.titleX = MENU_TITLE_X;
s_confirm.menu.titleY = MENU_TITLE_Y;
s_confirm.menu.titleI = MNT_CONFIRMATIONMENU_TITLE;
s_confirm.menu.footNoteEnum = MNT_CONFIRMATION;
s_confirm.menu.draw = ConfirmMenu_Draw;
s_confirm.menu.key = ConfirmMenu_Key;
s_confirm.menu.wrapAround = qtrue;
s_confirm.menu.fullscreen = qtrue;
s_confirm.menu.descX = MENU_DESC_X;
s_confirm.menu.descY = MENU_DESC_Y;
s_confirm.menu.titleX = MENU_TITLE_X;
s_confirm.menu.titleY = MENU_TITLE_Y;
s_confirm.menu.titleI = MNT_CONFIRMATIONMENU_TITLE;
s_confirm.menu.footNoteEnum = MNT_CONFIRMATION;
s_confirm.yes.generic.type = MTYPE_BITMAP;
s_confirm.yes.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_confirm.yes.generic.x = 215;
s_confirm.yes.generic.y = 365;
s_confirm.yes.generic.callback = ConfirmMenu_Event;
s_confirm.yes.generic.id = ID_CONFIRM_YES;
s_confirm.yes.generic.name = GRAPHIC_SQUARE;
s_confirm.yes.width = MENU_BUTTON_MED_WIDTH;
s_confirm.yes.height = MENU_BUTTON_MED_HEIGHT;
s_confirm.yes.color = CT_DKPURPLE1;
s_confirm.yes.color2 = CT_LTPURPLE1;
s_confirm.yes.textX = MENU_BUTTON_TEXT_X;
s_confirm.yes.textY = MENU_BUTTON_TEXT_Y;
s_confirm.yes.textEnum = MBT_GENERIC_YES;
s_confirm.yes.textcolor = CT_BLACK;
s_confirm.yes.textcolor2 = CT_WHITE;
s_confirm.yes.generic.type = MTYPE_BITMAP;
s_confirm.yes.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_confirm.yes.generic.x = 215;
s_confirm.yes.generic.y = 365;
s_confirm.yes.generic.callback = ConfirmMenu_Event;
s_confirm.yes.generic.id = ID_CONFIRM_YES;
s_confirm.yes.generic.name = GRAPHIC_SQUARE;
s_confirm.yes.width = MENU_BUTTON_MED_WIDTH;
s_confirm.yes.height = MENU_BUTTON_MED_HEIGHT;
s_confirm.yes.color = CT_DKPURPLE1;
s_confirm.yes.color2 = CT_LTPURPLE1;
s_confirm.yes.textX = MENU_BUTTON_TEXT_X;
s_confirm.yes.textY = MENU_BUTTON_TEXT_Y;
s_confirm.yes.textEnum = MBT_GENERIC_YES;
s_confirm.yes.textcolor = CT_BLACK;
s_confirm.yes.textcolor2 = CT_WHITE;
s_confirm.no.generic.type = MTYPE_BITMAP;
s_confirm.no.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_confirm.no.generic.x = 371;
s_confirm.no.generic.y = 365;
s_confirm.no.generic.callback = ConfirmMenu_Event;
s_confirm.no.generic.id = ID_CONFIRM_NO;
s_confirm.no.generic.name = GRAPHIC_SQUARE;
s_confirm.no.width = 103;
s_confirm.no.height = MENU_BUTTON_MED_HEIGHT;
s_confirm.no.color = CT_DKPURPLE1;
s_confirm.no.color2 = CT_LTPURPLE1;
s_confirm.no.textX = MENU_BUTTON_TEXT_X;
s_confirm.no.textY = MENU_BUTTON_TEXT_Y;
s_confirm.no.textEnum = MBT_GENERIC_NO;
s_confirm.no.textcolor = CT_BLACK;
s_confirm.no.textcolor2 = CT_WHITE;
s_confirm.no.generic.type = MTYPE_BITMAP;
s_confirm.no.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_confirm.no.generic.x = 371;
s_confirm.no.generic.y = 365;
s_confirm.no.generic.callback = ConfirmMenu_Event;
s_confirm.no.generic.id = ID_CONFIRM_NO;
s_confirm.no.generic.name = GRAPHIC_SQUARE;
s_confirm.no.width = 103;
s_confirm.no.height = MENU_BUTTON_MED_HEIGHT;
s_confirm.no.color = CT_DKPURPLE1;
s_confirm.no.color2 = CT_LTPURPLE1;
s_confirm.no.textX = MENU_BUTTON_TEXT_X;
s_confirm.no.textY = MENU_BUTTON_TEXT_Y;
s_confirm.no.textEnum = MBT_GENERIC_NO;
s_confirm.no.textcolor = CT_BLACK;
s_confirm.no.textcolor2 = CT_WHITE;
Menu_AddItem( &s_confirm.menu, &s_confirm.yes );
Menu_AddItem(&s_confirm.menu, &s_confirm.yes);
if (action) {
Menu_AddItem( &s_confirm.menu, &s_confirm.no );
Menu_AddItem(&s_confirm.menu, &s_confirm.no);
}
UI_PushMenu( &s_confirm.menu );
UI_PushMenu(&s_confirm.menu);
Menu_SetCursorToItem( &s_confirm.menu, &s_confirm.no );
Menu_SetCursorToItem(&s_confirm.menu, &s_confirm.no);
UI_LogFuncEnd();
}

View file

@ -15,7 +15,7 @@ qboolean passwordNeeded = qtrue;
menufield_s passwordField;
static connstate_t lastConnState;
static char lastLoadingText[MAX_INFO_VALUE];
static char lastLoadingText[MAX_INFO_VALUE];
static void UI_ReadableSize ( char *buf, int32_t bufsize, int32_t value )
{

File diff suppressed because it is too large Load diff