X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fmenu%2Fxonotic%2Fmaplist.qc;h=5184ee1fd546a0f90ad3838462a57c005b7b4a9e;hb=8b7d07cc724c130cb61a8b32099b01b26a418149;hp=8feee96ed7a05a7ac74ef8a97a8eae709a503c2e;hpb=d492869ab1f18e05121529b7bcffcb637d13994c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/maplist.qc b/qcsrc/menu/xonotic/maplist.qc index 8feee96ed..5184ee1fd 100644 --- a/qcsrc/menu/xonotic/maplist.qc +++ b/qcsrc/menu/xonotic/maplist.qc @@ -88,8 +88,10 @@ void XonoticMapList_resizeNotify(entity me, vector relOrigin, vector relSize, ve me.itemAbsSize = '0 0 0'; SUPER(XonoticMapList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); - me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize.y * me.itemHeight)); - me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize.x * (1 - me.controlWidth))); + me.itemAbsSize.y = absSize.y * me.itemHeight; + me.itemAbsSize.x = absSize.x * (1 - me.controlWidth); + me.realFontSize.y = me.fontSize / me.itemAbsSize.y; + me.realFontSize.x = me.fontSize / me.itemAbsSize.x; me.realUpperMargin1 = 0.5 * (1 - 2.5 * me.realFontSize.y); me.realUpperMargin2 = me.realUpperMargin1 + 1.5 * me.realFontSize.y; @@ -181,8 +183,6 @@ void XonoticMapList_refilter(entity me) for(i = 0; i < MapInfo_count; ++i) draw_PreloadPicture(strcat("/maps/", MapInfo_BSPName_ByID(i))); - if(me.g_maplistCache) - strunzone(me.g_maplistCache); s = "0"; for(i = 1; i < MapInfo_count; i *= 2) s = strcat(s, s); @@ -201,7 +201,7 @@ void XonoticMapList_refilter(entity me) ); } } - me.g_maplistCache = strzone(s); + strcpy(me.g_maplistCache, s); if(gt != me.lastGametype || f != me.lastFeatures) { me.lastGametype = gt; @@ -217,12 +217,9 @@ void XonoticMapList_refilterCallback(entity me, entity cb) void MapList_StringFilterBox_Change(entity box, entity me) { - if(me.stringFilter) - strunzone(me.stringFilter); + strfree(me.stringFilter); if(box.text != "") me.stringFilter = strzone(box.text); - else - me.stringFilter = string_null; me.refilter(me); } @@ -288,7 +285,7 @@ void MapList_LoadMap(entity btn, entity me) m = MapInfo_BSPName_ByID(i); if (!m) { - LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n")); + LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.")); me.refilter(me); return; } @@ -301,7 +298,7 @@ void MapList_LoadMap(entity btn, entity me) } else { - LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n")); + LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.")); me.refilter(me); return; } @@ -345,9 +342,7 @@ float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift) if(time < me.typeToSearchTime) { save = substring(me.typeToSearchString, 0, strlen(me.typeToSearchString) - 1); - if(me.typeToSearchString) - strunzone(me.typeToSearchString); - me.typeToSearchString = strzone(save); + strcpy(me.typeToSearchString, save); me.typeToSearchTime = time + 0.5; if(strlen(me.typeToSearchString)) { @@ -364,9 +359,7 @@ float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift) save = ch; else save = strcat(me.typeToSearchString, ch); - if(me.typeToSearchString) - strunzone(me.typeToSearchString); - me.typeToSearchString = strzone(save); + strcpy(me.typeToSearchString, save); me.typeToSearchTime = time + 0.5; MapInfo_FindName(me.typeToSearchString); if(MapInfo_FindName_firstResult >= 0)