]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
Use the old hack (now fixed) instead of checking Menu_Active to prevent cursor from...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index 1c7ed0386f5d63b90a1655c2e202ef639a7d40d8..bde7fbe281ce1423e7dc4448ec7ca0e8ebc2dafd 100644 (file)
@@ -1,9 +1,24 @@
 #include "menu.qh"
-#include "classes.qc"
+
+#include "item.qh"
+
+#include "anim/animhost.qh"
+
+#include "item/dialog.qh"
+#include "item/listbox.qh"
+#include "item/nexposee.qh"
+
+#include "xonotic/commandbutton.qh"
+#include "xonotic/mainwindow.qh"
+#include "xonotic/serverlist.qh"
+#include "xonotic/slider_resolution.qh"
+
+.string cvarName;
+
 #include "xonotic/util.qh"
 
 #include "../common/items/all.qh"
-#include "../common/weapons/all.qh"
+#include <common/weapons/all.qh>
 #include "../common/mapinfo.qh"
 #include "../common/mutators/base.qh"
 
@@ -384,7 +399,7 @@ void drawBackground(string img, float a, string algn, float force1)
                        draw_Picture_Aligned(v, scalemode, strcat(img, "_l", ftos(l + 1)), a);
                }
                ++l;
-               : nopic
+LABEL(nopic)
        }
 }
 
@@ -528,7 +543,7 @@ void m_tooltip(vector pos)
                {
                        it = m_findtooltipitem(main, pos);
 
-                       if (it.instanceOfListBox && it.isScrolling(it)) it = world;
+                       if (it.instanceOfListBox && it.isScrolling(it)) it = NULL;
 
                        if (it && prev_tooltip != it.tooltip)
                        {
@@ -656,6 +671,7 @@ void m_tooltip(vector pos)
 
 void m_draw(float width, float height)
 {
+       if (clientstate() == CS_DISCONNECTED) m_toggle(true);
        m_gamestatus();
 
        execute_next_frame();
@@ -774,15 +790,11 @@ void m_draw(float width, float height)
 
        draw_alpha *= menuAlpha;
 
-       if (!Menu_Active)
-       {
-               // do not update mouse position
-               // it prevents mouse jumping to '0 0 0' when menu is fading out
-       }
-       else if (menuMouseMode)
+       if (menuMouseMode)
        {
-               vector newMouse = globalToBox(getmousepos(), draw_shift, draw_scale);
-               if (newMouse != '0 0 0' && newMouse != menuMousePos)
+               vector rawMousePos = getmousepos();
+               vector newMouse = globalToBox(rawMousePos, draw_shift, draw_scale);
+               if (rawMousePos != '0 0 0' && newMouse != menuMousePos)
                {
                        menuMousePos = newMouse;
                        if (mouseButtonsPressed) main.mouseDrag(main, menuMousePos);
@@ -862,10 +874,10 @@ void m_toggle(int mode)
 void Shutdown()
 {
        m_hide();
-       FOREACH_ENTITY_ORDERED(it.destroy, LAMBDA(
+       FOREACH_ENTITY_ORDERED(it.destroy, {
                if (it.classname == "vtbl") continue;
                it.destroy(it);
-       ));
+       });
 }
 
 void m_focus_item_chain(entity outermost, entity innermost)