8 protected Widget m_wInfoWidget;
9 protected TextWidget m_wTextName;
11 protected Widget m_wWidgetUnderCursor;
12 protected bool m_bForceShow;
13 protected string m_sTextName;
15 protected RichTextWidget m_wTourniquetHintIconWidget;
16 protected ImageWidget m_wDamageIconWidget, m_wBleedingIconWidget, m_wTourniquetIconWidget, m_wSalineBagIconWidget, m_wMorphineIconWidget, m_wFractureIconWidget, m_wFractureIcon2Widget;
17 protected TextWidget m_wDamageRegenTextWidget, m_wDamageTextWidget, m_wBleedingTextWidget, m_wTourniquetTextWidget, m_wSalineBagTextWidget, m_wMorphineTextWidget, m_wTourniquetHintTextWidget, m_wFractureTextWidget, m_wFractureText2Widget;
19 protected ResourceName m_sMedicalIconsImageSet =
"{B9199157B90D6216}UI/Textures/InventoryIcons/Medical/Medical-icons.imageset";
20 protected string m_sBloodIcon =
"Blood_UI";
21 protected string m_sTourniquetIcon =
"Tourniquet_UI";
22 protected string m_sSalineBagIcon =
"Saline-bag_UI";
23 protected string m_sMorphineIcon =
"Morphine_UI";
24 protected string m_sFractureIcon =
"Bone-Fracture_UI";
25 protected string m_sTourniquetHintText =
"#AR-RemoveTourniquetAction";
26 protected string m_sDamageRegenText =
"#AR-DamageInfo_Regeneration";
27 protected string m_sTourniquetText =
"#AR-DamageInfo_TourniquetApplied";
28 protected string m_sSalinebagText =
"#AR-DamageInfo_SalineBagApplied";
29 protected string m_sMorphineText =
"#AR-DamageInfo_MorphineApplied";
30 protected string m_sArmFractureText =
"#AR_Inventory_ArmsDamage";
31 protected string m_sLegFractureText =
"#AR_Inventory_LegsDamage";
34 void Show(
float fDelay = 0.0, Widget w =
null,
bool forceShow =
false)
36 m_bForceShow = forceShow;
37 m_wWidgetUnderCursor = w;
45 GetGame().GetCallqueue().Remove(ShowInfoWidget);
46 GetGame().GetCallqueue().CallLater(ShowInfoWidget, fDelay * 1000,
false,
true);
51 protected void ShowInfoWidget(
bool bShow)
55 m_wInfoWidget.SetVisible(
true);
59 if (!m_wWidgetUnderCursor)
62 if (WidgetManager.GetWidgetUnderCursor() != m_wWidgetUnderCursor)
65 m_wInfoWidget.SetVisible(
true);
69 void SetDamageStateVisible(
bool visible,
bool regenerating,
string iconIntensity,
string damageText)
71 if (!m_sMedicalIconsImageSet || !m_wDamageIconWidget || !m_wDamageTextWidget || !m_wDamageRegenTextWidget)
74 if (!iconIntensity.IsEmpty())
75 m_wDamageIconWidget.LoadImageFromSet(0, m_sMedicalIconsImageSet, iconIntensity);
77 string regenText = m_sDamageRegenText;
78 m_wDamageIconWidget.SetVisible(visible);
83 m_wDamageTextWidget.SetText(damageText);
84 m_wDamageRegenTextWidget.SetText(regenText);
85 m_wDamageTextWidget.SetVisible(visible);
86 m_wDamageRegenTextWidget.SetVisible(visible);
90 void SetBleedingStateVisible(
bool visible,
string bleedingText)
92 if (!m_sMedicalIconsImageSet || !m_wBleedingIconWidget || !m_wBleedingTextWidget)
95 m_wBleedingIconWidget.LoadImageFromSet(0, m_sMedicalIconsImageSet, m_sBloodIcon);
96 m_wBleedingIconWidget.SetVisible(visible);
98 m_wBleedingTextWidget.SetVisible(visible);
99 m_wBleedingTextWidget.SetText(bleedingText);
103 void SetTourniquetStateVisible(
bool visible)
105 if (!m_sMedicalIconsImageSet || !m_wTourniquetIconWidget || !m_wTourniquetTextWidget)
108 m_wTourniquetIconWidget.LoadImageFromSet(0, m_sMedicalIconsImageSet, m_sTourniquetIcon);
109 m_wTourniquetIconWidget.SetVisible(visible);
111 m_wTourniquetTextWidget.SetText(m_sTourniquetText);
112 m_wTourniquetTextWidget.SetVisible(visible);
113 SetTourniquetHintVisible(visible);
117 void SetSalineBagStateVisible(
bool visible)
119 if (!m_sMedicalIconsImageSet || !m_wSalineBagIconWidget || !m_wSalineBagTextWidget)
122 m_wSalineBagIconWidget.LoadImageFromSet(0, m_sMedicalIconsImageSet, m_sSalineBagIcon);
123 m_wSalineBagIconWidget.SetVisible(visible);
125 m_wSalineBagTextWidget.SetText(m_sSalinebagText);
126 m_wSalineBagTextWidget.SetVisible(visible);
130 void SetTourniquetHintVisible(
bool visible)
132 if (!m_wTourniquetHintIconWidget || !m_wTourniquetHintTextWidget)
135 m_wTourniquetHintIconWidget.SetVisible(visible);
137 m_wTourniquetHintTextWidget.SetText(m_sTourniquetHintText);
138 m_wTourniquetHintTextWidget.SetVisible(visible);
142 void SetMorphineStateVisible(
bool visible)
144 if (!m_wMorphineIconWidget || !m_wMorphineTextWidget)
147 m_wMorphineIconWidget.LoadImageFromSet(0, m_sMedicalIconsImageSet, m_sMorphineIcon);
148 m_wMorphineIconWidget.SetVisible(visible);
150 m_wMorphineTextWidget.SetText(m_sMorphineText);
151 m_wMorphineTextWidget.SetVisible(visible);
155 void SetFractureStateVisible(
bool armFractured,
bool legFractured)
157 if (!m_wFractureIconWidget || !m_wFractureIcon2Widget || !m_wFractureTextWidget || !m_wFractureText2Widget)
160 m_wFractureIconWidget.LoadImageFromSet(0, m_sMedicalIconsImageSet, m_sFractureIcon);
161 m_wFractureIcon2Widget.LoadImageFromSet(0, m_sMedicalIconsImageSet, m_sFractureIcon);
163 m_wFractureIconWidget.SetVisible(armFractured);
164 m_wFractureIcon2Widget.SetVisible(legFractured);
166 m_wFractureTextWidget.SetText(m_sArmFractureText);
167 m_wFractureText2Widget.SetText(m_sLegFractureText);
169 m_wFractureTextWidget.SetVisible(armFractured);
170 m_wFractureText2Widget.SetVisible(legFractured);
179 m_wInfoWidget.SetVisible(
false);
180 m_wInfoWidget.SetEnabled(
false);
184 void Move(
float x,
float y)
189 m_pFrameSlotUI.SetPosX(x);
190 m_pFrameSlotUI.SetPosY(y);
194 void SetName(
string sName)
201 m_wTextName.GetParent().SetVisible(
false);
206 m_wTextName.SetText(sName);
207 m_wTextName.GetParent().SetVisible(
true);
217 override void HandlerAttached(Widget w)
222 m_wTextName = TextWidget.Cast( w.FindAnyWidget(
"ItemInfo_name" ) );
223 Widget wItemInfo = m_wInfoWidget.FindAnyWidget(
"ItemInfo" );
228 m_wDamageIconWidget = ImageWidget.Cast( w.FindAnyWidget(
"DamageInfo_icon" ) );
229 m_wDamageTextWidget = TextWidget.Cast( w.FindAnyWidget(
"DamageInfo_text" ) );
230 m_wFractureIconWidget = ImageWidget.Cast( w.FindAnyWidget(
"FractureInfo_icon" ) );
231 m_wFractureIcon2Widget = ImageWidget.Cast( w.FindAnyWidget(
"FractureInfo_icon2" ) );
232 m_wFractureTextWidget = TextWidget.Cast( w.FindAnyWidget(
"FractureInfo_text" ) );
233 m_wFractureText2Widget = TextWidget.Cast( w.FindAnyWidget(
"FractureInfo_text2" ) );
234 m_wDamageRegenTextWidget = TextWidget.Cast( w.FindAnyWidget(
"DamageRegenInfo_text" ) );
235 m_wBleedingIconWidget = ImageWidget.Cast( w.FindAnyWidget(
"BleedingInfo_icon" ) );
236 m_wBleedingTextWidget = TextWidget.Cast( w.FindAnyWidget(
"BleedingInfo_text" ) );
237 m_wTourniquetIconWidget = ImageWidget.Cast( w.FindAnyWidget(
"TourniquetInfo_icon" ) );
238 m_wTourniquetTextWidget = TextWidget.Cast( w.FindAnyWidget(
"TourniquetInfo_text" ) );
239 m_wTourniquetHintIconWidget = RichTextWidget.Cast( w.FindAnyWidget(
"TourniquetHint_icon" ) );
240 m_wTourniquetHintTextWidget = TextWidget.Cast( w.FindAnyWidget(
"TourniquetHint_text" ) );
241 m_wSalineBagIconWidget = ImageWidget.Cast( w.FindAnyWidget(
"SalineBagInfo_icon" ) );
242 m_wSalineBagTextWidget = TextWidget.Cast( w.FindAnyWidget(
"SalineBagInfo_text" ) );
243 m_wMorphineIconWidget = ImageWidget.Cast( w.FindAnyWidget(
"MorphineInfo_icon" ) );
244 m_wMorphineTextWidget = TextWidget.Cast( w.FindAnyWidget(
"MorphineInfo_text" ) );
252 GetGame().GetCallqueue().Remove(ShowInfoWidget);
253 m_wInfoWidget.RemoveHandler(m_pFrameSlotUI);
254 m_wInfoWidget.RemoveHandler(
this);
255 m_wInfoWidget.RemoveFromHierarchy();
260 Widget GetInfoWidget()
262 return m_wInfoWidget.FindAnyWidget(
"size");