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

◆ UpdateUnlockStateByPowerInternal()

static void Terraria.GameContent.Creative.CreativePowersHelper.UpdateUnlockStateByPowerInternal ( ICreativePower power,
Color colorWhenSelected,
IGroupOptionButton asButton )
inlinestaticprivate

Definition at line 199 of file CreativePowersHelper.cs.

200 {
201 bool isUnlocked = power.GetIsUnlocked();
202 bool flag = !IsAvailableForPlayer(power, Main.myPlayer);
203 asButton.SetBorderColor(flag ? Color.DimGray : Color.White);
204 if (flag)
205 {
206 asButton.SetColorsBasedOnSelectionState(new Color(60, 60, 60), new Color(60, 60, 60), 0.7f, 0.7f);
207 }
208 else if (isUnlocked)
209 {
210 asButton.SetColorsBasedOnSelectionState(colorWhenSelected, Colors.InventoryDefaultColor, 1f, 0.7f);
211 }
212 else
213 {
215 }
216 }
static bool IsAvailableForPlayer(ICreativePower power, int playerIndex)
static readonly Color InventoryDefaultColor
Definition Colors.cs:93
void SetColorsBasedOnSelectionState(Color pickedColor, Color unpickedColor, float opacityPicked, float opacityNotPicked)

References Microsoft.Xna.Framework.Graphics.Color, Microsoft.Xna.Framework.Color.Crimson, Microsoft.Xna.Framework.Color.DimGray, Terraria.GameContent.Creative.ICreativePower.GetIsUnlocked(), Terraria.ID.Colors.InventoryDefaultColor, Terraria.GameContent.Creative.CreativePowersHelper.IsAvailableForPlayer(), Terraria.Main.myPlayer, Microsoft.Xna.Framework.Color.Red, Terraria.GameContent.UI.Elements.IGroupOptionButton.SetBorderColor(), Terraria.GameContent.UI.Elements.IGroupOptionButton.SetColorsBasedOnSelectionState(), and Microsoft.Xna.Framework.Color.White.

Referenced by Terraria.GameContent.Creative.CreativePowersHelper.UpdateUnlockStateByPower().