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

◆ CreateToggleButton()

static GroupOptionButton< bool > Terraria.GameContent.Creative.CreativePowersHelper.CreateToggleButton ( CreativePowerUIElementRequestInfo info)
inlinestatic

Definition at line 87 of file CreativePowersHelper.cs.

88 {
89 GroupOptionButton<bool> groupOptionButton = new GroupOptionButton<bool>(option: true, null, null, Color.White, null, 0.8f);
90 groupOptionButton.Width = new StyleDimension(info.PreferredButtonWidth, 0f);
91 groupOptionButton.Height = new StyleDimension(info.PreferredButtonHeight, 0f);
92 groupOptionButton.ShowHighlightWhenSelected = false;
93 groupOptionButton.SetCurrentOption(option: false);
94 groupOptionButton.SetColorsBasedOnSelectionState(new Color(152, 175, 235), Colors.InventoryDefaultColor, 1f, 0.7f);
95 groupOptionButton.SetColorsBasedOnSelectionState(Main.OurFavoriteColor, Colors.InventoryDefaultColor, 1f, 0.7f);
96 return groupOptionButton;
97 }
void SetColorsBasedOnSelectionState(Color pickedColor, Color unpickedColor, float opacityPicked, float opacityNotPicked)
static readonly Color InventoryDefaultColor
Definition Colors.cs:93

References Microsoft.Xna.Framework.Graphics.Color, System.info, Terraria.ID.Colors.InventoryDefaultColor, Terraria.Main.OurFavoriteColor, Terraria.GameContent.UI.Elements.GroupOptionButton< T >.SetColorsBasedOnSelectionState(), Terraria.GameContent.UI.Elements.GroupOptionButton< T >.SetCurrentOption(), and Microsoft.Xna.Framework.Color.White.

Referenced by Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.ProvidePowerButtons(), and Terraria.GameContent.Creative.CreativePowers.ASharedTogglePower.ProvidePowerButtons().