Closed sc2ad closed 5 years ago
I haven't done a full review of this yet, will take a closer look tomorrow. But one thing I'll note is that removal shouldn't involve JSONTypes
except with maybe a helper, you should be able to delete a level just based on its levelD
field without having the original JSON version on hand, all the info needed to delete it should be in the assets. It looks like you already mostly use the asset data so this mostly will involve moving the method to SerializedAssets
Also I put your Windows fix in ahead of time since it's more urgent, which means this PR needs a rebase/merge.
An idea I had: by analogy to tracing garbage collectors, you can use the same routine to find the pointers you need to delete on the object you're deleting, and find the pointers you need to fix up on objects where you're fixing up the pointer pathIDs. Have a method on AssetData
and BehaviorData
like void Trace(Action<AssetPtr> del)
that calls the delegate for all AssetPtrs in the asset.
I have made quite a few patches, the most important being the addition of removals, allowed for a command line argument for replacing the existing texture for the ExtrasCollection, added splitting of assets after assets was saved (fixed some issues when installing), reassigning of PathIDs via any object.Trace, and verified all of the following by signing and verifying the existing .apk.
-r
as any argument will remove existing songs that exist in the songs folders and songs that match levelIDs already saved. This is required sometimes, if the original songs folder contains duplicates, as the zipalign will fail without removal of these duplicate levelIDs.-s path/to/my/custom/texture.rgb
as any positional argument will overwrite the existing ExtrasCollection icon with the cover image of your choosing. Just confirm that it is in the proper format before attempting to run this command, as there is no double checking. If anything, this is one of the largest areas for improvement.@sc2ad Check out #5 which I'm going to merge shortly. It should fix the problem that lead you to implement re-splitting so you can probably get rid of the re-splitting. Previously the manifest wasn't updated when we added/removed files but now the manifest is re-built.
Although keep the code around in Git history because it might be good for performance, or it might be bad for performance I really don't know. Might be worth testing with a huge library and see if we can notice any frame rate or loading time differences. I can see it going either way, so for now I'm inclined to keep it simpler for patcher performance and reliability reasons.
This PR is now SIGNIFICANTLY outdated. For that reason, I am closing it.
Okay, so, I finished up most of what I wanted to do, I made some way of removing. However, I want to mention a few things first: