Преглед на файлове

fixing easier comments made on PR, still working on shared UI fixed

msDestiny14 преди 4 години
родител
ревизия
d807c91b1a

+ 0 - 1
Playground/src/tools/monacoManager.ts

@@ -228,7 +228,6 @@ class Playground {
             "https://preview.babylonjs.com/loaders/babylonjs.loaders.d.ts",
             "https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.d.ts",
             "https://preview.babylonjs.com/nodeEditor/babylon.nodeEditor.d.ts",
-            "https://preview.babylonjs.com/guiEditor/babylon.guiEditor.d.ts",
             "https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.d.ts",
             "https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.d.ts",
             "https://preview.babylonjs.com/serializers/babylonjs.serializers.d.ts",

+ 4 - 0
dist/preview release/what's new.md

@@ -41,6 +41,10 @@
 - Increased float precision to 4([msDestiny14](https://github.com/msDestiny14))
 - Added ability to make input node's properties visible in the properties of a custom frame ([msDestiny14](https://github.com/msDestiny14))
 
+### GUIEditor
+
+- Added GUI Editor project to master. ([msDestiny14](https://github.com/msDestiny14))
+
 ### GUI
 
 - Added a `FocusableButton` gui control to simplify creating menus with keyboard navigation ([Flux159](https://github.com/Flux159))

+ 3 - 3
guiEditor/public/index.js

@@ -84,7 +84,7 @@ var showEditor = function() {
                                 resolve();
                             }
                             else {
-                                reject(`Unable to save your node material. It may be too large (${(dataToSend.payload.length / 1024).toFixed(2)} KB) because of embedded textures. Please reduce texture sizes or point to a specific url instead of embedding them and try again.`);
+                                reject(`Unable to save your gui layout. It may be too large (${(dataToSend.payload.length / 1024).toFixed(2)}`);
                             }
                         }
                     }
@@ -94,7 +94,7 @@ var showEditor = function() {
         
                     var dataToSend = {
                         payload : JSON.stringify({
-                            nodeMaterial: data
+                            guiLayout: data
                         }),
                         name: "",
                         description: "",
@@ -111,7 +111,7 @@ var showEditor = function() {
 // Let's start
 if (BABYLON.Engine.isSupported()) {
     var canvas = document.createElement("canvas");
-    var engine = new BABYLON.Engine(canvas, false, {disableWebGL2Support: true});
+    var engine = new BABYLON.Engine(canvas, false);
     var scene = new BABYLON.Scene(engine);
 
     // Set to default

+ 3 - 3
guiEditor/src/guiEditor.ts

@@ -8,7 +8,7 @@ import { Observable } from 'babylonjs/Misc/observable';
 /**
  * Interface used to specify creation options for the gui editor
  */
-export interface INodeEditorOptions {
+export interface IGuiEditorOptions {
     hostElement?: HTMLElement,
     customSave?: {label: string, action: (data: string) => Promise<void>};
     customLoadObservable?: Observable<any>
@@ -24,7 +24,7 @@ export class GuiEditor {
      * Show the gui editor
      * @param options defines the options to use to configure the gui editor
      */
-    public static Show(options: INodeEditorOptions) {
+    public static Show(options: IGuiEditorOptions) {
         if (this._CurrentState) {
             var popupWindow = (Popup as any)["gui-editor"];
             if (popupWindow) {
@@ -35,7 +35,7 @@ export class GuiEditor {
         let hostElement = options.hostElement;
         
         if (!hostElement) {
-            hostElement = Popup.CreatePopup("BABYLON.JS NODE EDITOR", "gui-editor", 1000, 800)!;
+            hostElement = Popup.CreatePopup("BABYLON.JS GUI EDITOR", "gui-editor", 1000, 800)!;
         }
 
         let globalState = new GlobalState();

+ 1 - 1
guiEditor/src/blockTools.ts

@@ -7,7 +7,7 @@ import { Rectangle } from "babylonjs-gui/2D/controls/rectangle";
 import { Slider } from "babylonjs-gui/2D/controls/sliders/slider";
 import { TextBlock } from "babylonjs-gui/2D/controls/textBlock";
 
-export class BlockTools {
+export class GuiNodeTools {
     public static GetGuiFromString(data: string) {
 
         //TODO: Add more elements and create default values for certain types.

+ 1 - 1
guiEditor/src/sharedComponents/draggableLineComponent.tsx

@@ -16,7 +16,7 @@ export class DraggableLineComponent extends React.Component<IButtonLineComponent
                 title={this.props.tooltip}
                 draggable={true}
                 onDragStart={event => {
-                    event.dataTransfer.setData("babylonjs-material-node", this.props.data);
+                    event.dataTransfer.setData("babylonjs-gui-node", this.props.data);
                 }}>
                 {this.props.data.replace("Block", "")}
             </div>

+ 3 - 3
guiEditor/src/workbenchEditor.tsx

@@ -6,7 +6,7 @@ import { Portal } from './portal';
 import { LogComponent, LogEntry } from './components/log/logComponent';
 import { DataStorage } from 'babylonjs/Misc/dataStorage';
 import { Nullable } from 'babylonjs/types';
-import { BlockTools } from './blockTools';
+import { GuiNodeTools } from './guiNodeTools';
 import { IEditorData } from './nodeLocationInfo';
 import { WorkbenchComponent } from './diagram/workbench';
 import { GUINode } from './diagram/guiNode';
@@ -237,9 +237,9 @@ export class WorkbenchEditor extends React.Component<IGraphEditorProps, IGraphEd
     }
 
     emitNewBlock(event: React.DragEvent<HTMLDivElement>) {
-        var data = event.dataTransfer.getData("babylonjs-material-node") as string;
+        var data = event.dataTransfer.getData("babylonjs-gui-node") as string;
 
-        let guiElement = BlockTools.GetGuiFromString(data);
+        let guiElement = GuiNodeTools.GetGuiFromString(data);
 
         let newGuiNode = this._workbenchCanvas.appendBlock(guiElement);