DolphinQt: Extract creator name from code name in Gecko codes. #13217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Gecko codes in Dolphin feature a dedicated field for the creator of the cheat code. When saved into the INI file, the code name and the creator name are concatenated, and then inserted in the
[Gecko]
section:[Gecko] $<cheat code name> [<creator>] <code line 1> <code line 2> <code line 3> <...> $<other cheat code name> [<creator>] <code line 1> <code line 2> <code line 3> <...>
On the other hand, enabled codes are listed under the
[Gecko_Enabled]
section, but in this case the creator name is omitted from the line:[Gecko_Enabled] $<cheat code name> $<other cheat code name>
Having the creator name in the
[Gecko]
section but not in the[Gecko_Enabled]
section is arguably not ideal, but this is legacy behavior in Dolphin.The Cheat Code Editor dialog is not acknowledging this subtle behavior in Dolphin: the cheat code name and the creator name can be both inserted in the name field. This issue manifests as an inconsistent state where a Gecko code that appears to be enabled has no effect when the game is launched.
As part of this fix, the creator name (if present) is now moved into the dedicated creator field before the code is stored internally.
Test plan:
This is a test [Jane Doe]
in the Name: field.01234567 00000000
in the Code: field.Without the fix, the newly added code, while still on the list, has been inadvertently disabled (it was never really enabled!).
With the fix, the newly added code is the list and remains enabled.
This fixes https://bugs.dolphin-emu.org/issues/13695.