Darragh Burke vor 5 Jahren
Ursprung
Commit
15f4bd717c

+ 2 - 2
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/contrast.tsx

@@ -53,7 +53,7 @@ class contrastTool implements IToolType {
     }
 };
 
-class GUI extends React.Component<IToolGUIProps> {
+class Settings extends React.Component<IToolGUIProps> {
     render() {
         const instance = this.props.instance as contrastTool;
         return (
@@ -89,7 +89,7 @@ export const Contrast : IToolData = {
     name: 'Contrast/Exposure',
     type: contrastTool,
     is3D: true,
-    GUI: GUI,
+    settingsComponent: Settings,
     icon: `PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0i
     NDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuNTUsMjYuNTVsOC41OS0zLjIxQTYuODYsNi44NiwwLDAsMSwyNCwyNS43NWwtMy4x
     OSwxLjE5QTcsNywwLDAsMSwxNy41NSwyNi41NVpNMjAsMTEuNUE4LjUsOC41LDAsMSwwLDI4LjUsMjAsOC41MSw4LjUxLDAsMCwwLDIwLDExLjVNMjAsMTBBMTAsMTAs

Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.tsx


+ 4 - 5
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx

@@ -15,7 +15,7 @@ import { Vector2 } from 'babylonjs/Maths/math.vector';
 import { PointerInfo } from 'babylonjs/Events/pointerEvents';
 
 import { PopupComponent } from '../../../../../popupComponent';
-import { ToolUI } from './toolUI';
+import { ToolSettings } from './toolSettings';
 
 require('./textureEditor.scss');
 
@@ -79,17 +79,16 @@ export interface IToolData {
     usesWindow? : boolean;
     /** Whether the tool uses postprocesses */
     is3D? : boolean;
-    GUI? : React.ComponentType<IToolGUIProps>;
+    settingsComponent? : React.ComponentType<IToolGUIProps>;
 }
 
 export interface IToolType {
     /** Called when the tool is selected. */
     setup: () => void;
-    /** Called when the tool is deseleted. */
+    /** Called when the tool is deselected. */
     cleanup: () => void;
     /** Optional. Called when the user resets the texture or uploads a new texture. Tools may want to reset their state when this happens. */
     onReset?: () => void;
-    gui?: (props: any) => JSX.Element;
 }
 
 /** For constructable types, TS requires that you define a seperate interface which constructs your actual interface */
@@ -296,7 +295,7 @@ export class TextureEditorComponent extends React.Component<ITextureEditorCompon
             />}
             <ChannelsBar channels={this.state.channels} setChannels={(channels) => {this.setState({channels})}}/>
             <TextureCanvasComponent canvas2D={this._2DCanvas} canvas3D={this._3DCanvas} canvasUI={this._UICanvas} texture={this.props.texture}/>
-            <ToolUI tool={currentTool} />
+            <ToolSettings tool={currentTool} />
             <BottomBar name={this.props.url} mipLevel={this.state.mipLevel} hasMips={!this.props.texture.noMipmap}/>
         </div>
     }

+ 15 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/toolSettings.tsx

@@ -0,0 +1,15 @@
+import * as React from 'react';
+import { ITool } from './toolBar';
+
+interface IToolSettingsProps {
+    tool: ITool | undefined;
+}
+
+export class ToolSettings extends React.Component<IToolSettingsProps> {
+    render() {
+        if (!this.props.tool || !this.props.tool.settingsComponent) return <></>;
+        return <div id='tool-ui'>
+            {<this.props.tool.settingsComponent instance={this.props.tool.instance}/>}
+        </div>;
+    }
+}

+ 0 - 15
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/toolUI.tsx

@@ -1,15 +0,0 @@
-import * as React from 'react';
-import { ITool } from './toolBar';
-
-interface IToolUIProps {
-    tool: ITool | undefined;
-}
-
-export class ToolUI extends React.Component<IToolUIProps> {
-    render() {
-        if (!this.props.tool || !this.props.tool.GUI) return <></>;
-        return <div id='tool-ui'>
-            {<this.props.tool.GUI instance={this.props.tool.instance}/>}
-        </div>;
-    }
-}