Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Store GameSettings.lua addresses as a JSON #497

Closed
UTDZac opened this issue Dec 16, 2024 · 1 comment · Fixed by #505
Closed

[Feature Request]: Store GameSettings.lua addresses as a JSON #497

UTDZac opened this issue Dec 16, 2024 · 1 comment · Fixed by #505
Assignees
Labels
Feature Request A new feature idea Fixed/Added in Dev Bugs fixed / Features added in dev, but not in main/release yet.
Milestone

Comments

@UTDZac
Copy link
Collaborator

UTDZac commented Dec 16, 2024

Tell us about your request

Goal of this change

Makes it easier for custom ROM hack developers to conveniently provide a list of changed addresses for the Tracker to load up and use.

Process of implementation

Move the hard-coded addresses from GameSettings.lua to JSON files, one file for each supported game version (such as Emerald, FireRed v1.0, FireRed v1.1, etc.)

Example custom code extension

Here is a snippet of code showing how a custom code extension uses this concept to replace the used addresses:

self.offsetFiles = {
    [2] = "offsets_em.json",
    [3] = "offsets_fr.json"
}
self.extensionKey = "MAXExtension"
local offsetFile = self.offsetFiles[GS.game] or "offsets.json"
local filePath = FileManager.getCustomFolderPath() .. self.extensionKey .. FileManager.slash .. offsetFile
local off = FileManager.decodeJsonFile(filePath)
--pass the off table into a function that loads everything into the game settings

Example JSON file

Definitely want a bit more structure than this, but here is a loose example

{"gBattleTerrain":33697776,"gBattleStruct":33703068, ... }

Additional Information

No response

@UTDZac UTDZac added the Feature Request A new feature idea label Dec 16, 2024
@UTDZac UTDZac self-assigned this Dec 16, 2024
@Fellshadow Fellshadow added this to the 9.0.0 milestone Jan 8, 2025
@Fellshadow Fellshadow added the Fixed/Added in Dev Bugs fixed / Features added in dev, but not in main/release yet. label Jan 8, 2025
@UTDZac
Copy link
Collaborator Author

UTDZac commented Jan 8, 2025

Completed in v9.0.0

@UTDZac UTDZac closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request A new feature idea Fixed/Added in Dev Bugs fixed / Features added in dev, but not in main/release yet.
Projects
None yet
2 participants