Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TeleportPylonsMapLayer.cs
Go to the documentation of this file.
9using Terraria.UI;
10
11namespace Terraria.Map;
12
14{
15 public void Draw(ref MapOverlayDrawContext context, ref string text)
16 {
18 float num = 1f;
19 float scaleIfSelected = num * 2f;
20 Texture2D value = TextureAssets.Extra[182].Value;
21 bool num2 = TeleportPylonsSystem.IsPlayerNearAPylon(Main.LocalPlayer) && (Main.DroneCameraTracker == null || !Main.DroneCameraTracker.IsInUse());
22 Color color = Color.White;
23 if (!num2)
24 {
25 color = Color.Gray * 0.5f;
26 }
27 for (int i = 0; i < pylons.Count; i++)
28 {
29 TeleportPylonInfo info = pylons[i];
30 if (context.Draw(value, info.PositionInTiles.ToVector2() + new Vector2(1.5f, 2f), color, new SpriteFrame(9, 1, (byte)info.TypeOfPylon, 0)
31 {
32 PaddingY = 0
33 }, num, scaleIfSelected, Alignment.Center).IsMouseOver)
34 {
35 Main.cancelWormHole = true;
37 text = itemNameValue;
39 {
40 Main.mouseLeftRelease = false;
41 Main.mapFullscreen = false;
43 Main.PylonSystem.RequestTeleportation(info, Main.LocalPlayer);
45 }
46 }
47 }
48 }
49}
static void PlaySound(int type, Vector2 position, int style=1)
static Asset< Texture2D >[] Extra
static void LockGamepadButtons(string TriggerName)
static string GetItemNameValue(int id)
Definition Lang.cs:185
static bool mouseLeftRelease
Definition Main.cs:1755
static TeleportPylonsSystem PylonSystem
Definition Main.cs:1872
static DroneCameraTracker DroneCameraTracker
Definition Main.cs:1878
static Player LocalPlayer
Definition Main.cs:2829
static bool mouseLeft
Definition Main.cs:614
void Draw(ref MapOverlayDrawContext context, ref string text)
static readonly Alignment Center
Definition Alignment.cs:15