35 m_wGlow = w.FindAnyWidget(
"Glow");
39 m_pDamageHandler = SCR_InventoryHitZonePointUI.Cast(damageW.FindHandler(SCR_InventoryHitZonePointUI));
70 spinbox.SetCurrentItem(
id);
122 SCR_ApplicableMedicalItemPredicate predicate =
new SCR_ApplicableMedicalItemPredicate();
123 predicate.characterEntity =
m_Player;
152 return "#AR-Inventory_Head";
157 return "#AR-Inventory_Chest";
162 return "#AR-Inventory_Abdomen";
167 return "#AR-Inventory_LeftArm";
172 return "#AR-Inventory_RightArm";
177 return "#AR-Inventory_LeftLeg";
182 return "#AR-Inventory_RightLeg";
217 SCR_CharacterHitZone scrHZ;
221 scrHZ = SCR_CharacterHitZone.Cast(hz);
237 array<HitZone> hzs = {};
292 const float regen = (dotHealing + dotRegen);
300 const bool bleedingVisible = (bleeding > 0 || tourniquetted || salineBagged);
301 const bool damageVisible = (health < 1 && bleeding == 0);
302 m_pDamageHandler.GetRootWidget().SetVisible(damageVisible || bleedingVisible);
303 m_pDamageHandler.UpdateHitZoneState(bleeding, regen, tourniquetted, salineBagged);
313 if (bleeding > 0 || health < 1 || tourniquetted || salineBagged)
392 protected static SCR_InventoryHitZonePointUI s_pSelectedPoint;
418 protected const string DAMAGE_INFO =
"{55AFA256E1C20FB2}UI/layouts/Menus/Inventory/InventoryDamageInfo.layout";
465 Widget damageOverlay = w.FindAnyWidget(
"DamageOverlay");
486 if (w.GetName() ==
"BigBloodIcon")
488 else if (w.GetName() ==
"BigDamageIcon")
497 if (w.GetName() ==
"BigBloodIcon")
499 else if (w.GetName() ==
"BigDamageIcon")
508 if (s_pSelectedPoint)
510 s_pSelectedPoint.m_bSelected =
false;
511 s_pSelectedPoint.Highlight(
false);
517 s_pSelectedPoint =
this;
519 s_pSelectedPoint = null;
542 if (!inventoryMenuUI)
545 return inventoryMenuUI;
552 if (!bloodIcon && !fractureIcon)
555 int groupDamageIntensity;
557 float bleedingRate, bloodHealth;
558 bool isTourniquetted, isSalineBagged, isArmFractured, isLegFractured;
559 string damageIntensity, damageIntensityText, bleedingIntensityText, bloodLevelText;
569 if (!inventoryMenuUI)
572 localInfoWidget =
GetGame().GetWorkspace().CreateWidgets(
DAMAGE_INFO, inventoryMenuUI.GetRootWidget());
573 if (!localInfoWidget)
576 localInfoWidget.SetVisible(
true);
577 localInfoWidget.SetOpacity(0);
588 m_DamageInfo.SetFractureStateVisible(isArmFractured, isLegFractured);
590 m_DamageInfo.SetBleedingStateVisible(bloodHealth < 1, bloodLevelText);
604 w.GetScreenPos(x, y);
607 w.GetScreenSize(width, height);
609 float screenSizeX, screenSizeY;
610 GetGame().GetWorkspace().GetScreenSize(screenSizeX, screenSizeY);
612 localInfoWidget.SetOpacity(1);
614 float infoWidth, infoHeight;
615 int iMouseX, iMouseY;
617 localInfoWidget.GetScreenSize(infoWidth, infoHeight);
619 iMouseY = y + height;
620 if (x + infoWidth > screenSizeX)
621 iMouseX = screenSizeX - infoWidth - width * 0.5;
623 m_DamageInfo.Move(
GetGame().GetWorkspace().DPIUnscale( iMouseX ) - infoWidth * 0.60,
GetGame().GetWorkspace().DPIUnscale( iMouseY ) );
639 if (!show && !virtualHZ)
649 int groupDamageIntensity;
651 float bleedingRate, bloodHealth;
652 bool isTourniquetted, isSalineBagged, isArmFractured, isLegFractured;
653 const bool isMorphined;
654 string damageIntensity, damageIntensityText, bleedingIntensityText;
656 GetHitZoneInfo(group, groupDamageIntensity, regenerating, bleedingRate, bloodHealth, isTourniquetted, isSalineBagged, isArmFractured, isLegFractured);
657 GetDamageInfoTexts(group, groupDamageIntensity, bleedingRate, damageIntensity, damageIntensityText, bleedingIntensityText);
661 groupDamageIntensity != 0,
671 bleedingIntensityText
682 void GetDamageInfoTexts(
EHitZoneGroup group,
int groupDamageIntensity,
float bleedingRate, out
string damageIntensity, out
string damageIntensityText, out
string bleedingIntensityText)
684 if (groupDamageIntensity == 0)
686 damageIntensity =
"";
687 damageIntensityText =
"";
689 else if (groupDamageIntensity == 1)
691 damageIntensity =
"Wound_1_UI";
694 else if (groupDamageIntensity == 2)
696 damageIntensity =
"Wound_2_UI";
699 else if (groupDamageIntensity == 3)
701 damageIntensity =
"Wound_3_UI";
704 else if (groupDamageIntensity == 4)
706 damageIntensity =
"Wound_4_UI";
734 protected void GetHitZoneInfo(
EHitZoneGroup group, out
int groupDamageIntensity, out
bool regenerating, out
float bleedingRate, out
float bloodHealth, out
bool isTourniquetted, out
bool isSalineBagged, out
bool isArmFractured, out
bool isLegFractured)
751 isArmFractured = damageMan.GetAimingDamage() > 0;
752 isLegFractured = damageMan.GetMovementDamage() > 0;
757 bleedingRate = hz.GetTotalBleedingAmount();
758 bloodHealth = hz.GetHealthScaled();
762 isArmFractured = damageMan.GetAimingDamage() > 0;
764 isLegFractured = damageMan.GetMovementDamage() > 0;
767 regenerating =
false;
771 if (groupHealth == 1)
772 groupDamageIntensity = 0;
774 groupDamageIntensity = 4;
776 groupDamageIntensity = 3;
778 groupDamageIntensity = 2;
780 groupDamageIntensity = 1;
791 if (tourniquetted || salineBagged)
802 float bleedRate, bloodHealth;
804 bool isArmFractured, isLegFractured;
805 GetHitZoneInfo(
m_eHitZoneGroup, damageIntensity, regenerating, bleedRate, bloodHealth, tourniquetted, salineBagged, isArmFractured, isLegFractured);
806 if (damageIntensity > 0)
811 m_wIcon.SetVisible(!tourniquetted && !salineBagged);
823 bool isRegen = (regen > 0);
824 float regenSpeed =
Math.AbsFloat(regen);
825 if (regenSpeed < 0.3)
828 if (isRegen && !bleeding)
837 if (isRegen && bleeding == 0)
897 float opacitySpeed = speed;
905 float targetSize[2] = {32, 32};
960 float mask =
Math.Lerp(0.25, 0.75, 1 - bloodLevel);
ArmaReforgerScripted GetGame()
ChimeraCharacter m_Player
ECharacterHitZoneGroup m_eHitZoneGroup
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
override bool OnMouseEnter(Widget w, int x, int y)
ref array< int > m_aDOTLevels
float m_fMediumDamageThreshold
void ShowHitZoneInfo(bool show, bool virtualHZ=false)
const float OPACITY_DEFAULT
void GetHitZoneInfo(EHitZoneGroup group, out int groupDamageIntensity, out bool regenerating, out float bleedingRate, out float bloodHealth, out bool isTourniquetted, out bool isSalineBagged, out bool isArmFractured, out bool isLegFractured)
void UpdateHitZoneState(float bleeding, float regen, bool tourniquetted, bool salineBagged)
WidgetAnimationBase m_IconOpacityAnim
float m_fMediumBloodLossThreshold
string m_sMediumBloodLoss
float m_fLowDamageThreshold
void ShowVirtualHZInfo(Widget w, bool bloodIcon=false, bool fractureIcon=false)
Gather data for, and create, infowidget for virtual hitzones.
WidgetAnimationBase m_IconOutlineAnim
SCR_InventoryHitZonePointContainerUI m_DamageState
SCR_InventoryHitZonePointContainerUI m_pParentContainer
SCR_InventoryDamageInfoUI m_DamageInfo
void Highlight(bool highlight)
void PlayRegenAnim(float regenSpeed=1)
float m_fHighBleedingThreshold
ref SCR_InventoryHitZoneUI m_pStorageHandler
ImageWidget m_wIconSalineBag
SCR_DamageStateUIComponent m_DamageStateUIComp
const float OPACITY_BLOOD
ImageWidget m_wIconTourniquet
string m_sSevereBloodLoss
void GetBloodInfoText(float bloodHitZoneHealthScaled, out string bloodLossText)
float m_fLowBloodLossThreshold
float m_fLowBleedingThreshold
float m_fHighBloodLossThreshold
void SetBloodLevelProgress(float bloodLevel)
void SetParentContainer(SCR_InventoryHitZonePointContainerUI container)
void GetDamageInfoTexts(EHitZoneGroup group, int groupDamageIntensity, float bleedingRate, out string damageIntensity, out string damageIntensityText, out string bleedingIntensityText)
void EnableVirtualHZInfoWidget(Widget localInfoWidget, Widget w)
Determine size and location for the infowidget.
void OnAnimCycleComplete(WidgetAnimationBase anim)
bool m_bAllowProgressAnim
void PlayBloodDropAnim(float speed=1)
WidgetAnimationBase m_DamageIconOpacityAnim
void SetRegeneration(float regen, float bleeding)
WidgetAnimationBase m_IconSizeAnim
ref array< HitZone > m_aGroupHitZones
SCR_InventoryMenuUI GetInventoryMenuUI()
float m_fMediumBleedingThreshold
const float OPACITY_SOLID
float m_fHighDamageThreshold
void SCR_InventoryHitZoneUI(BaseInventoryStorageComponent storage, LoadoutAreaType slotID=null, SCR_InventoryMenuUI menuManager=null, int iPage=0, array< BaseInventoryStorageComponent > aTraverseStorage=null, SCR_InventoryHitZonePointContainerUI parent=null, bool isTourniquetted=false)
override void HandlerAttached(Widget w)
override void HandlerDeattached(Widget w)
proto external Managed FindComponent(typename typeName)
Blood - does not receive damage directly, only via scripted events.
float GetGroupHealthScaled(ECharacterHitZoneGroup hitZoneGroup)
bool GetGroupSalineBagged(ECharacterHitZoneGroup hitZoneGroup)
SCR_CharacterBloodHitZone GetBloodHitZone()
bool GetGroupTourniquetted(ECharacterHitZoneGroup hitZoneGroup)
override float GetGroupDamageOverTime(ECharacterHitZoneGroup hitZoneGroup, EDamageType damageType)
void SetGlowVisible(bool visible)
ref SCR_InventoryHitZoneUI m_pStorageUI
SCR_InventoryHitZoneUI GetStorage()
ref array< HitZone > m_aGroupHitZones
SCR_TourniquetStorageComponent m_TourniquetStorage
void UpdateHitZoneDOTRemoved(notnull SCR_DamageEffect dmgEffect)
void SetGlowColor(Color color)
SCR_CharacterBloodHitZone m_pBloodHitZone
override bool OnClick(Widget w, int x, int y, int button)
static SCR_InventoryHitZonePointContainerUI s_pSelectedPoint
void Highlight(bool highlight)
void RemoveTourniquetFromSlot()
void HideApplicableItems()
override bool OnMouseEnter(Widget w, int x, int y)
ECharacterHitZoneGroup m_eHitZoneGroup
SCR_CharacterDamageManagerComponent m_pCharDmgManager
BaseInventoryStorageComponent m_pStorage
void InitializeHitZoneUI(BaseInventoryStorageComponent storage, SCR_InventoryMenuUI menuManager, int hitZoneId, IEntity player, bool updateAttachmentStorage=true)
string m_sDamageHitZoneName
SCR_InventoryHitZonePointUI m_pDamageHandler
override void HandlerAttached(Widget w)
void UpdateHitZoneDOTAdded(notnull SCR_DamageEffect dmgEffect)
ECharacterHitZoneGroup GetHitZoneGroup()
SCR_InventoryMenuUI m_pInventoryMenu
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
bool m_bApplicableItemsShown
SCR_InventoryMenuUI GetInventoryHandler()
void ShowApplicableItems()
void OnTourniquetMoved(int hzGroupId)
void UpdateBleedingHitZoneRemoved(EDamageType dType, HitZone hz=null)
void Select(bool select=true)
void UpdateHitZoneState(SCR_HitZone hz, bool updateAttachmentStorage=true)
string m_sBleedingHitZoneName
int FindItem(string item)
float GetHitZoneDamageOverTime(EDamageType targetDamageType)
Get current total damage per second of this hitZone.
SCR_EditableEntityComponent GetControlledEntity()
SCR_FieldOfViewSettings Attribute
int TNodeId
Node global id is a hash of name of the node.
proto external PlayerController GetPlayerController()