Ejemplo n.º 1
0
 private void bImportContainer_Click(object sender, EventArgs e)
 {
     using (OpenFileDialog fileDialog = new OpenFileDialog()) {
         fileDialog.Filter = "PokeSharp Resource Container (*.pcon)|*.pcon";
         if (fileDialog.ShowDialog() == DialogResult.OK)
         {
             try {
                 if (tabs.SelectedIndex == 0)
                 {
                     TilesetContainer container = EncoderUtil.Decode <TilesetContainer>(fileDialog.FileName, EditorEngine.Instance.GraphicsDevice);
                     EditorEngine.Instance.World.TilesetContainer = container;
                 }
                 else if (tabs.SelectedIndex == 1)
                 {
                     EntityContainer container = EncoderUtil.Decode <EntityContainer>(fileDialog.FileName, EditorEngine.Instance.GraphicsDevice);
                     EditorEngine.Instance.World.EntityContainer = container;
                     EditorEngine.Instance.HasEdit = true;
                 }
             } catch (Exception exc) {
                 MessageBox.Show("Error. Stacktrace: \n\n{0}".WithFormat(exc.Message),
                                 "Importing Error",
                                 MessageBoxButtons.OK,
                                 MessageBoxIcon.Exclamation);
             }
         }
     }
     RefreshView();
 }
Ejemplo n.º 2
0
        public void Update(GameTime gameTime)
        {
            Stopwatch watch = Stopwatch.StartNew();

            TilesetContainer.Update(gameTime);
            GameConsole.Update(gameTime);

            foreach (Map m in Maps)
            {
                m.Update(gameTime);
            }

            watch.Stop();

            updateTime = (float)watch.Elapsed.TotalSeconds;
        }