Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool changed = false;
- public static Texture2D[] oldTextures;
- public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
- {
- if (Main.time % 30 == 0)
- {
- if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.O))
- {
- if (!changed)
- {
- var fieldInfo = typeof(Main).GetField("underworldTexture", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
- oldTextures = (Texture2D[])fieldInfo.GetValue(null);
- Texture2D[] textures = new Texture2D[5];
- textures[0] = mod.GetTexture("Background_50");
- textures[1] = mod.GetTexture("Background_9");
- textures[2] = mod.GetTexture("Background_113");
- textures[3] = mod.GetTexture("Background_7");
- textures[4] = mod.GetTexture("Background_0");
- fieldInfo.SetValue(null, textures);
- changed = true;
- Main.NewText("changed to new");
- }
- else
- {
- var fieldInfo = typeof(Main).GetField("underworldTexture", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
- fieldInfo.SetValue(null, oldTextures);
- changed = false;
- Main.NewText("changed back old");
- }
- }
- }
- if (oldTextures != null) spriteBatch.Draw(oldTextures[0], new Rectangle(0, 0, 100, 500), lightColor);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement