A Lua script for the Bizhawk/mGBA emulator compatible with Pokemon Fire Red, Leaf Green, Ruby, Sapphire, and Emerald that tracks relevant data for the IronMon challenge.
This is a new feature that expands upon the "Check for Version Updates" to allow the Tracker to fully and seamlessly update itself (HURRAY!!). The was a bit tricky to setup, and even trickier to test properly, but here is the current structure:
Changes
New files are Main.lua and UpdateScreen.lua. The first hosts mostly old code, with some new version-update additions, the second contains a new screen to show options for updating.
Most all code has been moved out of the Ironmon-Tracker.lua file into a Main.lua file. This is because the file that is loaded into Bizhawk cannot be auto-updated without manually reloading the script or restarting the emulator. All the other files can be reloaded live while the emulator is running. Thus, after an update completes, there needs to always be a function exposed from the primary Tracker script to reload all other files.
The Tracker version has intentionally been set to "1.0.0" to help with testing. Prior to an official release to main branch, this will be updated to the next major version: "7.0.0"
On the Navigation Menu screen for Tracker settings, there is now a 5th button for "Check for Updates" which is always available. This is helpful if you accidentally clicked to skip the current update release, or if a new update came out in the middle of the day after the Tracker's once-a-day version check has occurred.
This button changes to "New Update Available" if the Tracker has already determined that an update is available. This is typically only noticeable under the scenario where the user saw the Version-Update screen originally but chose "Remind me tomorrow" or "Skip this update"
Feature Explanation
The Version-Update screen will appear under the same conditions that the old pop-up notifications would appear: typically only once per day and only if an new release is known to exist
Update automatically: This executes a series of batch commands that download, extract, and replacing existing Tracker files with the new ones. Afterwards, it reports the status of the update procedure (See below).
Remind me tomorrow: Informs the Tracker that you don't want to deal with updating right now, hiding this screen until the following day.
Skip this update: Hides the Version-Update screen permanently for this current newest release. You won't be notified of this screen again until a new major/minor update is released in the future.
View release notes: Simply opens a browser window to the latest release on Github, which is typically where release notes are.
Current Feature Concerns
While I hope most of this is functional as-is, its quite challenging to test that this will correctly download the latest release, since that won't actually occur until the release update after the release that includes this feature. Let me know if you have any questions about how to go about testing this. Most of my testing was setting internal variables to different states so that I could see what things looked like, as clicking the auto-update button would always replace all my code files :(
This uses batch commands to perform many actions related to downloading, extracting, and replacing Tracker files. While these worked on my own machine and environment, it's possible this may not work for all users' computers. This is challenging to test and ensure that all edge-cases are captured and handled properly.
The Version-Update Screen
Status Updates after clicking "Update automatically"
This is a new feature that expands upon the "Check for Version Updates" to allow the Tracker to fully and seamlessly update itself (HURRAY!!). The was a bit tricky to setup, and even trickier to test properly, but here is the current structure:
Changes
Main.lua
andUpdateScreen.lua
. The first hosts mostly old code, with some new version-update additions, the second contains a new screen to show options for updating.Ironmon-Tracker.lua
file into aMain.lua
file. This is because the file that is loaded into Bizhawk cannot be auto-updated without manually reloading the script or restarting the emulator. All the other files can be reloaded live while the emulator is running. Thus, after an update completes, there needs to always be a function exposed from the primary Tracker script to reload all other files.main
branch, this will be updated to the next major version: "7.0.0"Feature Explanation
Current Feature Concerns
The Version-Update Screen
Status Updates after clicking "Update automatically"