dolphin/Source/Core/DolphinQt/Config
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
..
ConfigControls DolphinQt: Allow ConfigComplexChoice to handle DefaultState values. 2025-03-17 20:46:24 -05:00
ControllerInterface DolphinQt: Set window decorations for all top-level QWidgets. 2023-08-12 16:54:54 +02:00
Graphics Config: Expose Default and 1x Anisotropic Filtering setting. 2025-03-17 20:46:24 -05:00
Mapping Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection 2025-03-23 15:56:13 -04:00
ToolTipControls DolphinQt: Fix BalloonTip positioning on secondary monitors. 2024-03-20 03:13:11 -05:00
ARCodeWidget.cpp Fixed Multi Config Code Approvals 2025-03-15 07:57:16 -04:00
ARCodeWidget.h CheatsManager: Create ARCodeWidget and GeckoCodeWidget only once. 2024-08-25 23:44:17 -07:00
CheatCodeEditor.cpp DolphinQt: Extract creator name from code name in Gecko codes. 2025-03-23 21:37:23 +00:00
CheatCodeEditor.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
CheatWarningWidget.cpp Partially revert "Revert "Audit uses of IsRunning and GetState"" 2024-10-04 18:35:41 +02:00
CheatWarningWidget.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
CommonControllersWidget.cpp DolphinQt: Set window decorations for all top-level QWidgets. 2023-08-12 16:54:54 +02:00
CommonControllersWidget.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
ControllersWindow.cpp Qt/WiimoteControllersWidget: Add bluetooth unavailable message 2023-02-24 14:30:43 -08:00
ControllersWindow.h Qt/WiimoteControllersWidget: Add bluetooth unavailable message 2023-02-24 14:30:43 -08:00
FilesystemWidget.cpp Remove unused lambda capture 2024-08-13 10:26:25 +02:00
FilesystemWidget.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
FreeLookWidget.cpp AchievementManager: Make GetInstance() return a reference 2023-12-11 13:36:39 -05:00
FreeLookWidget.h Qt: Rename GraphicsChoice to ConfigChoice 2023-04-25 11:39:24 -07:00
FreeLookWindow.cpp Disable Freelook in hardcore mode 2023-12-02 16:41:16 -05:00
FreeLookWindow.h Disable Freelook in hardcore mode 2023-12-02 16:41:16 -05:00
GameConfigEdit.cpp Use 'contains' method 2024-08-15 14:20:16 -07:00
GameConfigEdit.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
GameConfigHighlighter.cpp DolphinQt: Adjust panel-specific colors and syntax highlighting for dark theme. 2023-08-12 19:43:12 +02:00
GameConfigHighlighter.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
GameConfigWidget.cpp Add method to bold slider/spin labels when a user game ini setting is being used 2024-12-10 13:42:30 -07:00
GameConfigWidget.h Add GFX property tabs to game properties window, allowing them to be set to the user game ini. Additionally, refactor ConfigWidgets to reduce duplication. Refactor GameConfigWidget to use config system. 2024-12-10 13:40:30 -07:00
GamecubeControllersWidget.cpp DolphinQt: Rename "GameCube Adapter for Wii U" to "GameCube Controller Adapter". 2024-10-31 01:25:36 -05:00
GamecubeControllersWidget.h Qt/GamecubeControllersWidget: Disable dropdowns during netplay. 2022-10-02 23:10:43 +02:00
GeckoCodeWidget.cpp Fixed Multi Config Code Approvals 2025-03-15 07:57:16 -04:00
GeckoCodeWidget.h CheatsManager: Create ARCodeWidget and GeckoCodeWidget only once. 2024-08-25 23:44:17 -07:00
GraphicsModListWidget.cpp Modernize std::none_of with ranges 2024-12-15 19:54:17 -08:00
GraphicsModListWidget.h GraphicsModListWidget: Pass optional by const reference 2024-01-31 12:09:35 -05:00
GraphicsModWarningWidget.cpp DolphinQt: add warning if graphics mods are not enabled 2022-06-27 18:28:28 -05:00
GraphicsModWarningWidget.h DolphinQt: add warning if graphics mods are not enabled 2022-06-27 18:28:28 -05:00
HardcoreWarningWidget.cpp Scale back hardcore code block 2024-11-27 21:21:26 -05:00
HardcoreWarningWidget.h Added Hardcore Warning Widget 2023-12-02 16:41:15 -05:00
InfoWidget.cpp DolphinQt: Restrict size of banner image in game properties info tab. 2024-10-11 22:56:33 -05:00
InfoWidget.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
LogConfigWidget.cpp DolphinQt: Fix leak in LogConfigWidget 2023-04-04 16:05:23 -04:00
LogConfigWidget.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
LogWidget.cpp DolphinQt: Remove unnecessary qOverloads 2023-11-04 14:14:14 -07:00
LogWidget.h Common: Move FixedSizeQueue into Common namespace 2023-03-22 01:23:15 -04:00
NewPatchDialog.cpp Simplify std::find_if with std::ranges::find and projections 2025-03-09 13:26:35 -07:00
NewPatchDialog.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
PatchesWidget.cpp Disable memory patches in hardcore mode 2023-12-02 16:41:16 -05:00
PatchesWidget.h Disable memory patches in hardcore mode 2023-12-02 16:41:16 -05:00
PropertiesDialog.cpp Disable cheats in hardcore mode 2023-12-02 16:41:17 -05:00
PropertiesDialog.h Disable memory patches in hardcore mode 2023-12-02 16:41:16 -05:00
SettingsWindow.cpp Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
SettingsWindow.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VerifyWidget.cpp Constness of 'result' prevents automatic move [performance-no-automatic-move] (0 issues) 2024-08-13 21:51:43 +02:00
VerifyWidget.h VerifyWidget: Listen for Core::State OnEmulationStateChanged 2024-04-09 12:13:02 -07:00
WiimoteControllersWidget.cpp Core::GetState: Avoid Global System Accessor 2024-04-08 16:23:23 -07:00
WiimoteControllersWidget.h Qt/WiimoteControllersWidget: Add bluetooth unavailable message 2023-02-24 14:30:43 -08:00