diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_main.c | 15 | ||||
-rw-r--r-- | src/ui/ui_main.c | 1 | ||||
-rw-r--r-- | src/ui/ui_shared.c | 8 |
3 files changed, 13 insertions, 11 deletions
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 6fe7655d..deb19580 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -317,13 +317,14 @@ static cvarTable_t cvarTable[ ] = { &cg_debugVoices, "cg_debugVoices", "0", 0 }, - { &ui_currentClass, "ui_currentClass", "0", 0 }, - { &ui_carriage, "ui_carriage", "", 0 }, - { &ui_stages, "ui_stages", "0 0", 0 }, - { &ui_dialog, "ui_dialog", "Text not set", 0 }, - { &ui_voteActive, "ui_voteActive", "0", 0 }, - { &ui_humanTeamVoteActive, "ui_humanTeamVoteActive", "0", 0 }, - { &ui_alienTeamVoteActive, "ui_alienTeamVoteActive", "0", 0 }, + // communication cvars set by the cgame to be read by ui + { &ui_currentClass, "ui_currentClass", "0", CVAR_ROM }, + { &ui_carriage, "ui_carriage", "", CVAR_ROM }, + { &ui_stages, "ui_stages", "0 0", CVAR_ROM }, + { &ui_dialog, "ui_dialog", "Text not set", CVAR_ROM }, + { &ui_voteActive, "ui_voteActive", "0", CVAR_ROM }, + { &ui_humanTeamVoteActive, "ui_humanTeamVoteActive", "0", CVAR_ROM }, + { &ui_alienTeamVoteActive, "ui_alienTeamVoteActive", "0", CVAR_ROM }, { &cg_debugRandom, "cg_debugRandom", "0", 0 }, diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index a741bf8c..d1af8f85 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -123,6 +123,7 @@ static cvarTable_t cvarTable[ ] = { &ui_textWrapCache, "ui_textWrapCache", "1", CVAR_ARCHIVE }, { &ui_developer, "ui_developer", "0", CVAR_ARCHIVE | CVAR_CHEAT }, { &ui_emoticons, "cg_emoticons", "1", CVAR_LATCH | CVAR_ARCHIVE }, + { &ui_winner, "ui_winner", "", CVAR_ROM } }; static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] ); diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index f62f7385..8862f328 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -4466,15 +4466,15 @@ void Item_SetTextExtents( itemDef_t *item, int *width, int *height, const char * *width = item->textRect.w; *height = item->textRect.h; + // as long as the item isn't dynamic content (ownerdraw or cvar), this // keeps us from computing the widths and heights more than once - - if( *width == 0 || ( item->type == ITEM_TYPE_OWNERDRAW && item->textalignment == ALIGN_CENTER ) ) + if( *width == 0 || item->cvar || ( item->type == ITEM_TYPE_OWNERDRAW && + item->textalignment != ALIGN_LEFT ) ) { int originalWidth; - if( item->type == ITEM_TYPE_EDITFIELD && item->textalignment == ALIGN_CENTER && item->cvar ) + if( item->cvar && item->textalignment != ALIGN_LEFT ) { - //FIXME: this will only be called once? char buff[256]; DC->getCVarString( item->cvar, buff, 256 ); originalWidth = UI_Text_Width( item->text, item->textscale, 0 ) + |