new preset browser
-
Is there a way of excluding the path of preset and only show the preset name using this?
example: "nameofpreset.preset"// PRESETS ///////////////////////
const var Presets = Content.getComponent("Presets");
const var convoLbl = Content.getComponent("convoLbl");var menuItems = [];
const var x = Engine.getUserPresetList();
for (i in x)
menuItems.insert(-1, i);menuItems = menuItems.join("\n");
Presets.set("items", menuItems);inline function onPresetsControl(component, value)
{
Engine.loadUserPreset(Presets.getItemText() + ".preset");
convoLbl.set("text", Presets.getItemText());
};
Content.getComponent("Presets").setControlCallback(onPresetsControl);
// PRESETS ///////////////////////Thanks in advance.......
-
@Jay Use the substring, indexof, lastindexof, and replace commands
-
I made a little function to pull a file name from a url. Maybe something similar might work for you.
inline function extractFileName(string) { local fileName = string.split("/").pop(); // Extract the file name return fileName; }