Пример #1
0
        private void bNew_Click(object sender, EventArgs e)
        {
            switch (tabs.SelectedIndex)
            {
            case 0:
                using (FrmTilesetEditor form = new FrmTilesetEditor()) {
                    DialogResult result = form.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        EditorEngine.Instance.World.TilesetContainer.Add(form.Tileset);
                    }
                }
                break;

            case 1:
                using (FrmEntityTemplateEditor frm = new FrmEntityTemplateEditor()) {
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        EntityTemplate temp = frm.Template;
                        EditorEngine.Instance.World.EntityContainer.Add(temp);
                    }
                }
                RefreshView();
                break;
            }

            RefreshView();
        }
Пример #2
0
        private void lItems_DoubleClick(object sender, EventArgs e)
        {
            if (lItems.SelectedIndex < 0)
            {
                return;
            }
            switch (tabs.SelectedIndex)
            {
            case 0:
                Tileset tileset = EditorEngine.Instance.World.TilesetContainer[lItems.SelectedIndex];
                using (FrmTilesetEditor frm = new FrmTilesetEditor()) {
                    frm.Tileset = tileset;
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        EditorEngine.Instance.World.TilesetContainer[lItems.SelectedIndex] = frm.Tileset;
                        EditorEngine.Instance.HasEdit = true;
                    }
                }
                break;

            case 1:
                EntityTemplate entity = EditorEngine.Instance.World.EntityContainer.All()[lItems.SelectedIndex];
                using (FrmEntityTemplateEditor frm = new FrmEntityTemplateEditor()) {
                    frm.Template = entity;
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        EditorEngine.Instance.World.EntityContainer.All()[lItems.SelectedIndex] = frm.Template;
                        EditorEngine.Instance.HasEdit = true;
                    }
                }
                break;
            }
        }
Пример #3
0
		private void bNew_Click(object sender, EventArgs e) {
			switch (tabs.SelectedIndex) {
				case 0:
					using (FrmTilesetEditor form = new FrmTilesetEditor()) {
						DialogResult result = form.ShowDialog();
						if (result == DialogResult.OK) {
							EditorEngine.Instance.World.TilesetContainer.Add(form.Tileset);
						}
					}
					break;
				case 1:
					using (FrmEntityTemplateEditor frm = new FrmEntityTemplateEditor()) {
						if (frm.ShowDialog() == DialogResult.OK) {
							EntityTemplate temp = frm.Template;
							EditorEngine.Instance.World.EntityContainer.Add(temp);
						}
					}
					RefreshView();
					break;
			}

			RefreshView();
		}
Пример #4
0
		private void lItems_DoubleClick(object sender, EventArgs e) {
			if (lItems.SelectedIndex < 0) return;
			switch (tabs.SelectedIndex) {
				case 0:
					Tileset tileset = EditorEngine.Instance.World.TilesetContainer[lItems.SelectedIndex];
					using (FrmTilesetEditor frm = new FrmTilesetEditor()) {
						frm.Tileset = tileset;
						if (frm.ShowDialog() == DialogResult.OK) {
							EditorEngine.Instance.World.TilesetContainer[lItems.SelectedIndex] = frm.Tileset;
							EditorEngine.Instance.HasEdit = true;
						}
					}
					break;
				case 1:
					EntityTemplate entity = EditorEngine.Instance.World.EntityContainer.All()[lItems.SelectedIndex];
					using (FrmEntityTemplateEditor frm = new FrmEntityTemplateEditor()) {
						frm.Template = entity;
						if (frm.ShowDialog() == DialogResult.OK) {
							EditorEngine.Instance.World.EntityContainer.All()[lItems.SelectedIndex] = frm.Template;
							EditorEngine.Instance.HasEdit = true;
						}
					}
					break;
			}
		}