Skip to content

Commit

Permalink
restore fixes + QOL improvements
Browse files Browse the repository at this point in the history
FIXED:
- restoring a collection from a previous beta would cause errors due to new table entries

IMPROVED:
- arps start at default "last pressed" vs "additive"
  • Loading branch information
dndrks committed Oct 5, 2020
1 parent 5f50f62 commit 107b94f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
7 changes: 4 additions & 3 deletions cheat_codes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4197,11 +4197,12 @@ function named_loadstate(path)
if tab.load(_path.data .. "cheat_codes2/collection-"..collection.."/euclid/euclid"..i..".data") ~= nil then
rytm.track[i] = tab.load(_path.data .. "cheat_codes2/collection-"..collection.."/euclid/euclid"..i..".data")
end
for i = 1,3 do
rytm.reset_pattern(i)
end

end

arps.restore_collection()
rytm.restore_collection()

for i = 1,2 do
if tab.load(_path.data .. "cheat_codes2/collection-"..collection.."/delays/delay"..(i == 1 and "L" or "R")..".data") ~= nil then
delay[i] = tab.load(_path.data .. "cheat_codes2/collection-"..collection.."/delays/delay"..(i == 1 and "L" or "R")..".data")
Expand Down
6 changes: 6 additions & 0 deletions lib/arp_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,10 @@ function arp_actions.loadstate()
end
end

function arp_actions.restore_collection()
for i = 1,3 do
arp[i].down = arp[i].down == nil and 0 or arp[i].down
end
end

return arp_actions
10 changes: 4 additions & 6 deletions lib/euclid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,12 @@ function euclid.savestate()
end
end

function euclid.loadstate()
local collection = params:get("collection")
function euclid.restore_collection()
for i = 1,3 do
if tab.load(_path.data .. "cheat_codes2/rytm/collection-"..collection.."/"..i..".data") ~= nil then
euclid.track[i] = tab.load(_path.data .. "cheat_codes2/rytm/collection-"..collection.."/"..i..".data")
end
euclid.track[i].auto_rotation = euclid.track[i].auto_rotation == nil and 0 or euclid.track[i].auto_rotation
euclid.track[i].auto_pad_offset = euclid.track[i].auto_pad_offset == nil and 0 or euclid.track[i].auto_pad_offset
euclid.reset_pattern(i)
end
euclid.reset_pattern()
end

return euclid
4 changes: 2 additions & 2 deletions lib/grid_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function grid_actions.init(x,y,z)
if bank[i].quantize_press == 0 then
-- if (arp[i].enabled or (menu == 9)) and grid_pat[i].rec == 0 and not arp[i].pause then
if arp[i].enabled and grid_pat[i].rec == 0 and not arp[i].pause then
if arp[i].down == 0 and params:get("arp_"..i.."_hold_style") == 2 then
if arp[i].down == 0 and params:string("arp_"..i.."_hold_style") == "last pressed" then
for j = #arp[i].notes,1,-1 do
table.remove(arp[i].notes,j)
end
Expand Down Expand Up @@ -808,7 +808,7 @@ function grid_actions.init(x,y,z)
bank[id].id = selected[id].id
-- if (arp[id].hold or (menu == 9)) and grid_pat[id].rec == 0 and not arp[id].pause then
if (arp[id].enabled or (menu == 9)) and grid_pat[id].rec == 0 and not arp[id].pause then
if arp[id].down == 0 and params:get("arp_"..id.."_hold_style") == 2 then
if arp[id].down == 0 and params:string("arp_"..id.."_hold_style") == "last pressed" then
for i = #arp[id].notes,1,-1 do
table.remove(arp[id].notes,i)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/start_up.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function start_up.init()

params:add_separator("arps")
for i = 1,3 do
params:add_option("arp_"..i.."_hold_style", "arp "..i.." hold style", {"additive","momentary"},1)
params:add_option("arp_"..i.."_hold_style", "arp "..i.." hold style", {"last pressed","additive"},1)
end

params:add_group("manual control params",34)
Expand Down

0 comments on commit 107b94f

Please sign in to comment.