Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.77 KB | None | 0 0
  1.  
  2.         public static bool changed = false;
  3.         public static Texture2D[] oldTextures;
  4.         public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
  5.         {
  6.             if (Main.time % 30 == 0)
  7.             {
  8.                 if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.O))
  9.                 {
  10.                     if (!changed)
  11.                     {
  12.                         var fieldInfo = typeof(Main).GetField("underworldTexture", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
  13.                         oldTextures = (Texture2D[])fieldInfo.GetValue(null);
  14.                         Texture2D[] textures = new Texture2D[5];
  15.                         textures[0] = mod.GetTexture("Background_50");
  16.                         textures[1] = mod.GetTexture("Background_9");
  17.                         textures[2] = mod.GetTexture("Background_113");
  18.                         textures[3] = mod.GetTexture("Background_7");
  19.                         textures[4] = mod.GetTexture("Background_0");
  20.                         fieldInfo.SetValue(null, textures);
  21.                         changed = true;
  22.                         Main.NewText("changed to new");
  23.                     }
  24.                     else
  25.                     {
  26.                         var fieldInfo = typeof(Main).GetField("underworldTexture", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
  27.                         fieldInfo.SetValue(null, oldTextures);
  28.                         changed = false;
  29.                         Main.NewText("changed back old");
  30.                     }
  31.                 }
  32.             }
  33.             if (oldTextures != null) spriteBatch.Draw(oldTextures[0], new Rectangle(0, 0, 100, 500), lightColor);
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement