Support for changing the SSG crosshair. Some other stuff

This commit is contained in:
Andrei Drexler 2002-06-12 11:15:31 +00:00
parent 7e68d5418c
commit 7729408d8d
5 changed files with 72 additions and 47 deletions

View file

@ -6,32 +6,6 @@
--------------------Configuration: ui - Win32 Release TA--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1F2.tmp" with contents
[
/nologo /G6 /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /Fp"Release_TA/ta_ui.pch" /YX /Fo"Release_TA/" /Fd"Release_TA/" /FD /c
"C:\Games\Quake3\rq3source\reaction\ta_ui\ui_main.c"
]
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1F2.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1F3.tmp" with contents
[
/nologo /base:"0x40000000" /dll /incremental:no /pdb:"Release_TA/uix86.pdb" /map:"Release_TA/uix86.map" /machine:I386 /def:".\ui.def" /out:"../Release/uix86.dll" /implib:"Release_TA/uix86.lib"
.\Release_TA\bg_misc.obj
.\Release_TA\q_math.obj
.\Release_TA\q_shared.obj
.\Release_TA\ui_atoms.obj
.\Release_TA\ui_gameinfo.obj
.\Release_TA\ui_main.obj
.\Release_TA\ui_players.obj
.\Release_TA\ui_shared.obj
.\Release_TA\ui_syscalls.obj
.\Release_TA\ui_util.obj
]
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1F3.tmp"
<h3>Output Window</h3>
Compiling...
ui_main.c
Linking...
Creating library Release_TA/uix86.lib and object Release_TA/uix86.exp

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.14 2002/06/12 11:15:31 makro
// Support for changing the SSG crosshair. Some other stuff
//
// Revision 1.13 2002/06/09 18:56:53 makro
// Removed teamcount cvars
//
@ -178,7 +181,8 @@ extern vmCvar_t ui_RQ3_demoName;
#define MAX_EDIT_LINE 256
#define MAX_MENUDEPTH 8
#define MAX_MENUITEMS 96
//Makro - this is already defined in ui_shared.h
//#define MAX_MENUITEMS 100
#define MTYPE_NULL 0
#define MTYPE_SLIDER 1
@ -868,8 +872,6 @@ typedef struct {
int nextFindPlayerRefresh;
int currentCrosshair;
//Makro - for the SSG crosshair preview
int currentSSGCrosshair;
//Makro - save the music volume
float oldMusicVol;
qboolean savedMusicVol;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.31 2002/06/12 11:15:31 makro
// Support for changing the SSG crosshair. Some other stuff
//
// Revision 1.30 2002/06/09 18:56:53 makro
// Removed teamcount cvars
//
@ -2065,10 +2068,6 @@ static void UI_DrawSSGCrosshair(rectDef_t *rect) {
color[3] = trap_Cvar_VariableValue("cg_RQ3_ssgColorA");
trap_R_SetColor( color );
if (uiInfo.currentSSGCrosshair < 0 || uiInfo.currentSSGCrosshair >= NUM_SSGCROSSHAIRS) {
uiInfo.currentSSGCrosshair = 0;
}
UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.uiDC.Assets.SSGcrosshairShader);
trap_R_SetColor( NULL );
}
@ -2974,13 +2973,32 @@ static qboolean UI_Crosshair_HandleKey(int flags, float *special, int key) {
return qfalse;
}
//Makro - for the SSG crosshair
//Not used yet
/*
//Makro - added for the SSG crosshair
static qboolean UI_SSG_Crosshair_HandleKey(int flags, float *special, int key) {
//Makro - left/right support
if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER || key == K_LEFTARROW || key == K_RIGHTARROW) {
int current = (int) trap_Cvar_VariableValue("cg_RQ3_ssgCrosshair"), offset = 1;
if (key == K_MOUSE2 || key == K_LEFTARROW) {
offset = -1;
}
current += offset;
if (current < 0)
current = NUM_SSGCROSSHAIRS - 1;
else if (current >= NUM_SSGCROSSHAIRS)
current = 0;
trap_Cvar_SetValue("cg_RQ3_ssgCrosshair", (float) current);
if (current == 0)
uiInfo.uiDC.Assets.SSGcrosshairShader = trap_R_RegisterShaderNoMip("gfx/rq3_hud/ssg2x");
else
uiInfo.uiDC.Assets.SSGcrosshairShader = trap_R_RegisterShaderNoMip(va("gfx/rq3_hud/ssg2x-%i", current));
return qtrue;
}
return qfalse;
}
*/
static qboolean UI_SelectedPlayer_HandleKey(int flags, float *special, int key) {
//Makro - left/right support
@ -3082,7 +3100,7 @@ static qboolean UI_OwnerDrawHandleKey(int ownerDraw, int flags, float *special,
break;
//Makro - for the SSG crosshair
case UI_SSG_CROSSHAIR:
UI_Crosshair_HandleKey(flags, special, key);
UI_SSG_Crosshair_HandleKey(flags, special, key);
break;
case UI_SELECTEDPLAYER:
UI_SelectedPlayer_HandleKey(flags, special, key);
@ -3634,6 +3652,26 @@ static void UI_RunMenuScript(char **args) {
} else {
trap_Cvar_Set("ui_cdkeyvalid", "CD Key does not appear to be valid.");
}
//Makro - change the SSG crosshair
} else if (Q_stricmp(name, "nextSSGCrosshair") == 0) {
int current, offset;
if (Int_Parse(args, &offset)) {
if (String_Parse(args, &name2)) {
qboolean instant = (Q_stricmp(name2, "instant") == 0);
current = (int) trap_Cvar_VariableValue("cg_RQ3_ssgCrosshair") + offset;
if (current < 0)
current = NUM_SSGCROSSHAIRS - 1;
else if (current >= NUM_SSGCROSSHAIRS)
current = 0;
if (instant) {
if (current == 0)
uiInfo.uiDC.Assets.SSGcrosshairShader = trap_R_RegisterShaderNoMip("gfx/rq3_hud/ssg2x");
else
uiInfo.uiDC.Assets.SSGcrosshairShader = trap_R_RegisterShaderNoMip(va("gfx/rq3_hud/ssg2x-%i", current));
}
trap_Cvar_SetValue("cg_RQ3_ssgCrosshair", (float) current);
}
}
} else if (Q_stricmp(name, "loadArenas") == 0) {
//Makro - updating cvars needed here
trap_Cvar_Set( "ui_netGameType", va("%d", ui_netGameType.integer));
@ -3833,7 +3871,8 @@ static void UI_RunMenuScript(char **args) {
trap_Cmd_ExecuteText( EXEC_APPEND, va("wait; addbot %s %i %s\n", UI_GetBotNameByNumber(index), uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") );
//Makro - record a demo
} else if (Q_stricmp(name, "recordDemo") == 0) {
trap_Cmd_ExecuteText( EXEC_APPEND, va("record %s", ui_RQ3_demoName.string) );
int oldSync = (int) trap_Cvar_VariableValue("g_synchronousClients");
trap_Cmd_ExecuteText( EXEC_APPEND, va("wait; wait; set g_synchronousClients 1; record %s; set g_synchronousClients %i", ui_RQ3_demoName.string, oldSync) );
} else if (Q_stricmp(name, "addFavorite") == 0) {
if (ui_netSource.integer != AS_FAVORITES) {
char name[MAX_NAME_LENGTH];
@ -5653,8 +5692,7 @@ void _UI_Init( qboolean inGameLoad ) {
// sets defaults for ui temp cvars
uiInfo.effectsColor = gamecodetoui[(int)trap_Cvar_VariableValue("color1")-1];
uiInfo.currentCrosshair = (int)trap_Cvar_VariableValue("cg_drawCrosshair");
//Makro - for the SSG crosshair preview
uiInfo.currentSSGCrosshair = (int)trap_Cvar_VariableValue("cg_RQ3_ssgCrosshair");
trap_Cvar_Set("ui_mousePitch", (trap_Cvar_VariableValue("m_pitch") >= 0) ? "0" : "1");
//Makro - save the music volume

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.20 2002/06/12 11:15:31 makro
// Support for changing the SSG crosshair. Some other stuff
//
// Revision 1.19 2002/06/08 11:43:31 makro
// Changed color "lerping" for focused items a bit
//
@ -3732,7 +3735,9 @@ static bind_t g_bindings[] =
{"ui_RQ3_loadout", 'l', -1, -1, -1},
{"ui_RQ3_joinTeam", 'j', -1, -1, -1},
{"ui_RQ3_radio", -1, -1, -1, -1},
{"ui_RQ3_tkok", -1, -1, -1, -1}
{"ui_RQ3_tkok", -1, -1, -1, -1},
{"screenshot", -1, -1, -1. -1},
{"screenshotJPEG", K_F12, -1, -1. -1}
};
@ -3976,10 +3981,12 @@ void Item_Bind_Paint(itemDef_t *item) {
lowLight[2] = 0.8f * 0.0f;
lowLight[3] = 0.8f * 1.0f;
} else {
lowLight[0] = 0.8f * parent->focusColor[0];
lowLight[1] = 0.8f * parent->focusColor[1];
lowLight[2] = 0.8f * parent->focusColor[2];
lowLight[3] = 0.8f * parent->focusColor[3];
//Makro - changed to use item forecolor
//lowLight[0] = 0.8f * parent->focusColor[0];
//lowLight[1] = 0.8f * parent->focusColor[1];
//lowLight[2] = 0.8f * parent->focusColor[2];
//lowLight[3] = 0.8f * parent->focusColor[3];
memcpy(lowLight, &item->window.foreColor, sizeof(item->window.foreColor));
}
LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));
} else {

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.12 2002/06/12 11:15:31 makro
// Support for changing the SSG crosshair. Some other stuff
//
// Revision 1.11 2002/04/11 20:57:19 makro
// Tweaked onShow script handling; added onFirstShow script
//
@ -53,7 +56,8 @@
#define MAX_MENUDEFFILE 4096
#define MAX_MENUFILE 32768
#define MAX_MENUS 64
#define MAX_MENUITEMS 96
//Makro - changed max item count from 96
#define MAX_MENUITEMS 100
#define MAX_COLOR_RANGES 10
#define MAX_OPEN_MENUS 16