Browse Source

send_name attribute

main
TFLCL 1 month ago
parent
commit
5b3b12e613
  1. 16
      code/tc.preset.js

16
code/tc.preset.js

@ -75,6 +75,7 @@ var scrollable = 0; // Defines weither the object can be scrolled or not
var min_rows = 10; // Minimum number of rows to display if scrollable is enabled var min_rows = 10; // Minimum number of rows to display if scrollable is enabled
var color_mode = 0; // Change the way the filled slots (stored presets) color is handeld. 0: stored_slot_color. 1: looping through color_1 to color_6. 2: Freely assign colors 1 to 6. 3: Set any color to any preset var color_mode = 0; // Change the way the filled slots (stored presets) color is handeld. 0: stored_slot_color. 1: looping through color_1 to color_6. 2: Freely assign colors 1 to 6. 3: Set any color to any preset
var select_mode = 0; // 0: single click to select and recall the slot. 1: single click to select the slot, double click to recall it. var select_mode = 0; // 0: single click to select and recall the slot. 1: single click to select the slot, double click to recall it.
var send_name = "none"; // The global name to send presets dict name to (received by the [receive] object)
// (WORK) // (WORK)
var pattrstorage_name, pattrstorage_obj = null; var pattrstorage_name, pattrstorage_obj = null;
@ -1109,7 +1110,8 @@ function update_filled_slots_dict() {
var tmp_color_custom = slots[filled_slots[i]].color_custom; var tmp_color_custom = slots[filled_slots[i]].color_custom;
filled_slots_dict.setparse('filled_slots[' + i + ']', 'slot:', filled_slots[i], 'name:', '"' + slots[filled_slots[i]].name + '"', 'lock:', slots[filled_slots[i]].lock, 'color_index:', slots[filled_slots[i]].color_index, 'color_custom:', tmp_color_custom[0], tmp_color_custom[1], tmp_color_custom[2], tmp_color_custom[3]); filled_slots_dict.setparse('filled_slots[' + i + ']', 'slot:', filled_slots[i], 'name:', '"' + slots[filled_slots[i]].name + '"', 'lock:', slots[filled_slots[i]].lock, 'color_index:', slots[filled_slots[i]].color_index, 'color_custom:', tmp_color_custom[0], tmp_color_custom[1], tmp_color_custom[2], tmp_color_custom[3]);
} }
messnamed(pattrstorage_name + '_presets_dict', 'dictionary', filled_slots_dict.name); var tmp_send_name = send_name == "none" ? pattrstorage_name + '_presets_dict' : send_name;
messnamed(tmp_send_name, 'dictionary', filled_slots_dict.name);
} }
update_filled_slots_dict.local = 1; update_filled_slots_dict.local = 1;
@ -1796,6 +1798,18 @@ function setcolor6(){
} }
} }
declareattribute("send_name", "getsendname", "setsendname", 1);
function getsendname() {
return send_name;
}
function setsendname(){
if (arguments.length > 0) {
send_name = arguments[0];
} else {
send_name = "none";
}
}
// UTILITY // UTILITY
function post_keys(obj) { function post_keys(obj) {
post('Keys of obj: ', obj, '\n'); post('Keys of obj: ', obj, '\n');

Loading…
Cancel
Save