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

◆ DrawOptionsPanel()

void Terraria.UI.AchievementAdvisor.DrawOptionsPanel ( SpriteBatch spriteBatch,
Vector2 leftPosition,
Vector2 rightPosition )
inline

Definition at line 84 of file AchievementAdvisor.cs.

85 {
87 _hoveredCard = null;
88 int num = bestCards.Count;
89 if (num > 5)
90 {
91 num = 5;
92 }
93 bool hovered;
94 for (int i = 0; i < num; i++)
95 {
96 DrawCard(bestCards[i], spriteBatch, leftPosition + new Vector2(42 * i, 0f), 0.5f, out hovered);
97 if (hovered)
98 {
100 }
101 }
102 for (int j = 5; j < bestCards.Count; j++)
103 {
104 DrawCard(bestCards[j], spriteBatch, rightPosition + new Vector2(42 * j, 0f), 0.5f, out hovered);
105 if (hovered)
106 {
108 }
109 }
110 if (_hoveredCard == null)
111 {
112 return;
113 }
114 if (_hoveredCard.achievement.IsCompleted)
115 {
116 _hoveredCard = null;
117 }
119 {
120 Main.player[Main.myPlayer].mouseInterface = true;
121 if (Main.mouseLeft && Main.mouseLeftRelease)
122 {
123 Main.ingameOptionsWindow = false;
124 IngameFancyUI.OpenAchievementsAndGoto(_hoveredCard.achievement);
125 }
126 }
127 }
void DrawCard(AchievementAdvisorCard card, SpriteBatch spriteBatch, Vector2 position, float scale, out bool hovered)
List< AchievementAdvisorCard > GetBestCards(int cardsAmount=10)
AchievementAdvisorCard _hoveredCard

References Terraria.UI.AchievementAdvisor._hoveredCard, Terraria.UI.AchievementAdvisorCard.achievement, System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.UI.AchievementAdvisor.DrawCard(), Terraria.UI.AchievementAdvisor.GetBestCards(), Terraria.GameInput.PlayerInput.IgnoreMouseInterface, Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.Main.myPlayer, Terraria.UI.IngameFancyUI.OpenAchievementsAndGoto(), Terraria.Main.player, and Microsoft.Xna.Framework.Graphics.Vector2.