X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fweapons.qc;h=a7c0ade00b473de2f7e49cd3604464f657e1fe59;hb=ea21cf9661f922f64dd6cc698f3aa717bb70c3ab;hp=db25d532a016f938e31a04045ac54e1886f03617;hpb=a491650510dce3f774cce457ebf15ddcafcf393f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index db25d532a..a7c0ade00 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -1,5 +1,10 @@ #include "weapons.qh" +#include +#include +#include +#include +#include // Weapons (#0) @@ -373,10 +378,12 @@ void HUD_Weapons() switch_speed = frametime * autocvar_hud_panel_weapons_selection_speed; vector radius_size = weapon_size * (autocvar_hud_panel_weapons_selection_radius + 1); - if(switchweapon == WEP_Null) + entity wepent = viewmodels[0]; // TODO: unhardcode + + if(wepent.switchweapon == WEP_Null) panel_switchweapon = NULL; else if(!panel_switchweapon) - panel_switchweapon = switchweapon; + panel_switchweapon = wepent.switchweapon; // draw background behind currently selected weapon // do it earlier to make sure bg is drawn behind every weapon icons while it's moving @@ -405,7 +412,7 @@ void HUD_Weapons() } // figure out the drawing position of weapon - weapon_pos = (panel_pos + eX * column * weapon_size.x + eY * row * weapon_size.y); + weapon_pos = panel_pos + vec2(column * weapon_size.x, row * weapon_size.y); // update position of the currently selected weapon if(it == panel_switchweapon)