]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add cvar hud_panel_weapons_label_scale
authorSeverin Meyer <sev.ch@web.de>
Wed, 21 Jan 2015 20:33:09 +0000 (21:33 +0100)
committerSeverin Meyer <sev.ch@web.de>
Wed, 21 Jan 2015 20:33:09 +0000 (21:33 +0100)
_hud_descriptions.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/menu/xonotic/dialog_hudpanel_weapons.c

index 7d8b0ccf9f02356814b2fb14e3431f8c96dce665..a47884ef05f586d66da20ad330a33b864eb3d017 100644 (file)
@@ -58,6 +58,7 @@ seta hud_panel_weapons_timeout_fadefgmin "" "minimum alpha of the panel foregrou
 seta hud_panel_weapons_timeout_speed_in "" "speed that fading/moving onto the screen occurs"
 seta hud_panel_weapons_timeout_speed_out "" "speed that fading/moving off of the screen occurs"
 seta hud_panel_weapons_label "" "1 = show number of weapon, 2 = show bound key of weapon, 3 = show name of weapon"
+seta hud_panel_weapons_label_scale "" "scale of the weapon text label"
 seta hud_panel_weapons_accuracy "" "show accuracy color as the weapon icon background; colors can be configured with accuracy_color* cvars"
 seta hud_panel_weapons_ammo "" "show ammo as a status bar"
 seta hud_panel_weapons_onlyowned "" "show only owned weapons"
index a37447783d6009448e095c0bfc26a9d894aae7fe..34db2beb663e7cdf118e8cdb3814575a18529ef1 100644 (file)
@@ -41,6 +41,7 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding "4"
 seta hud_panel_weapons_accuracy "1"
 seta hud_panel_weapons_label "1"
+seta hud_panel_weapons_label_scale "0.5"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-1"
 seta hud_panel_weapons_complainbubble_time "0"
index 3128aff4f15c84140e961f7976c3d47e182a18f1..39a6fd2eddbcb8547c9be24ca5cc983ad6ac0c7c 100644 (file)
@@ -41,6 +41,7 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
 seta hud_panel_weapons_accuracy "1"
 seta hud_panel_weapons_label "1"
+seta hud_panel_weapons_label_scale "0.5"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-1"
 seta hud_panel_weapons_complainbubble_time "0"
index 0f424c6f06547e643c6b26f629321f00b00d6553..4b6b7e4a74288362ce8761363045f4d2e8767042 100644 (file)
@@ -41,6 +41,7 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
 seta hud_panel_weapons_accuracy "1"
 seta hud_panel_weapons_label "1"
+seta hud_panel_weapons_label_scale "0.5"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-1"
 seta hud_panel_weapons_complainbubble_time "0"
index 3ee6b927758b0c567ce856a0fb3019f580bc00b8..20650899e77de25e7e1e33d485fbeb5beb2e243f 100644 (file)
@@ -41,6 +41,7 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
 seta hud_panel_weapons_accuracy "1"
 seta hud_panel_weapons_label "1"
+seta hud_panel_weapons_label_scale "0.5"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-1"
 seta hud_panel_weapons_complainbubble_time "0"
index c4aebab73900a22d3bd034984dbd58659cdc5d47..2d86881f5fa81c7827cf133718987757fd0da4df 100644 (file)
@@ -41,6 +41,7 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding "-5"
 seta hud_panel_weapons_accuracy "1"
 seta hud_panel_weapons_label "1"
+seta hud_panel_weapons_label_scale "0.5"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-1"
 seta hud_panel_weapons_complainbubble_time "0"
index 8215b9faf2aeddfe7057eede883513cbc258a4c7..1355bafe7687ffddf316a450a79e01c00ab070ac 100644 (file)
@@ -347,6 +347,7 @@ float autocvar_hud_panel_weapons_complainbubble_fadetime;
 float autocvar_hud_panel_weapons_complainbubble_padding;
 float autocvar_hud_panel_weapons_complainbubble_time;
 float autocvar_hud_panel_weapons_label;
+float autocvar_hud_panel_weapons_label_scale = 0.5;
 float autocvar_hud_panel_weapons_onlyowned;
 float autocvar_hud_panel_weapons_timeout;
 float autocvar_hud_panel_weapons_timeout_effect;
index d6e88e77b2bfdfc4a4dcf19f98f34a8e44f26d50..0ef988ae341ade44a0e0838b39d3796d0614e405 100644 (file)
@@ -692,7 +692,9 @@ void HUD_Weapons(void)
        if(autocvar_hud_panel_weapons_accuracy)
                Accuracy_LoadColors();
 
+       // draw items
        row = column = 0;
+       vector label_size = '1 1 0' * min(weapon_size_x, weapon_size_y) * bound(0, autocvar_hud_panel_weapons_label_scale, 1);
        for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
        {
                // retrieve information about the current weapon to be drawn
@@ -737,15 +739,15 @@ void HUD_Weapons(void)
                        switch(autocvar_hud_panel_weapons_label)
                        {
                                case 1: // weapon number
-                                       drawstring(weapon_pos, ftos(weapon_id), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       drawstring(weapon_pos, ftos(weapon_id), label_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                                        break;
 
                                case 2: // bind
-                                       drawstring(weapon_pos, getcommandkey(ftos(weapon_id), strcat("weapon_group_", ftos(weapon_id))), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       drawstring(weapon_pos, getcommandkey(ftos(weapon_id), strcat("weapon_group_", ftos(weapon_id))), label_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                                        break;
 
                                case 3: // weapon name
-                                       drawstring(weapon_pos, strtolower(self.message), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       drawstring(weapon_pos, strtolower(self.message), label_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                                        break;
 
                                default: // nothing
index 78f16f88db99f7b851edc2c426cb6d960527ccee..4ae8f9f6141dcd8459cce17ff1072b20f56e329d 100644 (file)
@@ -67,6 +67,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                case HUD_PANEL_WEAPONS:
                                        HUD_Write_PanelCvar_q("_accuracy");
                                        HUD_Write_PanelCvar_q("_label");
+                                       HUD_Write_PanelCvar_q("_label_scale");
                                        HUD_Write_PanelCvar_q("_complainbubble");
                                        HUD_Write_PanelCvar_q("_complainbubble_padding");
                                        HUD_Write_PanelCvar_q("_complainbubble_time");
index 07026be69f8fba06495b8d94dcb4658ac3e55dc5..64c9cf43a6959ccfd04206049c068aafb0c7bcf0 100644 (file)
@@ -4,7 +4,7 @@ CLASS(XonoticHUDWeaponsDialog) EXTENDS(XonoticRootDialog)
        ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel"))
        ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4)
-       ATTRIB(XonoticHUDWeaponsDialog, rows, float, 18)
+       ATTRIB(XonoticHUDWeaponsDialog, rows, float, 19)
        ATTRIB(XonoticHUDWeaponsDialog, columns, float, 4)
        ATTRIB(XonoticHUDWeaponsDialog, name, string, "HUDweapons")
        ATTRIB(XonoticHUDWeaponsDialog, requiresConnection, float, TRUE)
@@ -50,20 +50,25 @@ void XonoticHUDWeaponsDialog_fill(entity me)
                        me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "0", ZCTX(_("SHOWAS^None"))));
                        me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "1", _("Number")));
                        me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "2", _("Bind")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Weapon ID scale:")));
+                       me.TD(me, 1, 2.4, e = makeXonoticSlider(0.1, 1, 0.05, "hud_panel_weapons_label_scale"));
+                       setDependent(e, "hud_panel_weapons_label", 1, 2);
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 3.8/2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", _("Show Accuracy")));
                me.TD(me, 1, 3.8/2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", _("Show Ammo")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Ammo bar color:")));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_panel_weapons_ammo_color", "hud_panel_weapons_ammo_color"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Ammo bar alpha:")));
+                       me.TD(me, 1, 2.4, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
-               me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Ammo bar alpha:")));
-                       me.TD(me, 1, 2.4, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Ammo bar color:")));
+               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_panel_weapons_ammo_color", "hud_panel_weapons_ammo_color"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
+               me.TR(me);
 }
 #endif