Skip to content

Commit

Permalink
Issue 228
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyBars3k committed Mar 2, 2022
1 parent a0a7b61 commit 007ba6b
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions Superglue/MB_Superglue-Utils.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- @description MB_Superglue-Utils: Codebase for MB_Superglue scripts' functionality
-- @author MonkeyBars
-- @version 1.783
-- @changelog Add option: Abstract out source placement propagation (https://github.com/MonkeyBars3k/ReaScripts/issues/218)
-- @version 1.784
-- @changelog Remove from Pool doesn't recolor item if enabled (https://github.com/MonkeyBars3k/ReaScripts/issues/228)
-- @provides [nomain] .
-- serpent.lua
-- rtk.lua
Expand All @@ -21,7 +21,7 @@
-- General utility functions at bottom

-- for dev only
-- require("sg-dev-functions")
require("sg-dev-functions")


local serpent = require("serpent")
Expand Down Expand Up @@ -1725,10 +1725,6 @@ function handleSuperitemPostGlue(superitem, superitem_init_name, pool_id, select
_active_instance_length_has_changed = _pool_parent_last_glue_length ~= selected_items_length
end

if not this_is_reglue then
setSuperitemColor()
end

setSuperitemName(superitem, superitem_init_name)
addRemoveItemImage(superitem, "superitem")
storeRetrieveSuperitemParams(pool_id, _postglue_action_step, superitem)
Expand All @@ -1739,20 +1735,6 @@ function handleSuperitemPostGlue(superitem, superitem_init_name, pool_id, select
end


function setSuperitemColor()
local global_option_toggle_new_superglue_random_color = reaper.GetExtState(_global_options_section, _global_option_toggle_new_superglue_random_color_key)

if global_option_toggle_new_superglue_random_color == "true" then
setItemToRandomColor()
end
end


function setItemToRandomColor()
reaper.Main_OnCommand(40706, _api_command_flag)
end


function setSuperitemName(item, superitem_name_ending)
local take, new_superitem_name

Expand Down Expand Up @@ -3514,11 +3496,26 @@ function handleDePoolPostGlue(superitem, target_item_state, target_item_params)
getSetItemStateChunk(superitem, target_item_state)
getSetItemName(superitem, active_take_name)
storeRetrieveItemData(superitem, _instance_pool_id_key_suffix, new_pool_id)
setSuperitemColor()

return new_pool_id
end


function setSuperitemColor()
local global_option_toggle_new_superglue_random_color = reaper.GetExtState(_global_options_section, _global_option_toggle_new_superglue_random_color_key)

if global_option_toggle_new_superglue_random_color == "true" then
setItemToRandomColor()
end
end


function setItemToRandomColor()
reaper.Main_OnCommand(40706, _api_command_flag)
end


function setAllSuperitemsColor()
local current_window, retval, color, all_items_count, i, this_item, this_item_instance_pool_id

Expand Down

0 comments on commit 007ba6b

Please sign in to comment.