Since reload() and cstore() can now read and write across carts, it should be possible to create tools to edit carts from within pico8.
I'm making a small utility to reorganize the sfx samples (and remap them to the music accordingly). Keeping it on pico8 itself allows the user to preview what each sample sounds like.
However, it would be great if filesystem commands were accessible from carts themselves.
It is possible to use the commands, but for instance, it would be great if ls() returned a table with the files in the current directory, instead of just printing them to the screen directly.
This would allow to make file browsers (like splore) to choose carts to edit from a running cart.
I was initially thinking of a table with filenames as keys and file type as value, but you could also make an array and have each entry hold another table with all the file metadata (name, type, size, etc)
something like this:
local files = ls() -- iterate over the files for k,v in pairs(files) do print(v .. " - " .. k) end --> d - wip --> f - disco_descent.p8 --> f - iconoclasm.p8 --> f - music_editor.p8 --> f - visualizer.p8
or, for the second implementation:
local files = ls() -- iterate over the files for file in all(files) do if file.type == "d" then color(14) print(file.name) else color(6) print(file.name .. " - " .. file.chars) end end --> wip --> disco_descent.p8 - 1175 --> iconoclasm.p8 - 0 --> music_editor.p8 - 2727 --> visualizer.p8 - 1160
Log in to post a comment