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

◆ button_OnUpdate()

void Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.button_OnUpdate ( UIElement affectedElement)
inlineprivateinherited

Definition at line 171 of file CreativePowers.cs.

172 {
173 bool currentOption = _perPlayerIsEnabled[Main.myPlayer];
175 groupOptionButton.SetCurrentOption(currentOption);
176 if (affectedElement.IsMouseHovering)
177 {
178 string originalText = Language.GetTextValue(groupOptionButton.IsSelected ? (_powerNameKey + "_Enabled") : (_powerNameKey + "_Disabled"));
179 CreativePowersHelper.AddDescriptionIfNeeded(ref originalText, _powerNameKey + "_Description");
180 CreativePowersHelper.AddUnlockTextIfNeeded(ref originalText, GetIsUnlocked(), _powerNameKey + "_Unlock");
181 CreativePowersHelper.AddPermissionTextIfNeeded(this, ref originalText);
182 Main.instance.MouseTextNoOverride(originalText, 0, 0);
183 }
184 }
static string GetTextValue(string key)
Definition Language.cs:15

References Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower._perPlayerIsEnabled, Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower._powerNameKey, Terraria.GameContent.Creative.CreativePowersHelper.AddDescriptionIfNeeded(), Terraria.GameContent.Creative.CreativePowersHelper.AddPermissionTextIfNeeded(), Terraria.GameContent.Creative.CreativePowersHelper.AddUnlockTextIfNeeded(), Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.GetIsUnlocked(), Terraria.Localization.Language.GetTextValue(), Terraria.Main.instance, and Terraria.Main.myPlayer.

Referenced by Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.ProvidePowerButtons().