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

◆ button_OnUpdate()

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

Definition at line 172 of file CreativePowers.cs.

173 {
174 bool currentOption = _perPlayerIsEnabled[Main.myPlayer];
176 groupOptionButton.SetCurrentOption(currentOption);
177 if (affectedElement.IsMouseHovering)
178 {
179 string originalText = Language.GetTextValue(groupOptionButton.IsSelected ? (_powerNameKey + "_Enabled") : (_powerNameKey + "_Disabled"));
180 CreativePowersHelper.AddDescriptionIfNeeded(ref originalText, _powerNameKey + "_Description");
181 CreativePowersHelper.AddUnlockTextIfNeeded(ref originalText, GetIsUnlocked(), _powerNameKey + "_Unlock");
182 CreativePowersHelper.AddPermissionTextIfNeeded(this, ref originalText);
183 Main.instance.MouseTextNoOverride(originalText, 0, 0);
184 }
185 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: