X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fmenu.qc;h=fde2c3c1eb7594125c82cb2cac15eb99ae68284d;hb=3ae1efa7401791e42e3171f4db2cc2d38adde088;hp=b2a85093c6ecc21a5258692ac5df1db8fa1c4ccc;hpb=0a6d4cd16b83990beff55c8b7850a492da8864e2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index b2a85093c..fde2c3c1e 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -5,6 +5,7 @@ #include "../common/items/all.qh" #include "../common/weapons/all.qh" #include "../common/mapinfo.qh" +#include "../common/mutators/base.qh" /////////////////////////////////////////////// // Menu Source File @@ -62,7 +63,7 @@ void m_init() cvar_set("_menu_prvm_language", prvm_language); #ifdef WATERMARK - dprintf("^4MQC Build information: ^1%s\n", WATERMARK); + LOG_TRACEF("^4MQC Build information: ^1%s\n", WATERMARK); #endif // list all game dirs (TEST) @@ -75,13 +76,12 @@ void m_init() s = getgamedirinfo(i, GETGAMEDIRINFO_NAME); if (!s) break; - dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION)); + LOG_TRACE(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION)); } } // needs to be done so early because of the constants they create static_init(); - CALL_ACCUMULATED_FUNCTION(RegisterWeapons); RegisterSLCategories(); @@ -213,10 +213,8 @@ void m_init_delayed() draw_setMousePointer(SKINGFX_CURSOR, SKINSIZE_CURSOR, SKINOFFSET_CURSOR); - loadTooltips(); anim = NEW(AnimHost); main = NEW(MainWindow); main.configureMainWindow(main); - unloadTooltips(); main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight); main.focused = 1; @@ -252,7 +250,7 @@ void m_keyup (float key, float ascii) if(mouseButtonsPressed < 0) { mouseButtonsPressed = 0; - dprint("Warning: released an already released button\n"); + LOG_TRACE("Warning: released an already released button\n"); } } if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT); @@ -303,7 +301,7 @@ void m_keydown(float key, float ascii) if(mouseButtonsPressed > 10) { mouseButtonsPressed = 10; - dprint("Warning: pressed an already pressed button\n"); + LOG_TRACE("Warning: pressed an already pressed button\n"); } } if(key == K_ALT) menuShiftState |= S_ALT; @@ -480,7 +478,7 @@ entity m_findtooltipitem(entity root, vector pos) entity it; entity best; - best = world; + best = NULL; it = root; while(it.instanceOfContainer) @@ -497,7 +495,7 @@ entity m_findtooltipitem(entity root, vector pos) best = it; else if(menu_tooltips == 2 && (it.cvarName || it.onClickCommand)) best = it; - it = world; + it = NULL; } else if(it.instanceOfModalController) it = it.focusedChild; @@ -547,9 +545,9 @@ void m_tooltip(vector pos) if (!menu_tooltips) { // don't return immediately, fade out the active tooltip first - if (menuTooltipItem == world) + if (menuTooltipItem == NULL) return; - it = world; + it = NULL; menu_tooltips_old = menu_tooltips; } else @@ -560,7 +558,7 @@ void m_tooltip(vector pos) if(f < 0.01) it = m_findtooltipitem(main, pos); else - it = world; + it = NULL; } fontsize = '1 0 0' * (SKINFONTSIZE_TOOLTIP / conwidth) + '0 1 0' * (SKINFONTSIZE_TOOLTIP / conheight); @@ -631,12 +629,12 @@ void m_tooltip(vector pos) if(menuTooltipAlpha == 0) { menuTooltipState = 0; - menuTooltipItem = world; + menuTooltipItem = NULL; } break; } - if(menuTooltipItem == world) + if(menuTooltipItem == NULL) { if (menuTooltipText) { @@ -650,7 +648,7 @@ void m_tooltip(vector pos) if(menu_tooltips != menu_tooltips_old) { if (menu_tooltips != 0 && menu_tooltips_old != 0) - menuTooltipItem = world; // reload tooltip next frame + menuTooltipItem = NULL; // reload tooltip next frame menu_tooltips_old = menu_tooltips; } else if(menuTooltipOrigin.x < 0) // unallocated?