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

◆ DrawSettingButton()

static void Terraria.Main.DrawSettingButton ( ref bool mouseOver,
ref float scale,
int posX,
int posY,
string text,
string textSizeMatcher,
Action clickAction )
inlinestatic

Definition at line 58655 of file Main.cs.

58656 {
58657 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
58658 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
58659 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
58660 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
58661 //IL_0034: Unknown result type (might be due to invalid IL or missing references)
58662 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
58663 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
58664 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
58665 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
58666 //IL_0133: Unknown result type (might be due to invalid IL or missing references)
58667 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
58668 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
58669 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
58670 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
58671 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
58672 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
58673 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
58674 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
58675 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
58676 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
58677 Vector2 val = FontAssets.MouseText.Value.MeasureString(textSizeMatcher);
58678 Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(text);
58679 Vector2 vector3 = FontAssets.DeathText.Value.MeasureString(text);
58680 float num = val.X / vector2.X;
58681 if (mouseOver)
58682 {
58683 if ((double)scale < 0.96)
58684 {
58685 scale += 0.02f;
58686 }
58687 }
58688 else if ((double)scale > 0.8)
58689 {
58690 scale -= 0.02f;
58691 }
58692 UILinkPointNavigator.SetPosition(308, new Vector2((float)posX, (float)posY));
58693 for (int i = 0; i < 5; i++)
58694 {
58695 int num2 = 0;
58696 int num3 = 0;
58697 Color color = Color.Black;
58698 if (i == 0)
58699 {
58700 num2 = -2;
58701 }
58702 if (i == 1)
58703 {
58704 num2 = 2;
58705 }
58706 if (i == 2)
58707 {
58708 num3 = -2;
58709 }
58710 if (i == 3)
58711 {
58712 num3 = 2;
58713 }
58714 if (i == 4)
58715 {
58716 color = Color.White;
58717 }
58718 spriteBatch.DrawString(FontAssets.DeathText.Value, text, new Vector2((float)(posX + num2), (float)(posY + num3)), color, 0f, new Vector2(vector3.X / 2f, vector3.Y / 2f), (scale - 0.2f) * num, (SpriteEffects)0, 0f);
58719 }
58720 if ((float)mouseX > (float)posX - vector3.X / 2f && (float)mouseX < (float)posX + vector3.X / 2f && (float)mouseY > (float)posY - vector3.Y / 2f && (float)mouseY < (float)posY + vector3.Y / 2f - 10f && !LocalPlayer.mouseInterface)
58721 {
58723 {
58724 if (!mouseOver)
58725 {
58727 }
58728 mouseOver = true;
58729 player[myPlayer].mouseInterface = true;
58731 {
58732 mouseOver = false;
58733 scale = 0.8f;
58734 clickAction();
58735 }
58736 }
58737 }
58738 else
58739 {
58740 mouseOver = false;
58741 }
58742 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static Asset< DynamicSpriteFont > DeathText
Definition FontAssets.cs:12
static Asset< DynamicSpriteFont > MouseText
Definition FontAssets.cs:10
static SpriteBatch spriteBatch
Definition Main.cs:1043
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
Definition Main.cs:1958
static bool mouseLeftRelease
Definition Main.cs:1908
static int mouseY
Definition Main.cs:634
static Player LocalPlayer
Retrieves the T:Terraria.Player object for the local user. Shorthand for F:Terraria....
Definition Main.cs:3001
static Player[] player
Definition Main.cs:1960
static int mouseX
Definition Main.cs:632
static bool mouseLeft
Definition Main.cs:642
static void SetPosition(int ID, Vector2 Position)

References Terraria.GameContent.FontAssets.DeathText, Terraria.GameInput.PlayerInput.IgnoreMouseInterface, Terraria.Main.LocalPlayer, Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.myPlayer, Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.UI.Gamepad.UILinkPointNavigator.SetPosition(), and Terraria.Main.spriteBatch.

Referenced by Terraria.Main.DrawInterface_29_SettingsButton().

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