Hallo everyone,
I just wanted to ask whether the new update could break compatibility with code from the previous versions.
I’m interested in the new asset features but I use “assetList”, saveText/loadText and a lot of “Documents:…”. Will those functions still work or will my project fail to run? I don’t want to risk breaking my projects since downgrading to a previous version isn’t possible anymore after updating.
Secondly, I read something in the description of the latest update about subfolders in projects and being notified about changes in “MyFolder”. Does that mean that Codea projects (exported) can have integration with the Files app or is this restricted to the development process? Could this be opened up to exported projects and is it possible for exported Codea projects to import new files such as images into its folder?
@LeonsaveText will continue to work with the string version but nearly anywhere you can use the "Documents:MyFile" syntax you can replace it with an asset key (asset.documents.MyFile). Using the string variant of some functions will print a warning that you should asset keys, but that’s the main change.
Does it also print a warning in an exported App? I use the parameter window, so any print on the console would be visible.
I hope it’s okay, if I repeat my second question :
I read something in the description of the latest update about subfolders in projects and being notified about changes in “MyFolder”. Does that mean that Codea projects (exported) can have integration with the Files app or is this restricted to the development process? Could this be opened up to exported projects and is it possible for exported Codea projects to import new files such as images into its folder?
On the second, yes you can integrate with the files app by monitoring a folder. For example, to monitor the documents folder for your app:
asset.documents.updated = function(lib)
-- lib is the asset key for the documents folder
print("Num files:", #lib)
for _,file in pairs(lib.all) do
-- scan through all the files to see what changed...
print(file.name)
end
end