TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
Terraria.Main Class Reference
+ Inheritance diagram for Terraria.Main:

Classes

class  CurrentFrameFlags
 
struct  CurrentPlayerOverride
 
struct  InfoToSetBackColor
 
struct  MouseTextCache
 
class  NativeMethods
 
struct  SceneArea
 
class  TextDisplayCache
 

Public Types

enum  WorldPreparationState { AwaitingData , ProcessingData , Ready }
 

Public Member Functions

delegate void OnPlayerSelected (PlayerFileData player)
 
void SetMouseNPC (int index, int type)
 
void SetMouseNPC_ToHousingQuery ()
 
static IntPtr LoadLibrary (string dllToLoad)
 
void UpdateParticleSystems ()
 
void setServerWorldRollbacks (string rollBacksToKeep)
 
void autoCreate (string worldSize)
 
void NewMOTD (string newMOTD)
 
void LoadDedConfig (string configPath)
 
void SetNetPlayers (int mPlayers)
 
void SetWorld (string world, bool cloud)
 
void SetWorldName (string world)
 
void EnableAutoShutdown ()
 
static IntPtr FindWindow (string lpClassName, string lpWindowName)
 
void AutoPass ()
 
void AutoJoin (string IP, string player=null)
 
void AutoHost ()
 
void loadLib (string path)
 
void NeverSleep ()
 
void YouCanSleepNow ()
 
void DedServ ()
 
 Main ()
 
void updateCloudLayer ()
 
void UpdateViewZoomKeys ()
 
bool ShouldUpdateEntities ()
 
static short GetKeyState (int keyCode)
 
void MouseTextHackZoom (string text, string buffTooltip=null)
 
void MouseTextHackZoom (string text, int itemRarity, byte diff=0, 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 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 ClearCachedTileDraws ()
 
void ResetAllContentBasedRenderTargets ()
 
void DrawHealthBar (float X, float Y, int Health, int MaxHealth, float alpha, float scale=1f, bool noFlip=false)
 Draws a small health bar.
F:Terraria.Main.spriteBatch should already be started before calling this method.
 
void DrawNPCCheckAlt (NPC n)
 
void DrawNPC (int iNPCIndex, bool behindTiles)
 
void DrawNPCDirect_QueenSlimeWings (NPC rCurrentNPC, SpriteBatch mySpriteBatch, Vector2 screenPos, Vector2 drawCenter, Color originColor)
 
void DrawNPCDirect (SpriteBatch mySpriteBatch, NPC rCurrentNPC, bool behindTiles, Vector2 screenPos)
 
void DrawProj (int i)
 
void DrawProjDirect (Projectile proj)
 
void PrepareDrawnProjectileDrawing (Projectile proj)
 
void PrepareDrawnEntityDrawing (Entity entity, int intendedShader, Matrix? overrideMatrix)
 
void DrawItems ()
 
void DrawWindowsIMEPanel (Vector2 position, float xAnchor=0f)
 
void HandleIME ()
 
void DrawMouseOver ()
 
void GUIBarsDraw ()
 
void DrawInterface_Resources_Buffs ()
 
void GUIChatDraw ()
 
void DrawSimpleSurfaceBackground (Vector2 areaPosition, int areaWidth, int areaHeight)
 
void DrawCapture (Rectangle area, CaptureSettings settings)
 
void oldDrawWater (bool bg=false, int Style=0, float Alpha=1f)
 
void UpdateWeather (GameTime gameTime, int currentDayRateIteration)
 
void LoadBackground (int i)
 
void LoadItem (int i)
 
void LoadNPC (int i)
 
void LoadProjectile (int i)
 
void LoadGore (int i)
 
void LoadWall (int i)
 
void LoadTiles (int i)
 
void LoadItemFlames (int i)
 
void LoadWings (int i)
 
void LoadHair (int i)
 
void LoadArmorHead (int i)
 
void LoadArmorBody (int i)
 
void LoadArmorLegs (int i)
 
void LoadAccHandsOn (int i)
 
void LoadAccHandsOff (int i)
 
void LoadAccBack (int i)
 
void LoadAccFront (int i)
 
void LoadAccShoes (int i)
 
void LoadAccWaist (int i)
 
void LoadAccShield (int i)
 
void LoadAccNeck (int i)
 
void LoadAccFace (int i)
 
void LoadAccBalloon (int i)
 
void LoadAccBeard (int i)
 
void LoadFlameRing ()
 
void DrawTileCracks (int crackType, HitTile hitter)
 
void DrawInfernoRings ()
 
void OnTileChangeEvent (int x, int y, int count, TileChangeType eventType)
 
void FullscreenStartup ()
 
void UpdateDisplaySettings ()
 

Static Public Member Functions

static void ToggleGameplayUpdates (bool state)
 
static void SetRecommendedZoomContext (Matrix matrix)
 
static void FindAnnouncementBoxStatus ()
 
static bool CanPlayCreditsRoll ()
 
static void SetCameraLerp (float lerp, int time)
 
static void SetCameraGamepadLerp (float lerp)
 
static Vector2 ReverseGravitySupport (Vector2 pos, float height=0f)
 
static Point ReverseGravitySupport (Point pos, int height=0)
 
static Rectangle ReverseGravitySupport (Rectangle box)
 
static MoonPhase GetMoonPhase ()
 
static Vector2 DrawPlayerItemPos (float gravdir, int itemtype)
 
static void SetupTileMerge ()
 
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.
 
static void InitializeItemAnimations ()
 
static void AnglerQuestSwap ()
 
static void TrySetPreparationState (WorldPreparationState state)
 
static void UpdateWorldPreparationState ()
 
static bool InSmartCursorHighlightArea (int x, int y, out bool actuallySelected)
 
static void LoadWorlds ()
 
static void LoadPlayers ()
 
static void SaveRecent ()
 
static bool SaveSettings ()
 
static string GetPlayerPathFromName (string playerName, bool cloudSave)
 
static string GetWorldPathFromName (string worldName, bool cloudSave)
 
static string ConvertToSafeArgument (string arg)
 
static string ConvertFromSafeArgument (string arg)
 
static void startDedInput ()
 
static void startDedInputCallBack ()
 
static void ExecuteCommand (string text, CommandCaller commandCaller)
 
static bool IsFastForwardingTime ()
 
static void Sundialing ()
 
static void Moondialing ()
 
static void UpdateTimeRate ()
 
static void UpdateTimeRate_Inner ()
 
static void LoadTestLog (string logname)
 
static void CheckForMoonEventsStartingTemporarySeasons ()
 
static void CheckForMoonEventsScoreDisplay ()
 
static void stopMoonEvent ()
 
static void startPumpkinMoon ()
 
static void startSnowMoon ()
 
static void snowing ()
 
static void checkXMas ()
 
static void checkHalloween ()
 
static void TeleportEffect (Rectangle effectRect, int Style, int extraInfo=0, float dustCountMult=1f, TeleportationSide side=TeleportationSide.Entry, Vector2 otherPosition=default(Vector2))
 
static void Ambience ()
 
static void AnimateTiles_CritterCages ()
 
static void DoUpdate_AnimateItemIcons ()
 
static void QueueMainThreadAction (Action action)
 
static void NotifyOfEvent (GameNotificationType type)
 
static bool IsNPCActiveAndOneOfTypes (int npcIndex, params int[] types)
 
static void OpenPlayerChat ()
 
static void ClosePlayerChat ()
 
static void InputTextSign ()
 
static void InputTextChest ()
 
static void InputTextSignCancel ()
 
static void clrInput ()
 
static string GetInputText (string oldString, bool allowMultiLine=false)
 
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, out int prefixlineIndex)
 
static void DrawGamepadInstructions ()
 
static Color shine (Color newColor, int type)
 
static void shine (ref Vector3 newColor, int type)
 
static float NPCAddHeight (NPC theNPC)
 
static int GetProjectileDesiredShader (Projectile proj)
 
static void GetItemDrawFrame (int item, out Texture2D itemTexture, out Rectangle itemFrame)
 Gets the texture and frame of the given item type (F:Terraria.Item.type).
 
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_WhipSword (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_WhipBland (Projectile proj, List< Vector2 > controlPoints)
 
static Vector2 GetPlayerArmPosition (Projectile proj)
 
static void PlayInteractiveProjectileOpenCloseSound (int projType, bool open)
 
static void PrintTimedMessage (string message, params object[] arguments)
 
static void EntitySpriteDraw (Texture2D texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float worthless=0f)
 
static void EntitySpriteDraw (Texture2D texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float worthless=0f)
 
static void EntitySpriteDraw (DrawData data)
 
static Color buffColor (Color newColor, float R, float G, float B, float A)
 
static Color quickAlpha (Color oldColor, float Alpha)
 
static bool CanDryadPlayStardewAnimation (Player player, NPC npc)
 
static void SetNPCShopIndex (int index)
 
static void CloseNPCChatOrSign ()
 
static void SubmitSignText ()
 
static void LockCraftingForThisCraftClickDuration ()
 
static void CraftItem (Recipe r)
 
static void DrawInterface_Resources_ClearBuffs ()
 
static string GetBuffTooltip (Player player, int buffType)
 
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.
 
static int DrawBuffIcon (int drawBuffText, int buffSlotOnPlayer, int x, int y)
 Draws the buff icon corresponding to the buff in Main.LocalPlayer.buffType[buffSlotOnPlayer ].
 
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.
 
static void TryRemovingBuff_CheckBuffHideMisc (int slot, int buffID)
 
static void OpenHairWindow ()
 
static void CancelHairWindow ()
 
static void BuyHairWindow ()
 
static int UnlockedMaxHair ()
 
static void OpenClothesWindow ()
 
static void CancelClothesWindow (bool quiet=false)
 
static void SaveClothesWindow ()
 
static void DrawInterface_29_SettingsButton ()
 
static void DrawSettingButton (ref bool mouseOver, ref float scale, int posX, int posY, string text, string textSizeMatcher, Action clickAction)
 
static void ItemIconCacheUpdate (int selectedItemID)
 
static void ItemIconCacheVerification ()
 
static void DrawWallOfFish ()
 
static void DrawWallOfStars ()
 
static void DrawItemIcon (SpriteBatch spriteBatch, Item theItem, Vector2 screenPositionForItemCenter, Color itemLightColor, float sizeLimit)
 
static void CheckInvasionProgressDisplay ()
 
static void SyncAnInvasion (int toWho)
 
static void ReportInvasionProgress (int progress, int progressMax, int icon, int progressWave)
 
static void DrawInvasionProgress ()
 
static Color hslToRgb (Vector3 hslVector)
 
static Color hslToRgb (float Hue, float Saturation, float Luminosity, byte a=byte.MaxValue)
 
static double hue2rgb (double c, double t1, double t2)
 
static Vector3 rgbToHsl (Color newColor)
 
static void DrawCursor (Vector2 bonus, bool smart=false)
 
static void ClearSmartInteract ()
 
static Vector2 DrawThickCursor (bool smart=false)
 
static void GoToWorldSelect ()
 
static void StartClientGameplay ()
 
static void ReleaseHostAndPlayProcess ()
 
static void CycleFrameSkipMode ()
 
static void OnSubmitServerIP (string inputText)
 
static void OpenCharacterSelectUI ()
 
static void OpenReportsMenu ()
 
static void OpenWorldSelectUI ()
 
static void OpenResourcePacksMenu (UIState uiStateToGoBackTo)
 
static void ResetKeyBindings ()
 
static void CursorColor ()
 
static Point GetScreenOverdrawOffset ()
 
static bool WallLightAt (int i, int j)
 
static bool WallLightAt (int i, int j, bool showInvisibleWalls)
 
static string ValueToCoins (long value)
 
static void TriggerPing (Vector2 position)
 
static Color GetPlayerHeadBordersColor (Player plr)
 
static int CalculateWaterStyle (bool ignoreFountains=false)
 
static bool IsLiquidStyleWater (int liquidStyle)
 
static void DrawTileInWater (Vector2 drawOffset, int x, int y)
 
static bool ShouldShowInvisibleWalls ()
 
static int ConvertPaintIdToTileShaderIndex (int paintIndexOnTile, bool isUsedForPaintingGrass, bool useWallShaderHacks)
 
static void ResetWindCounter (bool resetExtreme=false)
 
static void NewLightning ()
 
static bool IsItDay ()
 
static double starGameMath (double value=1.0)
 
static void GetAreaToLight (out int firstTileX, out int lastTileX, out int firstTileY, out int lastTileY)
 
static int GetPreferredBGStyleForPlayer ()
 
static bool CanStartInvasion (int type=1, bool ignoreDelay=false)
 
static void StartInvasion (int type=1)
 
static void FakeLoadInvasionStart ()
 
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)
 Spawns chat text on the local client. Does nothing on the server.
For floating text, such as damage, see T:Terraria.CombatText
<VariousTextOptionsSummary>
Summary of options to display text to the user:
• M:Terraria.Main.NewText(System.String,System.Byte,System.Byte,System.Byte) to display a message in chat.
• T:Terraria.CombatText to display floating damage numbers in-game. Used for damage and healing numbers.
• T:Terraria.PopupText to display non-overlapping floating in-game text. Used for reforge and item pickup messages.
</VariousTextOptionsSummary>
 
static void NewTextMultiline (string text, bool force=false, Color c=default(Color), int WidthLimit=-1)
 
static void StopRain ()
 Stops rain. Should be called on the server (netMode != client) - vanilla syncs it using M:Terraria.Main.SyncRain.
You can also call this on the client to update visuals immediately, assuming it was called serverside as well (Journey Mode rain slider does this).
 
static void StartRain ()
 Starts rain for a random amount of time. Should be called on the server (netMode != client) - vanilla syncs it using M:Terraria.Main.SyncRain.
You can also call this on the client to update visuals immediately, assuming it was/will be called serverside as well (Journey Mode rain slider does this).
 
static void StartSlimeRain (bool announce=true)
 
static void StopSlimeRain (bool announce=true)
 
static bool AnyPlayerReadyToFightKingSlime ()
 
static void SkipToTime (int timeToSet, bool setIsDayTime)
 
static bool ShouldNormalEventsBeAbleToStart ()
 
static void UpdateTime_StartNight (ref bool stopEvents)
 
static void UpdateTime_StartDay (ref bool stopEvents)
 
static BestiaryUnlockProgressReport GetBestiaryProgressReport ()
 
static int DamageVar (float dmg, float luck=0f)
 Multiplies the input damage by a random value between 0.85f and 1.15f.
 
static int DamageVar (float dmg, int percent, float luck=0f)
 
static void ClearPendingPlayerSelectCallbacks ()
 
static void SelectPlayer (PlayerFileData data)
 
static void ToggleFullScreen ()
 
static void SetFullScreen (bool fullscreen)
 
static void SetResolution (int width, int height)
 
static void SetDisplayMode (int width, int height, bool fullscreen)
 
static void FixUIScale ()
 
static void OpenPlayerSelect (OnPlayerSelected method)
 
static void SwitchNetMode (int mode)
 
static void WeGameRequireExitGame ()
 
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.
 
static bool IsTileBiomeSightable (int tileX, int tileY, ref Color sightColor)
 Checks if a tile at the given coordinates counts towards tile coloring from the Biome Sight buff.
 
static void InfoDisplayPageHandler (int startX, ref string mouseText, out int startingDisplay, out int endingDisplay)
 
static void BuilderTogglePageHandler (int startY, int activeToggles, out bool moveDownForButton, out int startIndex, out int endIndex)
 
static void SyncRain ()
 Syncs rain state if M:Terraria.Main.StartRain or M:Terraria.Main.StopRain were called in the same tick and caused a change to

See also
F:Terraria.Main.maxRaining

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

 
static Task RunOnMainThread (Action action)
 Wait for an action to be performed on the main thread.
 
static Task< T > RunOnMainThread< T > (Func< T > func)
 Wait for an action to be performed on the main thread.
 
static void AddSignalTraps ()
 

Public Attributes

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

Static Public Attributes

const int curRelease = 279
 
const string assemblyVersionNumber = "1.4.4.9"
 
const string copyrightText = "Copyright © 2022 Re-Logic"
 
const ulong WorldGeneratorVersion = 1198295875585uL
 
static int mapDelay = 2
 
static IAssetRepository Assets
 
static AssetSourceController AssetSourceController
 
static int CurrentDrawnEntityShader
 
static Entity CurrentDrawnEntity
 
static float ForcedMinimumZoom = 1f
 
static SpriteViewMatrix GameViewMatrix
 
static SpriteViewMatrix BackgroundViewMatrix
 
static float GameZoomTarget = 1f
 
static bool LightingEveryFrame = true
 
static bool SettingsUnlock_WorldEvil
 
static bool SettingsEnabled_MinersWobble = true
 
static bool SettingsEnabled_AutoReuseAllItems = false
 
static bool SettingBlockGamepadsEntirely
 
static bool SettingDontScaleMainMenuUp
 
static bool SettingsEnabled_OpaqueBoxBehindTooltips = true
 
static bool SettingMusicReplayDelayEnabled = false
 
static bool HidePassword
 
static bool ReversedUpDownArmorSetBonuses
 
static Color MouseBorderColor = new Color(64, 64, 64, 64)
 
static bool MouseShowBuildingGrid
 
static bool AllowUnfocusedInputOnGamepad
 
static bool InvisibleCursorForGamepad = true
 
static bool GamepadDisableCursorItemIconInner = true
 
static bool GamepadDisableInstructionsDisplay
 
static bool CrouchingEnabled = false
 
static float MouseBuildingGridAlpha
 
static bool CaptureModeDisabled = false
 
static Main instance
 
static ChromaEngine Chroma
 
static ChromaHotkeyPainter ChromaPainter
 
static Camera Camera = new Camera()
 
static IPlayerRenderer PlayerRenderer = new LegacyPlayerRenderer()
 
static IPlayerRenderer PotionOfReturnRenderer = new ReturnGatePlayerRenderer()
 
static MapHeadRenderer MapPlayerRenderer = new MapHeadRenderer()
 
static NPCHeadRenderer TownNPCHeadRenderer = null
 
static NPCHeadRenderer BossNPCHeadRenderer = null
 
static List< TitleLinkButtonTitleLinks = new List<TitleLinkButton>()
 
static string versionNumber = "v1.4.4.9"
 
static string versionNumber2 = "v1.4.4.9"
 
static bool AnnouncementBoxDisabled
 
static int AnnouncementBoxRange = -1
 
static string AutogenSeedName
 
static Dictionary< int, GameModeDataRegisteredGameModes
 
static bool drunkWorld = false
 
static bool getGoodWorld = false
 
static bool tenthAnniversaryWorld = false
 
static bool dontStarveWorld = false
 
static bool notTheBeesWorld = false
 
static bool remixWorld = false
 
static bool noTrapsWorld = false
 
static bool zenithWorld = false
 
static Vector2 destroyerHB = new Vector2(0f, 0f)
 
static FavoritesFile LocalFavoriteData = new FavoritesFile(SavePath + "/favorites.json", isCloud: false)
 
static FavoritesFile CloudFavoritesData = new FavoritesFile("ModLoader/favorites.json", isCloud: true)
 
static FileMetadata WorldFileMetadata
 
static FileMetadata MapFileMetadata
 
static PingMapLayer Pings = new PingMapLayer()
 
static MapIconOverlay MapIcons = new MapIconOverlay().AddLayer(new SpawnMapLayer()).AddLayer(new TeleportPylonsMapLayer()).AddLayer(Pings)
 
static CreativeUI CreativeMenu = new CreativeUI()
 
static BigProgressBarSystem BigBossProgressBar = new BigProgressBarSystem()
 
static UserInterface MenuUI = new UserInterface()
 
static UserInterface InGameUI = new UserInterface()
 
static bool drawBackGore
 
static ulong LobbyId = 0uL
 
static WorldSections sectionManager
 
static bool ServerSideCharacter
 
static string clientUUID
 
static bool ContentLoaded = false
 
static float GlobalTimeWrappedHourly
 
static bool GlobalTimerPaused = false
 
static GameTime gameTimeCache = new GameTime()
 
static ulong TileFrameSeed = (ulong)Guid.NewGuid().GetHashCode()
 
static ContentManager ShaderContentManager
 
static Ref< EffectScreenShaderRef = new Ref<Effect>()
 
static Ref< EffectPixelShaderRef = new Ref<Effect>()
 
static Ref< EffectTileShaderRef = new Ref<Effect>()
 
static Ref< EffectVertexPixelShaderRef = new Ref<Effect>()
 
static int WaveQuality = 3
 
static bool UseStormEffects = true
 
static bool UseHeatDistortion = true
 
static List< IEnumerator > DelayedProcesses = new List<IEnumerator>()
 
static int npcStreamSpeed = 30
 
static int musicError
 
static bool dedServFPS
 
static int dedServCount1
 
static int dedServCount2
 
static bool superFast = false
 
static readonly int offLimitBorderTiles = 40
 
static readonly int maxMusic = 92
 
const int MaxBannerTypes = 290
 
static readonly int maxBackgrounds = 298
 
const int MaxShopIDs = 100
 
static Vector2[] OffsetsNPCOffhand
 
static Vector2[] OffsetsPlayerOffhand
 
static Vector2[] OffsetsPlayerOnhand
 
static Vector2[] OffsetsPlayerHeadgear
 
static Vector2 CurrentPan = Vector2.Zero
 
static float sunCircle
 
static int BlackFadeIn
 
static bool noWindowBorder = false
 
static RasterizerState Rasterizer = RasterizerState.CullCounterClockwise
 
static int undergroundBackground
 
static int oldUndergroundBackground
 
static bool skipMenu = false
 
static bool verboseNetplay = false
 
static bool stopTimeOuts = false
 
static bool showSpam = false
 
static bool showItemOwner = false
 
static bool[] townNPCCanSpawn = new bool[NPCID.Count]
 
static int musicBox2 = -1
 
static int musicBoxNotModifiedByVolume = -1
 
static byte HealthBarDrawSettings = 1
 
static bool runningCollectorsEdition
 
static float wFrCounter
 
static float wFrame
 
static float upTimer
 
static float upTimerMax
 
static float upTimerMaxDelay
 
static bool drawDiag
 
static bool drawRelease
 
static bool drawBetterDebug
 
static bool betterDebugRelease
 
static bool renderNow
 
static bool drawToScreen
 
static bool targetSet
 
static int mouseX
 
static int mouseY
 
static int lastMouseX
 
static int lastMouseY
 
static bool mouseLeft
 
static bool mouseRight
 
static bool isMouseLeftConsumedByUI = false
 
static float essScale = 1f
 
static int essDir = -1
 
static float[] cloudBGX = new float[2]
 
static float cloudBGAlpha
 
static float cloudBGActive
 
static int[] cloudBG = new int[2] { 112, 113 }
 
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[] treeBGSet1 = new int[3]
 
static int[] treeBGSet2 = new int[3]
 
static int[] treeBGSet3 = new int[3]
 
static int[] treeBGSet4 = new int[3]
 
static int[] corruptBG = new int[3]
 
static int[] jungleBG = new int[3]
 
static int[] snowMntBG = new int[2]
 
static int[] snowBG = new int[3]
 
static int[] hallowBG = new int[3]
 
static int[] crimsonBG = new int[3]
 
static int[] desertBG = new int[3]
 
static int[] mushroomBG = new int[3]
 
static int oceanBG
 
static int[] underworldBG = new int[5]
 
static int[] treeX = new int[4]
 
static int[] treeStyle = new int[4]
 
static int[] caveBackX = new int[4]
 
static int[] caveBackStyle = new int[4]
 
static int iceBackStyle
 
static int hellBackStyle
 
static int jungleBackStyle
 
static string debugWords = ""
 
static bool gamePad = false
 
static bool xMas
 
static bool halloween
 
static bool forceXMasForToday
 
static bool forceHalloweenForToday
 
static bool DisableIntenseVisualEffects = false
 
static int snowDust = 0
 
static bool changeTheTitle
 
static bool hairWindow
 
static bool clothesWindow
 
static bool ingameOptionsWindow = false
 
static bool inFancyUI = false
 
static int keyCount
 
static string[] keyString = new string[10]
 
static int[] keyInt = new int[10]
 
static byte gFade
 
static float gFader
 
static byte gFadeDir = 1
 
static bool shouldDrawNetDiagnosticsUI
 
static IMultiplayerClosePlayersOverlay ActiveClosePlayersTeamOverlay = new NewMultiplayerClosePlayersOverlay()
 
static double UpdateTimeAccumulator
 
static bool drawSkip
 
static int fpsCount
 
static Stopwatch fpsTimer = new Stopwatch()
 
static bool showSplash = true
 
static bool ignoreErrors = true
 
static string defaultIP = ""
 
static double dayRate = 1.0
 The rate at which F:Terraria.Main.time updates per tick.
Can be modified using M:Terraria.ModLoader.ModSystem.ModifyTimeRate(System.Double@,System.Double@,System.Double@). Capped at 86,400.0.
 
static double desiredWorldTilesUpdateRate = 1.0
 
static int maxScreenW = 1920
 
static int maxScreenH = 1200
 
static int minScreenW = 800
 
static int minScreenH = 720
 
static float iS = 1f
 
static bool render
 
static int qaStyle
 
static int buffScanAreaWidth = (maxScreenW + 800) / 16 - 1
 
static int buffScanAreaHeight = (maxScreenH + 800) / 16 - 1
 
static float musicPitch = 0f
 
static bool[] projHostile = new bool[ProjectileID.Count]
 
static bool[] projHook = new bool[ProjectileID.Count]
 
static bool[] pvpBuff = new bool[BuffID.Count]
 Indexed by T:Terraria.ID.BuffID. If true for a given T:Terraria.ID.BuffID, then that buff can be applied to players by other players in PvP.
Defaults to false.
 
static bool[] persistentBuff = new bool[BuffID.Count]
 Allows status effects for which this is set to true to persist after the afflicted player's death.
Defaults to false; all vanilla flask effects have their entries here set to true.

 
static bool[] vanityPet = new bool[BuffID.Count]
 Categorizes status effects for which this is set to true as being from vanity pets, preventing them from overlapping with other vanity pet status effects.
Defaults to false; all vanilla vanity pets have their entries here set to true.

 
static bool[] lightPet = new bool[BuffID.Count]
 Categorizes status effects for which this is set to true as being tied to a light pet, preventing them from overlapping with other light pet status effects.
Defaults to false; all vanilla light pets have their entries here set to true.

 
static bool[] meleeBuff = new bool[BuffID.Count]
 Categorizes status effects for which this is set to true as being from flasks, preventing them from overlapping with other flask status effects.
Defaults to false; all vanilla flask effects have their entries here set to true.

 
static bool[] debuff = new bool[BuffID.Count]
 Categorizes status effects for which this is set to true as being debuffs instead of buffs.
This has multiple effects on gameplay:

 
static bool[] buffNoSave = new bool[BuffID.Count]
 Indexed by T:Terraria.ID.BuffID. If true for a given T:Terraria.ID.BuffID, then that buff will not be saved when exiting a world.
Vanilla sets this for DoT effects (F:Terraria.ID.BuffID.Poisoned), short item buffs (F:Terraria.ID.BuffID.Panic), mount buffs, and conditionally-applied buffs (F:Terraria.ID.BuffID.Campfire, F:Terraria.ID.BuffID.Werewolf).
Defaults to false.
 
static bool[] buffNoTimeDisplay = new bool[BuffID.Count]
 Prevents status effects which have their entries set to true from displaying the amount of time they have left.
Defaults to false; most, if not all, status effects which have their entries set to true here are related to mounts, pets, and summons.

 
static bool[] buffDoubleApply = new bool[BuffID.Count]
 
static int maxMP = 10
 
static string[] recentWorld = new string[maxMP]
 
static string[] recentIP = new string[maxMP]
 
static int[] recentPort = new int[maxMP]
 
static bool shortRender = true
 
static bool BackgroundEnabled = true
 
static int instantBGTransitionCounter = 2
 
static int bgDelay
 
static int bgStyle
 
static float[] bgAlphaFrontLayer = new float[14]
 
static float[] bgAlphaFarBackLayer = new float[14]
 
static int[] bgFrame = new int[14]
 
static int[] bgFrameCounter = new int[14]
 
static int EquipPage
 
static int EquipPageSelected
 
static int wofNPCIndex = -1
 
static int wofDrawAreaTop
 
static int wofDrawAreaBottom
 
static int wofDrawFrameIndex
 
static int offScreenRange = 200
 
static RenderTarget2D waterTarget
 
static RenderTarget2D screenTarget
 
static RenderTarget2D screenTargetSwap
 
static int maxMapUpdates = 250000
 
static bool refreshMap
 
static int loadMapLastX
 
static bool loadMapLock
 
static bool loadMap
 
static bool mapReady
 
static int textureMaxWidth = 2000
 
static int textureMaxHeight = 1800
 
static bool updateMap
 
static int mapMinX = 0
 
static int mapMaxX = 0
 
static int mapMinY
 
static int mapMaxY
 
static int mapTimeMax = 30
 
static int mapTime = mapTimeMax
 
static bool clearMap
 
static int mapTargetX = 5
 
static int mapTargetY = 2
 
static bool[,] initMap = new bool[mapTargetX, mapTargetY]
 
static bool[,] mapWasContentLost = new bool[mapTargetX, mapTargetY]
 
const int numInfoIcons = 13
 
static Color OurFavoriteColor = new Color(255, 231, 69)
 
static bool mapInit
 
static bool mapEnabled = true
 
static int mapStyle = 1
 
static float grabMapX
 
static float grabMapY
 
static int miniMapX
 
static int miniMapY
 
static int miniMapWidth
 
static int miniMapHeight
 
static float mapMinimapDefaultScale = 1.05f
 
static float mapMinimapScale = mapMinimapDefaultScale
 
static float mapMinimapAlpha = 1f
 
static float mapOverlayScale = 2.5f
 
static float mapOverlayAlpha = 0.35f
 
static bool mapFullscreen
 
static bool resetMapFull
 
static float mapFullscreenScale = 4f
 
static Vector2 mapFullscreenPos = new Vector2(-1f, -1f)
 
static bool SkipAssemblyLoad
 
static int renderCount = 99
 
static GraphicsDeviceManager graphics
 
static SpriteBatch spriteBatch
 
static TileBatch tileBatch
 
static BasicDebugDrawer DebugDrawer
 
static SamplerState SamplerStateForCursor = SamplerState.LinearClamp
 
static GenerationProgress AutogenProgress = new GenerationProgress()
 
static KeyboardState keyState
 
static KeyboardState oldKeyState
 
static Color mcColor = new Color(1f, 0.6f, 0f)
 
static Color hcColor = new Color(1f, 0.15f, 0.1f)
 
static Color creativeModeColor = Color.Lerp(Color.HotPink, Color.White, 0.1f)
 
static Color legendaryModeColor = Color.LimeGreen
 
static Color highVersionColor = new Color(255, 255, 0)
 
static Color errorColor = new Color(255, 0, 0)
 
static bool craftingHide
 
static bool armorHide
 
static float shimmerAlpha = 0f
 
static float shimmerDarken = 0f
 
static float shimmerBrightenDelay = 0f
 
static float craftingAlpha = 1f
 
static float armorAlpha = 1f
 
static float[] buffAlpha = new float[BuffID.Count]
 
static bool afterPartyOfDoom = false
 
static bool hardMode
 
static Vector2 sceneWaterPos = Vector2.Zero
 
static Vector2 sceneTilePos = Vector2.Zero
 
static Vector2 sceneTile2Pos = Vector2.Zero
 
static Vector2 sceneWallPos = Vector2.Zero
 
static Vector2 sceneBackgroundPos = Vector2.Zero
 
static bool maxQ = true
 
static float gfxQuality = 1f
 
static float gfxRate = 0.01f
 
static int DiscoR = 255
 
static int DiscoB
 
static int DiscoG
 
static int teamCooldown
 
static int teamCooldownLen = 300
 
static bool gamePaused
 
static bool gameInactive
 
static int updatesCountedForFPS
 
static int drawsCountedForFPS
 
static int uCount
 
static int updateRate
 
static int frameRate
 
static bool RGBRelease
 
static bool qRelease = false
 
static bool netRelease
 
static bool frameRelease
 
static bool showFrameRate = false
 
static int magmaBGFrame
 
static int magmaBGFrameCounter
 
static int saveTimer = 0
 
static bool autoJoin
 
static bool serverStarting = false
 
static float leftWorld = 0f
 
static float rightWorld = 134400f
 
static float topWorld = 0f
 
static float bottomWorld = 38400f
 
static int maxTilesX = (int)rightWorld / 16 + 1
 The width of the currently-loaded world in tiles.
 
static int maxTilesY = (int)bottomWorld / 16 + 1
 The height of the currently-loaded world in tiles.
 
const int sectionWidth = 200
 
const int sectionHeight = 150
 
static int maxSectionsX = maxTilesX / 200
 
static int maxSectionsY = maxTilesY / 150
 
const int maxDust = 6000
 
static int maxDustToDraw = 6000
 
const int maxCombatText = 100
 
const int maxItemText = 20
 
const int maxPlayers = 255
 
static int maxNetPlayers = 255
 
static readonly int maxChests = 8000
 
static readonly int maxItems = 400
 
static readonly int maxProjectiles = 1000
 
static readonly int maxNPCs = 200
 
static UIManageControls ManageControlsMenu = new UIManageControls()
 
static UIAchievementsMenu AchievementsMenu = new UIAchievementsMenu()
 
static int maxRain = 750
 
static int slimeWarningTime
 
static int slimeWarningDelay = 420
 
static float slimeRainNPCSlots = 0.65f
 
static bool[] slimeRainNPC = new bool[NPCID.Count]
 
static double slimeRainTime
 
static bool slimeRain
 
static int slimeRainKillCount
 
const int maxGore = 600
 
const int InventoryItemSlotsStart = 0
 
const int InventoryItemSlotsCount = 50
 
const int InventoryCoinSlotsStart = 50
 
const int InventoryCoinSlotsCount = 4
 
const int InventoryAmmoSlotsStart = 54
 
const int InventoryAmmoSlotsCount = 4
 
const int InventorySlotsTotal = 58
 
const int maxLiquidTypes = 15
 
static float cameraX
 
static bool drewLava
 
static float[] liquidAlpha = new float[15]
 
static int waterStyle
 
static int WorldRollingBackupsCountToKeep = 2
 
static float caveParallax = 0.88f
 
static int dungeonX
 
static int dungeonY
 
static Liquid[] liquid = new Liquid[Liquid.maxLiquid]
 
static LiquidBuffer[] liquidBuffer = new LiquidBuffer[50000]
 
static bool dedServ
 
static int spamCount = 0
 
static int curMusic
 
static int dayMusic
 
static int ugMusic
 
static int newMusic
 
static bool showItemText = true
 
static bool autoSave = true
 
static bool validateSaves = true
 
static bool bannerMouseOver
 
static string buffString = ""
 
static string libPath = ""
 
static int lo
 
static int LogoA = 255
 
static int LogoB
 
static bool LogoT
 
static string worldName = ""
 
static int worldID
 
static int background
 
static int caveBackground = 0
 
static float ugBackTransition
 
static Color tileColor
 
static double worldSurface
 The y-coordinate of the top of the dirt layer, in tile coordinates. Corresponds to 0' on the Depth Meter.
 
static double rockLayer
 The y-coordinate of the top of the caverns layer, in tile coordinates.
 
static Color[] teamColor = (Color[])(object)new Color[6]
 
const double dayLength = 54000.0
 
const double nightLength = 32400.0
 
static bool dayTime = true
 
static double time = 13500.0
 The time that has passed since it last became day/night.
Increased by F:Terraria.Main.dayRate every tick.
If it is F:Terraria.Main.dayTime, this caps at F:Terraria.Main.dayLength. Otherwise, this caps at F:Terraria.Main.nightLength.
 
static double timeForVisualEffects
 
static int moonPhase
 
static short sunModY
 
static short moonModY
 
static bool alreadyGrabbingSunOrMoon
 
static bool bloodMoon
 
static bool pumpkinMoon
 
static bool snowMoon
 
static float cloudAlpha
 
static float maxRaining
 
static float oldMaxRaining
 
static double rainTime
 
static bool raining
 
static bool eclipse
 
static float eclipseLight
 
static int checkForSpawns
 
static int helpText
 
static int BartenderHelpTextIndex = 0
 
static bool autoGen
 
static bool autoPause = false
 
static int[] projFrames = new int[ProjectileID.Count]
 Indicates how many frames of animation are in each projectile type spritesheet.
Use F:Terraria.Projectile.frame to animate the projectile.
The Basic Projectile Guideteaches how to animate projectiles.
Indexed by F:Terraria.Projectile.type. Defaults to 1.
 
static bool[] projPet = new bool[ProjectileID.Count]
 
static float demonTorch = 1f
 
static int demonTorchDir = 1
 
static float martianLight = 1f
 
static int martianLightDir = 1
 
static float masterColor = 1f
 
static int masterColorDir = 1
 
static bool placementPreview = true
 
static SceneMetrics SceneMetrics
 
const int maxStars = 400
 
static int numStars
 
const int maxStarTypes = 4
 
const int maxClouds = 200
 
static int weatherCounter
 
static int numClouds = 200
 
static int numCloudsTemp = numClouds
 
static float windSpeedCurrent
 
static float windSpeedTarget
 
static int windCounter
 
static int extremeWindCounter
 
static bool windPhysics = false
 
static float windPhysicsStrength = 0.1f
 
static bool SettingsEnabled_TilesSwayInWind = true
 
static Cloud[] cloud = new Cloud[200]
 
static bool resetClouds = true
 
static float SmoothedMushroomLightInfluence
 
static int fadeCounter
 
static float invAlpha = 1f
 
static float invDir = 1f
 
static UnifiedRandom _rand
 
static bool allChestStackHover
 
static bool inventorySortMouseOver
 
static float GraveyardVisualIntensity
 
const int maxMoons = 9
 
static int moonType = 0
 
const int numTileColors = 32
 
const int numTreeStyles = 32
 
const int numberOfHairstyles = 165
 
const int maxHairStyles = 165
 
const int maxCharSelectHair = 51
 
const int maxHairOfStylistDefault = 123
 
static bool UseExperimentalFeatures
 
static string DefaultSeed = ""
 
static IAudioSystem audioSystem
 
static bool[] musicNoCrossFade = new bool[maxMusic]
 
static float[] musicFade = new float[maxMusic]
 
static float musicVolume = 1f
 
static float ambientVolume = 1f
 
static float soundVolume = 1f
 
static ServerMode MenuServerMode = ServerMode.Lobby | ServerMode.FriendsCanJoin
 
static bool[] tileLighted = new bool[TileID.Count]
 Indexed by T:Terraria.ID.TileID. If true for a given T:Terraria.ID.TileID, then that tile produces light.
You can set the light color for tile using M:Terraria.ModLoader.ModBlockType.ModifyLight(System.Int32,System.Int32,System.Single@,System.Single@,System.Single@) or M:Terraria.ModLoader.GlobalBlockType.ModifyLight(System.Int32,System.Int32,System.Int32,System.Single@,System.Single@,System.Single@).
Defaults to false.
 
static bool[] tileMergeDirt = new bool[TileID.Count]
 Indexed by T:Terraria.ID.TileID. If true for a given T:Terraria.ID.TileID, then that tile has frames for merging with F:Terraria.ID.TileID.Dirt.
Defaults to false.
 
static bool[] tileCut = new bool[TileID.Count]
 If true, Tiles of the indexed Tile Type will be destroyed by weapons and projectiles.
 
static bool[] tileAlch = new bool[TileID.Count]
 
static int[] tileShine = new int[TileID.Count]
 How rarely tiny ambient dust appear from this tile. Larger values mean less frequently.
 
static bool[] tileShine2 = new bool[TileID.Count]
 If true, the tile will be drawn to be slightly more bright.
 
static bool[] wallHouse = new bool[WallID.Count]
 If true, the wall is considered "safe" for enemy spawning purposes.
 
static bool[] wallDungeon = new bool[WallID.Count]
 
static bool[] wallLight = new bool[WallID.Count]
 
static int[] wallBlend = new int[WallID.Count]
 
static bool[] tileStone = new bool[TileID.Count]
 
static bool[] tileAxe = new bool[TileID.Count]
 If true for the given tile type, tiles of the type are mined using an axe instead of pickaxe.
 
static bool[] tileHammer = new bool[TileID.Count]
 
static bool[] tileWaterDeath = new bool[TileID.Count]
 If true for the given tile type, tiles of the type will be destroyed if in contact with water. P:Terraria.ObjectData.TileObjectData.WaterDeath supersedes this if a T:Terraria.ObjectData.TileObjectData is available.
 
static bool[] tileLavaDeath = new bool[TileID.Count]
 If true for the given tile type, tiles of the type will be destroyed if in contact with lava. P:Terraria.ObjectData.TileObjectData.LavaDeath supersedes this if a T:Terraria.ObjectData.TileObjectData is available. Use F:Terraria.Main.tileObsidianKill instead if the tile should only be killed by obsidian forming over it.
 
static bool[] tileTable = new bool[TileID.Count]
 
static bool[] tileBlockLight = new bool[TileID.Count]
 
static bool[] tileNoSunLight = new bool[TileID.Count]
 
static bool[] tileDungeon = new bool[TileID.Count]
 
static bool[] tileSpelunker = new bool[TileID.Count]
 If true for the given tile type, tiles will be drawn much brighter and give off additional dust if the player is under the effects of the Spelunker buff, magic lantern, or similar effect.
 
static bool[] tileSolidTop = new bool[TileID.Count]
 
static bool[] tileSolid = new bool[TileID.Count]
 
static bool[] tileBouncy = new bool[TileID.Count]
 
static short[] tileOreFinderPriority = new short[TileID.Count]
 The priority of this tile in relation to the Metal Detector. The tile with the highest priority in range will show the corresponding map entry. The Metal Detector wiki pagelists existing values to use as reference.
 
static byte[] tileLargeFrames = new byte[TileID.Count]
 
static byte[] wallLargeFrames = new byte[WallID.Count]
 
static bool[] tileRope = new bool[TileID.Count]
 
static bool[] tileBrick = new bool[TileID.Count]
 
static bool[] tileMoss = new bool[TileID.Count]
 
static bool[] tileNoAttach = new bool[TileID.Count]
 
static bool[] tileNoFail = new bool[TileID.Count]
 
static bool[] tileCracked = new bool[TileID.Count]
 
static bool[] tileObsidianKill = new bool[TileID.Count]
 If true for the given tile type, tiles of the type will be destroyed if obsidian would generate at it's location because of lava and water mixing. Automatically set to true if F:Terraria.Main.tileLavaDeath is true. Many tiles are immune to lava but break if obsidian kills it, such as Statues and Anvils.
 
static bool[] tileFrameImportant = new bool[TileID.Count]
 Set to true if this is not a typical Terrain tile. Terrain tiles are 1x1 tiles that automatically adjust their frame values to nearby tiles. They don't have a TileObjectData.
All non-1x1 tiles should set this to true. All 1x1 tiles that have a TileObjectData or that should preserve frame data should set this to true.
 
static bool[] tilePile = new bool[TileID.Count]
 
static bool[] tileBlendAll = new bool[TileID.Count]
 
static short[] tileGlowMask = new short[TileID.Count]
 
static bool[] tileContainer = new bool[TileID.Count]
 
static bool[] tileSign = new bool[TileID.Count]
 
static bool[][] tileMerge = new bool[TileID.Count][]
 
static int cageFrames = 25
 
static bool critterCage
 
static int[] bunnyCageFrame = new int[cageFrames]
 
static int[] bunnyCageFrameCounter = new int[cageFrames]
 
static int[] squirrelCageFrame = new int[cageFrames]
 
static int[] squirrelCageFrameCounter = new int[cageFrames]
 
static int[] squirrelCageFrameOrange = new int[cageFrames]
 
static int[] squirrelCageFrameCounterOrange = new int[cageFrames]
 
static int[] mallardCageFrame = new int[cageFrames]
 
static int[] mallardCageFrameCounter = new int[cageFrames]
 
static int[] duckCageFrame = new int[cageFrames]
 
static int[] duckCageFrameCounter = new int[cageFrames]
 
static int[] grebeCageFrame = new int[cageFrames]
 
static int[] grebeCageFrameCounter = new int[cageFrames]
 
static int[] seagullCageFrame = new int[cageFrames]
 
static int[] seagullCageFrameCounter = new int[cageFrames]
 
static int[] birdCageFrame = new int[cageFrames]
 
static int[] birdCageFrameCounter = new int[cageFrames]
 
static int[] redBirdCageFrame = new int[cageFrames]
 
static int[] redBirdCageFrameCounter = new int[cageFrames]
 
static int[] blueBirdCageFrame = new int[cageFrames]
 
static int[] blueBirdCageFrameCounter = new int[cageFrames]
 
static int[] macawCageFrame = new int[cageFrames]
 
static int[] macawCageFrameCounter = new int[cageFrames]
 
static byte[,] butterflyCageMode = new byte[9, cageFrames]
 
static int[,] butterflyCageFrame = new int[9, cageFrames]
 
static int[,] butterflyCageFrameCounter = new int[9, cageFrames]
 
static int[,] dragonflyJarFrameCounter = new int[7, cageFrames]
 
static int[,] dragonflyJarFrame = new int[7, cageFrames]
 
static int[,] scorpionCageFrame = new int[2, cageFrames]
 
static int[,] scorpionCageFrameCounter = new int[2, cageFrames]
 
static int[] snailCageFrame = new int[cageFrames]
 
static int[] snailCageFrameCounter = new int[cageFrames]
 
static int[] snail2CageFrame = new int[cageFrames]
 
static int[] snail2CageFrameCounter = new int[cageFrames]
 
static byte[] fishBowlFrameMode = new byte[cageFrames]
 
static int[] fishBowlFrame = new int[cageFrames]
 
static int[] fishBowlFrameCounter = new int[cageFrames]
 
static int[] lavaFishBowlFrame = new int[cageFrames]
 
static int[] lavaFishBowlFrameCounter = new int[cageFrames]
 
static int[] frogCageFrame = new int[cageFrames]
 
static int[] frogCageFrameCounter = new int[cageFrames]
 
static int[] mouseCageFrame = new int[cageFrames]
 
static int[] mouseCageFrameCounter = new int[cageFrames]
 
static int[] turtleCageFrame = new int[cageFrames]
 
static int[] turtleCageFrameCounter = new int[cageFrames]
 
static int[] fairyJarFrame = new int[cageFrames]
 
static int[] fairyJarFrameCounter = new int[cageFrames]
 
static byte[,] jellyfishCageMode = new byte[3, cageFrames]
 
static int[,] jellyfishCageFrame = new int[3, cageFrames]
 
static int[,] jellyfishCageFrameCounter = new int[3, cageFrames]
 
static int[] wormCageFrame = new int[cageFrames]
 
static int[] wormCageFrameCounter = new int[cageFrames]
 
static int[] maggotCageFrame = new int[cageFrames]
 
static int[] maggotCageFrameCounter = new int[cageFrames]
 
static int[] ratCageFrame = new int[cageFrames]
 
static int[] ratCageFrameCounter = new int[cageFrames]
 
static int[] ladybugCageFrame = new int[cageFrames]
 
static int[] ladybugCageFrameCounter = new int[cageFrames]
 
static int[] penguinCageFrame = new int[cageFrames]
 
static int[] penguinCageFrameCounter = new int[cageFrames]
 
static int[] waterStriderCageFrame = new int[cageFrames]
 
static int[] waterStriderCageFrameCounter = new int[cageFrames]
 
static int[] seahorseCageFrame = new int[cageFrames]
 
static int[] seahorseCageFrameCounter = new int[cageFrames]
 
static int[,] slugCageFrame = new int[3, cageFrames]
 
static int[,] slugCageFrameCounter = new int[3, cageFrames]
 
static int[] owlCageFrame = new int[cageFrames]
 
static int[] owlCageFrameCounter = new int[cageFrames]
 
static int[] grasshopperCageFrame = new int[cageFrames]
 
static int[] grasshopperCageFrameCounter = new int[cageFrames]
 
static bool[] tileSand = new bool[TileID.Count]
 
static bool[] tileFlame = new bool[TileID.Count]
 If true, indicates that a tile has a flame texture that will draw over the tile. Modded tiles should not use this. M:Terraria.ModLoader.ModBlockType.PostDraw(System.Int32,System.Int32,Microsoft.Xna.Framework.Graphics.SpriteBatch) can be used to manually draw a flame texture.
 
static bool[] npcCatchable = new bool[NPCID.Count]
 Used to denote an NPC as being catchable by bug nets and similar.
Contrary to its name, this array isn't actually used for catching logic at all.
It is instead used to determine if an NPC can be released back into the world after being caught.
These NPC will be forced F:Terraria.NPC.friendly for 1.5 seconds if naturally spawned.

 
static int[] tileFrame = new int[TileID.Count]
 
static int[] tileFrameCounter = new int[TileID.Count]
 
static byte[] wallFrame = new byte[WallID.Count]
 
static byte[] wallFrameCounter = new byte[WallID.Count]
 
static int[] backgroundWidth = new int[maxBackgrounds]
 
static int[] backgroundHeight = new int[maxBackgrounds]
 
static HairstyleUnlocksHelper Hairstyles = new HairstyleUnlocksHelper()
 
static bool tilesLoaded = false
 
static WorldMap Map
 
static Tilemap tile = new Tilemap((ushort)maxTilesX, (ushort)maxTilesY)
 
static Dust[] dust = new Dust[6001]
 
static Star[] star = new Star[400]
 
static Item[] item = new Item[401]
 
static int[] timeItemSlotCannotBeReusedFor = new int[401]
 
static NPC[] npc = new NPC[201]
 
static Gore[] gore = new Gore[601]
 
static Rain[] rain = new Rain[maxRain + 1]
 
static Projectile[] projectile = new Projectile[1001]
 
static int[,] projectileIdentity = new int[256, 1001]
 
static CombatText[] combatText = new CombatText[100]
 
static PopupText[] popupText = new PopupText[20]
 
static Chest[] chest = new Chest[8000]
 
static Sign[] sign = new Sign[1000]
 
static int[] itemFrame = new int[401]
 
static int[] itemFrameCounter = new int[401]
 
static DrawAnimation[] itemAnimations = new DrawAnimation[ItemID.Count]
 
static List< int > itemAnimationsRegistered = new List<int>()
 
static Vector2 screenPosition
 The position of the top left corner of the screen in world coordinates. Modify in M:Terraria.ModLoader.ModSystem.ModifyScreenPosition or M:Terraria.ModLoader.ModPlayer.ModifyScreenPosition. Also consider using Main.instance.CameraModifiers.Add(CameraModifier); as shown in ExampleMods MinionBossBody for screen shakes.

When manually drawing, subtracting Main.screenPosition from the world position of the thing being drawn will result in the correct screen coordinates for use in T:Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw methods. When drawing tiles or walls, an additional offset calculated as Vector2 zero = Main.drawToScreen? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); needs to be added to the coordinates.
 
static Vector2 screenLastPosition
 
static int screenWidth = 1152
 
static int screenHeight = 864
 
static bool screenMaximized = true
 
static bool screenBorderless = true
 
static int screenBorderlessPendingResizes
 
static int teamNamePlateDistance = 2000
 
static int multiplayerNPCSmoothingRange = 300
 
static bool Setting_UseReducedMaxLiquids = false
 
static int PlayerOverheadChatMessageDisplayTime = 400
 
static object CurrentInputTextTakerOverride
 
static bool drawingPlayerChat
 
static bool chatRelease
 
static string chatText = ""
 
static bool inputTextEnter
 
static bool inputTextEscape
 
static float[] hotbarScale = new float[10] { 1f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }
 
static byte mouseTextColor
 A value that oscillates between 190 and 255. It is used to drive the slight pulsing color effect seen in much of the text shown in-game. The value is used to create T:Microsoft.Xna.Framework.Colors by passing in this value as either all 4 parameters or just the alpha parameter.

P:Terraria.Main.MouseTextColorReal can be used to access the typical pulsing white T:Microsoft.Xna.Framework.Color value.
 
static int mouseTextColorChange = 1
 
static bool mouseLeftRelease
 
static bool mouseRightRelease
 
static bool playerInventory
 
static int stackSplit
 
static bool preventStackSplitReset
 
static int stackCounter
 
static int timesTriedToFastStack
 
static int stackDelay = 7
 
static int superFastStack
 
static Item mouseItem = new Item()
 
static Item guideItem = new Item()
 
static Item reforgeItem = new Item()
 
static float inventoryScale = 0.75f
 
static bool hasFocus
 
static Point rulerLineDisplayValues = default(Point)
 
static bool recFastScroll
 
static bool recBigList
 
static int recStart
 
static Recipe[] recipe = new Recipe[Recipe.maxRecipes]
 
static int[] availableRecipe = new int[Recipe.maxRecipes]
 
static float[] availableRecipeY = new float[Recipe.maxRecipes]
 
static int numAvailableRecipes
 
static int focusRecipe
 
static int myPlayer
 The index in F:Terraria.Main.player of this client's Player.
If this is 255, this client is the server.
 
static Player[] player = new Player[256]
 
static Player[] playerVisualClone = new Player[256]
 
static bool[] countsAsHostForGameplay = new bool[256]
 
static int spawnTileX
 
static int spawnTileY
 
static bool npcChatRelease
 
static bool editSign
 
static bool editChest
 
static bool blockInput = false
 
static string blockKey
 
static string defaultChestName
 
static string npcChatText
 
static bool npcChatFocus1
 
static bool npcChatFocus2
 
static bool npcChatFocus3
 
static bool npcChatFocus4
 
static int oldNPCShop
 
static int npcChatCornerItem
 
static ItemShopSellbackHelper shopSellbackHelper
 
static int[] travelShop
 
static List< string > anglerWhoFinishedToday
 
static bool anglerQuestFinished
 
static int anglerQuest
 
static int[] anglerQuestItemNetIDs
 
static AmbienceServer AmbienceServer
 
static ItemDropDatabase ItemDropsDB
 
static BestiaryDatabase BestiaryDB
 
static ItemDropResolver ItemDropSolver
 
static BestiaryUnlocksTracker BestiaryTracker
 
static UIBestiaryTest BestiaryUI
 
static TeleportPylonsSystem PylonSystem
 
static ShopHelper ShopHelper
 
static GolfState LocalGolfState
 
static DroneCameraTracker DroneCameraTracker
 
static WorkshopPublishingIndicator WorkshopPublishingIndicator
 
static IssueReportsIndicator IssueReporterIndicator
 
static bool Support4K
 
static float MinimumZoomComparerX
 
static float MinimumZoomComparerY
 
static int LogicCheckScreenWidth
 
static int LogicCheckScreenHeight
 
static float temporaryGUIScaleSlider
 
static bool temporaryGUIScaleSliderUpdate
 
static bool InGuideCraftMenu
 
static bool InReforgeMenu
 
static Item HoverItem
 
static string motd
 
static bool toggleFullscreen
 
static int numDisplayModes
 
static int[] displayWidth
 
static int[] displayHeight
 
static bool gameMenu
 
static bool menuBGChangedDay
 
static bool menuBGChangedNight
 
static bool lockMenuBGChange
 
static List< PlayerFileDataPlayerList
 
static PlayerFileData ActivePlayerFileData
 
static Player PendingPlayer
 
static List< WorldFileDataWorldList
 
static WorldFileData ActiveWorldFileData
 
static string WorldPath
 
static string CloudWorldPath
 
static string PlayerPath
 
static string CloudPlayerPath
 
static Preferences Configuration
 
static Preferences InputProfiles
 
static KeyboardState inputText
 
static KeyboardState oldInputText
 
static int PendingResolutionWidth
 
static int PendingResolutionHeight
 
static bool PendingBorderlessState
 
static int invasionType
 
static double invasionX
 
static int invasionSize
 
static int invasionDelay
 
static int invasionWarn
 
static int invasionSizeStart
 
static bool invasionProgressNearInvasion
 
static int invasionProgressMode
 
static int invasionProgressIcon
 
static int invasionProgress
 
static int invasionProgressMax
 
static int invasionProgressWave
 
static int invasionProgressDisplayLeft
 
static float invasionProgressAlpha
 
static bool HasInteractibleObjectThatIsNotATile
 
static int[] npcFrameCount
 
static Dictionary< int, byte > npcLifeBytes
 
static bool mouseExit
 
static float exitScale
 
static bool mouseReforge
 
static float reforgeScale
 
static Player clientPlayer
 Used internally for network syncing. Use P:Terraria.Main.LocalPlayer to access the player for the local user.
 
static string getIP
 
static string getPort
 
static bool menuMultiplayer
 
static bool menuServer
 
static int netMode
 Denotes the current network mode: 0 for single player client, 1 for multiplayer client, and 2 for server.
Using T:Terraria.ID.NetmodeID entries instead of 0, 1, and 2 will greatly enhance code readability.
Modders must properly use netMode to selectively run code. Following examples in ExampleMod and Terraria code as well as reading the Basic Netcode guideare the best way to learn how to use netMode correctly.

 
const int MaxTimeout = 120
 
static int netPlayCounter
 
static int lastNPCUpdate
 
static int lastItemUpdate
 
static int maxNPCUpdates
 
static int maxItemUpdates
 
static string cUp
 
static string cLeft
 
static string cDown
 
static string cRight
 
static string cJump
 
static string cThrowItem
 
static string cHeal
 
static string cMana
 
static string cBuff
 
static string cHook
 
static string cTorch
 
static string cInv
 
static string cSmart
 
static string cMount
 
static string cFavoriteKey
 
static bool cSmartCursorModeIsToggleAndNotHold
 
static bool SmartCursorWanted_Mouse
 
static bool SmartCursorWanted_GamePad
 
static bool SmartCursorShowing
 
static int SmartCursorX
 
static int SmartCursorY
 
static bool SmartInteractShowingGenuine
 
static bool SmartInteractShowingFake
 
static int SmartInteractX
 
static int SmartInteractY
 
static int SmartInteractNPC
 
static int SmartInteractProj
 
static bool SmartInteractPotionOfReturn
 
static List< Point > SmartInteractTileCoords
 
static List< Point > SmartInteractTileCoordsSelected
 
static int TileInteractionLX
 
static int TileInteractionLY
 
static int TileInteractionHX
 
static int TileInteractionHY
 
static int cursorOverride
 
static int signHover
 
static string cMapZoomIn
 
static string cMapZoomOut
 
static string cMapAlphaUp
 
static string cMapAlphaDown
 
static string cMapFull
 
static string cMapStyle
 
static Keys FavoriteKey
 
static ColorSlidersSet mouseColorSlider
 
static ColorSlidersSet mouseBorderColorSlider
 
static Color mouseColor
 
static Color cursorColor
 
static int cursorColorDirection
 
static float cursorAlpha
 
static float cursorScale
 
static bool signBubble
 
static int signX
 
static int signY
 
static bool hideUI
 
static bool releaseUI
 
static FrameSkipMode FrameSkipMode
 
static bool terrariasFixedTiming
 
static ParticleRenderer ParticleSystem_World_OverPlayers
 
static ParticleRenderer ParticleSystem_World_BehindPlayers
 
static AnchoredEntitiesCollection sittingManager
 
static AnchoredEntitiesCollection sleepingManager
 
static MinimapFrameManager MinimapFrameManagerInstance
 
static PlayerResourceSetsManager ResourceSetsManager
 
static bool IsInTheMiddleOfLoadingSettings
 
static Point LastLoadedResolution
 
static bool startFullscreen
 
static string oldStatusText
 
static string autoGenFileLocation
 
static bool autoShutdown
 
static bool fastForwardTimeToDawn
 
static int sundialCooldown
 
static bool fastForwardTimeToDusk
 
static int moondialCooldown
 
static GeneralIssueReporter IssueReporter
 
static bool PreventUpdatingTargets
 
static bool _shouldUseWindyDayMusic
 
static bool _shouldUseStormMusic
 
static float ambientWaterfallX
 
static float ambientWaterfallY
 
static float ambientWaterfallStrength
 
static float ambientLavafallX
 
static float ambientLavafallY
 
static float ambientLavafallStrength
 
static float ambientLavaX
 
static float ambientLavaY
 
static float ambientLavaStrength
 
static int ambientCounter
 
static IChatMonitor chatMonitor
 
static int ProjectileUpdateLoopIndex
 
static GameTipsDisplay gameTips
 
static int weatherVaneBobframe
 
static int selectedPlayer
 
static int selectedWorld
 
static int menuMode
 
static int menuSkip
 
static Item tooltipPrefixComparisonItem
 
static string newWorldName
 
static int[] specX
 
static int[] specY
 
static bool HoveringOverAnNPC
 
static string hoverItemName
 
static Color inventoryBack
 
static bool mouseText
 
static int rare
 
static int hairStart
 
static int selClothes
 
static int interactedDresserTopLeftX
 
static int interactedDresserTopLeftY
 
static Player dresserInterfaceDummy
 
static GameTime _drawInterfaceGameTime
 
static Color selColor
 
static int focusColor
 
static int colorDelay
 
static int setKey
 
static int bgScroll
 
static bool autoPass
 
static int menuFocus
 
static float hBar
 
static float sBar
 
static float lBar
 
static float aBar
 
static bool blockMouse
 
static float GamepadCursorAlpha
 
static float MenuXMovement
 
static float InitialMapScale
 
static float MapScale
 
static bool cancelWormHole
 
static float lightning
 
static int thunderDistance
 
static float atmo
 
static Color ColorOfTheSkies
 
static List< INeedRenderTargetContentContentThatNeedsRenderTargets
 
static bool starGame
 
static int starsHit
 
static double ladyBugRainBoost
 
static int DefaultDamageVariationPercent
 
static int soundError
 
static int ambientError
 
static bool mouseMiddle
 
static bool mouseXButton1
 
static bool mouseXButton2
 
static bool mouseMiddleRelease
 
static bool mouseXButton1Release
 
static bool mouseXButton2Release
 
static Point16 trashSlotOffset
 
static bool hidePlayerCraftingMenu
 
static bool showServerConsole
 
static bool Support8K
 
static double desiredWorldEventsUpdateRate
 
static int worldEventUpdates
 Representation that dictates the actual amount of "world event updates" that happen in a given GAME tick. This number increases/decreases in direct tandem with

See also
F:Terraria.Main.desiredWorldEventsUpdateRate

.

 
static List< TitleLinkButtontModLoaderTitleLinks
 

Protected Member Functions

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

Protected Attributes

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

Package Functions

void DrawLiquid (bool bg=false, int waterStyle=0, float Alpha=1f, bool drawSinglePassLiquids=true)
 
void InitTMLContentManager ()
 

Static Package Functions

static void SetupAllBlockMerge ()
 
static void Initialize_BuffDataFromMountData ()
 
static void OnceFailedLoadingAnAsset (string assetPath, Exception e)
 
static void UpdateCreativeGameModeOverride ()
 
static bool IsTileSpelunkable (int tileX, int tileY, Tile t)
 
static bool IsTileSpelunkable (int tileX, int tileY, ushort typeCache, short tileFrameX, short tileFrameY)
 
static bool IsTileBiomeSightable (int tileX, int tileY, Tile t, ref Color sightColor)
 
static bool IsTileBiomeSightable (int tileX, int tileY, ushort type, short tileFrameX, short tileFrameY, ref Color sightColor)
 

Package Attributes

double bgParallax
 
int bgStartX
 
int bgLoops
 
int bgTopY
 
int[] _npcIndexWhoHoldsHeadIndex = new int[NPCHeadID.Count]
 
float screenOff
 
float scAdj
 

Static Package Attributes

const int BG_STYLES_COUNT = 14
 
static UICharacterSelect _characterSelectMenu = new UICharacterSelect()
 
static UIWorldSelect _worldSelectMenu = new UIWorldSelect()
 
static float bgScale
 
static int bgWidthScaled
 
static Color ColorOfSurfaceBackgroundsBase
 
static Color ColorOfSurfaceBackgroundsModified
 

Properties

static string statusText [get, set]
 
static UnifiedRandom rand [get, set]
 
static bool CanUpdateGameplay [get, private set]
 
static Vector2 ViewPosition [get]
 
static Vector2 ViewSize [get]
 
static Matrix CurrentWantedZoomMatrix [get]
 
static Matrix UIScaleMatrix [get]
 
static float UIScaleWanted [get]
 
static float UIScale [get, set]
 
float UIScaleMax [get]
 
static bool RenderTargetsRequired [get]
 
static bool IsItRaining [get]
 
static bool ThickMouse [get]
 
static bool GamepadDisableCursorItemIcon [get]
 
static string SavePath [get]
 
static GameModeData GameModeInfo [get]
 
static int GameMode [get, set]
 
static bool specialSeedWorld [get]
 
static bool masterMode [get]
 
static bool expertMode [get]
 
static AchievementManager Achievements [get]
 
static AchievementAdvisor AchievementAdvisor [get]
 
static ulong UnpausedUpdateSeed [get, private set]
 
static Effect screenShader [get]
 
static Effect pixelShader [get]
 
static Effect vertexPixelShader [get]
 
static Effect tileShader [get]
 
static Matrix Transform [get]
 
static Vector2 MouseScreen [get]
 Fetches the position of the mouse cursor on the screen.
Useful for making things visually happen near the cursor.

 
static Vector2 MouseWorld [get]
 Fetches the position of the mouse cursor in the world.
Useful for making things functionally happen near the cursor, such as projectile or NPC spawns.

 
static INetDiagnosticsUI ActiveNetDiagnosticsUI [get]
 
static uint GameUpdateCount [get]
 
static SamplerState DefaultSamplerState [get]
 
static int UnderworldLayer [get]
 The y-coordinate of the top of the underworld, in tile coordinates.
 
static float WindForVisuals [get]
 
static Player LocalPlayer [get]
 Retrieves the T:Terraria.Player object for the local user. Shorthand for F:Terraria.Main.player[F:Terraria.Main.myPlayer].
Many gameplay elements such as recipes, UI, TownNPC chat, and Biome logic are only executed locally, P:Terraria.Main.LocalPlayer is suitable for code relating to those situations. If the hook has a T:Terraria.Player parameter, it is likely not suitable to use P:Terraria.Main.LocalPlayer in it.
 
static CreativeUnlocksTracker LocalPlayerCreativeTracker [get]
 
static int npcShop [get, set]
 
static string playerPathName [get]
 
static string worldPathName [get]
 
static bool SmartCursorWanted [get]
 
static bool SmartCursorIsUsed [get]
 
static bool HasSmartInteractTarget [get]
 
static bool IsItAHappyWindyDay [get]
 
static bool IsItStorming [get]
 
static bool WindyEnoughForKiteDrops [get]
 
static bool ShouldPVPDraw [get]
 
int RecommendedEquipmentAreaPushUp [get]
 
static bool ShouldDrawInfoIconsHorizontally [get]
 
static bool CanShowInfoAccs [get]
 
static Point ScreenSize [get]
 
static bool IsGraphicsDeviceAvailable [get]
 
static Color DiscoColor [get]
 A color that cycles through the colors like Rainbow Brick does.
 
static Color MouseTextColorReal [get]
 The typical pulsing white color used for much of the text shown in-game.
 
static bool PlayerLoaded [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)
 

Events

static Action OnEnginePreload
 
static Action< Vector2 > OnResolutionChanged
 
static Action OnEngineLoad
 
static Action OnTickForThirdPartySoftwareOnly
 
static Action OnTickForInternalCodeOnly
 
static Action< GameTimeOnPreDraw
 
static Action< GameTimeOnPostDraw
 
static Action< Vector2, float > OnPostFullscreenMapDraw
 
static Action OnRenderTargetsReleased
 
static ResolutionChangeEvent OnRenderTargetsInitialized
 

Private Member Functions

static int RemoveMenu (IntPtr hMenu, int nPosition, int wFlags)
 
static IntPtr GetSystemMenu (IntPtr hWnd, bool bRevert)
 
static int GetMenuItemCount (IntPtr hWnd)
 
static bool ShowWindow (IntPtr hWnd, int nCmdShow)
 
void DedServ_PostModLoad (out bool reloadMods)
 
void BindSettingsTo (Preferences preferences)
 
void LoadResourcePacks (Preferences prefs)
 
void SaveResourcePacks (Preferences prefs)
 
void Initialize_AlmostEverything ()
 
void Initialize_Entities ()
 
void ClientInitialize ()
 
void TickLoadProcess ()
 
IEnumerator LoadMusic_InSteps ()
 
void UpdateAudio_DecideOnTOWMusic ()
 
void UpdateAudio_DecideOnNewMusic ()
 
void UpdateWindyDayState ()
 
void DoDebugFunctions ()
 
void PreUpdateAllProjectiles ()
 
void PostUpdateAllProjectiles ()
 
void DoUpdateInWorld (Stopwatch sw)
 
void DoUpdate_HandleInput ()
 
void DoUpdate_AnimateWaterfalls ()
 
void DoUpdate_AnimateDiscoRGB ()
 
void MouseTextInner (MouseTextCache info)
 
void MouseText_DrawItemTooltip (MouseTextCache info, int rare, byte diff, int X, int Y)
 
void MouseText_DrawBuffTooltip (string buffString, ref int X, ref int Y, int buffNameHeight)
 
void DrawTileEntities (bool solidLayer, bool overRenderTargets, bool intoRenderTargets)
 
void RefreshPlayerDrawOrder ()
 
void DrawNPCDirect_Inner (SpriteBatch mySpriteBatch, NPC rCurrentNPC, bool behindTiles, Vector2 screenPos, ref Color npcColor)
 
void DrawProj_LightsBane (Projectile proj)
 
void DrawProj_NightsEdge (Projectile proj)
 
void DrawProj_Excalibur (Projectile proj)
 
void DrawProj_TheHorsemansBlade (Projectile proj)
 
void DrawProj_TrueExcalibur (Projectile proj)
 
void DrawProj_TrueNightsEdge (Projectile proj)
 
void DrawProj_TerraBlade2 (Projectile proj)
 
void DrawProj_TerraBlade2Shot (Projectile proj)
 
void DrawContinuousTrail (Projectile proj)
 
void DrawProj_DrawVoidLens (Projectile proj, ref bool earlyReturn)
 
void DrawProj_Inner (Projectile proj)
 
void DrawProj_DrawYoyoString (Projectile proj, Vector2 mountedCenter)
 
void DrawProj_DrawSpecialProjs (Projectile proj, ref bool earlyReturn)
 
void DrawProj_DrawExtras (Projectile proj, Vector2 mountedCenter, ref float polePosX, ref float polePosY)
 
void DrawProj_Inner_DoDrawProj (Projectile proj, Vector2 mountedCenter, float polePosX, float polePosY)
 
void DrawProj_DrawNormalProjs (Projectile proj, float polePosX, float polePosY, Vector2 mountedCenter, ref Color projectileColor)
 
void DrawProj_StardustGuardianPunching (Projectile proj)
 
void DrawProj_PiercingStarlight (Projectile proj)
 
void DrawProj_FairyQueenLance (Projectile proj)
 
void DrawProj_FairyQueenRangedItemShot (Projectile proj)
 
void DrawProj_EmpressBlade (Projectile proj, float hueOverride)
 
void DrawProj_CoolWhipMinion (Projectile proj)
 
void DrawMurderAurora (Projectile proj)
 
void DrawWhip (Projectile proj)
 
void DrawTwinsPet (Projectile proj)
 
void DrawMultisegmentPet (Projectile proj)
 
void DrawKite (Projectile proj)
 
void DrawProjWithStarryTrail (Projectile proj, Color projectileColor, SpriteEffects dir)
 
void SortBabyBirdProjectiles (List< int > list)
 
void SortStardustDragonProjectiles (List< int > list)
 
void DrawItem_GetBasics (Item item, int slot, out Texture2D texture, out Rectangle frame, out Rectangle glowmaskFrame)
 
void DrawItem_AnimateSlot (int slot, int gameFramesPerSpriteFrame, int spriteFramesAmount)
 
void OpenShop (int shopIndex)
 
int NPCBannerSorter (int npcIndex1, int npcIndex2)
 
void DrawNPCHousesInUI ()
 
void DrawHotbarLockIcon (int pivotTopLeftX, int pivotTopLeftY, bool pushSideToolsUp)
 
void HoverOverNPCs (Rectangle mouseRectangle)
 
void DrawInterface_Tests ()
 
void SetupDrawInterfaceLayers ()
 
void DrawInterface_40_InteractItemIcon ()
 
bool TryGetAmmo (Item sourceItem, out Item ammoItem, out Color ammoColor, out float ammoScale, out Vector2 ammoOffset)
 
void DrawInterface_39_MouseOver ()
 
void DrawInterface_38_MouseCarriedObject ()
 
void DrawInterface_34_PlayerChat ()
 
void DrawInterface_33_MouseText ()
 
void DrawInterface_InstrumentMouseText ()
 
void DrawInterface_31_BuilderAccToggles ()
 
void DrawInterface_28_InfoAccs ()
 
void HackForGamepadInputHell ()
 
void DrawInterface_27_Inventory ()
 
void DrawInterface_25_ResourceBars ()
 
void DrawInterface_23_NPCSignsDialog ()
 
void DrawInterface_22_DresserWindow ()
 
void DrawInterface_21_HairWindow ()
 
void DrawInterface_16_MapOrMinimap ()
 
void DrawInterface_14_EntityHealthBars ()
 
void DrawInterface_Healthbar_Worm (NPC head, int tailID, float scale)
 
bool DrawInterface_11_IngameOptionsMenu ()
 
void DrawInterface_7_TownNPCHouseBanners ()
 
void DrawInterface_30_Hotbar ()
 
void DrawInfoAccs ()
 
void DrawInfoAccs_AdjustInfoTextColorsForNPC (NPC npc, ref Color infoTextColor, ref Color infoTextShadowColor)
 
void DrawBuilderAccToggles (Vector2 start)
 
void Main_Exiting (object sender, EventArgs e)
 
void OnCharacterNamed (string text)
 
void OnSeedSelected (string text)
 
void OnWorldNamed (string text)
 
string SanitizePathArgument (string argumentName, string argumentPath)
 
void OnSubmitServerPassword (string passwordCandidate)
 
void OnSubmitServerPassword ()
 
void PreDrawMenu (out Point screenSizeCache, out Point screenSizeCacheAfterScaling)
 
void DrawSplash_LoadingFlower (Color splashColor)
 
void DrawSplash_LoadingStar (Color splashColor)
 
void DrawMiscMapIcons (SpriteBatch spriteBatch, Vector2 mapTopLeft, Vector2 mapX2Y2AndOff, Rectangle? mapRect, float mapScale, float drawScale, ref string mouseTextString)
 
void DrawMapIcons_PotionOfReturnAppearAfterUsePosition (SpriteBatch spriteBatch, Vector2 mapTopLeft, Vector2 mapX2Y2AndOff, Rectangle? mapRect, float mapScale, float drawScale, ref string mouseTextString)
 
void DrawMapIcons_PotionOfReturnHomePosition (SpriteBatch spriteBatch, Vector2 mapTopLeft, Vector2 mapX2Y2AndOff, Rectangle? mapRect, float mapScale, float drawScale, ref string mouseTextString)
 
void DrawMapIcons_LastGolfballHit (SpriteBatch spriteBatch, Vector2 mapTopLeft, Vector2 mapX2Y2AndOff, Rectangle? mapRect, float mapScale, float drawScale, ref string mouseTextString)
 
void DrawWaters (bool isBackground=false)
 
void DrawSurfaceBG_DrawBackMountainsLayer (int bgTextureIndex)
 
int DrawSurfaceBG_GetLayerYOffset (int bgTextureIndex)
 
float GetForestToForestBackgroundLerperValue ()
 
void DrawSurfaceBG_BackMountainsStep1 (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack)
 
void DrawSurfaceBG_BackMountainsStep2 (int pushBGTopHack)
 
void UpdateOceanWaterLineForAmbience ()
 
void DrawSurfaceBG_Mushroom (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
void DrawSurfaceBG_Crimson (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
void DrawSurfaceBG_Snow (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
void SetBackgroundOffsets (int backgroundID, double backgroundTopMagicNumber, int pushBGTopHack)
 
void DrawSurfaceBG_Hallow (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
void DrawSurfaceBG_GoodEvilDesert (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack)
 
void DrawSurfaceBG_Jungle (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
void DrawSurfaceBG_Desert (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
void DrawSurfaceBG_DrawChangeOverlay (int backgroundAreaId)
 
void DrawSurfaceBG_Corrupt (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
Rectangle? GetBackgroundRect (int backgroundTextureIndex)
 
uint GetBackgroundCounter ()
 
void DrawSurfaceBG_Forest (double backgroundTopMagicNumber, float bgGlobalScaleMultiplier, int pushBGTopHack, int[] bgTexIndexes)
 
void DrawBackgroundBlackFill ()
 
void GraphicsDeviceLost (object sender, EventArgs evt)
 
void Draw_Inner (GameTime gameTime)
 
void DoDraw (GameTime gameTime)
 
void DrawSunAndMoon (SceneArea sceneArea, Color moonColor, Color sunColor, float tempMushroomInfluence)
 
void DrawStarsInBackground (SceneArea sceneArea, bool artificial)
 
void DrawStarsInForeground (SceneArea sceneArea)
 
void DrawStar (ref SceneArea sceneArea, float starOpacity, Color bgColorForStars, int i, Star theStar, bool artificial, bool foreground=false)
 
void Debug_PrettifyMap ()
 
void DrawPlayerChatBubbles ()
 
void DrawRainInMenu ()
 
void DoDraw_WallsTilesNPCs ()
 
void DoDraw_Waterfalls ()
 
void DoDraw_Tiles_Solid ()
 
void DoDraw_Tiles_NonSolid ()
 
void DoDraw_DrawNPCsOverTiles ()
 
void DoDraw_DrawNPCsBehindTiles ()
 
void DrawBackGore ()
 
void DoDraw_WallsAndBlacks ()
 
void DoLightTiles ()
 
void DrawBG ()
 
void UpdateBGVisibility_FrontLayer (int? targetBiomeOverride, float? transitionAmountOverride)
 
void UpdateBGVisibility_BackLayer (int? targetBiomeOverride, float? transitionAmountOverride)
 
void DrawBG_ModifyBGFarBackLayerAlpha (int desiredBG, int? desiredBG2=null, float? transitionAmountOverride=null)
 
void DrawBuilderAccToggles_Inner (Vector2 start)
 

Static Private Member Functions

static int WorldListSortMethod (WorldFileData data1, WorldFileData data2)
 
static int PlayerListSortMethod (PlayerFileData data1, PlayerFileData data2)
 
static void TryPickingDefaultUIScale (float displayHeight)
 
static void ErasePlayer (int i)
 
static void EraseWorld (int i)
 
static void WriteFancyWorldLoadErrorToConsole ()
 
static string ReadLineInput ()
 
static void SetDisplayMonitor ()
 
static void SetMonitorOnce (object sender, PreparingDeviceSettingsEventArgs e)
 
static void SetTileValue ()
 
static void ResetGameCounter ()
 
static void Initialize_Items ()
 
static void Initialize_TileAndNPCData2 ()
 
static void AddEchoFurnitureTile (int tileId)
 
static void Initialize_TileAndNPCData1 ()
 
static void Initialize_TileAndNPCData1_Part2 ()
 
static void CacheSupportedDisplaySizes ()
 
static void PostContentLoadInitialize ()
 
static void UpdateOwlCageFrames ()
 
static void UpdateDragonflyJarFrames ()
 
static void UpdateOwlCageFrame (int[] frames, int[] frameCounters, int style)
 
static void UpdateDragonflyJarFrame (int[,] frames, int[,] frameCounters, int style, int variation)
 
static void DoUpdate_AnimateItemIcons_Inner ()
 
static void ConsumeAllMainThreadActions ()
 
static void TryPlayingCreditsRoll ()
 
static bool CanPauseGame ()
 
static void DoUpdate_WhilePaused ()
 
static void UpdateUIStates (GameTime gameTime)
 
static void TrySyncingMyPlayer ()
 
static void TrySyncingItemArray (ref bool syncedAnyInventoryContents, Item[] my, Item[] other, int slotOffset)
 
static void CheckBossIndexes ()
 
static void UpdateOldNPCShop ()
 
static void DoUpdate_AnimateCursorColors ()
 
static void DoUpdate_AnimateTileGlows ()
 
static void DoUpdate_Enter_ToggleChat ()
 
static void DoUpdate_HandleChat ()
 
static void DoUpdate_AltEnter_ToggleFullscreen ()
 
static void DoUpdate_F11_ToggleUI ()
 
static void DoUpdate_F7_ToggleGraphicsDiagnostics ()
 
static void DoUpdate_F8_ToggleNetDiagnostics ()
 
static void DoUpdate_F9_ToggleLighting ()
 
static void DoUpdate_F10_ToggleFPS ()
 
static void AnimateTiles ()
 
static void AnimateTiles_WeatherVane ()
 
static void DoUpdate_AnimateWalls ()
 
static void DoUpdate_AnimateVisualPlayerAura ()
 
static void DoUpdate_AnimateBackgrounds ()
 
static void DoUpdate_AnimateBackgrounds_UpdateForest (int bgIndex, int[] bgSet)
 
static void DoUpdate_AutoSave ()
 
static void UpdateSettingUnlocks ()
 
static void UpdateMenu ()
 
static string PasteTextIn (bool allowMultiLine, string newKeys)
 
static void DrawNPCDirect_Deerclops (SpriteBatch mySpriteBatch, NPC rCurrentNPC, ref Vector2 screenPos, int typeCache, ref Color npcColor, ref Vector2 halfSize, SpriteEffects npcSpriteEffect)
 
static void DrawNPCDirect_DeerclopsLeg (SpriteBatch mySpriteBatch, NPC rCurrentNPC, ref Vector2 screenPos, int typeCache, ref Color npcColor, ref Vector2 halfSize, SpriteEffects npcSpriteEffect)
 
static void DrawNPCDirect_Faeling (SpriteBatch mySpriteBatch, NPC rCurrentNPC, ref Vector2 screenPos, int typeCache, ref Color npcColor, ref Vector2 halfSize, SpriteEffects npcSpriteEffect)
 
static void DrawNPCDirect_HallowBoss (SpriteBatch mySpriteBatch, NPC rCurrentNPC, ref Vector2 screenPos, int typeCache, ref Color npcColor, ref Vector2 halfSize, SpriteEffects npcSpriteEffect)
 
static void DrawNPCDirect_GetHallowBossArmFrame (NPC rCurrentNPC, out int armFrame_Count, out int armFrameToUseLeft, out int armFrameToUseRight)
 
static void DrawNPC_SlimeItem (NPC rCurrentNPC, int typeCache, Color npcColor, float addedRotation)
 
static void DrawTrail (Projectile proj, Vector2 rotatableOffsetFromCenter, Color baseColor)
 
static void DrawProj_Flamethrower (Projectile proj)
 
static void DrawProj_Spear (Projectile proj, ref Color projectileColor, ref SpriteEffects dir)
 
static void DrawPrettyStarSparkle (float opacity, SpriteEffects dir, Vector2 drawpos, Color drawColor, Color shineColor, float flareCounter, float fadeInStart, float fadeInEnd, float fadeOutStart, float fadeOutEnd, float rotation, Vector2 scale, Vector2 fatness)
 
static void DrawProj_FlailChains (Projectile proj, Vector2 mountedCenter)
 
static void DrawProj_FlailChains_Old (Projectile proj, Vector2 mountedCenter)
 
static Color TryApplyingPlayerStringColor (int playerStringColor, Color stringColor)
 
static void DrawProj_FishingLine (Projectile proj, ref float polePosX, ref float polePosY, Vector2 mountedCenter)
 
static int TryInteractingWithVoidLens (Projectile proj)
 
static int TryInteractingWithMoneyTrough (Projectile proj)
 
static void TryInteractingWithMoneyTrough2 (Projectile proj)
 
static void DrawWOFBody ()
 
static void DrawWOFRopeToTheHungry (int i)
 
static void DrawWOFTongueToPlayer (int i)
 
static void HelpText ()
 
static void DrawNPCChatButtons (int superColor, Color chatColor, int numLines, string focusText, string focusText3)
 
static void DrawLoadoutButtons (int inventoryTop, bool demonHeartSlotAvailable, bool masterModeSlotAvailable)
 
static void DrawDefenseCounter (int inventoryX, int inventoryY)
 
static void DrawGuideCraftText (int adjY, Color craftingTipColor, out int inventoryX, out int inventoryY)
 
static void DrawGuideCraftText_Old (int adjY, Color craftingTipColor, out int inventoryX, out int inventoryY)
 
static void HoverOverCraftingItemButton (int recipeIndex)
 
static bool TryAllowingToCraftRecipe (Recipe currentRecipe, bool tryFittingItemInInventoryToAllowCrafting, out bool movedAnItemToAllowCrafting)
 
static void DrawTrashItemSlot (int pivotTopLeftX, int pivotTopLeftY)
 
static void DrawEmoteBubblesButton (int pivotTopLeftX, int pivotTopLeftY)
 
static void DrawBestiaryIcon (int pivotTopLeftX, int pivotTopLeftY)
 
static void SetRecipeMaterialDisplayName (int i)
 
static void DrawPVPIcons ()
 
static int DrawPageIcons (int yPos)
 
static bool TryFreeingElderSlime (int npcIndex)
 
static void DrawNPCChatBubble (int i)
 
static void DrawInterface_Resources_Breath ()
 
static void DrawInterface_Resources_GolfPower ()
 
static void DrawInterface_GolfBallIndicator ()
 
static void DrawWallOfCopperShortswords ()
 
static void DrawWallOfBoulders ()
 
static void DrawInterface_41_InterfaceLogic4 ()
 
static void DrawPendingMouseText ()
 
static void DrawInterface_37_DebugStuff ()
 
static void DrawInterface_36_Cursor ()
 
static void DrawInterface_35_YouDied ()
 
static void DrawInterface_32_GamepadRadialHotbars ()
 
static void DrawInterface_26_InterfaceLogic3 ()
 
static void DrawInterface_24_InterfaceLogic2 ()
 
static void DrawInterface_20_MultiplayerPlayerNames ()
 
static void DrawInterface_19_SignTileBubble ()
 
static void DrawInterface_18_DiagnoseVideo ()
 
static void DrawInterface_17_DiagnoseNet ()
 
static void DrawInterface_15_InvasionProgressBars ()
 
static void DrawInterface_13_AchievementCompletePopups ()
 
static bool DrawInterface_12_IngameFancyUI ()
 
static bool DrawInterface_8_CheckF11UIHideToggle ()
 
static bool DrawInterface_10_CheckCaptureManager ()
 
static void DrawInterface_9_WireSelection ()
 
static void DrawInterface_0_InterfaceLogic1 ()
 
static void DrawInterface_6_TileGridOption ()
 
static void DrawInterface_5_GamepadLockOn ()
 
static void DrawInterface_4_Ruler ()
 
static void DrawInterface_3_LaserRuler ()
 
static void DrawInterface_2_SmartCursorTargets ()
 
static void DrawInterface_1_1_DrawEmoteBubblesInWorld ()
 
static void DrawInterface_1_2_DrawEntityMarkersInWorld ()
 
static void MouseOversTryToClear ()
 
static void MouseOversClear ()
 
static void DrawSmartCursor ()
 
static void DrawSmartInteract ()
 
static void GetInfoAccIconPosition (int drawnCount, int StartX, out int X, out int Y)
 
static void GetBuilderAccsCountToShow (Player plr, out int blockReplaceIcons, out int torchGodIcons, out int totalDrawnIcons)
 
static void TryDisposingEverything ()
 
static Action CreateGoToMenuEvent (int menu)
 
static void OnSubmitServerPasswordFromRequest (string passwordCandidate)
 
static void OnSubmitServerPasswordFromRequest ()
 
static void CanceledGivingServerPassword ()
 
static void ExitServerPasswordMenu ()
 
static bool IsGoodPortAddress (string text)
 
static void OnSubmitServerPort (string candidatePort)
 
static void DrawSocialMediaButtons (Color menuColor, float upBump)
 
static void DrawVersionNumber (Color menuColor, float upBump)
 
static void ClearVisualPostProcessEffects ()
 
static void PostDrawMenu (Point screenSizeCache, Point screenSizeCacheAfterScaling)
 
static bool IsBorderlessDisplayAvailable ()
 
static void CycleClothingStyle (Player plr)
 
static bool IsValidPlayerStyle (Player plr)
 
static void CycleClothingStyle_Inner (Player plr)
 
static void DrawUnderworldBackgroudLayer (bool flat, Vector2 screenOffset, float pushUp, int layerTextureIndex)
 
static bool ShouldDrawBackgroundTileAt (int i, int j)
 
static void UpdateMinimapAnchors ()
 
static void DrawMapFullscreenBackground (Vector2 screenPosition, int screenWidth, int screenHeight)
 
static bool DrawPlayerDeathMarker (float X, float Y, float scale, float left, float top, float headScale, int i)
 
static void DrawNPCHeadFriendly (Entity theNPC, byte alpha, float headScale, SpriteEffects dir, int townHeadId, float x, float y)
 
static void DrawNPCHeadBoss (Entity theNPC, byte alpha, float headScale, float rotation, SpriteEffects effects, int bossHeadId, float x, float y)
 
static void DrawWithOutlines (Entity entity, Texture2D tex, Vector2 position, Rectangle? rect, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects)
 
static string DrawMap_FindChestName (LocalizedText[] chestNames, Tile chestTile, int x, int y, int fullTileWidth=36)
 
static float DrawSurfaceBG_GetFogPower ()
 
static void CheckMonoliths ()
 
static void DrawItemTextPopups (float scaleTarget)
 
static void DoDraw_UpdateCameraPosition ()
 
static void ApplyColorOfTheSkiesToTiles ()
 
static void UpdateAtmosphereTransparencyToSkyColor ()
 
static void DrawNetplayStatusText ()
 
static void SetBackColor (InfoToSetBackColor info, out Color sunColor, out Color moonColor)
 
static void ClampScreenPositionToWorld ()
 
static void UpdateInvasion ()
 
static void UpdateInvasion_Inner ()
 
static void InvasionWarning ()
 
static void UpdateClient ()
 
static void UpdateServer ()
 
static void ChangeRain ()
 
static void UpdateTime ()
 
static void HandleMeteorFall ()
 
static void UpdateSlimeRainWarning ()
 
static void UpdateTime_SpawnTownNPCs ()
 
static int BorderedHeight (int height, bool state)
 
static void DrawtModLoaderSocialMediaButtons (Color menuColor, float upBump)
 
static Main ()
 

Private Attributes

volatile bool _musicLoaded
 
volatile bool _artLoaded
 
volatile bool _begunMainAsyncLoad
 
AchievementManager _achievements
 
AchievementAdvisor _achievementAdvisor
 
string _cachedTitle
 
int firstTileX
 
int lastTileX
 
int firstTileY
 
int lastTileY
 
int bgStartY
 
int bgLoopsY
 
int splashCounter
 
uint previousExecutionState
 
JArray _lastLoadedPacks
 
IEnumerator _gameContentLoadProcess
 
int lastMusicPlayed = -1
 
Stopwatch _worldUpdateTimeTester = new Stopwatch()
 
float logoRotation
 
float logoRotationDirection = -1f
 
float logoRotationSpeed = 1f
 
float logoScale = 1f
 
float logoScaleDirection = 1f
 
float logoScaleSpeed = 1f
 
float[] menuItemScale = new float[maxMenuItems]
 
int focusMenu = -1
 
int selectedMenu = -1
 
int selectedMenu2 = -1
 
MouseTextCache _mouseTextCache
 
AmbientWindSystem _ambientWindSys = new AmbientWindSystem()
 
List< Player_playersThatDrawBehindNPCs = new List<Player>(255)
 
List< Player_playersThatDrawAfterProjectiles = new List<Player>(255)
 
List< DrawData_voidLensData = new List<DrawData>()
 
List< DrawData_voidLensDataSillouette = new List<DrawData>()
 
List< DrawData_voidLensDataSillouette2 = new List<DrawData>()
 
TextDisplayCache _textDisplayCache = new TextDisplayCache()
 
List< int > _occupantsListToDrawNPCHouses = new List<int>()
 
List< int > _npcsWithBannersToDraw = new List<int>()
 
bool _imeToggle
 
List< int > _npcTypesThatAlreadyDrewAHead = new List<int>()
 
bool _needToSetupDrawInterfaceLayers = true
 
List< GameInterfaceLayer_gameInterfaceLayers
 
byte instrumentMouseFixHack
 
int grabColorSlider
 
bool[] menuWide = new bool[100]
 
bool _needsMenuUIRecalculation
 
float _splashFrameCount
 
bool quickSplash
 
float hellBlackBoxBottom
 
float cTop
 
bool _isDrawingOrUpdating
 
double _partialWorldEventUpdates
 

Static Private Attributes

const string versionStringBecauseTheyreTheSame = "v1.4.4.9"
 
static bool GameAskedToQuit = false
 
static Matrix _currentWantedZoomMatrix
 
static Matrix _uiScaleMatrix
 
static float _uiScaleWanted = 1f
 
static float _uiScaleUsed = 1f
 
static GameNotificationType _flashNotificationType = GameNotificationType.All
 
static GameModeData _currentGameModeInfo = GameModeData.NormalMode
 
static ? bool _overrideForExpertMode = null
 
static ? bool _overrideForMasterMode = null
 
static Vector2 _lastPingMousePosition = Vector2.Zero
 
static double _lastPingMouseDownTime = 0.0
 
static OnPlayerSelected _pendingCharacterSelect
 
static Color[] _mapColorCacheArray = (Color[])(object)new Color[30000]
 
static int toolTipDistance = 6
 
static ulong _drawCycleCounter
 
static float cameraLerp
 
static int cameraLerpTimer
 
static int cameraLerpTimeToggle
 
static bool cameraGamePadLerp
 
static ConcurrentQueue< Action > _mainThreadActions = new ConcurrentQueue<Action>()
 
static INetDiagnosticsUI _activeNetDiagnosticsUI
 
const bool USE_ASYNC_LOAD = true
 
static bool _isAsyncLoadComplete
 
static bool IsEnginePreloaded
 
static bool IsEngineLoaded
 
static uint _gameUpdateCount
 
const int MF_BYPOSITION = 1024
 
static Process tServer
 
static Stopwatch saveTime = new Stopwatch()
 
const double slimeRainMaxTime = 54000.0
 
const double slimeRainMinTime = 32400.0
 
const double slimeRainMaxDelay = 604800.0
 
const double slimeRainMinDelay = 302400.0
 
const double LeinforsBalanceRequestForSlimeRainChance = 1.0416666666666667
 
const double slimeRainChance = 450000.00000000006
 
static bool TOWMusicUnlocked = false
 
static bool swapMusic = false
 
static string _statusText = ""
 
static DrawAnimation _coinOnWorldAnimation = new DrawAnimationVertical(6, 8)
 
static DrawAnimation _monkStaffT3OnWorldAnimation = new DrawAnimationVertical(5, 3)
 
static int _renderTargetMaxSize
 
static GraphicsProfile _selectedGraphicsProfile
 
static GraphicsProfile _currentGraphicsProfile
 
static WorldPreparationState _worldPreparationState
 
static int backSpaceCount
 
static float backSpaceRate
 
static int maxLoadPlayer
 
static int maxLoadWorld
 
static int _targetNetMode
 
static bool _hasPendingNetmodeChange
 
static WindowStateController _windowMover
 
static bool shouldSetDefaultUIScale
 
static float newDefaultUIScale
 
static Stopwatch splashTimer
 
static float _minWind
 
static float _maxWind
 
static float _minRain
 
static float _maxRain
 
static int maxMenuItems
 
static bool _needsLanguageSelect
 
static Vector3 shimmerShine
 
static BlendState _multiplyBlendState
 
static StardewValleyAnimation _stardewAnimation
 
static UnifiedRandom _tempSeededRandom
 
static int _lastHoveredLoadoutIndex
 
static List< string > _requiredObjecsForCraftingText
 
static bool _preventCraftingBecauseClickWasUsedToChangeFocusedRecipe
 
static int _currentRecipeBeingCrafted
 
static bool hidePVPIcons
 
static int mH
 
static int oldHairStyle
 
static Color oldHairColor
 
static Color[] oldClothesColor
 
static int oldClothesStyle
 
static bool _settingsButtonIsPushedToSide
 
static bool _MouseOversCanClear
 
static Vector2 _itemIconCacheScreenPosition
 
static int _itemIconCacheSelectedItemID
 
static int _itemIconCacheTime
 
static bool _cannotDrawAccessoriesHorizontally
 
static bool _blockFancyUIWhileLoading
 
static int _minimapTopRightAnchorOffsetTowardsLeft
 
static int _minimapTopRightAnchorOffsetTowardsBottom
 
static VertexColors _glowPaintColors
 
static float lightningDecay
 
static float lightningSpeed
 
static int thunderDelay
 
static string[] MonolithFilterNames
 
static string[] MonolithSkyNames
 
static float backgroundLayerTransitionSpeed
 
static bool _cameraPanHasBlackTransition
 
static string _oldNetplayStatusText
 
static TextSnippet[] _netplayStatusTextSnippets
 
static bool _canShowMeteorFall
 
static bool _isResizingAndRemakingTargets
 
static SlotId waterfallSoundSlot
 
static SlotId lavafallSoundSlot
 
static bool hairstylesUpdatedForThisInteraction
 
static Player _currentPlayerOverride
 
static PosixSignalRegistration SIGINTHandler
 
static PosixSignalRegistration SIGTERMHandler
 

Detailed Description

Definition at line 82 of file Main.cs.


The documentation for this class was generated from the following file: