tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.Main Class Reference

Inherits Game.


class  CurrentFrameFlags
struct  CurrentPlayerOverride
struct  InfoToSetBackColor
struct  SceneArea
class  TextDisplayCache

Public Types

enum class  WorldPreparationState { AwaitingData , ProcessingData , Ready }

Public Member Functions

void autoCreate (string worldSize)
void AutoHost ()
void AutoJoin (string IP)
void AutoPass ()
void ClearCachedTileDraws ()
void DedServ ()
void DrawCapture (Microsoft.Xna.Framework.Rectangle area, CaptureSettings settings)
void DrawHealthBar (float X, float Y, int Health, int MaxHealth, float alpha, float scale=1f, bool noFlip=false)
void DrawInfernoRings ()
void DrawInterface_Resources_Buffs ()
void DrawItems ()
void DrawMouseOver ()
void DrawNPC (int iNPCIndex, bool behindTiles)
void DrawNPCCheckAlt (NPC n)
void DrawNPCDirect (SpriteBatch mySpriteBatch, NPC rCurrentNPC, bool behindTiles, Vector2 screenPos)
void DrawNPCDirect_QueenSlimeWings (NPC rCurrentNPC, SpriteBatch mySpriteBatch, Vector2 screenPos, Vector2 drawCenter, Microsoft.Xna.Framework.Color originColor)
void DrawProj (int i)
void DrawSimpleSurfaceBackground (Vector2 areaPosition, int areaWidth, int areaHeight)
void DrawTileCracks (int crackType, HitTile hitter)
void DrawWindowsIMEPanel (Vector2 position, float xAnchor=0f)
void EnableAutoShutdown ()
static IntPtr FindWindow (string lpClassName, string lpWindowName)
void FullscreenStartup ()
static short GetKeyState (int keyCode)
void GUIBarsDraw ()
void GUIChatDraw ()
void HandleIME ()
void LoadAccBack (int i)
void LoadAccBalloon (int i)
void LoadAccBeard (int i)
void LoadAccFace (int i)
void LoadAccFront (int i)
void LoadAccHandsOff (int i)
void LoadAccHandsOn (int i)
void LoadAccNeck (int i)
void LoadAccShield (int i)
void LoadAccShoes (int i)
void LoadAccWaist (int i)
void LoadArmorBody (int i)
void LoadArmorHead (int i)
void LoadArmorLegs (int i)
void LoadBackground (int i)
void LoadDedConfig (string configPath)
void LoadFlameRing ()
void LoadGore (int i)
void LoadHair (int i)
void LoadItem (int i)
void LoadItemFlames (int i)
void loadLib (string path)
static IntPtr LoadLibrary (string dllToLoad)
void LoadNPC (int i)
void LoadProjectile (int i)
void LoadTiles (int i)
void LoadWall (int i)
void LoadWings (int i)
void MouseText (string cursorText, int rare=0, byte diff=0, int hackedMouseX=-1, int hackedMouseY=-1, int hackedScreenWidth=-1, int hackedScreenHeight=-1, int pushWidthX=0)
void MouseText (string cursorText, string buffTooltip, int rare=0, byte diff=0, int hackedMouseX=-1, int hackedMouseY=-1, int hackedScreenWidth=-1, int hackedScreenHeight=-1, int pushWidthX=0, bool noOverride=false)
void MouseTextHackZoom (string text, int itemRarity, byte diff=0, string buffTooltip=null)
void MouseTextHackZoom (string text, string buffTooltip=null)
void MouseTextNoOverride (string cursorText, int rare=0, byte diff=0, int hackedMouseX=-1, int hackedMouseY=-1, int hackedScreenWidth=-1, int hackedScreenHeight=-1, int pushWidthX=0)
void NeverSleep ()
void NewMOTD (string newMOTD)
void oldDrawWater (bool bg=false, int Style=0, float Alpha=1f)
delegate void OnPlayerSelected (PlayerFileData player)
void OnTileChangeEvent (int x, int y, int count, TileChangeType eventType)
void PrepareDrawnEntityDrawing (Entity entity, int intendedShader)
void SetMouseNPC (int index, int type)
void SetMouseNPC_ToHousingQuery ()
void SetNetPlayers (int mPlayers)
void setServerWorldRollbacks (string rollBacksToKeep)
void SetWorld (string world, bool cloud)
void SetWorldName (string world)
bool ShouldUpdateEntities ()
void updateCloudLayer ()
void UpdateDisplaySettings ()
void UpdateParticleSystems ()
void UpdateViewZoomKeys ()
void UpdateWeather (GameTime gameTime)
void YouCanSleepNow ()

Static Public Member Functions

static void Ambience ()
static void AnglerQuestSwap ()
static void AnimateTiles_CritterCages ()
static Microsoft.Xna.Framework.Color buffColor (Microsoft.Xna.Framework.Color newColor, float R, float G, float B, float A)
static void BuyHairWindow ()
static double CalculateDamageNPCsTake (int Damage, int Defense)
static double CalculateDamagePlayersTake (int Damage, int Defense)
static double CalculateDamagePlayersTakeInPVP (int Damage, int Defense)
static int CalculateWaterStyle (bool ignoreFountains=false)
static void CancelClothesWindow (bool quiet=false)
static void CancelHairWindow ()
static bool CanPlayCreditsRoll ()
static bool CanStartInvasion (int type=1, bool ignoreDelay=false)
static void CheckForMoonEventsStartingTemporarySeasons ()
static void checkHalloween ()
static void CheckInvasionProgressDisplay ()
static void checkXMas ()
static void ClearPendingPlayerSelectCallbacks ()
static void ClearSmartInteract ()
static void CloseNPCChatOrSign ()
static void ClosePlayerChat ()
static void clrInput ()
static string ConvertFromSafeArgument (string arg)
static int ConvertPaintIdToTileShaderIndex (int paintIndexOnTile, bool isUsedForPaintingGrass, bool useWallShaderHacks)
static string ConvertToSafeArgument (string arg)
static void CraftItem (Recipe r)
static void CursorColor ()
static void CycleFrameSkipMode ()
static int DamageVar (float dmg, float luck=0f)
static void DoUpdate_AnimateItemIcons ()
static int DrawBuffIcon (int drawBuffText, int buffSlotOnPlayer, int x, int y)
 Draws the buff icon corresponding to the buff in Main.LocalPlayer.buffType[buffSlotOnPlayer ]. More...
static void DrawCursor (Vector2 bonus, bool smart=false)
static void DrawGamepadInstructions ()
static void DrawInterface_29_SettingsButton ()
static void DrawInterface_Resources_ClearBuffs ()
static void DrawInvasionProgress ()
static void DrawItemIcon (SpriteBatch spriteBatch, Item theItem, Vector2 screenPositionForItemCenter, Microsoft.Xna.Framework.Color itemLightColor, float sizeLimit)
static Vector2 DrawPlayerItemPos (float gravdir, int itemtype)
static void DrawSettingButton (ref bool mouseOver, ref float scale, int posX, int posY, string text, string textSizeMatcher, Action clickAction)
static Vector2 DrawThickCursor (bool smart=false)
static void DrawTileInWater (Vector2 drawOffset, int x, int y)
static void DrawWallOfFish ()
static void DrawWallOfStars ()
static Vector2 DrawWhip_BoneWhip (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_CoolWhip (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_FireWhip (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_RainbowWhip (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_ThornWhip (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_WhipBland (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_WhipMace (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_WhipScythe (Projectile proj, List< Vector2 > controlPoints)
static Vector2 DrawWhip_WhipSword (Projectile proj, List< Vector2 > controlPoints)
static void EntitySpriteDraw (DrawData data)
static void EntitySpriteDraw (Texture2D texture, Vector2 position, Microsoft.Xna.Framework.Rectangle? sourceRectangle, Microsoft.Xna.Framework.Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, int worthless)
static void EntitySpriteDraw (Texture2D texture, Vector2 position, Microsoft.Xna.Framework.Rectangle? sourceRectangle, Microsoft.Xna.Framework.Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, int worthless)
static void ExecuteCommand (string text, CommandCaller commandCaller)
static void FakeLoadInvasionStart ()
static void FindAnnouncementBoxStatus ()
static void FixUIScale ()
static void GetAreaToLight (out int firstTileX, out int lastTileX, out int firstTileY, out int lastTileY)
static BestiaryUnlockProgressReport GetBestiaryProgressReport ()
static string GetBuffTooltip (Player player, int buffType)
static string GetInputText (string oldString, bool allowMultiLine=false)
static MoonPhase GetMoonPhase ()
static Vector2 GetPlayerArmPosition (Projectile proj)
static Microsoft.Xna.Framework.Color GetPlayerHeadBordersColor (Player plr)
static string GetPlayerPathFromName (string playerName, bool cloudSave)
static int GetPreferredBGStyleForPlayer ()
static int GetProjectileDesiredShader (int i)
static Microsoft.Xna.Framework.Point GetScreenOverdrawOffset ()
static string GetWorldPathFromName (string worldName, bool cloudSave)
static void GoToWorldSelect ()
static Microsoft.Xna.Framework.Color hslToRgb (float Hue, float Saturation, float Luminosity, byte a=byte.MaxValue)
static Microsoft.Xna.Framework.Color hslToRgb (Vector3 hslVector)
static double hue2rgb (double c, double t1, double t2)
static void InfoDisplayPageHandler (int startX, ref string mouseText, out int startingDisplay, out int endingDisplay)
static void InitializeItemAnimations ()
static void InputTextChest ()
static void InputTextSign ()
static void InputTextSignCancel ()
static bool InSmartCursorHighlightArea (int x, int y, out bool actuallySelected)
static bool IsLiquidStyleWater (int liquidStyle)
static bool IsNPCActiveAndOneOfTypes (int npcIndex, params int[] types)
static bool IsTileSpelunkable (int tileX, int tileY)
 Checks if a tile at the given coordinates counts towards tile coloring from the Spelunker buff, and is detected by various pets. More...
static void ItemIconCacheUpdate (int selectedItemID)
static void ItemIconCacheVerification ()
static void LoadPlayers ()
static void LoadTestLog (string logname)
static void LoadWorlds ()
static void LockCraftingForThisCraftClickDuration ()
static void MouseText_DrawItemTooltip_GetLinesInfo (Item item, ref int yoyoLogo, ref int researchLine, float oldKB, ref int numLines, string[] toolTipLine, bool[] preFixLine, bool[] badPreFixLine, string[] toolTipNames)
static void NewLightning ()
static void NewText (object o, Color? color=null)
static void NewText (string newText, byte R=byte.MaxValue, byte G=byte.MaxValue, byte B=byte.MaxValue)
static void NewTextMultiline (string text, bool force=false, Microsoft.Xna.Framework.Color c=default(Microsoft.Xna.Framework.Color), int WidthLimit=-1)
static void NotifyOfEvent (GameNotificationType type)
static float NPCAddHeight (NPC theNPC)
static void OnSubmitServerIP (string inputText)
static void OpenCharacterSelectUI ()
static void OpenClothesWindow ()
static void OpenHairWindow ()
static void OpenPlayerChat ()
static void OpenPlayerSelect (OnPlayerSelected method)
static void OpenReportsMenu ()
static void OpenResourcePacksMenu (UIState uiStateToGoBackTo)
static void OpenWorldSelectUI ()
static void PlayInteractiveProjectileOpenCloseSound (int projType, bool open)
static void PrintTimedMessage (string message, params object[] arguments)
static void QueueMainThreadAction (Action action)
static Microsoft.Xna.Framework.Color quickAlpha (Microsoft.Xna.Framework.Color oldColor, float Alpha)
static void RegisterItemAnimation (int index, DrawAnimation animation)
 Registers an animation for an item type to draw inside UI (not world or held item on player). To enable its animation in the world, use ItemID.Sets.AnimatesAsSoul in conjunction with this More...
static void ReleaseHostAndPlayProcess ()
static void ReportInvasionProgress (int progress, int progressMax, int icon, int progressWave)
static void ResetKeyBindings ()
static void ResetWindCounter (bool resetExtreme=false)
static Microsoft.Xna.Framework.Point ReverseGravitySupport (Microsoft.Xna.Framework.Point pos, int height=0)
static Microsoft.Xna.Framework.Rectangle ReverseGravitySupport (Microsoft.Xna.Framework.Rectangle box)
static Vector2 ReverseGravitySupport (Vector2 pos, float height=0f)
static Vector3 rgbToHsl (Microsoft.Xna.Framework.Color newColor)
static void SaveClothesWindow ()
static void SaveRecent ()
static bool SaveSettings ()
static void SelectPlayer (PlayerFileData data)
static void SetCameraGamepadLerp (float lerp)
static void SetCameraLerp (float lerp, int time)
static void SetDisplayMode (int width, int height, bool fullscreen)
static void SetFullScreen (bool fullscreen)
static void SetNPCShopIndex (int index)
static void SetRecommendedZoomContext (Matrix matrix)
static void SetResolution (int width, int height)
static void SetupTileMerge ()
static Microsoft.Xna.Framework.Color shine (Microsoft.Xna.Framework.Color newColor, int type)
static void shine (ref Vector3 newColor, int type)
static bool ShouldNormalEventsBeAbleToStart ()
static void SkipToTime (int timeToSet, bool setIsDayTime)
static void snowing ()
static void StartClientGameplay ()
static void startDedInput ()
static void startDedInputCallBack ()
static void StartInvasion (int type=1)
static void startPumpkinMoon ()
static void StartRain ()
 Starts rain for a random amount of time. Should be called on the server (netMode != client) - vanilla syncs it using SyncRain.
You can also call this on the client to update visuals immediately, assuming it was/will be called serverside aswell (Journey Mode rain slider does this). More...
static void StartSlimeRain (bool announce=true)
static void startSnowMoon ()
static void stopMoonEvent ()
static void StopRain ()
 Stops rain. Should be called on the server (netMode != client) - vanilla syncs it using SyncRain.
You can also call this on the client to update visuals immediately, assuming it was called serverside aswell (Journey Mode rain slider does this). More...
static void StopSlimeRain (bool announce=true)
static void SubmitSignText ()
static void Sundialing ()
static void SwitchNetMode (int mode)
static void SyncAnInvasion (int toWho)
static void SyncRain ()
 Syncs rain state if StartRain or StopRain were called in the same tick and caused a change to

See also

Can be called on any side, but only the server will actually sync it. More...

static void TeleportEffect (Microsoft.Xna.Framework.Rectangle effectRect, int Style, int extraInfo=0, float dustCountMult=1f, TeleportationSide side=TeleportationSide.Entry, Vector2 otherPosition=default(Vector2))
static void ToggleFullScreen ()
static void ToggleGameplayUpdates (bool state)
static void TriggerPing (Vector2 position)
static bool TryGetBuffTime (int buffSlotOnPlayer, out int buffTimeValue)
 Checks if the buff at index buffSlotOnPlayer is allowed to draw a "remaining time" text, and sets buffTimeValue to it. More...
static void TryRemovingBuff (int i, int b)
 Calls Player.DelBuff with index i after checking Main.debuff of buff type b. Will toggle Player.hideMisc for pet and light pet. More...
static void TryRemovingBuff_CheckBuffHideMisc (int slot, int buffID)
static void TrySetPreparationState (WorldPreparationState state)
static int UnlockedMaxHair ()
static void UpdateTime_StartDay (ref bool stopEvents)
static void UpdateTime_StartNight (ref bool stopEvents)
static void UpdateTimeRate ()
static void UpdateWorldPreparationState ()
static string ValueToCoins (int value)
static void WeGameRequireExitGame ()

Public Attributes

RenderTarget2D backgroundTarget
RenderTarget2D backWaterTarget
RenderTarget2D blackTarget
CameraModifierStack CameraModifiers = new CameraModifierStack()
bool chestCancelHover
float chestCancelScale = 1f
bool chestDepositHover
float chestDepositScale = 1f
bool chestLootHover
float chestLootScale = 1f
bool chestRenameHover
float chestRenameScale = 1f
bool chestStackHover
float chestStackScale = 1f
ChumBucketProjectileHelper ChumBucketProjectileHelper = new ChumBucketProjectileHelper()
int currentNPCShowingChatBubble = -1
int DiscoStyle
List< int > DrawCacheFirstFractals = new List<int>(1000)
List< int > DrawCacheNPCProjectiles = new List<int>(200)
List< int > DrawCacheNPCsBehindNonSolidTiles = new List<int>(200)
List< int > DrawCacheNPCsMoonMoon = new List<int>(200)
List< int > DrawCacheNPCsOverPlayers = new List<int>(200)
List< int > DrawCacheProjsBehindNPCs = new List<int>(1000)
List< int > DrawCacheProjsBehindNPCsAndTiles = new List<int>(1000)
List< int > DrawCacheProjsBehindProjectiles = new List<int>(1000)
List< int > DrawCacheProjsOverPlayers = new List<int>(1000)
List< int > DrawCacheProjsOverWiresUI = new List<int>(1000)
bool gammaTest
int invBottom = 210
RenderTarget2D mapSectionTexture
RenderTarget2D[,] mapTarget = new RenderTarget2D[mapTargetX, mapTargetY]
int mouseNPCIndex = -1
int mouseNPCType = -1
bool playOldTile
RejectionMenuInfo RejectionMenuInfo
Chest[] shop = new Chest[100]
SpelunkerProjectileHelper SpelunkerProjectileHelper = new SpelunkerProjectileHelper()
int textBlinkerCount
int textBlinkerState
RenderTarget2D tile2Target
TilePaintSystemV2 TilePaintSystem
TileDrawing TilesRenderer
RenderTarget2D tileTarget
bool unityMouseOver
WallDrawing WallsRenderer
RenderTarget2D wallTarget
WaterfallManager waterfallManager

Static Public Attributes

static GameTime _drawInterfaceGameTime
static UnifiedRandom _rand
static bool _shouldUseStormMusic = false
static bool _shouldUseWindyDayMusic = false
static float aBar = 1f
static UIAchievementsMenu AchievementsMenu = new UIAchievementsMenu()
static IMultiplayerClosePlayersOverlay ActiveClosePlayersTeamOverlay = new NewMultiplayerClosePlayersOverlay()
static PlayerFileData ActivePlayerFileData = new PlayerFileData()
static WorldFileData ActiveWorldFileData = new WorldFileData()
static bool allChestStackHover
static bool AllowUnfocusedInputOnGamepad
static bool alreadyGrabbingSunOrMoon
static AmbienceServer AmbienceServer
static int ambientCounter
static int ambientError
static float ambientLavafallStrength = 0f
static float ambientLavafallX = -1f
static float ambientLavafallY = -1f
static float ambientLavaStrength
static float ambientLavaX = -1f
static float ambientLavaY = -1f
static float ambientVolume = 1f
static float ambientWaterfallStrength = 0f
static float ambientWaterfallX = -1f
static float ambientWaterfallY = -1f
static int anglerQuest
static bool anglerQuestFinished
static int[] anglerQuestItemNetIDs
static List< string > anglerWhoFinishedToday = new List<string>()
static bool AnnouncementBoxDisabled
static int AnnouncementBoxRange = -1
static float armorAlpha = 1f
static bool armorHide
const string assemblyVersionNumber = ""
static IAssetRepository Assets
static AssetSourceController AssetSourceController
static float atmo
static IAudioSystem audioSystem
static bool autoGen
static string autoGenFileLocation = null
static GenerationProgress AutogenProgress = new GenerationProgress()
static string AutogenSeedName
static bool autoJoin
static bool autoPass
static bool autoPause = false
static bool autoSave = true
static bool autoShutdown
static int[] availableRecipe = new int[Recipe.maxRecipes]
static float[] availableRecipeY = new float[Recipe.maxRecipes]
static int background
static bool BackgroundEnabled = true
static int[] backgroundHeight = new int[298]
static SpriteViewMatrix BackgroundViewMatrix
static int[] backgroundWidth = new int[298]
static bool bannerMouseOver
static int BartenderHelpTextIndex = 0
static BestiaryDatabase BestiaryDB
static BestiaryUnlocksTracker BestiaryTracker
static UIBestiaryTest BestiaryUI
static bool betterDebugRelease
static float[] bgAlphaFarBackLayer = new float[14]
static float[] bgAlphaFrontLayer = new float[14]
static int bgDelay
static int[] bgFrame = new int[14]
static int[] bgFrameCounter = new int[14]
static int bgScroll
static int bgStyle
static BigProgressBarSystem BigBossProgressBar = new BigProgressBarSystem()
static int[] birdCageFrame = new int[cageFrames]
static int[] birdCageFrameCounter = new int[cageFrames]
static int BlackFadeIn
static bool blockInput = false
static string blockKey = Microsoft.Xna.Framework.Input.Keys.None.ToString()
static bool blockMouse
static bool bloodMoon
static int[] blueBirdCageFrame = new int[cageFrames]
static int[] blueBirdCageFrameCounter = new int[cageFrames]
static NPCHeadRenderer BossNPCHeadRenderer = null
static float bottomWorld = 38400f
static float[] buffAlpha = new float[338]
static bool[] buffDoubleApply = new bool[338]
static bool[] buffNoSave = new bool[338]
static bool[] buffNoTimeDisplay = new bool[338]
static int buffScanAreaHeight = (maxScreenH + 800) / 16 - 1
static int buffScanAreaWidth = (maxScreenW + 800) / 16 - 1
static string buffString = ""
static int[] bunnyCageFrame = new int[cageFrames]
static int[] bunnyCageFrameCounter = new int[cageFrames]
static int[,] butterflyCageFrame = new int[9, cageFrames]
static int[,] butterflyCageFrameCounter = new int[9, cageFrames]
static byte[,] butterflyCageMode = new byte[9, cageFrames]
static int cageFrames = 25
static Camera Camera = new Camera()
static float cameraX
static bool cancelWormHole = false
static bool CaptureModeDisabled = false
static int caveBackground = 0
static int[] caveBackStyle = new int[4]
static int[] caveBackX = new int[4]
static float caveParallax = 0.88f
static string cBuff = "B"
static string cDown = "S"
static string cFavoriteKey = "LeftAlt"
static bool changeTheTitle
static IChatMonitor chatMonitor = new RemadeChatMonitor()
static bool chatRelease
static string chatText = ""
static string cHeal = "H"
static int checkForSpawns
static Chest[] chest = new Chest[8000]
static string cHook = "E"
static ChromaEngine Chroma
static ChromaHotkeyPainter ChromaPainter
static string cInv = "Escape"
static string cJump = "Space"
static bool clearMap
static string cLeft = "A"
static Player clientPlayer = new Player()
static string clientUUID
static bool clothesWindow
static Cloud[] cloud = new Cloud[200]
static float cloudAlpha
static int[] cloudBG
static float cloudBGActive
static float cloudBGAlpha
static float[] cloudBGX = new float[2]
static FavoritesFile CloudFavoritesData = new FavoritesFile("ModLoader/favorites.json", true)
static string CloudPlayerPath = "ModLoader/players"
static string CloudWorldPath = "ModLoader/worlds"
static string cMana = "J"
static string cMapAlphaDown = "PageDown"
static string cMapAlphaUp = "PageUp"
static string cMapFull = "M"
static string cMapStyle = "Tab"
static string cMapZoomIn = "Add"
static string cMapZoomOut = "Subtract"
static string cMount = "R"
static int colorDelay
static Microsoft.Xna.Framework.Color ColorOfTheSkies
static CombatText[] combatText = new CombatText[100]
static Preferences Configuration = new Preferences(SavePath + Path.DirectorySeparatorChar + "config.json")
static bool ContentLoaded = false
static List< INeedRenderTargetContentContentThatNeedsRenderTargets = new List<INeedRenderTargetContent>()
const string copyrightText = "Copyright © 2022 Re-Logic"
static int[] corruptBG = new int[3]
static bool[] countsAsHostForGameplay = new bool[256]
static float craftingAlpha = 1f
static bool craftingHide
static CreativeUI CreativeMenu = new CreativeUI()
static Microsoft.Xna.Framework.Color creativeModeColor = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.HotPink, Microsoft.Xna.Framework.Color.White, 0.1f)
static string cRight = "D"
static int[] crimsonBG = new int[3]
static bool critterCage
static bool CrouchingEnabled = false
static string cSmart = "LeftControl"
static bool cSmartCursorModeIsToggleAndNotHold = true
static string cThrowItem = "T"
static string cTorch = "LeftShift"
static string cUp = "W"
static int curMusic
const int curRelease = 248
static Entity CurrentDrawnEntity
static int CurrentDrawnEntityShader
static object CurrentInputTextTakerOverride
static Vector2 CurrentPan = Vector2.Zero
static float cursorAlpha
static Microsoft.Xna.Framework.Color cursorColor = Microsoft.Xna.Framework.Color.White
static int cursorColorDirection = 1
static int cursorOverride = -1
static float cursorScale
const double dayLength = 54000.0
static int dayMusic
static double dayRate = 1
static bool dayTime = true
static bool[] debuff = new bool[338]
static BasicDebugDrawer DebugDrawer
static string debugWords = ""
static bool dedServ
static int dedServCount1
static int dedServCount2
static bool dedServFPS
static string defaultChestName = string.Empty
static string defaultIP = ""
static string DefaultSeed = ""
static List< IEnumerator > DelayedProcesses = new List<IEnumerator>()
static float demonTorch = 1f
static int demonTorchDir = 1
static int[] desertBG = new int[3]
static double desiredWorldEventsUpdateRate
static double desiredWorldTilesUpdateRate = 1
static Vector2 destroyerHB = new Vector2(0f, 0f)
static bool DisableIntenseVisualEffects = false
static int DiscoB
static int DiscoG
static int DiscoR = 255
static int[] displayHeight = new int[99]
static int[] displayWidth = new int[99]
static bool dontStarveWorld = false
static int[,] dragonflyJarFrame = new int[7, cageFrames]
static int[,] dragonflyJarFrameCounter = new int[7, cageFrames]
static bool drawBackGore
static bool drawBetterDebug
static bool drawDiag
static bool drawingPlayerChat
static bool drawRelease
static int drawsCountedForFPS
static bool drawSkip
static bool drawToScreen
static Player dresserInterfaceDummy
static bool drewLava
static bool drunkWorld = false
static int[] duckCageFrame = new int[cageFrames]
static int[] duckCageFrameCounter = new int[cageFrames]
static int dungeonX
static int dungeonY
static Dust[] dust = new Dust[6001]
static bool eclipse
static float eclipseLight
static bool editChest
static bool editSign
static int EquipPage
static int EquipPageSelected
static Microsoft.Xna.Framework.Color errorColor = new Microsoft.Xna.Framework.Color(255, 0, 0)
static int essDir = -1
static float essScale = 1f
static float exitScale = 0.8f
static int extremeWindCounter
static int fadeCounter
static int[] fairyJarFrame = new int[cageFrames]
static int[] fairyJarFrameCounter = new int[cageFrames]
static bool fastForwardTime
static Microsoft.Xna.Framework.Input.Keys FavoriteKey = Microsoft.Xna.Framework.Input.Keys.LeftAlt
static int[] fishBowlFrame = new int[cageFrames]
static int[] fishBowlFrameCounter = new int[cageFrames]
static byte[] fishBowlFrameMode = new byte[cageFrames]
static int focusColor
static int focusRecipe
static float ForcedMinimumZoom = 1f
static bool forceHalloweenForToday
static bool forceXMasForToday
static int fpsCount
static Stopwatch fpsTimer = new Stopwatch()
static int frameRate
static bool frameRelease
static FrameSkipMode FrameSkipMode = FrameSkipMode.Subtle
static int[] frogCageFrame = new int[cageFrames]
static int[] frogCageFrameCounter = new int[cageFrames]
static bool gameInactive
static bool gameMenu = true
static bool gamePad = false
static float GamepadCursorAlpha = 0f
static bool GamepadDisableCursorItemIconInner = true
static bool GamepadDisableInstructionsDisplay
static bool gamePaused
static GameTime gameTimeCache = new GameTime()
static GameTipsDisplay gameTips
static SpriteViewMatrix GameViewMatrix
static float GameZoomTarget = 1f
static bool getGoodWorld = false
static string getIP = defaultIP
static string getPort = Convert.ToString(Netplay.ListenPort)
static byte gFade
static byte gFadeDir = 1
static float gFader
static float gfxQuality = 1f
static float gfxRate = 0.01f
static bool GlobalTimerPaused = false
static float GlobalTimeWrappedHourly
static Gore[] gore = new Gore[601]
static float grabMapX
static float grabMapY
static GraphicsDeviceManager graphics
static int[] grasshopperCageFrame = new int[cageFrames]
static int[] grasshopperCageFrameCounter = new int[cageFrames]
static float GraveyardVisualIntensity
static int[] grebeCageFrame = new int[cageFrames]
static int[] grebeCageFrameCounter = new int[cageFrames]
static Item guideItem = new Item()
static int hairStart
static HairstyleUnlocksHelper Hairstyles = new HairstyleUnlocksHelper()
static bool hairWindow
static int[] hallowBG = new int[3]
static bool halloween
static bool hardMode
static bool hasFocus
static bool HasInteractibleObjectThatIsNotATile = false
static float hBar = -1f
static Microsoft.Xna.Framework.Color hcColor = new Microsoft.Xna.Framework.Color(1f, 0.15f, 0.1f)
static byte HealthBarDrawSettings = 1
static int hellBackStyle
static int helpText
static bool HidePassword
static bool hidePlayerCraftingMenu
static bool hideUI
static Microsoft.Xna.Framework.Color highVersionColor = new Microsoft.Xna.Framework.Color(255, 255, 0)
static float[] hotbarScale
static bool HoveringOverAnNPC
static Item HoverItem = new Item()
static string hoverItemName = ""
static int iceBackStyle
static bool ignoreErrors = true
static bool inFancyUI = false
static bool ingameOptionsWindow = false
static UserInterface InGameUI = new UserInterface()
static bool InGuideCraftMenu
static float InitialMapScale = 1f
static bool[,] initMap = new bool[mapTargetX, mapTargetY]
static Preferences InputProfiles = new Preferences(SavePath + Path.DirectorySeparatorChar + "input profiles.json")
static KeyboardState inputText
static bool inputTextEnter
static bool inputTextEscape
static bool InReforgeMenu
static Main instance
static int instantBGTransitionCounter = 2
static int interactedDresserTopLeftX
static int interactedDresserTopLeftY
static float invAlpha = 1f
static int invasionDelay
static int invasionProgress
static float invasionProgressAlpha
static int invasionProgressDisplayLeft
static int invasionProgressIcon
static int invasionProgressMax
static int invasionProgressMode = 2
static bool invasionProgressNearInvasion
static int invasionProgressWave
static int invasionSize
static int invasionSizeStart
static int invasionType
static int invasionWarn
static double invasionX
static float invDir = 1f
const int InventoryAmmoSlotsCount = 4
const int InventoryAmmoSlotsStart = 54
static Microsoft.Xna.Framework.Color inventoryBack = new Microsoft.Xna.Framework.Color(220, 220, 220, 220)
const int InventoryCoinSlotsCount = 4
const int InventoryCoinSlotsStart = 50
const int InventoryItemSlotsCount = 50
const int InventoryItemSlotsStart = 0
static float inventoryScale = 0.75f
const int InventorySlotsTotal = 58
static bool inventorySortMouseOver
static bool InvisibleCursorForGamepad = true
static float iS = 1f
static bool IsInTheMiddleOfLoadingSettings
static bool isMouseLeftConsumedByUI = false
static GeneralIssueReporter IssueReporter
static IssueReportsIndicator IssueReporterIndicator = new IssueReportsIndicator()
static Item[] item = new Item[401]
static DrawAnimation[] itemAnimations = new DrawAnimation[5125]
static List< int > itemAnimationsRegistered = new List<int>()
static ItemDropDatabase ItemDropsDB
static ItemDropResolver ItemDropSolver
static int[] itemFrame = new int[401]
static int[] itemFrameCounter = new int[401]
static int[,] jellyfishCageFrame = new int[3, cageFrames]
static int[,] jellyfishCageFrameCounter = new int[3, cageFrames]
static byte[,] jellyfishCageMode = new byte[3, cageFrames]
static int jungleBackStyle
static int[] jungleBG = new int[3]
static int keyCount
static int[] keyInt = new int[10]
static KeyboardState keyState
static string[] keyString = new string[10]
static int[] ladybugCageFrame = new int[cageFrames]
static int[] ladybugCageFrameCounter = new int[cageFrames]
static double ladyBugRainBoost = 0
static int lastItemUpdate
static Microsoft.Xna.Framework.Point LastLoadedResolution
static int lastMouseX
static int lastMouseY
static int lastNPCUpdate
static int[] lavaFishBowlFrame = new int[cageFrames]
static int[] lavaFishBowlFrameCounter = new int[cageFrames]
static float lBar = 1f
static float leftWorld = 0f
static string libPath = ""
static bool LightingEveryFrame = true
static float lightning
static bool[] lightPet = new bool[338]
static Liquid[] liquid = new Liquid[Liquid.maxLiquid]
static float[] liquidAlpha = new float[13]
static LiquidBuffer[] liquidBuffer = new LiquidBuffer[50000]
static int lo
static bool loadMap
static int loadMapLastX
static bool loadMapLock
static ulong LobbyId = 0uL
static FavoritesFile LocalFavoriteData = new FavoritesFile(SavePath + "/favorites.json", isCloud: false)
static GolfState LocalGolfState = new GolfState()
static bool lockMenuBGChange = false
static int LogicCheckScreenHeight = 1200
static int LogicCheckScreenWidth = 1920
static int LogoA = 255
static int LogoB
static bool LogoT
static int[] maggotCageFrame = new int[cageFrames]
static int[] maggotCageFrameCounter = new int[cageFrames]
static int magmaBGFrame
static int magmaBGFrameCounter
static int[] mallardCageFrame = new int[cageFrames]
static int[] mallardCageFrameCounter = new int[cageFrames]
static UIManageControls ManageControlsMenu = new UIManageControls()
static WorldMap Map = new WorldMap(maxTilesX, maxTilesY)
static int mapDelay = 2
static bool mapEnabled = true
static FileMetadata MapFileMetadata
static bool mapFullscreen
static Vector2 mapFullscreenPos = new Vector2(-1f, -1f)
static float mapFullscreenScale = 4f
static MapIconOverlay MapIcons = new MapIconOverlay().AddLayer(new SpawnMapLayer()).AddLayer(new TeleportPylonsMapLayer()).AddLayer(Pings)
static bool mapInit
static int mapMaxX = 0
static int mapMaxY
static float mapMinimapAlpha = 1f
static float mapMinimapDefaultScale = 1.05f
static float mapMinimapScale = mapMinimapDefaultScale
static int mapMinX = 0
static int mapMinY
static float mapOverlayAlpha = 0.35f
static float mapOverlayScale = 2.5f
static MapHeadRenderer MapPlayerRenderer = new MapHeadRenderer()
static bool mapReady
static float MapScale = 1f
static int mapStyle = 1
static int mapTargetX = 5
static int mapTargetY = 2
static int mapTime = mapTimeMax
static int mapTimeMax = 30
static bool[,] mapWasContentLost = new bool[mapTargetX, mapTargetY]
static float martianLight = 1f
static int martianLightDir = 1
static float masterColor = 1f
static int masterColorDir = 1
const int maxBackgrounds = 298
const int MaxBannerTypes = 289
const int maxBuffTypes = 338
const int maxCharSelectHair = 51
const int maxChests = 8000
const int maxClouds = 200
const int maxCloudTypes = 41
const int maxCombatText = 100
const int maxDust = 6000
static int maxDustToDraw = 6000
const int maxExtras = 246
const int maxGlowMasks = 311
const int maxGore = 600
const int maxGoreTypes = 1275
const int maxHairOfStylistDefault = 123
const int maxHairStyles = 165
const int maxItems = 400
const int maxItemText = 20
const int maxItemTypes = 5125
static int maxItemUpdates = 5
const int maxLiquidTypes = 13
static int maxMapUpdates = 250000
const int maxMoons = 9
static int maxMP = 10
const int maxMusic = 91
static int maxNetPlayers = 255
const int maxNPCs = 200
const int maxNPCTypes = 670
static int maxNPCUpdates = 5
const int maxPlayers = 255
const int maxProjectiles = 1000
const int maxProjectileTypes = 972
static bool maxQ = true
static int maxRain = 750
static float maxRaining
static int maxScreenH = 1200
static int maxScreenW = 1920
static int maxSectionsX = maxTilesX / 200
static int maxSectionsY = maxTilesY / 150
const int MaxShopIDs = 100
const int maxStars = 400
const int maxStarTypes = 4
const int maxTileSets = 625
static int maxTilesX = (int)rightWorld / 16 + 1
static int maxTilesY = (int)bottomWorld / 16 + 1
const int MaxTimeout = 120
const int maxWallTypes = 316
const int maxWings = 47
static Microsoft.Xna.Framework.Color mcColor = new Microsoft.Xna.Framework.Color(1f, 0.6f, 0f)
static bool[] meleeBuff = new bool[338]
static bool menuBGChangedDay = false
static bool menuBGChangedNight = false
static int menuFocus = 0
static int menuMode = Interface.loadModsID
static bool menuMultiplayer
static bool menuServer
static ServerMode MenuServerMode = ServerMode.Lobby | ServerMode.FriendsCanJoin
static int menuSkip
static UserInterface MenuUI = new UserInterface()
static float MenuXMovement = 0f
static MinimapFrameManager MinimapFrameManagerInstance
static int miniMapHeight
static int miniMapWidth
static int miniMapX
static int miniMapY
static float MinimumZoomComparerX = 1920f
static float MinimumZoomComparerY = 1200f
static int minScreenH = 720
static int minScreenW = 800
static short moonModY
static int moonPhase
static int moonType = 0
static string motd = ""
static Microsoft.Xna.Framework.Color MouseBorderColor = new Microsoft.Xna.Framework.Color(64, 64, 64, 64)
static ColorSlidersSet mouseBorderColorSlider = new ColorSlidersSet()
static float MouseBuildingGridAlpha
static int[] mouseCageFrame = new int[cageFrames]
static int[] mouseCageFrameCounter = new int[cageFrames]
static Microsoft.Xna.Framework.Color mouseColor = new Microsoft.Xna.Framework.Color(255, 50, 95)
static ColorSlidersSet mouseColorSlider = new ColorSlidersSet()
static bool mouseExit
static Item mouseItem = new Item()
static bool mouseLeft
static bool mouseLeftRelease
static bool mouseMiddle
static bool mouseMiddleRelease
static bool mouseReforge
static bool mouseRight
static bool mouseRightRelease
static bool MouseShowBuildingGrid
static bool mouseText
static byte mouseTextColor
static int mouseTextColorChange = 1
static int mouseX
static bool mouseXButton1
static bool mouseXButton1Release
static bool mouseXButton2
static bool mouseXButton2Release
static int mouseY
static int multiplayerNPCSmoothingRange = 300
static int[] mushroomBG = new int[3]
static int musicBox2 = -1
static int musicBoxNotModifiedByVolume = -1
static int musicError
static float[] musicFade = new float[91]
static bool[] musicNoCrossFade = new bool[91]
static float musicPitch = 0f
static float musicVolume = 1f
static int myPlayer
static int netMode
static int netPlayCounter
static bool netRelease
static int newMusic
static string newWorldName = ""
const double nightLength = 32400.0
static bool notTheBeesWorld = false
static bool noWindowBorder = false
static NPC[] npc = new NPC[201]
static bool[] npcCatchable = new bool[670]
static int npcChatCornerItem
static bool npcChatFocus1
static bool npcChatFocus2
static bool npcChatFocus3
static bool npcChatFocus4
static bool npcChatRelease
static string npcChatText = ""
static int[] npcFrameCount
static Dictionary< int, byte > npcLifeBytes = new Dictionary<int, byte>()
static int npcStreamSpeed = 30
const int numAccBack = 35
const int numAccBalloon = 19
const int numAccBeard = 5
const int numAccFace = 20
const int numAccFront = 12
const int numAccHandsOff = 15
const int numAccHandsOn = 23
const int numAccNeck = 12
const int numAccShield = 10
const int numAccShoes = 27
const int numAccWaist = 17
const int numArmorBody = 246
const int numArmorHead = 277
const int numArmorLegs = 234
static int numAvailableRecipes
const int numberOfHairstyles = 165
static int numClouds = 200
static int numCloudsTemp = numClouds
static int numDisplayModes
const int numInfoIcons = 13
static int numStars
const int numTileColors = 32
const int numTreeStyles = 31
static int oceanBG
const int offLimitBorderTiles = 40
static int offScreenRange = 200
static Vector2[] OffsetsNPCOffhand
static Vector2[] OffsetsPlayerHeadgear
static Vector2[] OffsetsPlayerOffhand
static Vector2[] OffsetsPlayerOnhand
static KeyboardState oldInputText
static KeyboardState oldKeyState
static float oldMaxRaining
static int oldNPCShop
static string oldStatusText = ""
static int oldUndergroundBackground
static Microsoft.Xna.Framework.Color OurFavoriteColor = new Microsoft.Xna.Framework.Color(255, 231, 69)
static int[] owlCageFrame = new int[cageFrames]
static int[] owlCageFrameCounter = new int[cageFrames]
static ParticleRenderer ParticleSystem_World_BehindPlayers = new ParticleRenderer()
static ParticleRenderer ParticleSystem_World_OverPlayers = new ParticleRenderer()
static bool PendingBorderlessState
static Player PendingPlayer = null
static int PendingResolutionHeight = 600
static int PendingResolutionWidth = 800
static int[] penguinCageFrame = new int[cageFrames]
static int[] penguinCageFrameCounter = new int[cageFrames]
static bool[] persistentBuff = new bool[338]
static PingMapLayer Pings = new PingMapLayer()
static Ref< Effect > PixelShaderRef = new Ref<Effect>()
static bool placementPreview = true
static Player[] player = new Player[256]
static bool playerInventory
static List< PlayerFileDataPlayerList = new List<PlayerFileData>()
static int PlayerOverheadChatMessageDisplayTime = 400
static string PlayerPath = Path.Combine(SavePath, "Players")
static IPlayerRenderer PlayerRenderer = new LegacyPlayerRenderer()
static Player[] playerVisualClone = new Player[256]
static PopupText[] popupText = new PopupText[20]
static IPlayerRenderer PotionOfReturnRenderer = new ReturnGatePlayerRenderer()
static bool preventStackSplitReset
static bool PreventUpdatingTargets = true
static Projectile[] projectile = new Projectile[1001]
static int[,] projectileIdentity = new int[256, 1001]
static int ProjectileUpdateLoopIndex = -1
static int[] projFrames = new int[972]
static bool[] projHook = new bool[972]
static bool[] projHostile = new bool[972]
static bool[] projPet = new bool[972]
static bool pumpkinMoon
static bool[] pvpBuff = new bool[338]
static TeleportPylonsSystem PylonSystem
static int qaStyle
static bool qRelease = false
static Rain[] rain = new Rain[maxRain + 1]
static bool raining
static double rainTime
static int rare
static RasterizerState Rasterizer = RasterizerState.CullCounterClockwise
static int[] ratCageFrame = new int[cageFrames]
static int[] ratCageFrameCounter = new int[cageFrames]
static bool recBigList
static string[] recentIP = new string[maxMP]
static int[] recentPort = new int[maxMP]
static string[] recentWorld = new string[maxMP]
static bool recFastScroll
static Recipe[] recipe = new Recipe[Recipe.maxRecipes]
static int recStart
static int[] redBirdCageFrame = new int[cageFrames]
static int[] redBirdCageFrameCounter = new int[cageFrames]
static Item reforgeItem = new Item()
static float reforgeScale = 0.8f
static bool refreshMap
static Dictionary< int, GameModeDataRegisteredGameModes
static bool releaseUI
static bool render
static int renderCount = 99
static bool renderNow
static bool resetClouds = true
static bool resetMapFull
static PlayerResourceSetsManager ResourceSetsManager
static bool ReversedUpDownArmorSetBonuses
static bool RGBRelease
static float rightWorld = 134400f
static double rockLayer
static Microsoft.Xna.Framework.Point rulerLineDisplayValues = default(Microsoft.Xna.Framework.Point)
static bool runningCollectorsEdition
static SamplerState SamplerStateForCursor = SamplerState.LinearClamp
static string SavePath = Program.SavePath
static int saveTimer = 0
static float sBar = -1f
static Vector2 sceneBackgroundPos = Vector2.Zero
static SceneMetrics SceneMetrics
static Vector2 sceneTile2Pos = Vector2.Zero
static Vector2 sceneTilePos = Vector2.Zero
static Vector2 sceneWallPos = Vector2.Zero
static Vector2 sceneWaterPos = Vector2.Zero
static int[,] scorpionCageFrame = new int[2, cageFrames]
static int[,] scorpionCageFrameCounter = new int[2, cageFrames]
static bool screenBorderless = true
static int screenBorderlessPendingResizes
static int screenHeight = 864
static Vector2 screenLastPosition
static bool screenMaximized = true
static Vector2 screenPosition
static Ref< Effect > ScreenShaderRef = new Ref<Effect>()
static RenderTarget2D screenTarget
static RenderTarget2D screenTargetSwap
static int screenWidth = 1152
static int[] seagullCageFrame = new int[cageFrames]
static int[] seagullCageFrameCounter = new int[cageFrames]
static int[] seahorseCageFrame = new int[cageFrames]
static int[] seahorseCageFrameCounter = new int[cageFrames]
const int sectionHeight = 150
static WorldSections sectionManager
const int sectionWidth = 200
static int selClothes
static Microsoft.Xna.Framework.Color selColor = Microsoft.Xna.Framework.Color.White
static int selectedPlayer = 0
static int selectedWorld
static bool ServerSideCharacter
static bool serverStarting = false
static int setKey = -1
static bool Setting_UseReducedMaxLiquids = false
static bool SettingBlockGamepadsEntirely
static bool SettingDontScaleMainMenuUp
static bool SettingMusicReplayDelayEnabled = false
static bool SettingsEnabled_MinersWobble = true
static bool SettingsEnabled_OpaqueBoxBehindTooltips = true
static bool SettingsEnabled_TilesSwayInWind = true
static bool SettingsUnlock_WorldEvil
static ContentManager ShaderContentManager
static ShopHelper ShopHelper
static ItemShopSellbackHelper shopSellbackHelper = new ItemShopSellbackHelper()
static bool shortRender = true
static bool shouldDrawNetDiagnosticsUI
static bool showFrameRate = false
static bool showItemOwner = false
static bool showItemText = true
static bool showServerConsole
static bool showSpam = false
static bool showSplash = true
static Sign[] sign = new Sign[1000]
static bool signBubble
static int signHover = -1
static int signX = 0
static int signY = 0
static AnchoredEntitiesCollection sittingManager
static bool SkipAssemblyLoad
static bool skipMenu = false
static AnchoredEntitiesCollection sleepingManager
static bool slimeRain
static int slimeRainKillCount
static bool[] slimeRainNPC = new bool[670]
static float slimeRainNPCSlots = 0.65f
static double slimeRainTime
static int slimeWarningDelay = 420
static int slimeWarningTime
static int[,] slugCageFrame = new int[3, cageFrames]
static int[,] slugCageFrameCounter = new int[3, cageFrames]
static bool SmartCursorShowing = false
static bool SmartCursorWanted = false
static int SmartCursorX
static int SmartCursorY
static int SmartInteractNPC
static bool SmartInteractPotionOfReturn
static int SmartInteractProj
static bool SmartInteractShowingFake
static bool SmartInteractShowingGenuine
static List< Microsoft.Xna.Framework.Point > SmartInteractTileCoords = new List<Microsoft.Xna.Framework.Point>()
static List< Microsoft.Xna.Framework.Point > SmartInteractTileCoordsSelected = new List<Microsoft.Xna.Framework.Point>()
static int SmartInteractX
static int SmartInteractY
static float SmoothedMushroomLightInfluence
static int[] snail2CageFrame = new int[cageFrames]
static int[] snail2CageFrameCounter = new int[cageFrames]
static int[] snailCageFrame = new int[cageFrames]
static int[] snailCageFrameCounter = new int[cageFrames]
static int[] snowBG = new int[3]
static int snowDust = 0
static int[] snowMntBG = new int[2]
static bool snowMoon
static int soundError
static float soundVolume = 1f
static int spamCount = 0
static int spawnTileX
static int spawnTileY
static int[] specX = new int[1000]
static int[] specY = new int[1000]
static SpriteBatch spriteBatch
static int[] squirrelCageFrame = new int[cageFrames]
static int[] squirrelCageFrameCounter = new int[cageFrames]
static int[] squirrelCageFrameCounterOrange = new int[cageFrames]
static int[] squirrelCageFrameOrange = new int[cageFrames]
static int stackCounter
static int stackDelay = 7
static int stackSplit
static Star[] star = new Star[400]
static bool startFullscreen = false
static bool stopTimeOuts = false
static float sunCircle
static int sundialCooldown
static short sunModY
static bool superFast = false
static int superFastStack
static bool Support4K = true
static bool Support8K = true
static bool targetSet
static Microsoft.Xna.Framework.Color[] teamColor = new Microsoft.Xna.Framework.Color[6]
static int teamCooldown
static int teamCooldownLen = 300
static int teamNamePlateDistance = 2000
static float temporaryGUIScaleSlider = -1f
static bool temporaryGUIScaleSliderUpdate = false
static bool tenthAnniversaryWorld = false
const string TerrariaSaveFolderPath = "Terraria"
static bool terrariasFixedTiming = true
static int textureMaxHeight = 1800
static int textureMaxWidth = 2000
static int thunderDistance
static Tilemap tile = new Tilemap((ushort)maxTilesX, (ushort)maxTilesY)
static bool[] tileAlch = new bool[625]
static bool[] tileAxe = new bool[625]
static TileBatch tileBatch
static bool[] tileBlendAll = new bool[625]
static bool[] tileBlockLight = new bool[625]
static bool[] tileBouncy = new bool[625]
static bool[] tileBrick = new bool[625]
static Microsoft.Xna.Framework.Color tileColor
static bool[] tileContainer = new bool[625]
static bool[] tileCracked = new bool[625]
static bool[] tileCut = new bool[625]
static bool[] tileDungeon = new bool[625]
static bool[] tileFlame = new bool[625]
static int[] tileFrame = new int[625]
static int[] tileFrameCounter = new int[625]
static bool[] tileFrameImportant = new bool[625]
static ulong TileFrameSeed = (ulong)Guid.NewGuid().GetHashCode()
static short[] tileGlowMask = new short[625]
static bool[] tileHammer = new bool[625]
static int TileInteractionHX = -1
static int TileInteractionHY = -1
static int TileInteractionLX = -1
static int TileInteractionLY = -1
static byte[] tileLargeFrames = new byte[625]
static bool[] tileLavaDeath = new bool[625]
static bool[] tileLighted = new bool[625]
static bool[][] tileMerge = new bool[625][]
static bool[] tileMergeDirt = new bool[625]
static bool[] tileMoss = new bool[625]
static bool[] tileNoAttach = new bool[625]
static bool[] tileNoFail = new bool[625]
static bool[] tileNoSunLight = new bool[625]
static bool[] tileObsidianKill = new bool[625]
static short[] tileOreFinderPriority = new short[625]
static bool[] tilePile = new bool[625]
static bool[] tileRope = new bool[625]
static bool[] tileSand = new bool[625]
static Ref< Effect > TileShaderRef = new Ref<Effect>()
static int[] tileShine = new int[625]
static bool[] tileShine2 = new bool[625]
static bool[] tileSign = new bool[625]
static bool tilesLoaded = false
static bool[] tileSolid = new bool[625]
static bool[] tileSolidTop = new bool[625]
static bool[] tileSpelunker = new bool[625]
static bool[] tileStone = new bool[625]
static bool[] tileTable = new bool[625]
static bool[] tileWaterDeath = new bool[625]
static double time = 13500.0
static double timeForVisualEffects
static int[] timeItemSlotCannotBeReusedFor = new int[401]
static double timePass
static List< TitleLinkButtonTitleLinks = new List<TitleLinkButton>()
static bool toggleFullscreen
static Item tooltipPrefixComparisonItem = new Item()
static float topWorld = 0f
static bool[] townNPCCanSpawn = new bool[670]
static NPCHeadRenderer TownNPCHeadRenderer = null
static Point16 trashSlotOffset
static int[] travelShop = new int[40]
static int[] treeBGSet1 = new int[3]
static int[] treeBGSet2 = new int[3]
static int[] treeBGSet3 = new int[3]
static int[] treeBGSet4 = new int[3]
static int[] treeMntBGSet1 = new int[2]
static int[] treeMntBGSet2 = new int[2]
static int[] treeMntBGSet3 = new int[2]
static int[] treeMntBGSet4 = new int[2]
static int[] treeStyle = new int[4]
static int[] treeX = new int[4]
static int[] turtleCageFrame = new int[cageFrames]
static int[] turtleCageFrameCounter = new int[cageFrames]
static int uCount
static float ugBackTransition
static int ugMusic
static int undergroundBackground
static int[] underworldBG = new int[5]
static bool updateMap
static int updateRate
static int updatesCountedForFPS
static double UpdateTimeAccumulator
static float upTimer
static float upTimerMax
static float upTimerMaxDelay
static bool UseExperimentalFeatures
static bool UseHeatDistortion = true
static bool UseStormEffects = true
static bool validateSaves = true
static bool[] vanityPet = new bool[338]
static bool verboseNetplay = false
static string versionNumber = "v1.4.3.6"
static string versionNumber2 = "v1.4.3.6"
static Ref< Effect > VertexPixelShaderRef = new Ref<Effect>()
static int[] wallBlend = new int[316]
static bool[] wallDungeon = new bool[316]
static byte[] wallFrame = new byte[316]
static byte[] wallFrameCounter = new byte[316]
static bool[] wallHouse = new bool[316]
static byte[] wallLargeFrames = new byte[316]
static bool[] wallLight = new bool[316]
static int[] waterStriderCageFrame = new int[cageFrames]
static int[] waterStriderCageFrameCounter = new int[cageFrames]
static int waterStyle
static RenderTarget2D waterTarget
static int WaveQuality = 3
static int weatherCounter
static int weatherVaneBobframe = 0
static float wFrame
static float wFrCounter
static int windCounter
static bool windPhysics = false
static float windPhysicsStrength = 0.1f
static float windSpeedCurrent
static float windSpeedTarget
static int wofDrawAreaBottom
static int wofDrawAreaTop
static int wofDrawFrameIndex
static int wofNPCIndex = -1
static WorkshopPublishingIndicator WorkshopPublishingIndicator = new WorkshopPublishingIndicator()
static FileMetadata WorldFileMetadata
const ulong WorldGeneratorVersion = 1065151889409uL
static int worldID
static List< WorldFileDataWorldList = new List<WorldFileData>()
static string worldName = ""
static string WorldPath = Path.Combine(SavePath, "Worlds")
static int WorldRollingBackupsCountToKeep = 2
static double worldSurface
static int[] wormCageFrame = new int[cageFrames]
static int[] wormCageFrameCounter = new int[cageFrames]
static bool xMas

Protected Member Functions

void CacheNPCDraws ()
void CacheProjDraws ()
void CheckBunny ()
bool checkMap (int i, int j)
void DoUpdate (ref GameTime gameTime)
override void Draw (GameTime gameTime)
void DrawBackground ()
void DrawBlack (bool force=false)
void DrawCachedNPCs (List< int > npcCache, bool behindTiles)
void DrawCachedProjs (List< int > projCache, bool startSpriteBatch=true)
void DrawClothesWindow ()
void DrawDust ()
void DrawElderEye (SpriteBatch spriteBatch, Vector2 worldPosition, float opacity, float scale, int frameNumber, Microsoft.Xna.Framework.Color passedColor)
void DrawFPS ()
void DrawGore ()
void DrawGoreBehind ()
void DrawHairWindow ()
void DrawInterface (GameTime gameTime)
void DrawInventory ()
void DrawItem (Item item, int whoami)
void DrawMap (GameTime gameTime)
void DrawMenu (GameTime gameTime)
void DrawNPCExtras (NPC n, bool beforeDraw, float addHeight, float addY, Microsoft.Xna.Framework.Color npcColor, Vector2 halfSize, SpriteEffects npcSpriteEffect, Vector2 screenPosition)
void DrawNPCHousesInWorld ()
void DrawNPCs (bool behindTiles=false)
void DrawPlayerChat ()
void DrawPlayers_AfterProjectiles ()
void DrawPlayers_BehindNPCs ()
void DrawProjectiles ()
void DrawRain ()
void DrawSplash (GameTime gameTime)
void DrawSuperSpecialProjectiles (List< int > projCache, bool startSpriteBatch=true)
void DrawSurfaceBG ()
void DrawTiles (bool solidLayer, bool forRenderTargets, bool intoRenderTargets, int waterStyleOverride=-1)
void DrawToMap ()
void DrawToMap_Section (int secX, int secY)
void DrawUnderworldBackground (bool flat)
void DrawWalls ()
void DrawWires ()
void DrawWoF ()
void EnsureRenderTargetContent ()
bool FullTile (int x, int y)
void GUIBarsDrawInner ()
void GUIChatDrawInner ()
void GUIHotbarDrawInner ()
override void Initialize ()
void InitMap ()
void InitTargets ()
void InitTargets (int width, int height)
override void LoadContent ()
IEnumerator LoadContent_Deferred ()
void LoadSettings ()
void OldDrawBackground ()
void OpenLegacySettings ()
void OpenRecent ()
void QuitGame ()
Microsoft.Xna.Framework.Color randColor ()
void ReleaseTargets ()
void RenderBackground ()
void RenderBlack ()
void RenderTiles ()
void RenderTiles2 ()
void RenderWalls ()
void RenderWater ()
void SetTitle ()
void SortDrawCacheWorms ()
override void UnloadContent ()
override void Update (GameTime gameTime)
void UpdateAudio ()

Protected Attributes

List< Tuple< int, int, ushort > > DrawWiresSpecialTiles = new List<Tuple<int, int, ushort>>()


static AchievementAdvisor AchievementAdvisor [get]
static AchievementManager Achievements [get]
static INetDiagnosticsUI ActiveNetDiagnosticsUI [get]
static bool CanShowInfoAccs [get]
static bool CanUpdateGameplay [get]
static Player CurrentPlayer [get]
 A replacement for Main.LocalPlayer which respects whichever player is currently running hooks on the main thread. This works in the player select screen, and in multiplayer (when other players are updating) More...
static Matrix CurrentWantedZoomMatrix [get]
static SamplerState DefaultSamplerState [get]
static Color DiscoColor [get]
static bool expertMode [get]
static int GameMode [get, set]
static GameModeData GameModeInfo [get]
static bool GamepadDisableCursorItemIcon [get]
static uint GameUpdateCount [get]
static bool HasSmartInteractTarget [get]
static bool IsGraphicsDeviceAvailable [get]
static bool IsItAHappyWindyDay [get]
static bool IsItRaining [get]
static bool IsItStorming [get]
static Player LocalPlayer [get]
static CreativeUnlocksTracker LocalPlayerCreativeTracker [get]
static bool masterMode [get]
static Vector2 MouseScreen [get]
static Color MouseTextColorReal [get]
static Vector2 MouseWorld [get]
static int npcShop [get, set]
static Effect pixelShader [get]
static bool PlayerLoaded [get]
static string playerPathName [get]
static UnifiedRandom rand [get, set]
int RecommendedEquipmentAreaPushUp [get]
static bool RenderTargetsRequired [get]
static Effect screenShader [get]
static Microsoft.Xna.Framework.Point ScreenSize [get]
static bool ShouldDrawInfoIconsHorizontally [get]
static bool ShouldPVPDraw [get]
static bool SmartCursorIsUsed [get]
static string statusText [get, set]
static bool ThickMouse [get]
static Effect tileShader [get]
static Matrix Transform [get]
static float UIScale [get, set]
static Matrix UIScaleMatrix [get]
float UIScaleMax [get]
static float UIScaleWanted [get]
static int UnderworldLayer [get]
static ulong UnpausedUpdateSeed [get]
static Effect vertexPixelShader [get]
static Vector2 ViewPosition [get]
static Vector2 ViewSize [get]
static float WindForVisuals [get]
static bool WindyEnoughForKiteDrops [get]
static string worldPathName [get]


static Action OnEngineLoad
static Action OnEnginePreload
static Action< GameTime > OnPostDraw
static Action< Vector2, float > OnPostFullscreenMapDraw
static Action< GameTime > OnPreDraw
static ResolutionChangeEvent OnRenderTargetsInitialized
static Action OnRenderTargetsReleased
static Action< Vector2 > OnResolutionChanged
static Action OnTickForInternalCodeOnly
static Action OnTickForThirdPartySoftwareOnly

Member Function Documentation

◆ DrawBuffIcon()

static int Terraria.Main.DrawBuffIcon ( int  drawBuffText,
int  buffSlotOnPlayer,
int  x,
int  y 

Draws the buff icon corresponding to the buff in Main.LocalPlayer.buffType[buffSlotOnPlayer ].

Calls TML hooks related to drawing and clicking.

Has two exclusive contexts: Below the accessory slots (Main.EquipPage == 2), and regular under-the-inventory.

drawBuffTextThe return from a previous DrawBuffIcon call, -1 if first drawn buff
buffSlotOnPlayerThe index for buffType and buffTime
xTop-left draw position on the x-axis
yTop-left draw position on the y-axis
The index of the currently mouseovered buff icon, equal to buffSlotOnPlayer if it's currently mouseovered, -1 otherwise

◆ IsTileSpelunkable()

static bool Terraria.Main.IsTileSpelunkable ( int  tileX,
int  tileY 

Checks if a tile at the given coordinates counts towards tile coloring from the Spelunker buff, and is detected by various pets.

◆ RegisterItemAnimation()

static void Terraria.Main.RegisterItemAnimation ( int  index,
DrawAnimation  animation 

Registers an animation for an item type to draw inside UI (not world or held item on player). To enable its animation in the world, use ItemID.Sets.AnimatesAsSoul in conjunction with this

indexItem type
animationDraw animation

◆ StartRain()

static void Terraria.Main.StartRain ( )

Starts rain for a random amount of time. Should be called on the server (netMode != client) - vanilla syncs it using SyncRain.
You can also call this on the client to update visuals immediately, assuming it was/will be called serverside aswell (Journey Mode rain slider does this).

◆ StopRain()

static void Terraria.Main.StopRain ( )

Stops rain. Should be called on the server (netMode != client) - vanilla syncs it using SyncRain.
You can also call this on the client to update visuals immediately, assuming it was called serverside aswell (Journey Mode rain slider does this).

◆ SyncRain()

static void Terraria.Main.SyncRain ( )

Syncs rain state if StartRain or StopRain were called in the same tick and caused a change to

See also

Can be called on any side, but only the server will actually sync it.

◆ TryGetBuffTime()

static bool Terraria.Main.TryGetBuffTime ( int  buffSlotOnPlayer,
out int  buffTimeValue 

Checks if the buff at index buffSlotOnPlayer is allowed to draw a "remaining time" text, and sets buffTimeValue to it.

Check buffTimeValue > 2 afterwards if you want to mirror text draw logic.

buffSlotOnPlayerThe index for buffType and buffTime
buffTimeValueThe "remaining time" in ticks
true if buffTimeValue is set, otherwise false

◆ TryRemovingBuff()

static void Terraria.Main.TryRemovingBuff ( int  i,
int  b 

Calls Player.DelBuff with index i after checking Main.debuff of buff type b. Will toggle Player.hideMisc for pet and light pet.

iThe index for buffType and buffTime
bThe buff type

Member Data Documentation

◆ cloudBG

int [] Terraria.Main.cloudBG
Initial value:
= new int[2] {

◆ hotbarScale

float [] Terraria.Main.hotbarScale
Initial value:
= new float[10] {

◆ OffsetsNPCOffhand

Vector2 [] Terraria.Main.OffsetsNPCOffhand
Initial value:
= new Vector2[5] {
new Vector2(14f, 34f),
new Vector2(14f, 32f),
new Vector2(14f, 26f),
new Vector2(14f, 22f),
new Vector2(14f, 18f)

◆ OffsetsPlayerHeadgear

Vector2 [] Terraria.Main.OffsetsPlayerHeadgear
Initial value:
= new Vector2[20] {
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 0f),
new Vector2(0f, 0f),
new Vector2(0f, 0f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 0f),
new Vector2(0f, 0f),
new Vector2(0f, 0f),
new Vector2(0f, 2f),
new Vector2(0f, 2f),
new Vector2(0f, 2f)

◆ OffsetsPlayerOffhand

Vector2 [] Terraria.Main.OffsetsPlayerOffhand
Initial value:
= new Vector2[20] {
new Vector2(14f, 20f),
new Vector2(14f, 20f),
new Vector2(14f, 20f),
new Vector2(14f, 18f),
new Vector2(14f, 20f),
new Vector2(16f, 4f),
new Vector2(16f, 16f),
new Vector2(18f, 14f),
new Vector2(18f, 14f),
new Vector2(18f, 14f),
new Vector2(16f, 16f),
new Vector2(16f, 16f),
new Vector2(16f, 16f),
new Vector2(16f, 16f),
new Vector2(14f, 14f),
new Vector2(14f, 14f),
new Vector2(12f, 14f),
new Vector2(14f, 16f),
new Vector2(16f, 16f),
new Vector2(16f, 16f)

◆ OffsetsPlayerOnhand

Vector2 [] Terraria.Main.OffsetsPlayerOnhand
Initial value:
= new Vector2[20] {
new Vector2(6f, 19f),
new Vector2(5f, 10f),
new Vector2(12f, 10f),
new Vector2(13f, 17f),
new Vector2(12f, 19f),
new Vector2(5f, 10f),
new Vector2(7f, 17f),
new Vector2(6f, 16f),
new Vector2(6f, 16f),
new Vector2(6f, 16f),
new Vector2(6f, 17f),
new Vector2(7f, 17f),
new Vector2(7f, 17f),
new Vector2(7f, 17f),
new Vector2(8f, 17f),
new Vector2(9f, 16f),
new Vector2(9f, 12f),
new Vector2(8f, 17f),
new Vector2(7f, 17f),
new Vector2(7f, 17f)

◆ RegisteredGameModes

Dictionary<int, GameModeData> Terraria.Main.RegisteredGameModes
Initial value:
= new Dictionary<int, GameModeData> {
{ 0, GameModeData.NormalMode },
{ 1, GameModeData.ExpertMode },
{ 2, GameModeData.MasterMode },
{ 3, GameModeData.CreativeMode } }

Property Documentation

◆ CurrentPlayer

Player Terraria.Main.CurrentPlayer

A replacement for Main.LocalPlayer which respects whichever player is currently running hooks on the main thread. This works in the player select screen, and in multiplayer (when other players are updating)