5 Commits

3 changed files with 18 additions and 15 deletions

View File

@@ -135,7 +135,6 @@ var option_hold = 0;
var control_hold = 0;
var cmd_hold = 0;
var modifier = null; // null lock rename delete store drag_swap
var is_updating_names = 0;
var is_interpolating = 0;
var is_moving = 0;
var is_dragging = 0; // Drag flag
@@ -229,6 +228,13 @@ function slot(left, top, right, bottom) {
slot.local = 1;
function loadbang() {
// If running in a M4L device, for some reason loadbang needs to be delayed in order to properly get presets stored in Live set
// So we bypass the initial loadbang, and we rely on init_tsk instead
if (max.isplugin) return;
do_loadbang();
}
function do_loadbang() {
// post("loadbang\n");
has_loaded = true;
this.box.setboxattr('border', 0);
@@ -245,7 +251,7 @@ init_tsk.schedule(200);
function delayed_init() {
if (!has_loaded) {
loadbang();
do_loadbang();
}
if (arguments.callee.task.valid) {
arguments.callee.task.freepeer();
@@ -1025,7 +1031,6 @@ function slotlist() {
for (var i = 0; i < filled_slots.length; i++) {
slots[filled_slots[i]].filled = true;
}
is_updating_names = 1;
to_pattrstorage("getslotnamelist");
get_all_presets_metadata();
update_filled_slots_dict();
@@ -1036,12 +1041,9 @@ function slotname() {
var args = arrayfromargs(arguments);
var slot = args[0];
var name = args[1];
if (slot == 'done') {
is_updating_names = 0;
return;
}
if (slot > 0 && name != "(undefined)") {
if (is_updating_names == 1 && slots[slot].filled === false && name !== "<(unnamed)>") {
if (slot === 'done') return;
if (slot > 0 && name !== "(undefined)") {
if (slots[slot].filled === false && name !== "<(unnamed)>") {
// Removing parenthesis automatically added by pattrstorage if the preset has a name but isn't filled
name = name.slice(1, -1);
}
@@ -1484,7 +1486,6 @@ function resync() {
to_pattrstorage("getslotlist");
to_pattrstorage("getlockedslots");
calc_rows_columns();
}
function find_pattrstorage(name) {
@@ -1500,7 +1501,6 @@ function find_pattrstorage(name) {
if (pattrstorage_obj != null) {
pattrstorage_name = name;
filled_slots_dict.name = pattrstorage_name + '_presets_dict';
slots_clear();
// this.patcher.hiddenconnect(pattrstorage_obj, 0, this.box, 0);
// post('lets find presets_metata pattr for', name, '\n');
if (use_uid || color_mode > 1) connect_to_metadata_pattr();
@@ -1933,11 +1933,11 @@ ondblclick.local = 1;
function ondrag(x,y,but,cmd,shift,capslock,option,ctrl)
{
if (pattrstorage_name != null) {
y -= y_offset;
if (is_dragging === 0 && !but) {
// Triggering onclick() interactions when click releases if no drag happened
onclick(x, y, 0, cmd, shift, capslock, option, ctrl);
}
y -= y_offset;
if (drag_mode > 0 && !cmd && !shift && !ctrl) {
switch (is_dragging) {
case 0: // Not dragging yet
@@ -2075,7 +2075,7 @@ function ondrag(x,y,but,cmd,shift,capslock,option,ctrl)
if (!but) {
// When the click releases, we force onidle() to compute currently hovered slot
last_x += 1;
onidle(x, y, but, cmd, shift, capslock, option, ctrl);
onidle(x, y + y_offset, but, cmd, shift, capslock, option, ctrl);
}
}
}
@@ -2152,6 +2152,9 @@ function setpattrstorage(v){
} else {
pattrstorage_name = arrayfromargs(arguments)[0];
}
if (has_loaded) {
do_loadbang();
}
}
setpattrstorage.local = 1;

View File

@@ -1,7 +1,7 @@
{
"name" : "tc.preset",
"displayname" : "",
"version" : "1.5.1",
"version" : "1.5.3",
"author" : "Théophile Clet",
"authors" : [ ],
"description" : "A jsui replacement for the preset object",

View File

@@ -1,7 +1,7 @@
{
"name" : "tc.preset",
"displayname" : "",
"version" : "1.5.1",
"version" : "1.5.3",
"author" : "Théophile Clet",
"authors" : [ ],
"description" : "A v8ui replacement for the preset object",