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

◆ TryToHover()

void Terraria.GameContent.UI.ResourceSets.ClassicPlayerResourcesDisplaySet.TryToHover ( )
inline

Implements Terraria.GameContent.UI.ResourceSets.IPlayerResourcesDisplaySet.

Definition at line 184 of file ClassicPlayerResourcesDisplaySet.cs.

185 {
186 Vector2 mouseScreen = Main.MouseScreen;
187 Player localPlayer = Main.LocalPlayer;
188 int num = 26 * localPlayer.statLifeMax2 / (int)UIDisplay_LifePerHeart;
189 int num2 = 0;
190 if (localPlayer.statLifeMax2 > 200)
191 {
192 num = 260;
193 num2 += 26;
194 }
195 if (mouseScreen.X > (float)(500 + UI_ScreenAnchorX) && mouseScreen.X < (float)(500 + num + UI_ScreenAnchorX) && mouseScreen.Y > 32f && mouseScreen.Y < (float)(32 + TextureAssets.Heart.Height() + num2))
196 {
197 CommonResourceBarMethods.DrawLifeMouseOver();
198 }
199 num = 24;
200 num2 = 28 * localPlayer.statManaMax2 / UIDisplay_ManaPerStar;
201 if (mouseScreen.X > (float)(762 + UI_ScreenAnchorX) && mouseScreen.X < (float)(762 + num + UI_ScreenAnchorX) && mouseScreen.Y > 30f && mouseScreen.Y < (float)(30 + num2))
202 {
203 CommonResourceBarMethods.DrawManaMouseOver();
204 }
205 }

References Terraria.GameContent.UI.ResourceSets.CommonResourceBarMethods.DrawLifeMouseOver(), Terraria.GameContent.UI.ResourceSets.CommonResourceBarMethods.DrawManaMouseOver(), Terraria.GameContent.TextureAssets.Heart, Terraria.Main.LocalPlayer, Terraria.Main.MouseScreen, Terraria.Player.statLifeMax2, Terraria.GameContent.UI.ResourceSets.ClassicPlayerResourcesDisplaySet.UI_ScreenAnchorX, Terraria.GameContent.UI.ResourceSets.ClassicPlayerResourcesDisplaySet.UIDisplay_LifePerHeart, Terraria.GameContent.UI.ResourceSets.ClassicPlayerResourcesDisplaySet.UIDisplay_ManaPerStar, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.