mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Apply "Rename new cube" setting to all elements
This commit is contained in:
parent
74e52d5a16
commit
9b078273dc
@ -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()
|
||||||
}
|
}
|
||||||
|
@ -500,38 +500,6 @@ function getAllGroups() {
|
|||||||
iterate(Outliner.root)
|
iterate(Outliner.root)
|
||||||
return ta;
|
return ta;
|
||||||
}
|
}
|
||||||
function addGroup() {
|
|
||||||
Undo.initEdit({outliner: true});
|
|
||||||
var add_group = Group.selected
|
|
||||||
if (!add_group && selected.length) {
|
|
||||||
add_group = Cube.selected.last()
|
|
||||||
}
|
|
||||||
var base_group = new Group({
|
|
||||||
origin: add_group ? add_group.origin : undefined
|
|
||||||
})
|
|
||||||
base_group.addTo(add_group)
|
|
||||||
base_group.isOpen = true
|
|
||||||
|
|
||||||
if (Format.bone_rig) {
|
|
||||||
base_group.createUniqueName()
|
|
||||||
}
|
|
||||||
if (add_group instanceof NonGroup && selected.length > 1) {
|
|
||||||
selected.forEach(function(s, i) {
|
|
||||||
s.addTo(base_group)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
base_group.init().select()
|
|
||||||
Undo.finishEdit('add_group');
|
|
||||||
loadOutlinerDraggable()
|
|
||||||
Vue.nextTick(function() {
|
|
||||||
updateSelection()
|
|
||||||
if (settings.create_rename.value) {
|
|
||||||
base_group.rename()
|
|
||||||
}
|
|
||||||
base_group.showInOutliner()
|
|
||||||
Blockbench.dispatchEvent( 'add_group', {object: base_group} )
|
|
||||||
})
|
|
||||||
}
|
|
||||||
window.__defineGetter__('selected_group', () => {
|
window.__defineGetter__('selected_group', () => {
|
||||||
console.warn('selected_group is deprecated. Please use Group.selected instead.')
|
console.warn('selected_group is deprecated. Please use Group.selected instead.')
|
||||||
return Group.selected
|
return Group.selected
|
||||||
@ -545,7 +513,36 @@ BARS.defineActions(function() {
|
|||||||
condition: () => Modes.edit,
|
condition: () => Modes.edit,
|
||||||
keybind: new Keybind({key: 71, ctrl: true}),
|
keybind: new Keybind({key: 71, ctrl: true}),
|
||||||
click: function () {
|
click: function () {
|
||||||
addGroup();
|
Undo.initEdit({outliner: true});
|
||||||
|
var add_group = Group.selected
|
||||||
|
if (!add_group && selected.length) {
|
||||||
|
add_group = Cube.selected.last()
|
||||||
|
}
|
||||||
|
var base_group = new Group({
|
||||||
|
origin: add_group ? add_group.origin : undefined
|
||||||
|
})
|
||||||
|
base_group.addTo(add_group)
|
||||||
|
base_group.isOpen = true
|
||||||
|
|
||||||
|
if (Format.bone_rig) {
|
||||||
|
base_group.createUniqueName()
|
||||||
|
}
|
||||||
|
if (add_group instanceof NonGroup && selected.length > 1) {
|
||||||
|
selected.forEach(function(s, i) {
|
||||||
|
s.addTo(base_group)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
base_group.init().select()
|
||||||
|
Undo.finishEdit('add_group');
|
||||||
|
loadOutlinerDraggable()
|
||||||
|
Vue.nextTick(function() {
|
||||||
|
updateSelection()
|
||||||
|
if (settings.create_rename.value) {
|
||||||
|
base_group.rename()
|
||||||
|
}
|
||||||
|
base_group.showInOutliner()
|
||||||
|
Blockbench.dispatchEvent( 'add_group', {object: base_group} )
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
new Action({
|
new Action({
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user