mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:17:14 +02:00
Add Grid Actions Shortkeys
Add Grid Actions Shortkeys Toggle Grid G Activate/Deactivate Snap to Grid H Align Grid to Selected Entities J Align Grid to Avatar K
This commit is contained in:
parent
1f20536574
commit
6a31c19747
1 changed files with 15 additions and 8 deletions
|
@ -146,6 +146,20 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
that.setListMenuSnapToGrid = function (isSnapToGrid) {
|
||||||
|
emitJSONScriptEvent({ "type": "setSnapToGrid", "snap": isSnapToGrid });
|
||||||
|
};
|
||||||
|
|
||||||
|
that.toggleSnapToGrid = function () {
|
||||||
|
if (!grid.getSnapToGrid()) {
|
||||||
|
grid.setSnapToGrid(true);
|
||||||
|
emitJSONScriptEvent({ "type": "setSnapToGrid", "snap": true });
|
||||||
|
} else {
|
||||||
|
grid.setSnapToGrid(false);
|
||||||
|
emitJSONScriptEvent({ "type": "setSnapToGrid", "snap": false });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function valueIfDefined(value) {
|
function valueIfDefined(value) {
|
||||||
return value !== undefined ? value : "";
|
return value !== undefined ? value : "";
|
||||||
}
|
}
|
||||||
|
@ -394,16 +408,9 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
||||||
} else if (data.type === 'toggleGridVisibility') {
|
} else if (data.type === 'toggleGridVisibility') {
|
||||||
toggleGridVisibility();
|
toggleGridVisibility();
|
||||||
} else if (data.type === 'toggleSnapToGrid') {
|
} else if (data.type === 'toggleSnapToGrid') {
|
||||||
if (!grid.getSnapToGrid()) {
|
that.toggleSnapToGrid();
|
||||||
grid.setSnapToGrid(true);
|
|
||||||
emitJSONScriptEvent({ "type": "setSnapToGrid", "snap": true });
|
|
||||||
} else {
|
|
||||||
grid.setSnapToGrid(false);
|
|
||||||
emitJSONScriptEvent({ "type": "setSnapToGrid", "snap": false });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
webView.webEventReceived.connect(onWebEventReceived);
|
webView.webEventReceived.connect(onWebEventReceived);
|
||||||
|
|
Loading…
Reference in a new issue