diff options
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 ) +  | 
