From 81f92fe7f0040992d2e1e701076b3737a5c3dae6 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 8 Feb 2013 18:10:22 -0600 Subject: [PATCH] Extend Team Arena Favorite Address edit field to hold an IPv6 address --- code/ui/ui_shared.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/code/ui/ui_shared.c b/code/ui/ui_shared.c index 2ae36a31..275fc095 100644 --- a/code/ui/ui_shared.c +++ b/code/ui/ui_shared.c @@ -5125,6 +5125,28 @@ void Item_SetupKeywordHash(void) { } } +/* +=============== +Item_ApplyHacks + +Hacks to fix issues with Team Arena menu scripts +=============== +*/ +static void Item_ApplyHacks( itemDef_t *item ) { + + // Fix length of favorite address in createfavorite.menu + if ( item->type == ITEM_TYPE_EDITFIELD && item->cvar && !Q_stricmp( item->cvar, "ui_favoriteAddress" ) ) { + editFieldDef_t *editField = (editFieldDef_t *)item->typeData; + + // enough to hold an IPv6 address plus null + if ( editField->maxChars < 48 ) { + Com_Printf( "Extended create favorite address edit field length to hold an IPv6 address\n" ); + editField->maxChars = 48; + } + } + +} + /* =============== Item_Parse @@ -5147,6 +5169,7 @@ qboolean Item_Parse(int handle, itemDef_t *item) { } if (*token.string == '}') { + Item_ApplyHacks( item ); return qtrue; }