Skip to content

Commit

Permalink
Split Spawn and Simulation gpu emitter shaders in context menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
clementlandrin committed Jan 9, 2025
1 parent ea25dd9 commit ecbb75d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 6 additions & 1 deletion bin/defaultProps.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {},
Expand Down
14 changes: 9 additions & 5 deletions hide/view/FXEditor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<hide.comp.ContextMenu.MenuItem> = [];
var spawnItems : Array<hide.comp.ContextMenu.MenuItem> = [];
var simulationItems : Array<hide.comp.ContextMenu.MenuItem> = [];

if (parent.is2D) {
for(name in ["Group 2D", "Bitmap", "Anim2D", "Atlas", "Particle2D", "Text", "Shader", "Shader Graph", "Placeholder"]) {
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit ecbb75d

Please sign in to comment.