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

◆ ProvideSlider()

override UIElement Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.ProvideSlider ( )
inline

Implements Terraria.GameContent.Creative.IProvideSliderElement.

Definition at line 1026 of file CreativePowers.cs.

1027 {
1028 UIVerticalSlider uIVerticalSlider = CreativePowersHelper.CreateSlider(base.GetSliderValue, base.SetValueKeyboard, base.SetValueGamepad);
1029 UIPanel uIPanel = new UIPanel();
1030 uIPanel.Width = new StyleDimension(82f, 0f);
1031 uIPanel.Height = new StyleDimension(180f, 0f);
1032 uIPanel.HAlign = 0f;
1033 uIPanel.VAlign = 0.5f;
1034 uIPanel.Append(uIVerticalSlider);
1035 uIPanel.OnUpdate += CreativePowersHelper.UpdateUseMouseInterface;
1036 uIVerticalSlider.OnUpdate += UpdateSliderColorAndShowMultiplierMouseOver;
1037 AddIndication(uIPanel, 0f, "x3", "Images/UI/WorldCreation/IconDifficultyMaster", MouseOver_Master, Click_Master);
1038 AddIndication(uIPanel, 1f / 3f, "x2", "Images/UI/WorldCreation/IconDifficultyExpert", MouseOver_Expert, Click_Expert);
1039 AddIndication(uIPanel, 2f / 3f, "x1", "Images/UI/WorldCreation/IconDifficultyNormal", MouseOver_Normal, Click_Normal);
1040 AddIndication(uIPanel, 1f, "x0.5", "Images/UI/WorldCreation/IconDifficultyCreative", MouseOver_Journey, Click_Journey);
1041 return uIPanel;
1042 }
void Click_Expert(UIMouseEvent evt, UIElement listeningElement)
void Click_Normal(UIMouseEvent evt, UIElement listeningElement)
void Click_Journey(UIMouseEvent evt, UIElement listeningElement)
void Click_Master(UIMouseEvent evt, UIElement listeningElement)
static void AddIndication(UIPanel panel, float yAnchor, string indicationText, string iconImagePath, UIElement.ElementEvent updateEvent, UIElement.MouseEvent clickEvent)

References Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.AddIndication(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.Click_Expert(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.Click_Journey(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.Click_Master(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.Click_Normal(), Terraria.GameContent.Creative.CreativePowersHelper.CreateSlider(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.MouseOver_Expert(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.MouseOver_Journey(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.MouseOver_Master(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.MouseOver_Normal(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.UpdateSliderColorAndShowMultiplierMouseOver(), and Terraria.GameContent.Creative.CreativePowersHelper.UpdateUseMouseInterface().