Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PrepareFields()

void Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet.PrepareFields ( Player player)
inlineprivate

Definition at line 177 of file HorizontalBarsPlayerResourcesDisplaySet.cs.

178 {
179 PlayerStatsSnapshot playerStatsSnapshot = new PlayerStatsSnapshot(player);
180 _hpSegmentsCount = (int)((float)playerStatsSnapshot.LifeMax / playerStatsSnapshot.LifePerSegment);
181 _mpSegmentsCount = (int)((float)playerStatsSnapshot.ManaMax / playerStatsSnapshot.ManaPerSegment);
182 _maxSegmentCount = 20;
183 _hpFruitCount = playerStatsSnapshot.LifeFruitCount;
184 _hpPercent = (float)playerStatsSnapshot.Life / (float)playerStatsSnapshot.LifeMax;
185 _mpPercent = (float)playerStatsSnapshot.Mana / (float)playerStatsSnapshot.ManaMax;
186 }

References Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet._hpFruitCount, Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet._hpPercent, Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet._hpSegmentsCount, Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet._maxSegmentCount, Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet._mpPercent, Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet._mpSegmentsCount, Terraria.GameContent.UI.ResourceSets.PlayerStatsSnapshot.Life, Terraria.GameContent.UI.ResourceSets.PlayerStatsSnapshot.LifeFruitCount, Terraria.GameContent.UI.ResourceSets.PlayerStatsSnapshot.LifeMax, Terraria.GameContent.UI.ResourceSets.PlayerStatsSnapshot.LifePerSegment, Terraria.GameContent.UI.ResourceSets.PlayerStatsSnapshot.Mana, Terraria.GameContent.UI.ResourceSets.PlayerStatsSnapshot.ManaMax, and Terraria.GameContent.UI.ResourceSets.PlayerStatsSnapshot.ManaPerSegment.

Referenced by Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet.Draw().