Browse Source

cleaning for PR

msDestiny14 4 years ago
parent
commit
eaa687d822

+ 3 - 8
guiEditor/public/index.js

@@ -28,23 +28,18 @@ var checkHash = function () {
                     if (xmlHttp.readyState == 4) {
                         if (xmlHttp.status == 200) {
                             var snippet = JSON.parse(JSON.parse(xmlHttp.responseText).jsonPayload);
-                            let serializationObject = JSON.parse(snippet.nodeMaterial);
+                            let serializationObject = JSON.parse(snippet);
 
                             if (editorDisplayed) {
                                 customLoadObservable.notifyObservers(serializationObject);
                             } else {
-                                nodeMaterial.loadFromSerialization(serializationObject);
-                                try {
-                                    nodeMaterial.build(true);
-                                } catch (err) {
-                                     // Swallow the error here
-                                }
+                                //load from selization
                                 showEditor();
                             }
                         }
                     }
                 }
-
+                
                 var hash = location.hash.substr(1);
                 currentSnippetToken = hash.split("#")[0];
                 xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));

+ 0 - 24
guiEditor/src/components/propertyTab/properties/floatPropertyTabComponent.tsx

@@ -1,24 +0,0 @@
-
-import * as React from "react";
-import { GlobalState } from '../../../globalState';
-import { FloatLineComponent } from '../../../sharedComponents/floatLineComponent';
-import { InputBlock } from 'babylonjs/Materials/Node/Blocks/Input/inputBlock';
-
-interface IFloatPropertyTabComponentProps {
-    globalState: GlobalState;
-    inputBlock: InputBlock;
-}
-
-export class FloatPropertyTabComponent extends React.Component<IFloatPropertyTabComponentProps> {
-
-    render() {
-        return (
-            <FloatLineComponent globalState={this.props.globalState} label="Value" target={this.props.inputBlock} propertyName="value" onChange={() => {
-                if (this.props.inputBlock.isConstant) {
-                    this.props.globalState.onRebuildRequiredObservable.notifyObservers();    
-                }
-                this.props.globalState.onUpdateRequiredObservable.notifyObservers();
-            }}></FloatLineComponent>
-        );
-    }
-}

+ 1 - 28
guiEditor/src/components/propertyTab/propertyTabComponent.tsx

@@ -9,12 +9,10 @@ import { Tools } from 'babylonjs/Misc/tools';
 import { CheckBoxLineComponent } from '../../sharedComponents/checkBoxLineComponent';
 import { DataStorage } from 'babylonjs/Misc/dataStorage';
 import { GUINode } from '../../diagram/guiNode';
-import { SliderLineComponent } from '../../sharedComponents/sliderLineComponent';
-import { Engine } from 'babylonjs/Engines/engine';
-import { InputBlock } from 'babylonjs/Materials/Node/Blocks/Input/inputBlock';
 import { Observer } from 'babylonjs/Misc/observable';
 import { TextLineComponent } from "../../sharedUiComponents/lines/textLineComponent";
 import { SerializationTools } from "../../serializationTools";
+import { Engine } from "babylonjs/Engines/engine";
 
 require("./propertyTab.scss");
 
@@ -53,14 +51,6 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
         this.props.globalState.onBuiltObservable.remove(this._onBuiltObserver);
     }
 
-    processInputBlockUpdate(ib: InputBlock) {
-        this.props.globalState.onUpdateRequiredObservable.notifyObservers();
-
-        if (ib.isConstant) {
-            this.props.globalState.onRebuildRequiredObservable.notifyObservers();
-        }
-    }
-
 
     load(file: File) {
         Tools.ReadFile(file, (data) => {
@@ -186,8 +176,6 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
             );
         }
 
-        let gridSize = DataStorage.ReadNumber("GridSize", 20);
-
         return (
             <div id="propertyTab">
                 <div id="header">
@@ -205,21 +193,6 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
                         }} />
                     </LineContainerComponent>
                     <LineContainerComponent title="OPTIONS">
-                        <CheckBoxLineComponent label="Embed textures when saving"
-                            isSelected={() => DataStorage.ReadBoolean("EmbedTextures", true)}
-                            onSelect={(value: boolean) => {
-                                DataStorage.WriteBoolean("EmbedTextures", value);
-                            }}
-                        />
-                        <SliderLineComponent label="Grid size" minimum={0} maximum={100} step={5}
-                            decimalCount={0} globalState={this.props.globalState}
-                            directValue={gridSize}
-                            onChange={(value) => {
-                                DataStorage.WriteNumber("GridSize", value);
-                                this.props.globalState.onGridSizeChanged.notifyObservers();
-                                this.forceUpdate();
-                            }}
-                        />
                         <CheckBoxLineComponent label="Show grid"
                             isSelected={() => DataStorage.ReadBoolean("ShowGrid", true)}
                             onSelect={(value: boolean) => {

+ 0 - 1
guiEditor/src/sharedComponents/floatLineComponent.tsx

@@ -1,5 +1,4 @@
 import * as React from "react";
-
 import { Observable } from "babylonjs/Misc/observable";
 import { PropertyChangedEvent } from "./propertyChangedEvent";
 import { GlobalState } from '../globalState';