]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
Merge remote-tracking branch 'origin/master' into fruitiex/borken_shownames
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index 71cc021b5ae9cb239afec9395a46e3e2c3f43922..0894856f1f9e27f0b72334a23940dcd86e88252c 100644 (file)
@@ -350,12 +350,12 @@ float m_allocatetooltipbox(vector pos)
        vector avoidplus, avoidminus;
        vector v;
 
-       avoidplus_x = (SKINAVOID_TOOLTIP_x + SKINSIZE_CURSOR_x - SKINOFFSET_CURSOR_x) / conwidth;
-       avoidplus_y = (SKINAVOID_TOOLTIP_y + SKINSIZE_CURSOR_y - SKINOFFSET_CURSOR_y) / conheight;
+       avoidplus_x = (SKINAVOID_TOOLTIP_x + SKINSIZE_CURSOR_x - SKINOFFSET_CURSOR_x * SKINSIZE_CURSOR_x) / conwidth;
+       avoidplus_y = (SKINAVOID_TOOLTIP_y + SKINSIZE_CURSOR_y - SKINOFFSET_CURSOR_y * SKINSIZE_CURSOR_y) / conheight;
        avoidplus_z = 0;
 
-       avoidminus_x = (SKINAVOID_TOOLTIP_x + SKINOFFSET_CURSOR_x) / conwidth + menuTooltipSize_x;
-       avoidminus_y = (SKINAVOID_TOOLTIP_y + SKINOFFSET_CURSOR_y) / conheight + menuTooltipSize_y;
+       avoidminus_x = (SKINAVOID_TOOLTIP_x + SKINOFFSET_CURSOR_x * SKINSIZE_CURSOR_x) / conwidth + menuTooltipSize_x;
+       avoidminus_y = (SKINAVOID_TOOLTIP_y + SKINOFFSET_CURSOR_y * SKINSIZE_CURSOR_y) / conheight + menuTooltipSize_y;
        avoidminus_z = 0;
 
        // bottom right
@@ -561,9 +561,11 @@ void() m_draw =
                if(Menu_Active)
                if(!cvar("menu_video_played"))
                {
-                       localcmd("set menu_video_played 1; cd loop $menu_cdtrack; play sound/announcer/default/welcome.ogg\n");
+                       localcmd("cd loop $menu_cdtrack; play sound/announcer/default/welcome.ogg\n");
                        menuLogoAlpha = -0.8; // no idea why, but when I start this at zero, it jumps instead of fading FIXME
                }
+               // ALWAYS set this cvar; if we start but menu is not active, this means we want no background music!
+               localcmd("set menu_video_played 1\n");
        }
 
        t = gettime();