Add a 'grabbable' option to the new-model dialog

This commit is contained in:
Ryan Huffman 2018-10-19 16:42:45 -07:00
parent 388b31acf7
commit f1258e4445
2 changed files with 17 additions and 8 deletions

View file

@ -116,9 +116,14 @@ Rectangle {
Column {
id: column2
width: 200
height: 400
height: 600
spacing: 10
CheckBox {
id: grabbable
text: qsTr("Grabbable")
}
CheckBox {
id: dynamic
text: qsTr("Dynamic")
@ -219,7 +224,8 @@ Rectangle {
params: {
textInput: modelURL.text,
checkBox: dynamic.checked,
comboBox: collisionType.currentIndex
comboBox: collisionType.currentIndex,
grabbable: grabbable.checked
}
});
}

View file

@ -348,12 +348,12 @@ var toolBar = (function () {
if (!properties.grab) {
properties.grab = {};
}
if (Menu.isOptionChecked(MENU_CREATE_ENTITIES_GRABBABLE) &&
!(properties.type === "Zone" || properties.type === "Light" || properties.type === "ParticleEffect")) {
properties.grab.grabbable = true;
} else {
properties.grab.grabbable = false;
if (Menu.isOptionChecked(MENU_CREATE_ENTITIES_GRABBABLE) &&
!(properties.type === "Zone" || properties.type === "Light" || properties.type === "ParticleEffect")) {
properties.grab.grabbable = true;
} else {
properties.grab.grabbable = false;
}
}
SelectionManager.saveProperties();
@ -473,6 +473,9 @@ var toolBar = (function () {
type: "Model",
modelURL: url,
shapeType: shapeType,
grab: {
grabbable: result.grabbable
},
dynamic: dynamic,
gravity: dynamic ? { x: 0, y: -10, z: 0 } : { x: 0, y: 0, z: 0 }
});