public static void Draw()
        {
#if WINDOWS
            if (NeedSizeChange)
            {
                NeedSizeChange = false;

                Game1.graphics.PreferredBackBufferWidth  = TargetSizeX;
                Game1.graphics.PreferredBackBufferHeight = TargetSizeY;
                GameManager.SetSize(new Vector2(TargetSizeX, TargetSizeY));
                return;
            }
#endif

#if EDITOR
#if WINDOWS
            if (MasterManager.FullScreenViewport.Width != Game1.self.Window.ClientBounds.Width ||
                MasterManager.FullScreenViewport.Height != Game1.self.Window.ClientBounds.Height)
            {
                MasterManager.FullScreenSize       = new Vector2(Game1.self.Window.ClientBounds.Width, Game1.self.Window.ClientBounds.Height);
                MasterManager.FullScreenViewport   = new Viewport(0, 0, Game1.self.Window.ClientBounds.Width, Game1.self.Window.ClientBounds.Height);
                MasterManager.ProfileMessageRect.X = Game1.self.Window.ClientBounds.Width - 150;
            }
            EditorManager.Draw();
#endif
#if XBOX
            RecieverManager.Draw();
#endif
#endif

#if !EDITOR
            GameManager.Draw();
#endif
        }
        public static void Load()
        {
            if (Loaded)
            {
                return;
            }
            Loaded = true;

            CreatorBasic.Load();
            PlayerProfile.Load();

            Render.Load();
#if !EDITOR
            LoadDefaultLevel();
#endif

#if !EDITOR && AUTO
            DefaultLoader.AutoLoad();
#endif

#if EDITOR
#if !XBOX
            EditorManager.InitEditor();
#endif
#endif
        }
        public static void Load()
        {
            FileOpenLoad = true;

            Stream         MyStream;
            OpenFileDialog openFileDialog1;

            openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = LastFileLocation;
            openFileDialog1.Filter           = "cardLevel files (*.lvl)|*.lvl";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;

            InUse = true;


            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Game1.self.Window.Title = Path.GetFileName(openFileDialog1.FileName) + " - " + Game1.EngineTitle;
                LastFileLocation        = openFileDialog1.FileName;

                try
                {
                    if ((MyStream = File.Open(openFileDialog1.FileName, FileMode.Open)) != null)
                    {
                        EditorManager.LoadNewLevel(ReadFile(new BinaryReader(MyStream), true));
                        SetDefaultSaveLocation(openFileDialog1.FileName);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
                }
            }
            InUse = false;
        }
        public static void Update(GameTime gameTime)
        {
#if WINDOWS
            if (Game1.self.IsActive)
            {
                MouseManager.Update(gameTime);
                KeyboardManager.Update(gameTime);
            }
#endif
            bool Loading = Level.LoadLevels();

#if EDITOR
#if !XBOX
            EditorManager.Update(gameTime);
#endif
#if XBOX
            RecieverManager.Update(gameTime);
#endif
#endif

#if !EDITOR
            GameManager.Update(gameTime);
#endif
        }
 public void Run(Button button)
 {
     Destroy();
     EditorManager.SwitchToPlay();
 }
Exemplo n.º 6
0
 public void New(Button button)
 {
     EditorManager.NewEditorLevel();
     Destroy();
 }