Commit a6530728 authored by Christian Winter's avatar Christian Winter

wip. focus stuff

parent 26618e9a
......@@ -190,6 +190,10 @@
focus(focusable) {
this.currentFocus = focusable;
if (this.currentFocus)
GUI.writeToStats("currentFocus", this.currentFocus.toString());
else
GUI.writeToStats("currentFocus", "null");
}
setView(view) {
......@@ -208,6 +212,8 @@
this._currentView = view;
this._currentView.activate();
this._currentView.canvas.focus();
GUI.writeToStats("currentView", this._currentView.toString());
}
get currentView() {
......
......@@ -14,4 +14,7 @@
this.renderer.redraw();
}
toString() {
return "PrefabEditorView";
}
}
\ No newline at end of file
......@@ -4,4 +4,7 @@
this.renderer = new SceneRenderer(this);
}
toString() {
return "SceneView";
}
}
\ No newline at end of file
......@@ -651,4 +651,8 @@
this.canvas.width = this.canvas.offsetWidth;
this.canvas.height = this.canvas.offsetHeight;
}
toString() {
console.log("toString() not implemented for view!")
}
}
\ No newline at end of file
......@@ -31,11 +31,13 @@ class Input {
break;
}
if (Application.currentView)
if (Application.currentView) {
Application.currentView.keyDown(e.keyCode);
Application.currentView.logic.currentState.keyDown(e.keyCode);
}
if (Application.currentFocus)
Application.currentFocus.keyDown(e.keyCode);
//if (Application.currentFocus)
// Application.currentFocus.keyDown(e.keyCode);
// dont prevent default
if (Application.currentView && !(
......@@ -67,9 +69,12 @@ class Input {
switch (e.keyCode) {
default:
if (Application.currentView)
{
Application.currentView.keyUp(e.keyCode);
Application.currentView.logic.currentState.keyUp(e.keyCode);
if (Application.currentFocus)
Application.currentFocus.keyUp(e.keyCode);
}
//if (Application.currentFocus)
// Application.currentFocus.keyUp(e.keyCode);
break;
}
......
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