Пример #1
0
        private void LoadTilesetForms(TilesetEditor tiles)
        {
            if (tiles == null) return;

            if (listForm == null)
            {
                listForm = new TileListForm(this, tiles);
                listForm.Show();
                listForm.Top = 10;
                listForm.Left = 10;
                listForm.SelectedChanged += new Action<int>(listForm_SelectedChanged);
            }

            if (toolboxForm == null)
            {
                toolboxForm = new Toolbox(this, tiles);
                toolboxForm.Show();
                toolboxForm.Top = 120;
                toolboxForm.Left = 350;
            }

            var sheet = new TileSheetForm(this, tiles);
            sheet.Show();
            sheet.Top = 120;
            sheet.Left = 10;
            sheet.SheetClicked += new Action<Point>(sheetForm_SheetClicked);
            sheet.GotFocus += new EventHandler(sheet_GotFocus);

            if (!string.IsNullOrEmpty(tiles.FilePath))
            {
                savedSheets.Add(tiles.FilePath, sheet);
            }
            tiles.Closed += new Action<TilesetEditor>(tiles_Closed);

            ChangeSheet(sheet);

            tiles.PathChanged += new Action<string, string>(tiles_PathChanged);
        }
Пример #2
0
 public void ChangeSheet(TileSheetForm form)
 {
     this.activeSheet = form;
     if (listForm != null) listForm.ChangeTileset(activeSheet.Tileset);
     if (toolboxForm != null) toolboxForm.ChangeTileset(activeSheet.Tileset);
 }