]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
hud_panel_pressedkeys_attack (with placeholder images)
authorRudolf Polzer <divverent@xonotic.org>
Wed, 16 May 2012 07:53:17 +0000 (09:53 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 16 May 2012 08:08:55 +0000 (10:08 +0200)
15 files changed:
_hud_descriptions.cfg
gfx/hud/default/key_atck.tga [new file with mode: 0644]
gfx/hud/default/key_atck2.tga [new file with mode: 0644]
gfx/hud/default/key_atck2_inv.tga [new file with mode: 0644]
gfx/hud/default/key_atck_inv.tga [new file with mode: 0644]
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/common/constants.qh
qcsrc/server/cl_client.qc

index 372a6af3e146f635154231a39a71b730efd96fc0..cb95f968132ba7145549310b491ec98885459a7a 100644 (file)
@@ -206,6 +206,7 @@ seta hud_panel_pressedkeys_bg_alpha "" "if set to something else than \"\" = ove
 seta hud_panel_pressedkeys_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_pressedkeys_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_pressedkeys_aspect "" "forced aspect on panel"
+seta hud_panel_pressedkeys_attack "" "show attack buttons too"
 
 seta hud_panel_chat "" "enable/disable this panel"
 seta hud_panel_chat_pos "" "position of this base of the panel"
diff --git a/gfx/hud/default/key_atck.tga b/gfx/hud/default/key_atck.tga
new file mode 100644 (file)
index 0000000..40a12dc
Binary files /dev/null and b/gfx/hud/default/key_atck.tga differ
diff --git a/gfx/hud/default/key_atck2.tga b/gfx/hud/default/key_atck2.tga
new file mode 100644 (file)
index 0000000..40a12dc
Binary files /dev/null and b/gfx/hud/default/key_atck2.tga differ
diff --git a/gfx/hud/default/key_atck2_inv.tga b/gfx/hud/default/key_atck2_inv.tga
new file mode 100644 (file)
index 0000000..c1f6e42
Binary files /dev/null and b/gfx/hud/default/key_atck2_inv.tga differ
diff --git a/gfx/hud/default/key_atck_inv.tga b/gfx/hud/default/key_atck_inv.tga
new file mode 100644 (file)
index 0000000..c1f6e42
Binary files /dev/null and b/gfx/hud/default/key_atck_inv.tga differ
index df836368301076d984407568c470f5bdc6efef96..6472a257963fad8c9526546031d3d6e7c716779f 100644 (file)
@@ -204,6 +204,7 @@ seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
 seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat 1
 seta hud_panel_chat_pos "0.010000 0.700000"
index eef7aed2955353d6205e49a9598b218d4cc6f8d6..bb7e0662e32e3bcbce1060385a3f0d42a6961549 100644 (file)
@@ -204,6 +204,7 @@ seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
 seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat 1
 seta hud_panel_chat_pos "0 0.775000"
index 0a77fba082b0c8e590bd4ff58c1bb0c5b8e0f756..e0921ad35337d272f8e0c91a0032864349981cac 100644 (file)
@@ -204,6 +204,7 @@ seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
 seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat 1
 seta hud_panel_chat_pos "0 0.775000"
index cd4b1ba711a264fb5c2068a1cf0cc2ed09fcd2d7..119f7b18f6f8cd3f163e7e6ac172db53ed4516ad 100644 (file)
@@ -204,6 +204,7 @@ seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
 seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat 1
 seta hud_panel_chat_pos "0.020000 0.780000"
index 67bbde531da8e03e03a4c2e7fb3c8e8ef9f119f8..3cf0feb753e5e08b748ce408a03f42affc78393d 100644 (file)
@@ -204,6 +204,7 @@ seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
 seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat 1
 seta hud_panel_chat_pos "0 0.760000"
index 43dd0dd1834bd76fea1b760fefca9489d4c75f8a..344c3731c4561f1932d123df8a2032bc9f139934 100644 (file)
@@ -279,6 +279,7 @@ string autocvar_hud_panel_powerups_progressbar_superweapons;
 float autocvar_hud_panel_powerups_text;
 float autocvar_hud_panel_pressedkeys;
 float autocvar_hud_panel_pressedkeys_aspect;
+float autocvar_hud_panel_pressedkeys_attack;
 float autocvar_hud_panel_racetimer;
 float autocvar_hud_panel_radar;
 float autocvar_hud_panel_radar_foreground_alpha;
index ffd95f4feff69a5896f1fab4ef85e62ce9cd6082..27e0a0dc12cad21aa76e9c1337b5ca01dd46dfef 100644 (file)
@@ -3996,10 +3996,17 @@ void HUD_DrawPressedKeys(void)
        }
 
        vector keysize;
-       keysize = eX * mySize_x * (1/3) + eY * mySize_y * 0.5;
+       keysize = eX * mySize_x * (1/3.0) + eY * mySize_y * (1/(3.0 - !autocvar_hud_panel_pressedkeys_attack));
        float pressedkeys;
        pressedkeys = getstatf(STAT_PRESSED_KEYS);
 
+       if(autocvar_hud_panel_pressedkeys_attack)
+       {
+               drawpic_aspect_skin(pos + eX * keysize_x * 0.5, ((pressedkeys & KEY_ATCK) ? "key_atck_inv.tga" : "key_atck.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(pos + eX * keysize_x * 1.5, ((pressedkeys & KEY_ATCK2) ? "key_atck_inv.tga" : "key_atck.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               pos_y += keysize_y;
+       }
+
        drawpic_aspect_skin(pos, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv.tga" : "key_crouch.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        drawpic_aspect_skin(pos + eX * keysize_x, ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        drawpic_aspect_skin(pos + eX * keysize_x * 2, ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
index a53112bbd4b0495fe21483484b7818ebfd93c31c..0f990c69410d2646ccb0f8dca6a2281d6f46e3be 100644 (file)
@@ -138,6 +138,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_dom_layout");
                                        break;
                                case HUD_PANEL_PRESSEDKEYS:
+                                       HUD_Write_PanelCvar_q("_attack");
                                        HUD_Write_PanelCvar_q("_aspect");
                                        break;
                                case HUD_PANEL_ENGINEINFO:
index e70a83c391d7b992ce0091e91efc89504fa31c4d..d0149251f49f6827c80eb06eb33e246ed6b9b069 100644 (file)
@@ -127,6 +127,8 @@ const float KEY_LEFT                =       4;
 const float KEY_RIGHT          =       8;
 const float KEY_JUMP           =       16;
 const float KEY_CROUCH         =       32;
+const float KEY_ATCK           =       64;
+const float KEY_ATCK2          =       128;
 
 ///////////////////////////
 // cvar constants
index d6715e95044371e319137f2943e9cf08a40d586f..704eff0ae00687c5de4402c4dff2a7367d54168e 100644 (file)
@@ -2122,6 +2122,15 @@ void GetPressedKeys(void) {
                self.pressedkeys |= KEY_CROUCH;
        else
                self.pressedkeys &~= KEY_CROUCH;
+
+       if (self.BUTTON_ATCK)
+               self.pressedkeys |= KEY_ATCK;
+       else
+               self.pressedkeys &~= KEY_ATCK;
+       if (self.BUTTON_ATCK2)
+               self.pressedkeys |= KEY_ATCK2;
+       else
+               self.pressedkeys &~= KEY_ATCK2;
 }
 
 /*