From: Rudolf Polzer Date: Wed, 16 May 2012 07:53:17 +0000 (+0200) Subject: hud_panel_pressedkeys_attack (with placeholder images) X-Git-Tag: xonotic-v0.7.0~240^2~75^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b660d4ba58150ab24834cfb104c3216693daa7d8;p=xonotic%2Fxonotic-data.pk3dir.git hud_panel_pressedkeys_attack (with placeholder images) --- diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index 372a6af3e..cb95f9681 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -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 index 000000000..40a12dc69 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 index 000000000..40a12dc69 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 index 000000000..c1f6e42a9 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 index 000000000..c1f6e42a9 Binary files /dev/null and b/gfx/hud/default/key_atck_inv.tga differ diff --git a/hud_luminos.cfg b/hud_luminos.cfg index df8363683..6472a2579 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -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" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index eef7aed29..bb7e0662e 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -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" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 0a77fba08..e0921ad35 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -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" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index cd4b1ba71..119f7b18f 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -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" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 67bbde531..3cf0feb75 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -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" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 43dd0dd18..344c3731c 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index ffd95f4fe..27e0a0dc1 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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); diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index a53112bbd..0f990c694 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -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: diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index e70a83c39..d0149251f 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -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 diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index d6715e950..704eff0ae 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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; } /*