Skip to content

Commit

Permalink
xrGame: Made third ammo type optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Oct 17, 2018
1 parent 20c9be3 commit b94fc3d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/xrGame/ui/UIHudStatesWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void CUIHudStatesWnd::InitFromXml(CUIXml& xml, LPCSTR path)
m_ui_weapon_cur_ammo = UIHelper::CreateTextWnd(xml, "static_cur_ammo", this);
m_ui_weapon_fmj_ammo = UIHelper::CreateTextWnd(xml, "static_fmj_ammo", this);
m_ui_weapon_ap_ammo = UIHelper::CreateTextWnd(xml, "static_ap_ammo", this);
m_ui_weapon_third_ammo = UIHelper::CreateTextWnd(xml, "static_third_ammo", this); //Alundaio: Option to display a third ammo type
m_ui_weapon_third_ammo = UIHelper::CreateTextWnd(xml, "static_third_ammo", this, false); //Alundaio: Option to display a third ammo type
m_fire_mode = UIHelper::CreateTextWnd(xml, "static_fire_mode", this);
m_ui_grenade = UIHelper::CreateTextWnd(xml, "static_grenade", this);

Expand Down Expand Up @@ -309,7 +309,8 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)
m_ui_weapon_cur_ammo->Show(true);
m_ui_weapon_fmj_ammo->Show(true);
m_ui_weapon_ap_ammo->Show(true);
m_ui_weapon_third_ammo->Show(true);
if (m_ui_weapon_third_ammo)
m_ui_weapon_third_ammo->Show(true);

m_fire_mode->Show(true);
m_ui_grenade->Show(true);
Expand All @@ -326,7 +327,8 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)

m_ui_weapon_fmj_ammo->SetTextColor(color_rgba(238, 155, 23, 150));
m_ui_weapon_ap_ammo->SetTextColor(color_rgba(238, 155, 23, 150));
m_ui_weapon_third_ammo->SetTextColor(color_rgba(238, 155, 23, 150));
if (m_ui_weapon_third_ammo)
m_ui_weapon_third_ammo->SetTextColor(color_rgba(238, 155, 23, 150));

CWeaponMagazinedWGrenade* wpn = smart_cast<CWeaponMagazinedWGrenade*>(item);
if (wpn && wpn->m_bGrenadeMode)
Expand All @@ -341,7 +343,7 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)
m_ui_weapon_fmj_ammo->SetTextColor(color_rgba(238, 155, 23, 255));
else if (wpnm->m_ammoType == 1)
m_ui_weapon_ap_ammo->SetTextColor(color_rgba(238, 155, 23, 255));
else if (wpnm->m_ammoType == 2)
else if (wpnm->m_ammoType == 2 && m_ui_weapon_third_ammo)
m_ui_weapon_third_ammo->SetTextColor(color_rgba(238, 155, 23, 255));
}
//-Alundaio
Expand All @@ -353,7 +355,8 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)
m_ui_weapon_cur_ammo->Show(false);
m_ui_weapon_fmj_ammo->Show(false);
m_ui_weapon_ap_ammo->Show(false);
m_ui_weapon_third_ammo->Show(false);
if (m_ui_weapon_third_ammo)
m_ui_weapon_third_ammo->Show(false);
m_fire_mode->Show(false);
m_ui_grenade->Show(false);
}
Expand Down

0 comments on commit b94fc3d

Please sign in to comment.