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

◆ DrawToggleButton()

void Terraria.GameContent.Creative.CreativeUI.DrawToggleButton ( SpriteBatch spritebatch,
Vector2 location )
inlineprivate

Definition at line 149 of file CreativeUI.cs.

150 {
151 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
152 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
153 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
154 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
155 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
156 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
157 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
158 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
159 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
160 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
161 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
162 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
163 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
164 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
165 //IL_007c: Unknown result type (might be due to invalid IL or missing references)
166 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
167 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
168 //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
169 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
170 Vector2 vector = _buttonTexture.Size();
171 Rectangle rectangle = Utils.CenteredRectangle(location + vector / 2f, vector);
172 UILinkPointNavigator.SetPosition(311, ((Rectangle)(ref rectangle)).Center.ToVector2());
173 spritebatch.Draw(_buttonTexture.Value, location, (Rectangle?)null, Color.White, 0f, Vector2.Zero, 1f, (SpriteEffects)0, 0f);
174 Main.LocalPlayer.creativeInterface = false;
175 if (((Rectangle)(ref rectangle)).Contains(Main.MouseScreen.ToPoint()))
176 {
177 Main.LocalPlayer.creativeInterface = true;
178 Main.LocalPlayer.mouseInterface = true;
179 if (Enabled)
180 {
181 Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuOpen"), 0, 0);
182 }
183 else
184 {
185 Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuClosed"), 0, 0);
186 }
187 spritebatch.Draw(_buttonBorderTexture.Value, location, (Rectangle?)null, Color.White, 0f, Vector2.Zero, 1f, (SpriteEffects)0, 0f);
188 if (Main.mouseLeft && Main.mouseLeftRelease)
189 {
190 ToggleMenu();
191 }
192 }
193 }
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
static void SetPosition(int ID, Vector2 Position)

References Terraria.GameContent.Creative.CreativeUI._buttonBorderTexture, Terraria.GameContent.Creative.CreativeUI._buttonTexture, Terraria.Utils.CenteredRectangle(), Terraria.GameContent.Creative.CreativeUI.Enabled, Terraria.Localization.Language.GetTextValue(), Terraria.Main.instance, Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.Main.MouseScreen, Terraria.UI.Gamepad.UILinkPointNavigator.SetPosition(), and Terraria.GameContent.Creative.CreativeUI.ToggleMenu().

Referenced by Terraria.GameContent.Creative.CreativeUI.Draw().

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