Commit a02dcebe authored by Christian Winter's avatar Christian Winter

Preferences.onlyTransformInstancePosition added

parent 85f15f86
......@@ -261,6 +261,7 @@
<button type="button" id="use2DCursorToggle" onclick="GUI.use2DCursorTogglePressed()">Use Pivot</button>
<button type="button" id="selectVerticesToggle" onclick="GUI.selectVerticesTogglePressed()">Select vertices</button>
<button type="button" id="selectEdgesToggle" onclick="GUI.selectEdgesTogglePressed()">Select edges</button>
<button type="button" id="onlyTransformPrefabInstancePositionToggle" onclick="GUI.onlyTransformPrefabInstancePositionTogglePressed()">Only transform instance positions</button>
</div>
</div>
......
......@@ -17,6 +17,7 @@
this.renderGuideLayers = false;
this.qualitySetting = "quality"; // "mono", "speed", "quality"
this.onlyTransformPrefabInstancePosition = false;
// TODO gridPrefs? gridData class?
this.gridSize;
......@@ -38,8 +39,7 @@
localStorage.setItem("selectVertices", JSON.stringify(this.selectVertices));
localStorage.setItem("selectEdges", JSON.stringify(this.selectEdges));
localStorage.setItem("renderGuideLayers", JSON.stringify(this.renderGuideLayers));
localStorage.setItem("onlyTransformPrefabInstancePosition", JSON.stringify(this.onlyTransformPrefabInstancePosition));
}
static loadPreferences() {
......@@ -77,6 +77,9 @@
value = JSON.parse(localStorage.getItem("renderGuideLayers"));
if (value != null) this.renderGuideLayers = value;
value = JSON.parse(localStorage.getItem("onlyTransformPrefabInstancePosition"));
if (value != null) this.onlyTransformPrefabInstancePosition = value;
}
static clear() {
......@@ -91,6 +94,7 @@
localStorage.removeItem("selectVertices");
localStorage.removeItem("selectEdges");
localStorage.removeItem("renderGuideLayers");
localStorage.removeItem("onlyTransformPrefabInstancePosition");
Preferences.init();
window.location.reload();
......
......@@ -30,6 +30,7 @@
this.mirrorXToggle = document.getElementById("mirrorXToggle");
this.mirrorYToggle = document.getElementById("mirrorYToggle");
this.devModeToggle = document.getElementById("devModeToggle");
this.onlyTransformPrefabInstancePositionToggle = document.getElementById("onlyTransformPrefabInstancePositionToggle");
// Gridsettings
......@@ -68,6 +69,7 @@
this.updateSelectEdgesToggle();
this.updateDevModeToggle();
this.updateRenderGuideLayers();
this.updateOnlyTransformPrefabInstancePositionToggle();
}
static genereateGridSettings() {
......@@ -803,6 +805,18 @@
}
static onlyTransformPrefabInstancePositionTogglePressed() {
Preferences.onlyTransformPrefabInstancePosition = !Preferences.onlyTransformPrefabInstancePosition;
this.updateOnlyTransformPrefabInstancePositionToggle();
}
static updateOnlyTransformPrefabInstancePositionToggle() {
if (Preferences.onlyTransformPrefabInstancePosition)
this.onlyTransformPrefabInstancePositionToggle.setAttribute("class", "pressed");
else
this.onlyTransformPrefabInstancePositionToggle.removeAttribute("class");
}
static updateRenderGuideLayers() {
this.renderGuideLayers.checked = Preferences.renderGuideLayers;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment