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

◆ DrawMapFullscreenBackground()

static void Terraria.Main.DrawMapFullscreenBackground ( Vector2 screenPosition,
int screenWidth,
int screenHeight )
inlinestaticprivate

Definition at line 71818 of file Main.cs.

71819 {
71820 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
71821 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
71822 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
71823 //IL_0074: Unknown result type (might be due to invalid IL or missing references)
71824 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
71825 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
71826 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
71827 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
71828 //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
71829 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
71830 //IL_04a0: Unknown result type (might be due to invalid IL or missing references)
71831 //IL_04a5: Unknown result type (might be due to invalid IL or missing references)
71832 //IL_0318: Unknown result type (might be due to invalid IL or missing references)
71833 //IL_031d: Unknown result type (might be due to invalid IL or missing references)
71834 //IL_031e: Unknown result type (might be due to invalid IL or missing references)
71835 //IL_03d9: Unknown result type (might be due to invalid IL or missing references)
71836 //IL_045f: Unknown result type (might be due to invalid IL or missing references)
71837 //IL_0465: Unknown result type (might be due to invalid IL or missing references)
71838 //IL_046a: Unknown result type (might be due to invalid IL or missing references)
71839 if (ModContent.RequestIfExists(LocalPlayer.CurrentSceneEffect.mapBackground, out Asset<Texture2D> modTexture, AssetRequestMode.ImmediateLoad))
71840 {
71841 spriteBatch.Draw(modTexture.Value, new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
71842 return;
71843 }
71845 int num = -1;
71846 Color color = Color.White;
71847 if (tile[(int)(player[myPlayer].Center.X / 16f), (int)(player[myPlayer].Center.Y / 16f)] == null)
71848 {
71849 return;
71850 }
71851 int wall = tile[(int)(player[myPlayer].Center.X / 16f), (int)(player[myPlayer].Center.Y / 16f)].wall;
71852 if (screenPosition.Y > (float)((maxTilesY - 232) * 16))
71853 {
71854 num = 2;
71855 }
71856 else if (player[myPlayer].ZoneDungeon)
71857 {
71858 num = 4;
71859 }
71860 else if (wall == 87)
71861 {
71862 num = 13;
71863 }
71864 else if ((double)screenPosition.Y > worldSurface * 16.0)
71865 {
71866 switch (wall)
71867 {
71868 case 86:
71869 case 108:
71870 num = 15;
71871 break;
71872 case 180:
71873 case 184:
71874 num = 16;
71875 break;
71876 case 178:
71877 case 183:
71878 num = 17;
71879 break;
71880 case 62:
71881 case 263:
71882 num = 18;
71883 break;
71884 default:
71885 num = (player[myPlayer].ZoneGlowshroom ? 20 : (player[myPlayer].ZoneCorrupt ? (player[myPlayer].ZoneDesert ? 39 : ((!player[myPlayer].ZoneSnow) ? 22 : 33)) : (player[myPlayer].ZoneCrimson ? (player[myPlayer].ZoneDesert ? 40 : ((!player[myPlayer].ZoneSnow) ? 23 : 34)) : (player[myPlayer].ZoneHallow ? (player[myPlayer].ZoneDesert ? 41 : ((!player[myPlayer].ZoneSnow) ? 21 : 35)) : (player[myPlayer].ZoneSnow ? 3 : (player[myPlayer].ZoneJungle ? 12 : (player[myPlayer].ZoneDesert ? 14 : ((!player[myPlayer].ZoneRockLayerHeight) ? 1 : 31))))))));
71886 break;
71887 }
71888 }
71889 else if (player[myPlayer].ZoneGlowshroom)
71890 {
71891 num = 19;
71892 }
71893 else
71894 {
71895 color = ColorOfTheSkies;
71896 int num2 = (int)((screenPosition.X + (float)(screenWidth / 2)) / 16f);
71897 if (player[myPlayer].ZoneSkyHeight)
71898 {
71899 num = 32;
71900 }
71901 else if (player[myPlayer].ZoneCorrupt)
71902 {
71903 num = ((!player[myPlayer].ZoneDesert) ? 5 : 36);
71904 }
71905 else if (player[myPlayer].ZoneCrimson)
71906 {
71907 num = ((!player[myPlayer].ZoneDesert) ? 6 : 37);
71908 }
71909 else if (player[myPlayer].ZoneHallow)
71910 {
71911 num = ((!player[myPlayer].ZoneDesert) ? 7 : 38);
71912 }
71913 else if ((double)(screenPosition.Y / 16f) < worldSurface + 10.0 && (num2 < 380 || num2 > maxTilesX - 380))
71914 {
71915 num = 10;
71916 }
71917 else if (player[myPlayer].ZoneSnow)
71918 {
71919 num = 11;
71920 }
71921 else if (player[myPlayer].ZoneJungle)
71922 {
71923 num = 8;
71924 }
71925 else if (player[myPlayer].ZoneDesert)
71926 {
71927 num = 9;
71928 }
71929 else if (bloodMoon)
71930 {
71931 color *= 2f;
71932 num = 25;
71933 }
71934 else if (player[myPlayer].ZoneGraveyard)
71935 {
71936 num = 26;
71937 }
71938 }
71939 if (num > -1)
71940 {
71942 }
71943 spriteBatch.Draw(asset.Value, new Rectangle(0, 0, screenWidth, screenHeight), color);
71944 }
static Asset< Texture2D >[] MapBGs
static int maxTilesY
The height of the currently-loaded world in tiles.
Definition Main.cs:1191
static Color ColorOfTheSkies
Definition Main.cs:2660
static SpriteBatch spriteBatch
Definition Main.cs:1043
static double worldSurface
The y-coordinate of the top of the dirt layer, in tile coordinates. Corresponds to 0' on the Depth Me...
Definition Main.cs:1351
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
Definition Main.cs:1958
static bool bloodMoon
Definition Main.cs:1387
static int screenHeight
Definition Main.cs:1870
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864
static int maxTilesX
The width of the currently-loaded world in tiles.
Definition Main.cs:1186
static int screenWidth
Definition Main.cs:1868
static Tilemap tile
Definition Main.cs:1820
static Player LocalPlayer
Retrieves the T:Terraria.Player object for the local user. Shorthand for F:Terraria....
Definition Main.cs:3001
static Player[] player
Definition Main.cs:1960
Manages content added by mods. Liasons between mod content and Terraria's arrays and oversees the Loa...
Definition ModContent.cs:38

References Terraria.Main.bloodMoon, Terraria.Main.ColorOfTheSkies, Terraria.Main.LocalPlayer, Terraria.GameContent.TextureAssets.MapBGs, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.myPlayer, Terraria.Main.player, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.spriteBatch, Terraria.Main.tile, and Terraria.Main.worldSurface.

Referenced by Terraria.Main.DrawMap().

+ Here is the caller graph for this function: