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

◆ LineUpdate()

void Terraria.GameContent.UI.WiresUI.WiresRadial.LineUpdate ( )
inlineprivate

Definition at line 96 of file WiresUI.cs.

97 {
98 bool value = true;
99 float min = 0.75f;
100 Player player = Main.player[Main.myPlayer];
101 if (!Settings.DrawToolModeUI || Main.drawingPlayerChat)
102 {
103 value = false;
104 min = 0f;
105 }
106 if (player.dead || Main.mouseItem.type > 0)
107 {
108 value = false;
109 _lineOpacity = 0f;
110 return;
111 }
112 if (player.cursorItemIconEnabled && player.cursorItemIconID != 0 && player.cursorItemIconID != 3625)
113 {
114 value = false;
115 _lineOpacity = 0f;
116 return;
117 }
118 if ((!player.cursorItemIconEnabled && ((!PlayerInput.UsingGamepad && !Settings.DrawToolAllowActuators) || player.mouseInterface || player.lastMouseInterface)) || Main.ingameOptionsWindow || Main.InGameUI.IsVisible)
119 {
120 value = false;
121 _lineOpacity = 0f;
122 return;
123 }
124 float num = Utils.Clamp(_lineOpacity + 0.05f * (float)value.ToDirectionInt(), min, 1f);
125 _lineOpacity += 0.05f * (float)Math.Sign(num - _lineOpacity);
126 if (Math.Abs(_lineOpacity - num) < 0.05f)
127 {
128 _lineOpacity = num;
129 }
130 }
static double Abs(double value)
static int Sign(decimal value)
Definition Math.cs:1202

References Terraria.GameContent.UI.WiresUI.WiresRadial._lineOpacity, System.Math.Abs(), Terraria.Player.cursorItemIconEnabled, Terraria.Player.cursorItemIconID, Terraria.Player.dead, Terraria.Main.drawingPlayerChat, Terraria.GameContent.UI.WiresUI.Settings.DrawToolAllowActuators, Terraria.GameContent.UI.WiresUI.Settings.DrawToolModeUI, Terraria.Main.ingameOptionsWindow, Terraria.Main.InGameUI, Terraria.Player.lastMouseInterface, Terraria.Player.mouseInterface, Terraria.Main.mouseItem, Terraria.Main.myPlayer, Terraria.Main.player, System.Math.Sign(), Terraria.GameInput.PlayerInput.UsingGamepad, and System.value.

Referenced by Terraria.GameContent.UI.WiresUI.WiresRadial.Update().