summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/ui_main.c21
-rw-r--r--src/ui/ui_public.h269
-rw-r--r--src/ui/ui_shared.c2
3 files changed, 146 insertions, 146 deletions
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index d26835d8..ed4d9d36 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -1707,7 +1707,7 @@ static void UI_DrawPlayerModel(rectDef_t *rect) {
}
static void UI_DrawNetSource(rectDef_t *rect, float scale, vec4_t color, int textStyle) {
- if (ui_netSource.integer < 0 || ui_netSource.integer > uiInfo.numGameTypes) {
+ if (ui_netSource.integer < 0 || ui_netSource.integer > numNetSources) {
ui_netSource.integer = 0;
}
Text_Paint(rect->x, rect->y, scale, color, va("Source: %s", netSources[ui_netSource.integer]), 0, 0, textStyle);
@@ -1718,7 +1718,7 @@ static void UI_DrawNetMapPreview(rectDef_t *rect, float scale, vec4_t color) {
if (uiInfo.serverStatus.currentServerPreview > 0) {
UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.serverStatus.currentServerPreview);
} else {
- UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("menu/art/unknownmap"));
+ UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("gfx/2d/load_screen"));
}
}
@@ -2943,11 +2943,15 @@ static qboolean UI_TeamMember_HandleKey(int flags, float *special, int key, qboo
static qboolean UI_NetSource_HandleKey(int flags, float *special, int key) {
if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
+ Com_Printf( "pre1 ui_netSource: %d\n", ui_netSource.integer );
+
if (key == K_MOUSE2) {
ui_netSource.integer--;
} else {
ui_netSource.integer++;
}
+
+ Com_Printf( "pre ui_netSource: %d\n", ui_netSource.integer );
if (ui_netSource.integer >= numNetSources) {
ui_netSource.integer = 0;
@@ -2955,6 +2959,8 @@ static qboolean UI_NetSource_HandleKey(int flags, float *special, int key) {
ui_netSource.integer = numNetSources - 1;
}
+ Com_Printf( "post ui_netSource: %d\n", ui_netSource.integer );
+
UI_BuildServerDisplayList(qtrue);
if (ui_netSource.integer != AS_GLOBAL) {
UI_StartServerRefresh(qtrue);
@@ -5189,6 +5195,7 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan
lastColumn = column;
lastTime = uiInfo.uiDC.realTime;
}
+ /*return "bah";*/
ping = atoi(Info_ValueForKey(info, "ping"));
if (ping == -1) {
// if we ever see a ping that is out of date, do a server refresh
@@ -5216,17 +5223,11 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan
return hostname;
}
}
- case SORT_MAP : return Info_ValueForKey(info, "mapname");
+ case SORT_MAP :
+ return Info_ValueForKey(info, "mapname");
case SORT_CLIENTS :
Com_sprintf( clientBuff, sizeof(clientBuff), "%s (%s)", Info_ValueForKey(info, "clients"), Info_ValueForKey(info, "sv_maxclients"));
return clientBuff;
- case SORT_GAME :
- game = atoi(Info_ValueForKey(info, "gametype"));
- if (game >= 0 && game < numTeamArenaGameTypes) {
- return teamArenaGameTypes[game];
- } else {
- return "Unknown";
- }
case SORT_PING :
if (ping <= 0) {
return "...";
diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h
index 1b560fcb..29f795fb 100644
--- a/src/ui/ui_public.h
+++ b/src/ui/ui_public.h
@@ -17,162 +17,161 @@
#ifndef __UI_PUBLIC_H__
#define __UI_PUBLIC_H__
-#define UI_API_VERSION 6
+#define UI_API_VERSION 6
typedef struct {
- connstate_t connState;
- int connectPacketCount;
- int clientNum;
- char servername[MAX_STRING_CHARS];
- char updateInfoString[MAX_STRING_CHARS];
- char messageString[MAX_STRING_CHARS];
+ connstate_t connState;
+ int connectPacketCount;
+ int clientNum;
+ char servername[MAX_STRING_CHARS];
+ char updateInfoString[MAX_STRING_CHARS];
+ char messageString[MAX_STRING_CHARS];
} uiClientState_t;
typedef enum {
- UI_ERROR,
- UI_PRINT,
- UI_MILLISECONDS,
- UI_CVAR_SET,
- UI_CVAR_VARIABLEVALUE,
- UI_CVAR_VARIABLESTRINGBUFFER,
- UI_CVAR_SETVALUE,
- UI_CVAR_RESET,
- UI_CVAR_CREATE,
- UI_CVAR_INFOSTRINGBUFFER,
- UI_ARGC,
- UI_ARGV,
- UI_CMD_EXECUTETEXT,
- UI_FS_FOPENFILE,
- UI_FS_READ,
- UI_FS_WRITE,
- UI_FS_FCLOSEFILE,
- UI_FS_GETFILELIST,
- UI_R_REGISTERMODEL,
- UI_R_REGISTERSKIN,
- UI_R_REGISTERSHADERNOMIP,
- UI_R_CLEARSCENE,
- UI_R_ADDREFENTITYTOSCENE,
- UI_R_ADDPOLYTOSCENE,
- UI_R_ADDLIGHTTOSCENE,
- UI_R_RENDERSCENE,
- UI_R_SETCOLOR,
- UI_R_DRAWSTRETCHPIC,
- UI_UPDATESCREEN,
- UI_CM_LERPTAG,
- UI_CM_LOADMODEL,
- UI_S_REGISTERSOUND,
- UI_S_STARTLOCALSOUND,
- UI_KEY_KEYNUMTOSTRINGBUF,
- UI_KEY_GETBINDINGBUF,
- UI_KEY_SETBINDING,
- UI_KEY_ISDOWN,
- UI_KEY_GETOVERSTRIKEMODE,
- UI_KEY_SETOVERSTRIKEMODE,
- UI_KEY_CLEARSTATES,
- UI_KEY_GETCATCHER,
- UI_KEY_SETCATCHER,
- UI_GETCLIPBOARDDATA,
- UI_GETGLCONFIG,
- UI_GETCLIENTSTATE,
- UI_GETCONFIGSTRING,
- UI_LAN_GETPINGQUEUECOUNT,
- UI_LAN_CLEARPING,
- UI_LAN_GETPING,
- UI_LAN_GETPINGINFO,
- UI_CVAR_REGISTER,
- UI_CVAR_UPDATE,
- UI_MEMORY_REMAINING,
- UI_GET_CDKEY,
- UI_SET_CDKEY,
- UI_R_REGISTERFONT,
- UI_R_MODELBOUNDS,
- UI_PC_ADD_GLOBAL_DEFINE,
- UI_PC_LOAD_SOURCE,
- UI_PC_FREE_SOURCE,
- UI_PC_READ_TOKEN,
- UI_PC_SOURCE_FILE_AND_LINE,
- UI_S_STOPBACKGROUNDTRACK,
- UI_S_STARTBACKGROUNDTRACK,
- UI_REAL_TIME,
- UI_LAN_GETSERVERCOUNT,
- UI_LAN_GETSERVERADDRESSSTRING,
- UI_LAN_GETSERVERINFO,
- UI_LAN_MARKSERVERVISIBLE,
- UI_LAN_UPDATEVISIBLEPINGS,
- UI_LAN_RESETPINGS,
- UI_LAN_LOADCACHEDSERVERS,
- UI_LAN_SAVECACHEDSERVERS,
- UI_LAN_ADDSERVER,
- UI_LAN_REMOVESERVER,
- UI_CIN_PLAYCINEMATIC,
- UI_CIN_STOPCINEMATIC,
- UI_CIN_RUNCINEMATIC,
- UI_CIN_DRAWCINEMATIC,
- UI_CIN_SETEXTENTS,
- UI_R_REMAP_SHADER,
- UI_VERIFY_CDKEY,
- UI_LAN_SERVERSTATUS,
- UI_LAN_GETSERVERPING,
- UI_LAN_SERVERISVISIBLE,
- UI_LAN_COMPARESERVERS,
-
- UI_MEMSET = 100,
- UI_MEMCPY,
- UI_STRNCPY,
- UI_SIN,
- UI_COS,
- UI_ATAN2,
- UI_SQRT,
- UI_FLOOR,
- UI_CEIL
+ UI_ERROR,
+ UI_PRINT,
+ UI_MILLISECONDS,
+ UI_CVAR_SET,
+ UI_CVAR_VARIABLEVALUE,
+ UI_CVAR_VARIABLESTRINGBUFFER,
+ UI_CVAR_SETVALUE,
+ UI_CVAR_RESET,
+ UI_CVAR_CREATE,
+ UI_CVAR_INFOSTRINGBUFFER,
+ UI_ARGC,
+ UI_ARGV,
+ UI_CMD_EXECUTETEXT,
+ UI_FS_FOPENFILE,
+ UI_FS_READ,
+ UI_FS_WRITE,
+ UI_FS_FCLOSEFILE,
+ UI_FS_GETFILELIST,
+ UI_R_REGISTERMODEL,
+ UI_R_REGISTERSKIN,
+ UI_R_REGISTERSHADERNOMIP,
+ UI_R_CLEARSCENE,
+ UI_R_ADDREFENTITYTOSCENE,
+ UI_R_ADDPOLYTOSCENE,
+ UI_R_ADDLIGHTTOSCENE,
+ UI_R_RENDERSCENE,
+ UI_R_SETCOLOR,
+ UI_R_DRAWSTRETCHPIC,
+ UI_UPDATESCREEN,
+ UI_CM_LERPTAG,
+ UI_CM_LOADMODEL,
+ UI_S_REGISTERSOUND,
+ UI_S_STARTLOCALSOUND,
+ UI_KEY_KEYNUMTOSTRINGBUF,
+ UI_KEY_GETBINDINGBUF,
+ UI_KEY_SETBINDING,
+ UI_KEY_ISDOWN,
+ UI_KEY_GETOVERSTRIKEMODE,
+ UI_KEY_SETOVERSTRIKEMODE,
+ UI_KEY_CLEARSTATES,
+ UI_KEY_GETCATCHER,
+ UI_KEY_SETCATCHER,
+ UI_GETCLIPBOARDDATA,
+ UI_GETGLCONFIG,
+ UI_GETCLIENTSTATE,
+ UI_GETCONFIGSTRING,
+ UI_LAN_GETPINGQUEUECOUNT,
+ UI_LAN_CLEARPING,
+ UI_LAN_GETPING,
+ UI_LAN_GETPINGINFO,
+ UI_CVAR_REGISTER,
+ UI_CVAR_UPDATE,
+ UI_MEMORY_REMAINING,
+ UI_GET_CDKEY,
+ UI_SET_CDKEY,
+ UI_R_REGISTERFONT,
+ UI_R_MODELBOUNDS,
+ UI_PC_ADD_GLOBAL_DEFINE,
+ UI_PC_LOAD_SOURCE,
+ UI_PC_FREE_SOURCE,
+ UI_PC_READ_TOKEN,
+ UI_PC_SOURCE_FILE_AND_LINE,
+ UI_S_STOPBACKGROUNDTRACK,
+ UI_S_STARTBACKGROUNDTRACK,
+ UI_REAL_TIME,
+ UI_LAN_GETSERVERCOUNT,
+ UI_LAN_GETSERVERADDRESSSTRING,
+ UI_LAN_GETSERVERINFO,
+ UI_LAN_MARKSERVERVISIBLE,
+ UI_LAN_UPDATEVISIBLEPINGS,
+ UI_LAN_RESETPINGS,
+ UI_LAN_LOADCACHEDSERVERS,
+ UI_LAN_SAVECACHEDSERVERS,
+ UI_LAN_ADDSERVER,
+ UI_LAN_REMOVESERVER,
+ UI_CIN_PLAYCINEMATIC,
+ UI_CIN_STOPCINEMATIC,
+ UI_CIN_RUNCINEMATIC,
+ UI_CIN_DRAWCINEMATIC,
+ UI_CIN_SETEXTENTS,
+ UI_R_REMAP_SHADER,
+ UI_VERIFY_CDKEY,
+ UI_LAN_SERVERSTATUS,
+ UI_LAN_GETSERVERPING,
+ UI_LAN_SERVERISVISIBLE,
+ UI_LAN_COMPARESERVERS,
+
+ UI_MEMSET = 100,
+ UI_MEMCPY,
+ UI_STRNCPY,
+ UI_SIN,
+ UI_COS,
+ UI_ATAN2,
+ UI_SQRT,
+ UI_FLOOR,
+ UI_CEIL
} uiImport_t;
typedef enum {
- UIMENU_NONE,
- UIMENU_MAIN,
- UIMENU_INGAME,
- UIMENU_NEED_CD,
- UIMENU_BAD_CD_KEY,
- UIMENU_TEAM,
- UIMENU_POSTGAME
+ UIMENU_NONE,
+ UIMENU_MAIN,
+ UIMENU_INGAME,
+ UIMENU_NEED_CD,
+ UIMENU_BAD_CD_KEY,
+ UIMENU_TEAM,
+ UIMENU_POSTGAME
} uiMenuCommand_t;
-#define SORT_HOST 0
-#define SORT_MAP 1
-#define SORT_CLIENTS 2
-#define SORT_GAME 3
-#define SORT_PING 4
+#define SORT_HOST 0
+#define SORT_MAP 1
+#define SORT_CLIENTS 2
+#define SORT_PING 3
typedef enum {
- UI_GETAPIVERSION = 0, // system reserved
+ UI_GETAPIVERSION = 0, // system reserved
- UI_INIT,
-// void UI_Init( void );
+ UI_INIT,
+// void UI_Init( void );
- UI_SHUTDOWN,
-// void UI_Shutdown( void );
+ UI_SHUTDOWN,
+// void UI_Shutdown( void );
- UI_KEY_EVENT,
-// void UI_KeyEvent( int key );
+ UI_KEY_EVENT,
+// void UI_KeyEvent( int key );
- UI_MOUSE_EVENT,
-// void UI_MouseEvent( int dx, int dy );
+ UI_MOUSE_EVENT,
+// void UI_MouseEvent( int dx, int dy );
- UI_REFRESH,
-// void UI_Refresh( int time );
+ UI_REFRESH,
+// void UI_Refresh( int time );
- UI_IS_FULLSCREEN,
-// qboolean UI_IsFullscreen( void );
+ UI_IS_FULLSCREEN,
+// qboolean UI_IsFullscreen( void );
- UI_SET_ACTIVE_MENU,
-// void UI_SetActiveMenu( uiMenuCommand_t menu );
+ UI_SET_ACTIVE_MENU,
+// void UI_SetActiveMenu( uiMenuCommand_t menu );
- UI_CONSOLE_COMMAND,
-// qboolean UI_ConsoleCommand( int realTime );
+ UI_CONSOLE_COMMAND,
+// qboolean UI_ConsoleCommand( int realTime );
- UI_DRAW_CONNECT_SCREEN,
-// void UI_DrawConnectScreen( qboolean overlay );
- UI_HASUNIQUECDKEY
+ UI_DRAW_CONNECT_SCREEN,
+// void UI_DrawConnectScreen( qboolean overlay );
+ UI_HASUNIQUECDKEY
// if !overlay, the background will be drawn, otherwise it will be
// overlayed over whatever the cgame has drawn.
// a GetClientState syscall will be made to get the current strings
diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c
index c6a8253a..7a6da0c1 100644
--- a/src/ui/ui_shared.c
+++ b/src/ui/ui_shared.c
@@ -3755,7 +3755,7 @@ void Item_ListBox_Paint(itemDef_t *item) {
DC->drawHandlePic(x + 4 + listPtr->columnInfo[j].pos, y - 1 + listPtr->elementHeight / 2, listPtr->columnInfo[j].width, listPtr->columnInfo[j].width, optionalImage);
} else if (text) {
//TA:
- int alignOffset, tw;
+ int alignOffset = 0.0f, tw;
tw = DC->textWidth( text, item->textscale, 0 );