# SaveEditorForPathologic2 This desktop application is built using .NET and Avalonia UI and serves as a Save Editor for Pathologic 2, allowing users to modify player stats, add money in-game and maximize the current quantity of items in the inventory. ## Fixes and New Functionality: - Threading Error: Fixed the "Call from invalid thread" error related to performing UI operations from the wrong thread. I used Dispatcher.UIThread.InvokeAsync to ensure execution on the UI thread. - Crash when closing dialog without selecting a folder: Added a null check for the dialog result in the OpenSave to avoid crashing when closing the dialog window without selecting a folder. - Double invocation of the OpenSave: Optimized the process of working with decompressed files to avoid re-invoking the method. Now, after decompression, the file is loaded automatically. - Residual .xml file after compression: Added logic to delete the original .xml file after it has been successfully compressed in the Save method. - Fixed the Immunity stat: The Immunity stat was not being saved correctly. I fixed this by updating the Save method to include the Immunity stat. - Maximize Item Counts: Added the ability to maximize the current quantity of items in the inventory. This new feature allows users to increase the count of each item to its maximum allowed value. ## Features: - Player Stat Editing: Modify various player stats such as health, hunger, etc. - Currency Addition: Add in-game currency to the player's inventory. - Maximize Item Counts: Added the ability to maximize the current quantity of items in the inventory. ## Usage: 1. Load Default Save: Launch the application and press 'Load Save' to load the default Pathologic 2 save file. 2. Open Save: To load any other save file, press 'Open Save'. 3. Edit Player Stats: After loading a save file, press 'Player Stats' to edit the player's parameters such as health, hunger, thirst, etc. 4. Add Money: Press 'Add Money' to increase the player's money count to a predefined value. 5. Maximize Item Counts: Press 'Maximize Item Counts' to increase the current quantity of all items in the inventory to their maximum allowed values. 6. Save: After making changes, press 'Save' to save and compress the modified save file. The original .xml file will be deleted after successful compression. ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. ## Author TheMysteriousStranger90 ## License This project is licensed under the terms of the GNU General Public License v3.0 (GPL-3.0) - see the [LICENSE](LICENSE) file for details.