diff options
author | Ben Millwood <thebenmachine@gmail.com> | 2009-10-03 12:35:04 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:05 +0000 |
commit | ed3a99c42a9173e456620a63a91acb635d3ed94c (patch) | |
tree | 4842c5116e7a91c8b42cc4b4d15d102dacbc63ba /src/ui | |
parent | 8bb863e005db6faf45e545a16ed66d552366d55f (diff) |
* Fix text alignment of UI items that display cvar contents
* (bug 3952) display winning team string at the bottom of the scoreboard
after a game
* Prevent users from changing some ui communication cvars
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_main.c | 1 | ||||
-rw-r--r-- | src/ui/ui_shared.c | 8 |
2 files changed, 5 insertions, 4 deletions
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 ) + |