|
@@ -17,9 +17,15 @@ let {
|
|
|
|
|
|
|
|
|
export default class Gui {
|
|
|
- constructor() {
|
|
|
+ constructor(phone , toolbox) {
|
|
|
this.Keyboard = new Keyboard();
|
|
|
- this.Mouse = new Mouse();
|
|
|
+ this.phone = phone;
|
|
|
+ this.toolbox = toolbox;
|
|
|
+ if(this.phone){
|
|
|
+ this.ToolBoxMouse = new Mouse(this.toolbox);
|
|
|
+ this.phoneMouse = new Mouse(this.phone)
|
|
|
+ }
|
|
|
+
|
|
|
this.CoreSystem = { render: () => null};
|
|
|
this.ToolBox = new ToolBox();
|
|
|
this.MainBar = new MainBar();
|
|
@@ -32,15 +38,25 @@ export default class Gui {
|
|
|
}
|
|
|
this.SideBar = new SideBar(SideBarProps)
|
|
|
this.forceUpdate()
|
|
|
- })
|
|
|
+ })
|
|
|
|
|
|
this.MainBar.onSave( () => {
|
|
|
this.saveEnv();
|
|
|
this.forceUpdate()
|
|
|
})
|
|
|
|
|
|
- this.Mouse.listen()
|
|
|
- .on('LeftDown',(e) => this.ToolManagement(e))
|
|
|
+ if(this.ToolBoxMouse !== undefined){
|
|
|
+ this.ToolBoxMouse.listen()
|
|
|
+ .on('LeftDown',(e) => this.ToolManagement(e))
|
|
|
+
|
|
|
+ this.phoneMouse.listen()
|
|
|
+ .on('LeftDown',(e) => this.ToolManagement(e))
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -60,6 +76,7 @@ export default class Gui {
|
|
|
|
|
|
|
|
|
ToolManagement(e){
|
|
|
+ console.log("whattttt")
|
|
|
if(this.ToolBox.activeTool === null){
|
|
|
|
|
|
return null;
|
|
@@ -94,7 +111,8 @@ export default class Gui {
|
|
|
}
|
|
|
}
|
|
|
processElement(event){
|
|
|
-
|
|
|
+ console.log(event)
|
|
|
+ console.log('sdasdwd')
|
|
|
let ViewNode = this.CoreSystem.ray({event})
|
|
|
let NewNode = this.ToolBox.editNode(ViewNode);
|
|
|
this.forceUpdate();
|
|
@@ -104,7 +122,7 @@ export default class Gui {
|
|
|
|
|
|
mobileRender(){
|
|
|
return (
|
|
|
- <View style={styles.mobileView}>
|
|
|
+ <View ref = {this.phoneRef} style={styles.mobileView}>
|
|
|
{this.CoreSystem.render()}
|
|
|
</View>
|
|
|
)
|