dolphin-emulator/Source/Core
cristian64 6d8ba94e4c DolphinQt: Extract creator name from code name in Gecko codes.
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:

```ini
[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:

```ini
[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:

- Right-click on any game and open the **Properties** dialog.
- Switch to the **Gecko Codes** tab.
- Press the **Add New Code...** button.
- In the **Cheat Code Editor** dialog:
  - Enter `This is a test [Jane Doe]` in the **Name:** field.
  - Enter `01234567 00000000` in the **Code:** field.
  - Press **Save**.
- Observe that the newly added code is now in the list, and *appears* to
  be enabled.
- Close the **Properties** dialog.
- Right-click on the same game and open the **Properties** dialog again.

**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.
2025-03-23 21:37:23 +00:00
..
AudioCommon AudioCommon: Added Granular Synthesis 2025-03-14 01:22:35 -05:00
Common Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection 2025-03-23 15:56:13 -04:00
Core Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection 2025-03-23 15:56:13 -04:00
DiscIO Modernize std::stable_sort with ranges and projections 2025-03-09 13:26:38 -07:00
DolphinNoGUI Merge pull request #13181 from tygyh/Replace-'reinterpret_cast' 2025-03-15 15:31:38 +01:00
DolphinQt DolphinQt: Extract creator name from code name in Gecko codes. 2025-03-23 21:37:23 +00:00
DolphinTool VerifyTool: Add missing USE_RETRO_ACHIEVEMENTS ifdefs 2024-12-15 18:15:57 +01:00
InputCommon Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection 2025-03-23 15:56:13 -04:00
MacUpdater Simplify std::find_if with std::ranges::find and projections 2025-03-09 13:26:35 -07:00
UICommon Modernize std::sort with ranges and projections 2025-03-09 13:26:38 -07:00
UpdaterCommon Simplify std::copy with std::copy_n 2024-10-07 15:34:56 -07:00
VideoBackends Enable game-requested anisotropic filtering in Metal backend. 2025-03-17 20:46:24 -05:00
VideoCommon Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection 2025-03-23 15:56:13 -04:00
WinUpdater Simplify std::find_if with std::ranges::find and projections 2025-03-09 13:26:35 -07:00
CMakeLists.txt CMakeLists: Embed macOS Updater app inside DolphinQt 2024-08-01 22:06:55 -04:00
DolphinLib.ARM64.props
DolphinLib.props Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection 2025-03-23 15:56:13 -04:00
DolphinLib.vcxproj AudioCommon: Added Granular Synthesis 2025-03-14 01:22:35 -05:00
DolphinLib.vcxproj.user
DolphinLib.x64.props
VersionInfo.plist.in ScmRevGen: Don't generate Info.plist files directly 2024-12-05 14:56:08 -05:00