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