From 9b91bc80a8f48fe1a3903a216a2082dd10282886 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Tue, 30 Apr 2002 11:56:54 +0000 Subject: [PATCH] Stuff --- reaction/ta_ui/ta_ui.plg | 8 +-- reaction/ta_ui/ui_atoms.c | 12 ++++ reaction/ta_ui/ui_main.c | 20 +++++- reaction/ta_ui/ui_public.h | 6 +- reaction/ta_ui/ui_shared.c | 140 ++++++++++++++++++++----------------- 5 files changed, 113 insertions(+), 73 deletions(-) diff --git a/reaction/ta_ui/ta_ui.plg b/reaction/ta_ui/ta_ui.plg index e3a12df3..38cc99b0 100644 --- a/reaction/ta_ui/ta_ui.plg +++ b/reaction/ta_ui/ta_ui.plg @@ -6,7 +6,7 @@ --------------------Configuration: ui - Win32 Release TA--------------------

Command Lines

-Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP183E.tmp" with contents +Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP196A.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\game\bg_misc.c" @@ -20,8 +20,8 @@ Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP183E.tmp" with cont "C:\Games\Quake3\rq3source\reaction\ta_ui\ui_syscalls.c" "C:\Games\Quake3\rq3source\reaction\ta_ui\ui_util.c" ] -Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP183E.tmp" -Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP183F.tmp" with contents +Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP196A.tmp" +Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP196B.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:"uix86.dll" /implib:"Release_TA/uix86.lib" .\Release_TA\bg_misc.obj @@ -35,7 +35,7 @@ Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP183F.tmp" with cont .\Release_TA\ui_syscalls.obj .\Release_TA\ui_util.obj ] -Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP183F.tmp" +Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP196B.tmp"

Output Window

Compiling... bg_misc.c diff --git a/reaction/ta_ui/ui_atoms.c b/reaction/ta_ui/ui_atoms.c index 82cad84a..2f661fef 100644 --- a/reaction/ta_ui/ui_atoms.c +++ b/reaction/ta_ui/ui_atoms.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.10 2002/04/30 11:56:54 makro +// Stuff +// // Revision 1.9 2002/04/07 17:51:49 makro // Abbey // @@ -425,6 +428,15 @@ qboolean UI_ConsoleCommand( int realTime ) { return qtrue; } + //Makro - tkok menu + if ( Q_stricmp (cmd, "ui_RQ3_tkok") == 0 ) { + if ( trap_Cvar_VariableValue("g_gametype") >= GT_TEAM) + _UI_SetActiveMenu(UIMENU_RQ3_TKOK); + else + Com_Printf("Not playing a team-based game.\n"); + return qtrue; + } + //Makro - I've always wanted a command to inc/dec a cvar :) if ( Q_stricmp (cmd, "inc") == 0 ) { if (trap_Argc() >= 2) { diff --git a/reaction/ta_ui/ui_main.c b/reaction/ta_ui/ui_main.c index 1160fc3a..ac7df4e4 100644 --- a/reaction/ta_ui/ui_main.c +++ b/reaction/ta_ui/ui_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.19 2002/04/30 11:56:54 makro +// Stuff +// // Revision 1.18 2002/04/22 18:40:58 makro // Model validation // @@ -5569,6 +5572,9 @@ void _UI_Init( qboolean inGameLoad ) { uiInfo.playingIntro = ""; uiInfo.playingLoop = ""; + //Makro - set default bot skill to max + uiInfo.skillIndex = numSkillLevels - 1; + uiInfo.serverStatus.currentServerCinematic = -1; uiInfo.previewMovie = -1; @@ -5730,6 +5736,13 @@ void _UI_SetActiveMenu( uiMenuCommand_t menu ) { Menus_CloseAll(); Menus_ActivateByName("ingame_join"); return; + case UIMENU_RQ3_TKOK: + trap_Cvar_Set( "cl_paused", "1" ); + trap_Key_SetCatcher( KEYCATCH_UI ); + UI_BuildPlayerList(); + Menus_CloseAll(); + Menus_ActivateByName("ingame_tkok"); + return; } } } @@ -6201,7 +6214,8 @@ static cvarTable_t cvarTable[] = { { &ui_smallFont, "ui_smallFont", "0.25", CVAR_ARCHIVE}, { &ui_bigFont, "ui_bigFont", "0.4", CVAR_ARCHIVE}, { &ui_findPlayer, "ui_findPlayer", "Sarge", CVAR_ARCHIVE}, - { &ui_Q3Model, "ui_q3model", "0", CVAR_ARCHIVE}, + //Makro - adding CVAR_ROM + { &ui_Q3Model, "ui_q3model", "1", CVAR_ARCHIVE | CVAR_ROM}, { &ui_hudFiles, "cg_hudFiles", "ui/hud.txt", CVAR_ARCHIVE}, { &ui_recordSPDemo, "ui_recordSPDemo", "0", CVAR_ARCHIVE}, { &ui_teamArenaFirstRun, "ui_teamArenaFirstRun", "0", CVAR_ARCHIVE}, @@ -6209,9 +6223,9 @@ static cvarTable_t cvarTable[] = { { &ui_realCaptureLimit, "capturelimit", "8", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART}, { &ui_serverStatusTimeOut, "ui_serverStatusTimeOut", "7000", CVAR_ARCHIVE}, //Makro - cvar for player model display - { &ui_RQ3_modelCommand, "ui_RQ3_modelCommand", "0", CVAR_ARCHIVE}, + { &ui_RQ3_modelCommand, "ui_RQ3_modelCommand", "0", 0}, { &ui_RQ3_ssgCrosshair, "ui_RQ3_ssgCrosshair", "0", 0}, - { &ui_RQ3_weapAfterJoin, "ui_RQ3_weapAfterJoin", "0", CVAR_ARCHIVE}, + { &ui_RQ3_weapAfterJoin, "ui_RQ3_weapAfterJoin", "1", CVAR_ARCHIVE}, //Makro - team counts { &ui_RQ3_teamCount1, "g_RQ3_teamCount1", "0", 0}, { &ui_RQ3_teamCount2, "g_RQ3_teamCount2", "0", 0}, diff --git a/reaction/ta_ui/ui_public.h b/reaction/ta_ui/ui_public.h index f0ac7f96..5c8cc145 100644 --- a/reaction/ta_ui/ui_public.h +++ b/reaction/ta_ui/ui_public.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.5 2002/04/30 11:56:54 makro +// Stuff +// // Revision 1.4 2002/03/03 21:22:58 makro // no message // @@ -139,7 +142,8 @@ typedef enum { //Makro - added weapon menu UIMENU_RQ3_WEAPON, //Makro - added join menu - UIMENU_RQ3_JOIN + UIMENU_RQ3_JOIN, + UIMENU_RQ3_TKOK } uiMenuCommand_t; #define SORT_HOST 0 diff --git a/reaction/ta_ui/ui_shared.c b/reaction/ta_ui/ui_shared.c index 2299ead8..c3ec9a08 100644 --- a/reaction/ta_ui/ui_shared.c +++ b/reaction/ta_ui/ui_shared.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.15 2002/04/30 11:56:54 makro +// Stuff +// // Revision 1.14 2002/04/20 15:06:28 makro // Cool stuff :p // @@ -2923,7 +2926,7 @@ static void Display_CloseCinematics() { void Menus_Activate(menuDef_t *menu) { int i; - //Makro - better to check for this kind of stuff + //Makro - it's better to check for this kind of stuff if (!menu) { return; } @@ -2953,21 +2956,23 @@ void Menus_Activate(menuDef_t *menu) { for (i=0; iitemCount; i++) { if (menu->items[i]->type == ITEM_TYPE_LISTBOX && menu->items[i]->special == FEEDER_Q3HEADS) { //Makro - select the right player model icon - listBoxDef_t *listPtr; - int size = 2, start = 0, pos = UI_SelectedQ3Head(qtrue); + listBoxDef_t *listPtr = (listBoxDef_t*)menu->items[i]->typeData; + int size = 2, start = 0, end = 2, pos = UI_SelectedQ3Head(qtrue); - listPtr = (listBoxDef_t*)menu->items[i]->typeData; if (listPtr->elementWidth) { size = (int) (menu->items[i]->window.rect.w / listPtr->elementWidth); - if (size < 2) - break; - start = listPtr->startPos; - if ( start + size < pos) - start = ((int) (pos / size)) * size; - if (start + size > DC->feederCount(FEEDER_Q3HEADS)) - start = DC->feederCount(FEEDER_Q3HEADS) - size; - listPtr->startPos = start; - listPtr->endPos = start + size; + if (size >= 2) { + start = listPtr->startPos; + end = listPtr->endPos; + if (start + size <= pos || pos + size <= end) + start = ((int) (pos / size)) * size; + if (start + size > DC->feederCount(FEEDER_Q3HEADS)) + start = DC->feederCount(FEEDER_Q3HEADS) - size; + if (start < 0) + start = 0; + listPtr->startPos = start; + listPtr->endPos = start + size; + } } listPtr->cursorPos = pos; menu->items[i]->cursorPos = pos; @@ -3633,57 +3638,62 @@ typedef struct static bind_t g_bindings[] = { + //Makro - 3rd column was filled with -1; adding secondary binds + // - also, fixed the tabbing //Makro - using scores instead of +scores - {"scores", K_TAB, -1, -1, -1}, - {"+button2", K_ENTER, -1, -1, -1}, - {"+speed", K_SHIFT, -1, -1, -1}, - {"+forward", K_UPARROW, -1, -1, -1}, - {"+back", K_DOWNARROW, -1, -1, -1}, - {"+moveleft", ',', -1, -1, -1}, - {"+moveright", '.', -1, -1, -1}, - {"+moveup", K_SPACE, -1, -1, -1}, - {"+movedown", 'c', -1, -1, -1}, - {"+left", K_LEFTARROW, -1, -1, -1}, - {"+right", K_RIGHTARROW, -1, -1, -1}, - {"+strafe", K_ALT, -1, -1, -1}, - {"+lookup", K_PGDN, -1, -1, -1}, - {"+lookdown", K_DEL, -1, -1, -1}, - {"+mlook", '/', -1, -1, -1}, - {"centerview", K_END, -1, -1, -1}, - {"+zoom", -1, -1, -1, -1}, + {"scores", K_TAB, -1, -1, -1}, + //Makro - button2 was enter + {"+button2", -1, -1, -1, -1}, + {"+speed", K_SHIFT, -1, -1, -1}, + {"+forward", K_UPARROW, 'w', -1, -1}, + {"+back", K_DOWNARROW, 's', -1, -1}, + {"+moveleft", ',', 'a', -1, -1}, + {"+moveright", '.', 'd', -1, -1}, + {"+moveup", K_SPACE, -1, -1, -1}, + {"+movedown", 'c', -1, -1, -1}, + {"+left", K_LEFTARROW, -1, -1, -1}, + {"+right", K_RIGHTARROW, -1, -1, -1}, + {"+strafe", K_ALT, -1, -1, -1}, + {"+lookup", K_PGDN, -1, -1, -1}, + {"+lookdown", K_DEL, -1, -1, -1}, + {"+mlook", '/', -1, -1, -1}, + {"centerview", K_END, -1, -1, -1}, + {"+zoom", -1, -1, -1, -1}, //Blaze: Reaction Weapon binds //Jbravo: order is important. - {"weapon 1", '1', -1, -1, -1}, - {"weapon 2", '2', -1, -1, -1}, - {"weapon 3", '3', -1, -1, -1}, - {"weapon 4", '4', -1, -1, -1}, - {"weapon 5", '5', -1, -1, -1}, - {"weapon 6", '6', -1, -1, -1}, - {"weapon 7", '7', -1, -1, -1}, - {"weapon 8", '8', -1, -1, -1}, - {"weapon 9", '9', -1, -1, -1}, - {"+attack", K_CTRL, -1, -1, -1}, - {"weapprev", '[', -1, -1, -1}, - {"weapnext", ']', -1, -1, -1}, - {"+button3", K_MOUSE3, -1, -1, -1}, - {"messagemode", 't', -1, -1, -1}, - {"messagemode2", -1, -1, -1, -1}, - {"messagemode3", -1, -1, -1, -1}, - {"messagemode4", -1, -1, -1, -1}, - {"bandage", -1, -1, -1, -1}, + {"weapon 1", '1', -1, -1, -1}, + {"weapon 2", '2', -1, -1, -1}, + {"weapon 3", '3', -1, -1, -1}, + {"weapon 4", '4', -1, -1, -1}, + {"weapon 5", '5', -1, -1, -1}, + {"weapon 6", '6', -1, -1, -1}, + {"weapon 7", '7', -1, -1, -1}, + {"weapon 8", '8', -1, -1, -1}, + {"weapon 9", '9', -1, -1, -1}, + {"+attack", K_CTRL, K_MOUSE1, -1, -1}, + {"weapprev", '[', -1, -1, -1}, + {"weapnext", ']', 'q', -1, -1}, + //Makro - button3 was mouse3 + {"+button3", -1, -1, -1, -1}, + {"messagemode", 't', -1, -1, -1}, + {"messagemode2", -1, -1, -1, -1}, + {"messagemode3", -1, -1, -1, -1}, + {"messagemode4", -1, -1, -1, -1}, + {"bandage", 'b', -1, -1, -1}, //reload - {"+button5", -1, -1, -1, -1}, - {"weapon", -1, -1, -1, -1}, - {"opendoor", -1, -1, -1, -1}, - {"dropweapon", -1, -1, -1, -1}, - {"dropitem", -1, -1, -1, -1}, - {"irvision", -1, -1, -1, -1}, + {"+button5", 'r', -1, -1, -1}, + {"weapon", K_MOUSE3, -1, -1, -1}, + {"opendoor", K_ENTER, -1, -1, -1}, + {"dropweapon", 'x', -1, -1, -1}, + {"dropitem", 'z', -1, -1, -1}, + {"irvision", 'v', -1, -1, -1}, //Makro - this one was missing - {"specialweapon", -1, -1, -1, -1}, + {"specialweapon", 'e', -1, -1, -1}, //Makro - for the weapon/item, join and radio menus - {"ui_RQ3_loadout", -1, -1, -1, -1}, - {"ui_RQ3_joinTeam", -1, -1, -1, -1}, - {"ui_RQ3_radio", -1, -1, -1, -1} + {"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} }; @@ -3918,7 +3928,8 @@ void Item_Bind_Paint(itemDef_t *item) { value = (item->cvar) ? DC->getCVarValue(item->cvar) : 0; if (item->window.flags & WINDOW_HASFOCUS) { - if (g_bindItem == item) { + //Makro - if you bind a key, the item shouldn't keep flashing when you're done + if (g_bindItem == item && g_waitingForKey) { lowLight[0] = 0.8f * 1.0f; lowLight[1] = 0.8f * 0.0f; lowLight[2] = 0.8f * 0.0f; @@ -3972,25 +3983,24 @@ void UI_ClearBind( const char *cvar ) { qboolean Item_Bind_HandleKey(itemDef_t *item, int key, qboolean down) { int id; int i; - qboolean ok; + qboolean ok, returnVal; //Makro - the mouse doesn't have to be over the item unless we're clicking on it instead of using the keyboard ok = (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory) && UI_IsMouse(key)) || (item->window.flags && WINDOW_HASFOCUS); if (ok && !g_waitingForKey) { + returnVal = qfalse; if (down && (key == K_MOUSE1 || key == K_ENTER)) { g_waitingForKey = qtrue; g_bindItem = item; + returnVal = qtrue; //Makro - moved backspace code here; added up/down functionality (wtf was this missing?) } else if (key == K_BACKSPACE) { UI_ClearBind(item->cvar); - } else if (key == K_UPARROW) { - Menu_SetPrevCursorItem(item->parent); - } else if (key == K_DOWNARROW) { - Menu_SetNextCursorItem(item->parent); + returnVal = qtrue; } - return qtrue; + return returnVal; } else {