Commit 620dce20 authored by Christian Winter's avatar Christian Winter

globals class introduced. drawPolyLine part of globals

parent c4971e15
......@@ -84,6 +84,7 @@
<script src="scripts/PrefabEditorView.js"></script>
<script src="scripts/rendering/FinalRenderView.js"></script>
<script src="scripts/Globals.js"></script>
<script src="scripts/Application.js"></script>
......
Globals = new class {
constructor() {
this.pivot = Vector2.zero;
this.drawPolyLine = false;
this.mirrorX = false;
this.mirrorY = false;
}
}
\ No newline at end of file
......@@ -121,7 +121,7 @@
this.logic.setState(new IdleState());
} else if (this.logic.currentState instanceof DrawingState) {
if (drawPolyLine)
if (Globals.drawPolyLine)
this.logic.setState(new DrawingState());
else {
if (this.mouseMovedAfterMouseDown == false) {
......@@ -529,12 +529,12 @@
case Key.Shift:
if (this.logic.currentState instanceof DrawingState) {
if (drawPolyLine) {
if (Globals.drawPolyLine) {
this.logic.currentState.cancel();
Application.redrawAllViews();
}
}
drawPolyLine = false;
Globals.drawPolyLine = false;
break;
case Key.D:
......
......@@ -5,8 +5,6 @@ var offscreenContext;
let toolbar;
let drawPolyLine;
let waitingForStart = [];
let mirrorX = false;
......
......@@ -89,7 +89,7 @@
}
break;
case Key.Shift:
drawPolyLine = true;
Globals.drawPolyLine = true;
break;
case Key.P:
......
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