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

◆ Draw()

void Terraria.Map.TeleportPylonsMapLayer.Draw ( ref MapOverlayDrawContext context,
ref string text )
inline

Implements Terraria.Map.IMapLayer.

Definition at line 15 of file TeleportPylonsMapLayer.cs.

16 {
17 List<TeleportPylonInfo> pylons = Main.PylonSystem.Pylons;
18 float num = 1f;
19 float scaleIfSelected = num * 2f;
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 {
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;
36 string itemNameValue = Lang.GetItemNameValue(TETeleportationPylon.GetPylonItemTypeFromTileStyle((int)info.TypeOfPylon));
38 if (Main.mouseLeft && Main.mouseLeftRelease)
39 {
40 Main.mouseLeftRelease = false;
41 Main.mapFullscreen = false;
43 Main.PylonSystem.RequestTeleportation(info, Main.LocalPlayer);
45 }
46 }
47 }
48 }
static void PlaySound(int type, Vector2 position, int style=1)
static Asset< Texture2D >[] Extra
static void LockGamepadButtons(string TriggerName)
static readonly Alignment Center
Definition Alignment.cs:15

References Terraria.UI.Alignment.Center, System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.Main.DroneCameraTracker, Terraria.GameContent.TextureAssets.Extra, Terraria.Lang.GetItemNameValue(), Terraria.GameContent.Tile_Entities.TETeleportationPylon.GetPylonItemTypeFromTileStyle(), Terraria.GameContent.TeleportPylonsSystem.IsPlayerNearAPylon(), Terraria.Main.LocalPlayer, Terraria.GameInput.PlayerInput.LockGamepadButtons(), Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.PylonSystem, and Microsoft.Xna.Framework.Color.White.