OpenLoco / ObjectEditor

A modern implementation of 'LocoTool' for dat file parsing
7 stars 3 forks source link

"Download" button should download the original dat, not the extracted one. #131

Open LeftofZen opened 1 week ago

LeftofZen commented 1 week ago

Using Online mode in the editor to view and download objects, the file that is downloaded and saved to disk will be the extracted/unencoded version of the DAT file. This means the images are not compressed. This means some DAT files go from 700kb to 19mb, a massive size increase. Since the game can read the encoded versions, we should simply save the original encoded version of the file.

I wasn't aware the size increase could be so great, and this means I might have to implement compression into object saving (even just single pass would be good)

LeftofZen commented 1 week ago

Just recently I added the auto-save and this DOES save the original bytes: https://github.com/OpenLoco/ObjectEditor/blob/master/Gui/Models/ObjectEditorModel.cs#L225

But clicking the button "Download" we do save the uncompressed file, which is the issue: https://github.com/OpenLoco/ObjectEditor/blob/master/Gui/ViewModels/DatTypes/DatObjectEditorViewModel.cs#L184