PatchIt! Dev-log #10

March 11, 2013,
Revised May 29, 2013
#10 Post-creation, in-app editing of PiP file

JimbobJeffers made this suggestion for PatchIt!: perhaps it would be possible to edit the PiP file after creating it, but from within PatchIt! instead of an external editor. I thought about this idea, and it would be a great addition to PatchIt!, but it would have to come later on in the V1.1.x series. In this Dev-log, I will very roughly explain why this addition will work. (I said very roughly because this Dev-log is very scattered, and may be harder to follow than my other Dev-logs.)


PatchIt! Dev-log #9 has been intentionally skipped. The contents of the Dev-log dealt with the creation of a GUI, and the library that was to be used for such. However, the conclusion it reached is no longer valid, as other ways a GUI could be implemented have come up, and are being researched. Therefore, PatchIt! Dev-log #9 will not be posted.

Since I will already have a full GUI written up and an multi-line editor for Patch Creation (allowing everything to be done in one step), I can reuse that code and auto-populate it with the info from the PiP file. But I’m getting ahead of myself. When PatchIt! is loaded, the user will have the standard options, but there will be a new option: “Edit a PatchIt! Patch“. When it is clicked, the user will select a PiP file, all the info will be gathered, and the multi-line editor will come up. But first, the validity line is read, ensuring it is a Patch, and a Modern Patch at that (if the Legacy Installation module is still present), and a file check for the Patch archive will be conducted to ensure it exists. Only if everything checks out will the editor come up. It will look like the Patch Creation screen, except the Game field will be grayed out, and cannot be changed. Of course, there will also be the obligatory Save and Cancel buttons. If the user clicks Cancel, all changes are lost, and the PiP is left alone. If they click Save, the changes are saved (duh). Since the inplace setting in the fileinput module is hard to use and doesn’t always work, the changes will be saved in the following manner. When a Patch is selected for editing and everything checks out, a copy will be made with .bak appended to the file extension. When the change are saved, the non .bak file is rewritten with the new info, and the Patch archive is renamed (if needed). If Cancel is clicked, the .bak is deleted, the PatchIt! main menu is loaded, and the Patch is not touched any more.

Clearly, this Dev-log pulls a lot of code from my other Dev-logs and changes, so that is why I said it would have to come later in the V1.1.x series. 🙂


I originally wrote this Dev-log on March 11, but I revised it in May 29 with updates from issues and changes that surfaced since the initial writing, such as the Game field and Patch archive, as well as improving the actions and fields of the PiP Editor.