Hide reticle during snapshot

This commit is contained in:
howard-stearns 2016-08-16 12:35:49 -07:00
parent 1aca43ea88
commit a8fd92d2bf

View file

@ -9,7 +9,7 @@
// //
var SNAPSHOT_DELAY = 500; // 500ms var SNAPSHOT_DELAY = 500; // 500ms
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
var resetOverlays; var resetOverlays, recticleVisible;
var button = toolBar.addButton({ var button = toolBar.addButton({
objectName: "snapshot", objectName: "snapshot",
imageURL: Script.resolvePath("assets/images/tools/snap.svg"), imageURL: Script.resolvePath("assets/images/tools/snap.svg"),
@ -57,6 +57,8 @@ function snapshotShared(success) {
function onClicked() { function onClicked() {
// update button states // update button states
resetOverlays = Menu.isOptionChecked("Overlays"); resetOverlays = Menu.isOptionChecked("Overlays");
reticleVisible = Reticle.visible;
Reticle.visible = false;
Window.snapshotTaken.connect(resetButtons); Window.snapshotTaken.connect(resetButtons);
button.writeProperty("buttonState", 0); button.writeProperty("buttonState", 0);
@ -84,6 +86,7 @@ function resetButtons(path, notify) {
} }
// show hud // show hud
toolBar.writeProperty("visible", true); toolBar.writeProperty("visible", true);
Reticle.visible = reticleVisible;
// update button states // update button states
button.writeProperty("buttonState", 1); button.writeProperty("buttonState", 1);