]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/weaponslist.c
Menu: avoid loading font twice on resolution switch; avoid extra r_restart on resolut...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / weaponslist.c
index e64cc72d087f99aaa1315f304eeab312320c3ca8..6790befe122be32a5159e5732fa2615efc5d6daa 100644 (file)
@@ -65,17 +65,11 @@ void XonoticWeaponsList_resizeNotify(entity me, vector relOrigin, vector relSize
 }
 float XonoticWeaponsList_mouseDrag(entity me, vector pos)
 {
-       float f, i, scrollbar;
+       float f, i;
        i = me.selectedItem;
        f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
        
-       scrollbar = 1;
-       if(pos_x < 1 - me.controlWidth - me.tolerance_y * me.controlWidth) scrollbar = 0;
-       if(pos_y < 0 - me.tolerance_x) scrollbar = 0;
-       if(pos_x >= 1 + me.tolerance_y * me.controlWidth) scrollbar = 0;
-       if(pos_y >= 1 + me.tolerance_x) scrollbar = 0;
-       
-       if not(scrollbar) // don't change priority if the person is just scrolling
+       if(me.pressed != 1) // don't change priority if the person is just scrolling
        {
                if(me.selectedItem != i)
                        cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, i));
@@ -103,7 +97,10 @@ void XonoticWeaponsList_drawListBoxItem(entity me, float i, vector absSize, floa
        if(isSelected)
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
        e = get_weaponinfo(stof(argv(i)));
-       draw_Text(me.realUpperMargin * eY, e.message, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);
+       string msg = e.message;
+       if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+               msg = sprintf(_("%s (mutator weapon)"), msg);
+       draw_Text(me.realUpperMargin * eY, msg, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);
 }
 
 float XonoticWeaponsList_keyDown(entity me, float scan, float ascii, float shift)