Nikatlas 5 년 전
부모
커밋
f88a60f8f5
6개의 변경된 파일23개의 추가작업 그리고 8개의 파일을 삭제
  1. 5 0
      Components/Numbers.js
  2. 1 0
      Components/TypeHandler.js
  3. 6 2
      Systems/Gui.js
  4. 3 1
      Systems/ModuleBar.js
  5. 4 1
      Systems/SideBar.js
  6. 4 4
      yarn.lock

+ 5 - 0
Components/Numbers.js

@@ -11,6 +11,11 @@ export default function Numbers(props) {
 			<Text style={styles.title}>{title}</Text>
 			<TextInput style={styles.defaultInput} 
 					onChangeText={(number) => {
+						try{
+							number = parseInt(number);
+						} catch(e) {
+							return;
+						}
 						props.onChange && props.onChange(number);
 						setNumber(number);
 					}}

+ 1 - 0
Components/TypeHandler.js

@@ -10,6 +10,7 @@ export default function(Type) {
 				return Editors.ColorEditor;
 			return Editors.TextEditor;
 		case Types.Number: 
+		case Types.Integer: 
 			return Editors.Numbers;
 		default: 
 			return Editors.TextEditor;

+ 6 - 2
Systems/Gui.js

@@ -3,7 +3,7 @@ import ToolBox from './ToolBox';
 import Keyboard from './keyboard';
 import Mouse from './mouse';
 import React from 'react';
-import {StyleSheet, View, Text} from 'react-native';
+import {Dimensions, StyleSheet, View, Text} from 'react-native';
 import Library from 'trapilib/dist/lib';
 import SideBar from './SideBar';
 import MainBar from  './MainBar';
@@ -49,10 +49,14 @@ export default class Gui {
       this.saveEnv();
       this.forceUpdate()
     })    
+
+    let cview = this.CoreSystem.getCurrentView();
+    let container = cview.getDefaultContainer();
+    let mainContent = new ViewNode(Math.random(), 'BaseContainer', {width: 1125/3, height: 2436/3 - 10});
+    cview.setContent(mainContent, container);
   }
 
   onMount() {
-    debugger;
     if(this.phone){
         // thats fine
         this.ToolBoxMouse = new Mouse(this.toolbox.current);

+ 3 - 1
Systems/ModuleBar.js

@@ -43,7 +43,9 @@ export default class ModuleBar {
 							namespace: key,
 							ctor: name
 						})}>
-						{React.createElement(list[key][name])}
+							<View style={{minWidth: 50, minHeight:50, backgroundColor: 'rgba(0,0,0,0.2)'}}>
+								{React.createElement(list[key][name])}
+							</View>
 						</Text>
 						
 						</View>

+ 4 - 1
Systems/SideBar.js

@@ -60,7 +60,10 @@ export default class SideBar{
 			let Editor = TypeHandler(Structure[key]);
 			let editorProps = {
 				title: key,
-				onChange: (value) => this.editNode(value, key)
+				onChange: (value) => {
+					console.log(typeof value);
+					this.editNode(value, key);
+				}
 			};
 			console.log(DataTypes)
 			switch(Structure[key].type){

+ 4 - 4
yarn.lock

@@ -1888,9 +1888,9 @@ [email protected]:
   integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
 
 electron-to-chromium@^1.3.191:
-  version "1.3.235"
-  resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.235.tgz#8d0d52c9ec76d12189f2f2d265a17d57f41d20dc"
-  integrity sha512-xNabEDbMIKPLQd6xgv4nyyeMaWXIKSJr6G51ZhUemHhbz6kjZAYcygA8CvfEcMF+Mt5eLmDWaLmfSOWdQxzBVQ==
+  version "1.3.236"
+  resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.236.tgz#c7158cbd4d17a3670ac7c9b44da44d752aa193a9"
+  integrity sha512-LWOvuJ80pLO3FtFqTcGuXB0dxdMtzSCkRmbXdY5mHUvXRQGor3sTVmyfU70aD2yF5i+fbHz52ncWr5T3xUYHlA==
 
 encodeurl@~1.0.2:
   version "1.0.2"
@@ -5619,7 +5619,7 @@ [email protected]:
 
 "trapilib@git+http://git.onarbooks.com/Klapi/TrapiLib.git":
   version "1.0.7"
-  resolved "git+http://git.onarbooks.com/Klapi/TrapiLib.git#b7a4fb4a6315c275d56278db28f6e2ec9bf6792f"
+  resolved "git+http://git.onarbooks.com/Klapi/TrapiLib.git#a8a49ab6458b649f405ac2eac468e1fbb7ee49eb"
   dependencies:
     expo "^34.0.0-experiment.8"
     prop-types "^15.7.2"