mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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) {
|
||||
return value !== undefined ? value : "";
|
||||
}
|
||||
|
@ -394,16 +408,9 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
|||
} else if (data.type === 'toggleGridVisibility') {
|
||||
toggleGridVisibility();
|
||||
} else if (data.type === 'toggleSnapToGrid') {
|
||||
if (!grid.getSnapToGrid()) {
|
||||
grid.setSnapToGrid(true);
|
||||
emitJSONScriptEvent({ "type": "setSnapToGrid", "snap": true });
|
||||
} else {
|
||||
grid.setSnapToGrid(false);
|
||||
emitJSONScriptEvent({ "type": "setSnapToGrid", "snap": false });
|
||||
}
|
||||
that.toggleSnapToGrid();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
webView.webEventReceived.connect(onWebEventReceived);
|
||||
|
|
Loading…
Reference in a new issue