From ecbb75da3f89c55a0cc30f79483e47714c5c8070 Mon Sep 17 00:00:00 2001 From: clementlandrin Date: Thu, 9 Jan 2025 07:25:24 +0100 Subject: [PATCH] Split Spawn and Simulation gpu emitter shaders in context menu. --- bin/defaultProps.json | 7 ++++++- hide/view/FXEditor.hx | 14 +++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bin/defaultProps.json b/bin/defaultProps.json index d30dde08a..c9d56667b 100644 --- a/bin/defaultProps.json +++ b/bin/defaultProps.json @@ -148,7 +148,12 @@ "sceneeditor.scalePrecision": 0.01, "sceneeditor.rotatePrecision": 0.1, - "sceneeditor.newgroups" : ["2D|hrt.prefab.Object2D","3D|hrt.prefab.Object3D","RFX|hrt.prefab.rfx.RendererFX"], + "sceneeditor.newgroups" : ["2D|hrt.prefab.Object2D", + "3D|hrt.prefab.Object3D", + "RFX|hrt.prefab.rfx.RendererFX", + "Spawn|hrt.prefab.fx.gpuemitter.SpawnShader", + "Simulation|hrt.prefab.fx.gpuemitter.SimulationShader" + ], "sceneeditor.recentsize" : 6, "sceneeditor.icons" : {}, diff --git a/hide/view/FXEditor.hx b/hide/view/FXEditor.hx index 754ea2156..e8b001942 100644 --- a/hide/view/FXEditor.hx +++ b/hide/view/FXEditor.hx @@ -212,13 +212,13 @@ private class FXSceneEditor extends hide.comp.SceneEditor { return ret; } var allTypes = super.getNewContextMenu(current, onMake, false); + var allTypesGrouped = super.getNewContextMenu(current, onMake, true); var recents = getNewRecentContextMenu(current, onMake); var menu = []; - - - var shaderItems : Array = []; + var spawnItems : Array = []; + var simulationItems : Array = []; if (parent.is2D) { for(name in ["Group 2D", "Bitmap", "Anim2D", "Atlas", "Particle2D", "Text", "Shader", "Shader Graph", "Placeholder"]) { @@ -285,13 +285,17 @@ private class FXSceneEditor extends hide.comp.SceneEditor { menu.push({label: null, isSeparator: true}); - //splitMenu(menu, "Shader", shaderItems); menu.push({label: "Shader", menu: shaderItems}); + var spawn = allTypesGrouped.find(t -> t.label == "Spawn"); + if ( spawn != null ) + menu.push({label: "Spawn", menu: spawn.menu}); + var simulation = allTypesGrouped.find(t-> t.label == "Simulation"); + if ( simulation != null ) + menu.push({label: "Simulation", menu: simulation.menu}); menu.push({label: null, isSeparator: true}); - //splitMenu(menu, "Other", allTypes); menu.push({label: "Other", menu: allTypes}); menu.unshift({