Exemplo n.º 1
0
        public void EditSelectedTile()
        {
            TileEditor.MainWindow editor = new TileEditor.MainWindow(Tileset, TileIndex);
            editor.MapEditorWindow = this;
            editor.ShowDialog(this);

            TilesetBox.Refresh();
            UpdateTilesetPageIndicator();
            UpdateTilePreview();

            Tileset.Save(TilesetFile);
            Log("Tileset saved to " + TilesetFile);

            MapBox.InvalidateAllMapPositionsAndRefresh();
        }
Exemplo n.º 2
0
        private void BtnTilesetClear_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show(
                "This will load the default tileset. Are you sure?",
                "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

            if (result == DialogResult.OK)
            {
                Tileset.Load(DefaultTilesetFile);

                TileIndex = 0;
                TilesetBox.Refresh();
                UpdateTilesetPageIndicator();
                UpdateTilePreview();
                MapBox.InvalidateAllMapPositionsAndRefresh();

                Log("Tileset imported from file " + DefaultTilesetFile);
            }
        }
Exemplo n.º 3
0
        private void ImportTileset()
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.InitialDirectory = DataDirectory;
            dialog.Filter           = "Tileset files|*.dat";

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Tileset.Load(dialog.FileName);

                TileIndex = 0;
                TilesetBox.Refresh();
                UpdateTilesetPageIndicator();
                UpdateTilePreview();
                MapBox.InvalidateAllMapPositionsAndRefresh();

                Log("Tileset imported from file " + dialog.FileName);
            }
        }
Exemplo n.º 4
0
 public void UpdateTileViews()
 {
     TilesetBox.Refresh();
     MapBox.InvalidateAllMapPositionsAndRefresh();
     UpdateTilePreview();
 }
Exemplo n.º 5
0
 private void ChkTilesetGrid_Click(object sender, EventArgs e)
 {
     TilesetBox.ShowGrid = (sender as ToolStripMenuItem).Checked;
     TilesetBox.Refresh();
 }
Exemplo n.º 6
0
 private void BtnTilesetNextPage_Click(object sender, EventArgs e)
 {
     TilesetBox.NextPage();
 }
Exemplo n.º 7
0
 private void BtnTilesetPrevPage_Click(object sender, EventArgs e)
 {
     TilesetBox.PrevPage();
 }
Exemplo n.º 8
0
 public void UpdateTilesetPageIndicator()
 {
     LblTilesetPage.Text = TilesetBox.GetPageIndicator();
 }