+ static vector weapon_pos_current = '-1 0 0';
+ if(weapon_pos_current.x == -1)
+ weapon_pos_current = panel_pos;
+
+ float switch_speed;
+ if(autocvar_hud_panel_weapons_selection_speed <= 0 || autocvar__hud_configure)
+ switch_speed = 999;
+ else
+ switch_speed = frametime * autocvar_hud_panel_weapons_selection_speed;
+ vector radius_size = weapon_size * (autocvar_hud_panel_weapons_selection_radius + 1);
+
+ entity wepent = viewmodels[0]; // TODO: unhardcode
+
+ if(wepent.switchweapon == WEP_Null)
+ panel_switchweapon = NULL;
+ else if(!panel_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
+ if(panel_switchweapon)
+ drawpic_aspect_skin(weapon_pos_current, "weapon_current_bg", weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);