public void CommandCreate()
        {
            using (NameChangeForm form = new NameChangeForm(FindDefaultLibraryName("New Library"), "Add New Library")) {
                foreach (var library in _editor.Project.LibraryManager.Libraries)
                    form.ReservedNames.Add(library.Name);

                if (form.ShowDialog() == DialogResult.OK) {
                    Library library = new Library(form.Name);
                    _editor.Project.LibraryManager.Libraries.Add(library);
                }
            }
        }
        public void CommandRename(object param)
        {
            if (!TilePoolExists(param))
                return;

            Guid uid = (Guid)param;
            TilePool tilePool = Editor.Project.TilePoolManager.Pools[uid];

            using (NameChangeForm form = new NameChangeForm(tilePool.Name)) {
                foreach (TilePool pool in Editor.Project.TilePoolManager.Pools) {
                    if (pool.Name != tilePool.Name)
                        form.ReservedNames.Add(pool.Name);
                }

                if (form.ShowDialog() == DialogResult.OK)
                    tilePool.TrySetName(form.Name);
            }
        }
        public void CommandRename(object param)
        {
            if (!ObjectExists(param))
                return;

            Guid uid = (Guid)param;
            ObjectPool objPool = Editor.Project.ObjectPoolManager.PoolFromItemKey(uid);
            ObjectClass objClass = objPool.GetObject(uid);

            using (NameChangeForm form = new NameChangeForm(objClass.Name)) {
                foreach (ObjectClass obj in objPool.Objects) {
                    if (obj.Name != objClass.Name)
                        form.ReservedNames.Add(obj.Name);
                }

                if (form.ShowDialog() == DialogResult.OK)
                    objClass.TrySetName(form.Name);
            }
        }
Beispiel #4
0
        private void CommandRename()
        {
            if (CommandCanRename()) {
                using (NameChangeForm form = new NameChangeForm(_level.Name)) {
                    foreach (Level lev in _level.Project.Levels)
                        form.ReservedNames.Add(lev.Name);

                    if (form.ShowDialog() == DialogResult.OK)
                        _level.TrySetName(form.Name);
                }
            }
        }
Beispiel #5
0
        public void CommandRename(object param)
        {
            if (!LevelExists(param))
                return;

            Level level = Editor.Project.Levels[(Guid)param];

            using (NameChangeForm form = new NameChangeForm(level.Name)) {
                foreach (Level lev in level.Project.Levels)
                    form.ReservedNames.Add(lev.Name);

                if (form.ShowDialog() == DialogResult.OK)
                    level.TrySetName(form.Name);
            }
        }