]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
s/LOG_WARNING/LOG_WARN/g
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index b2b2d662af8677faecf6de0daf9ecbdf66dc91ce..f32b85298ed7e23a8a70c04f46aa8d1fedad6dde 100644 (file)
@@ -270,7 +270,8 @@ void m_keydown(float key, float ascii)
        else
        {
                draw_reset_cropped();
-               if (!mouseButtonsPressed && key >= K_MOUSE1 && key <= K_MOUSE3) main.mousePress(main, menuMousePos);
+               if (!mouseButtonsPressed && key >= K_MOUSE1 && key <= K_MOUSE3)
+                       main.mousePress(main, menuMousePos);
                if (!main.keyDown(main, key, ascii, menuShiftState))
                {
                        // disable menu on unhandled ESC
@@ -588,9 +589,11 @@ void m_tooltip(vector pos)
 
                                        int i = 0;
                                        float w = 0;
-                                       for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining; ++i)
+                                       for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining && i <= 16; ++i)
                                        {
                                                string s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
+                                               if (i == 16)
+                                                       s = "...";
                                                float f = draw_TextWidth(s, false, fontsize);
                                                if (f > w) w = f;
                                        }
@@ -660,9 +663,12 @@ void m_tooltip(vector pos)
                        p = menuTooltipOrigin;
                        p.x += SKINMARGIN_TOOLTIP_x / conwidth;
                        p.y += SKINMARGIN_TOOLTIP_y / conheight;
-                       for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining; p.y += fontsize.y)
+                       int i = 0;
+                       for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining && i <= 16; ++i, p.y += fontsize.y)
                        {
                                string s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
+                               if (i == 16)
+                                       s = "...";
                                draw_Text(p, s, fontsize, SKINCOLOR_TOOLTIP, SKINALPHA_TOOLTIP * menuTooltipAlpha, false);
                        }
                }
@@ -843,6 +849,7 @@ void m_draw(float width, float height)
        postMenuDraw();
 
        frametime = 0;
+       IL_ENDFRAME();
 }
 
 void m_display()