// Because [pattrstorage] doesn't output anything when renaming presets with "slotname", we use a custom "setslotname" instead, that will rename the active preset
if(active_slot>0){
varsname=arrayfromargs(arguments).join(' ');
slotname(selected_slot,sname);
to_pattrstorage("slotname",selected_slot,sname);
update_umenu();
update_filled_slots_dict();
select(selected_slot);
trigger_writeagain();
if(layout==1){
paint_base();
if(selected_slot>0){
if(slots[selected_slot].lock==0){
varsname=arrayfromargs(arguments).join(' ');
slotname(selected_slot,sname);
to_pattrstorage("slotname",selected_slot,sname);
update_umenu();
update_filled_slots_dict();
select(selected_slot);
trigger_writeagain();
if(layout==1){
paint_base();
}
}else{
error('Cannot set name of locked slot\n');
}
}
}
@ -919,6 +923,7 @@ function lock() {
to_pattrstorage("lock",args[0],args[1]);
to_pattrstorage("getlockedslots");
outlet(0,"lock",args[0],args[1]);
update_filled_slots_dict();
trigger_writeagain();
if(layout==1){
paint_base();
@ -1103,13 +1108,23 @@ function update_umenu() {
update_umenu.local=1;
functionupdate_filled_slots_dict(){
// Creates a coll-compatible dict containing slot id, name, lock, color index and color_custom for all existing presets
// And sends the dict name to a receive.
// Best would be to allow for single slot updates, but for that we need to be able to know which at index of filled_slot is a slot id.