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

◆ DrawCursor()

static void Terraria.Main.DrawCursor ( Vector2 bonus,
bool smart = false )
inlinestatic

Definition at line 61952 of file Main.cs.

61953 {
61954 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
61955 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
61956 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
61957 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
61958 //IL_0311: Unknown result type (might be due to invalid IL or missing references)
61959 //IL_0316: Unknown result type (might be due to invalid IL or missing references)
61960 //IL_0317: Unknown result type (might be due to invalid IL or missing references)
61961 //IL_031c: Unknown result type (might be due to invalid IL or missing references)
61962 //IL_0321: Unknown result type (might be due to invalid IL or missing references)
61963 //IL_036c: Unknown result type (might be due to invalid IL or missing references)
61964 //IL_0378: Unknown result type (might be due to invalid IL or missing references)
61965 //IL_037e: Unknown result type (might be due to invalid IL or missing references)
61966 //IL_03b4: Unknown result type (might be due to invalid IL or missing references)
61967 //IL_03b9: Unknown result type (might be due to invalid IL or missing references)
61968 //IL_03ba: Unknown result type (might be due to invalid IL or missing references)
61969 //IL_03c9: Unknown result type (might be due to invalid IL or missing references)
61970 //IL_03d1: Unknown result type (might be due to invalid IL or missing references)
61971 //IL_03d7: Unknown result type (might be due to invalid IL or missing references)
61972 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
61973 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
61974 //IL_0108: Unknown result type (might be due to invalid IL or missing references)
61975 //IL_010d: Unknown result type (might be due to invalid IL or missing references)
61976 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
61977 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
61978 //IL_012b: Unknown result type (might be due to invalid IL or missing references)
61979 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
61980 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
61981 //IL_015d: Unknown result type (might be due to invalid IL or missing references)
61982 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
61983 //IL_016c: Unknown result type (might be due to invalid IL or missing references)
61984 //IL_0186: Unknown result type (might be due to invalid IL or missing references)
61985 //IL_0187: Unknown result type (might be due to invalid IL or missing references)
61986 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
61987 //IL_019c: Unknown result type (might be due to invalid IL or missing references)
61988 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
61989 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
61990 //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
61991 //IL_01d0: Unknown result type (might be due to invalid IL or missing references)
61992 //IL_027b: Unknown result type (might be due to invalid IL or missing references)
61993 //IL_0280: Unknown result type (might be due to invalid IL or missing references)
61994 //IL_02a3: Unknown result type (might be due to invalid IL or missing references)
61995 //IL_02a8: Unknown result type (might be due to invalid IL or missing references)
61996 //IL_02a9: Unknown result type (might be due to invalid IL or missing references)
61997 //IL_02b8: Unknown result type (might be due to invalid IL or missing references)
61998 //IL_02cb: Unknown result type (might be due to invalid IL or missing references)
61999 //IL_02d5: Unknown result type (might be due to invalid IL or missing references)
62000 //IL_01f1: Unknown result type (might be due to invalid IL or missing references)
62001 //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
62002 //IL_0202: Unknown result type (might be due to invalid IL or missing references)
62003 //IL_0207: Unknown result type (might be due to invalid IL or missing references)
62004 //IL_0221: Unknown result type (might be due to invalid IL or missing references)
62005 //IL_0222: Unknown result type (might be due to invalid IL or missing references)
62006 //IL_0223: Unknown result type (might be due to invalid IL or missing references)
62007 //IL_0237: Unknown result type (might be due to invalid IL or missing references)
62008 //IL_0241: Unknown result type (might be due to invalid IL or missing references)
62009 //IL_0256: Unknown result type (might be due to invalid IL or missing references)
62010 //IL_025b: Unknown result type (might be due to invalid IL or missing references)
62011 //IL_0265: Unknown result type (might be due to invalid IL or missing references)
62013 {
62014 return;
62015 }
62016 if (player[myPlayer].dead || player[myPlayer].mouseInterface)
62017 {
62020 }
62021 Color color = cursorColor;
62022 if (!gameMenu && LocalPlayer.hasRainbowCursor)
62023 {
62024 color = hslToRgb(GlobalTimeWrappedHourly * 0.25f % 1f, 1f, 0.5f);
62025 }
62026 bool flag = UILinkPointNavigator.Available && !PlayerInput.InBuildingMode;
62028 {
62030 {
62031 return;
62032 }
62033 Vector2 t = default(Vector2);
62034 ((Vector2)(ref t))._002Ector((float)mouseX, (float)mouseY);
62035 Vector2 t2 = Vector2.Zero;
62036 bool flag2 = SmartCursorIsUsed;
62037 if (flag2)
62038 {
62039 PlayerInput.smartSelectPointer.UpdateCenter(ScreenSize.ToVector2() / 2f);
62040 t2 = PlayerInput.smartSelectPointer.GetPointerPosition();
62041 if (Vector2.Distance(t2, t) < 1f)
62042 {
62043 flag2 = false;
62044 }
62045 else
62046 {
62047 Utils.Swap(ref t, ref t2);
62048 }
62049 }
62050 float num = 1f;
62051 if (flag2)
62052 {
62053 num = 0.3f;
62054 color = Color.White * GamepadCursorAlpha;
62055 int num2 = 17;
62056 int frameX = 0;
62057 spriteBatch.Draw(TextureAssets.Cursors[num2].Value, t2 + bonus, (Rectangle?)TextureAssets.Cursors[num2].Frame(1, 1, frameX), color, (float)Math.PI / 2f * GlobalTimeWrappedHourly, TextureAssets.Cursors[num2].Frame(1, 1, frameX).Size() / 2f, cursorScale, (SpriteEffects)0, 0f);
62058 }
62059 if (smart && !flag)
62060 {
62061 color = Color.White * GamepadCursorAlpha * num;
62062 int num3 = 13;
62063 int frameX2 = 0;
62064 spriteBatch.Draw(TextureAssets.Cursors[num3].Value, t + bonus, (Rectangle?)TextureAssets.Cursors[num3].Frame(2, 1, frameX2), color, 0f, TextureAssets.Cursors[num3].Frame(2, 1, frameX2).Size() / 2f, cursorScale, (SpriteEffects)0, 0f);
62065 }
62066 else
62067 {
62068 color = Color.White;
62069 int num4 = 15;
62070 spriteBatch.Draw(TextureAssets.Cursors[num4].Value, new Vector2((float)mouseX, (float)mouseY) + bonus, (Rectangle?)null, color, 0f, TextureAssets.Cursors[num4].Value.Size() / 2f, cursorScale, (SpriteEffects)0, 0f);
62071 }
62072 }
62073 else
62074 {
62075 int num5 = smart.ToInt();
62076 spriteBatch.Draw(TextureAssets.Cursors[num5].Value, new Vector2((float)mouseX, (float)mouseY) + bonus + Vector2.One, (Rectangle?)null, new Color((int)((float)(int)((Color)(ref color)).R * 0.2f), (int)((float)(int)((Color)(ref color)).G * 0.2f), (int)((float)(int)((Color)(ref color)).B * 0.2f), (int)((float)(int)((Color)(ref color)).A * 0.5f)), 0f, default(Vector2), cursorScale * 1.1f, (SpriteEffects)0, 0f);
62077 spriteBatch.Draw(TextureAssets.Cursors[num5].Value, new Vector2((float)mouseX, (float)mouseY) + bonus, (Rectangle?)null, color, 0f, default(Vector2), cursorScale, (SpriteEffects)0, 0f);
62078 }
62079 }
static Asset< Texture2D >[] Cursors
static SmartSelectGamepadPointer smartSelectPointer
static int TileInteractionLX
Definition Main.cs:2260
static Point ScreenSize
Definition Main.cs:3097
static Color hslToRgb(Vector3 hslVector)
Definition Main.cs:61847
static int TileInteractionLY
Definition Main.cs:2262
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 int TileInteractionHY
Definition Main.cs:2266
static bool alreadyGrabbingSunOrMoon
Definition Main.cs:1385
static float cursorScale
Definition Main.cs:2298
static float GamepadCursorAlpha
Definition Main.cs:2610
static bool SmartCursorIsUsed
Definition Main.cs:3027
static void ClearSmartInteract()
Definition Main.cs:62081
static int TileInteractionHX
Definition Main.cs:2264
static int mouseY
Definition Main.cs:634
static bool gameMenu
Definition Main.cs:2076
static Player LocalPlayer
Retrieves the T:Terraria.Player object for the local user. Shorthand for F:Terraria....
Definition Main.cs:3001
static Color cursorColor
Definition Main.cs:2292
static Player[] player
Definition Main.cs:1960
static int mouseX
Definition Main.cs:632
static float GlobalTimeWrappedHourly
Definition Main.cs:433

References Terraria.Main.alreadyGrabbingSunOrMoon, Terraria.Main.ClearSmartInteract(), Terraria.Graphics.Light.Color, Terraria.Main.cursorColor, Terraria.GameContent.TextureAssets.Cursors, Terraria.Main.cursorScale, Terraria.Main.gameMenu, Terraria.Main.GamepadCursorAlpha, Terraria.Main.GlobalTimeWrappedHourly, Terraria.Main.hslToRgb(), Terraria.GameInput.PlayerInput.InBuildingMode, Terraria.GameInput.PlayerInput.InvisibleGamepadInMenus, Terraria.Main.LocalPlayer, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.myPlayer, Terraria.Main.player, Terraria.Main.ScreenSize, Terraria.GameInput.PlayerInput.SettingsForUI.ShowGamepadCursor, Terraria.Main.SmartCursorIsUsed, Terraria.GameInput.PlayerInput.smartSelectPointer, Terraria.Main.spriteBatch, Terraria.Main.TileInteractionHX, Terraria.Main.TileInteractionHY, Terraria.Main.TileInteractionLX, and Terraria.Main.TileInteractionLY.

Referenced by Terraria.Main.DoDraw(), Terraria.UI.IngameFancyUI.Draw(), Terraria.Main.DrawInterface_36_Cursor(), Terraria.Main.DrawMap(), and Terraria.Main.DrawMenu().

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