浏览代码

fixing merging mistake

msDestiny14 4 年之前
父节点
当前提交
1f383d2817

+ 1 - 1
guiEditor/src/diagram/guiNode.ts

@@ -178,7 +178,7 @@ export class GUINode {
 
         return React.createElement(ContainerPropertyTabComponent, {
         globalState: this._globalState,
-        guiControl: this
+        guiNode: this
         });
     }
 

+ 1 - 2
guiEditor/src/diagram/properties/containterPropertyComponent.tsx

@@ -4,7 +4,7 @@ import * as React from "react";
 import { ButtonLineComponent } from "../../sharedUiComponents/lines/buttonLineComponent";
 import { LineContainerComponent } from "../../sharedUiComponents/lines/lineContainerComponent";
 import { TextLineComponent } from "../../sharedUiComponents/lines/textLineComponent";
-import { IContainerComponentProps} from './propertyComponentProps';
+import { IContainerComponentProps } from "./propertyComponentProps";
 
 export class ContainerPropertyTabComponent extends React.Component<IContainerComponentProps> {
     constructor(props: IContainerComponentProps) {
@@ -32,7 +32,6 @@ export class ContainerPropertyTabComponent extends React.Component<IContainerCom
             guiElementMenu.push(<TextLineComponent label={child.name}></TextLineComponent>);           
         });
 
-        
 
         return (
             <>                

+ 0 - 113
guiEditor/src/diagram/properties/genericNodePropertyComponent.tsx

@@ -1,113 +0,0 @@
-
-import * as React from "react";
-import { LineContainerComponent } from '../../sharedUiComponents/lines/lineContainerComponent';
-import { IPropertyComponentProps } from './propertyComponentProps';
-import { CheckBoxLineComponent } from '../../sharedUiComponents/lines/checkBoxLineComponent';
-import { FloatLineComponent } from '../../sharedComponents/floatLineComponent';
-import { SliderLineComponent } from '../../sharedComponents/sliderLineComponent';
-import { PropertyTypeForEdition, IPropertyDescriptionForEdition } from 'babylonjs/Materials/Node/nodeMaterialDecorator';
-
-export class GenericPropertyComponent extends React.Component<IPropertyComponentProps> {
-    constructor(props: IPropertyComponentProps) {
-        super(props);
-    }
-
-    render() {
-        return (
-            <>
-                <GeneralPropertyTabComponent globalState={this.props.globalState} guiControl={this.props.guiControl}/>
-                <GenericPropertyTabComponent globalState={this.props.globalState} guiControl={this.props.guiControl}/>
-            </>
-        );
-    }
-}
-
-export class GeneralPropertyTabComponent extends React.Component<IPropertyComponentProps> {
-    constructor(props: IPropertyComponentProps) {
-        super(props);
-    }
-
-    render() {
-        return (
-            <>
-                <LineContainerComponent title="GENERAL">
-                </LineContainerComponent>
-            </>
-        );
-    }
-}
-
-export class GenericPropertyTabComponent extends React.Component<IPropertyComponentProps> {
-    constructor(props: IPropertyComponentProps) {
-        super(props);
-    }
-
-    forceRebuild(notifiers?: { "rebuild"?: boolean; "update"?: boolean; }) {
-        if (!notifiers || notifiers.update) {
-            this.props.globalState.onUpdateRequiredObservable.notifyObservers();
-        }
-
-        if (!notifiers || notifiers.rebuild) {
-            this.props.globalState.onRebuildRequiredObservable.notifyObservers();
-        }
-    }
-
-    render() {
-        const block = this.props.guiControl,
-              propStore: IPropertyDescriptionForEdition[] = (block as any)._propStore;
-
-        if (!propStore) {
-            return (
-                <>
-                </>
-            );
-        }
-
-        const componentList: { [groupName: string]: JSX.Element[]} = {},
-              groups: string[] = [];
-
-        for (const { propertyName, displayName, type, groupName, options } of propStore) {
-            let components = componentList[groupName];
-
-            if (!components) {
-                components = [];
-                componentList[groupName] = components;
-                groups.push(groupName);
-            }
-
-            switch (type) {
-                case PropertyTypeForEdition.Boolean: {
-                    components.push(
-                        <CheckBoxLineComponent label={displayName} target={this.props.guiControl} propertyName={propertyName} onValueChanged={() => this.forceRebuild(options.notifiers)} />
-                    );
-                    break;
-                }
-                case PropertyTypeForEdition.Float: {
-                    let cantDisplaySlider = (isNaN(options.min as number) || isNaN(options.max as number) || options.min === options.max);
-                    if (cantDisplaySlider) {
-                        components.push(
-                            <FloatLineComponent globalState={this.props.globalState} label={displayName} propertyName={propertyName} target={this.props.guiControl} onChange={() => this.forceRebuild(options.notifiers)} />
-                        );
-                    } else {
-                        components.push(
-                            <SliderLineComponent label={displayName} target={this.props.guiControl} globalState={this.props.globalState} propertyName={propertyName} step={Math.abs((options.max as number) - (options.min as number)) / 100.0} minimum={Math.min(options.min as number, options.max as number)} maximum={options.max as number} onChange={() => this.forceRebuild(options.notifiers)}/>
-                        );
-                    }
-                    break;
-                }
-            }
-        }
-
-        return (
-            <>
-            {
-                groups.map((group) =>
-                    <LineContainerComponent title={group}>
-                        {componentList[group]}
-                    </LineContainerComponent>
-                )
-            }
-            </>
-        );
-    }
-}

+ 1 - 2
guiEditor/src/guiEditor.ts

@@ -3,7 +3,6 @@ import * as ReactDOM from "react-dom";
 import { GlobalState } from "./globalState";
 import { WorkbenchEditor } from "./workbenchEditor";
 import { Popup } from "./sharedUiComponents/lines/popup";
-import { SerializationTools } from "./serializationTools";
 import { Observable } from "babylonjs/Misc/observable";
 /**
  * Interface used to specify creation options for the gui editor
@@ -57,7 +56,7 @@ export class GUIEditor {
 
         if (options.customLoadObservable) {
             options.customLoadObservable.add((data) => {
-                SerializationTools.Deserialize(data, globalState);
+                //TODO: Add deserilization here.
                 globalState.onResetRequiredObservable.notifyObservers();
                 globalState.onBuiltObservable.notifyObservers();
             });