Apply "Rename new cube" setting to all elements

This commit is contained in:
JannisX11 2020-12-30 22:30:43 +01:00
parent 74e52d5a16
commit 9b078273dc
3 changed files with 35 additions and 34 deletions

View File

@ -857,7 +857,6 @@ BARS.defineActions(function() {
Blockbench.dispatchEvent( 'add_cube', {object: base_cube} ) Blockbench.dispatchEvent( 'add_cube', {object: base_cube} )
Vue.nextTick(function() { Vue.nextTick(function() {
updateSelection()
if (settings.create_rename.value) { if (settings.create_rename.value) {
base_cube.rename() base_cube.rename()
} }

View File

@ -500,7 +500,19 @@ function getAllGroups() {
iterate(Outliner.root) iterate(Outliner.root)
return ta; return ta;
} }
function addGroup() { window.__defineGetter__('selected_group', () => {
console.warn('selected_group is deprecated. Please use Group.selected instead.')
return Group.selected
})
BARS.defineActions(function() {
new Action({
id: 'add_group',
icon: 'create_new_folder',
category: 'edit',
condition: () => Modes.edit,
keybind: new Keybind({key: 71, ctrl: true}),
click: function () {
Undo.initEdit({outliner: true}); Undo.initEdit({outliner: true});
var add_group = Group.selected var add_group = Group.selected
if (!add_group && selected.length) { if (!add_group && selected.length) {
@ -532,21 +544,6 @@ function addGroup() {
Blockbench.dispatchEvent( 'add_group', {object: base_group} ) Blockbench.dispatchEvent( 'add_group', {object: base_group} )
}) })
} }
window.__defineGetter__('selected_group', () => {
console.warn('selected_group is deprecated. Please use Group.selected instead.')
return Group.selected
})
BARS.defineActions(function() {
new Action({
id: 'add_group',
icon: 'create_new_folder',
category: 'edit',
condition: () => Modes.edit,
keybind: new Keybind({key: 71, ctrl: true}),
click: function () {
addGroup();
}
}) })
new Action({ new Action({
id: 'collapse_groups', id: 'collapse_groups',

View File

@ -107,6 +107,11 @@ BARS.defineActions(function() {
locator.select().createUniqueName(); locator.select().createUniqueName();
objs.push(locator); objs.push(locator);
Undo.finishEdit('add locator'); Undo.finishEdit('add locator');
Vue.nextTick(function() {
if (settings.create_rename.value) {
locator.rename();
}
})
} }
}) })
}) })