]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/weaponslist.c
Delete empty files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / weaponslist.c
index 952c3c956af14273fa62a3ecded70b9935dfeb42..8a8e2205dde03b0ed001162728dda4e6e6783dc9 100644 (file)
@@ -65,16 +65,16 @@ 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);
-       
+
        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));
        }
-       
+
        return f;
 }
 string XonoticWeaponsList_toString(entity me)
@@ -97,7 +97,17 @@ 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);
+
+       vector save_fontscale = draw_fontscale;
+       float f = draw_CondensedFontFactor(msg, FALSE, me.realFontSize, 1);
+       draw_fontscale_x *= f;
+       vector fs = me.realFontSize;
+       fs_x *= f;
+       draw_Text(me.realUpperMargin * eY, msg, fs, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0);
+       draw_fontscale = save_fontscale;
 }
 
 float XonoticWeaponsList_keyDown(entity me, float scan, float ascii, float shift)
@@ -107,7 +117,7 @@ float XonoticWeaponsList_keyDown(entity me, float scan, float ascii, float shift
                WeaponsList_MoveUp_Click(NULL, me);
                return 1;
        }
-       else if(scan == 45) // -
+       else if(ascii == 45) // -
        {
                WeaponsList_MoveDown_Click(NULL, me);
                return 1;