Opened 3 weeks ago

Closed 12 days ago

Last modified 12 days ago

#16883 closed defect (fixed)

BAGEL: HODJNPODJ: Th Gesng Gme checkboxes appear checked but save as unchecked

Reported by: BQ31X Owned by: dreammaster
Priority: normal Component: Engine: BAGEL
Version: Keywords:
Cc: BQ31X Game: Hodj'n'Podj

Description

### ScummVM version: 2026.3.0 on
macOS 26.4.1
Apple Silicon (M4)

In the Th Gesng Gme minigame options, “Show Category” and “Fixed Ordering” can be visibly checked, but pressing OK saves both options as disabled.

On a fresh configuration, both features initially work because their default values are enabled. After opening the options dialog and pressing OK, they stop working and cannot be re-enabled through the dialog.

### Steps to reproduce

  1. Start Hodj 'n' Podj.
  2. Open the standalone Th Gesng Gme minigame.
  3. Open its Options dialog.
  4. Check “Show Category” and “Fixed Ordering.”
  5. Press OK.
  6. Reopen the Options dialog or start another round.

### Actual behavior

Both options behave as disabled and appear unchecked when the dialog is reopened.

The target settings file contains:

[ThGesngGme]
ShowCategoryNames=No
RandomLetters=Yes

This also disables the spoken category announcement.
Expected behavior
The options should remain checked and be saved as:
ShowCategoryNames=Yes
RandomLetters=No

Possible root cause (hypothesis)
The issue may stem from a mismatch between the custom Hodj ‘n’ Podj checkbox state and CButton::GetCheck(). If correct, this would explain why the controls render as checked but are subsequently written to the configuration file as unchecked. The relevant source locations are listed below in case they help narrow the investigation.

CCheckButton::OnSetCheck() stores the visible state in m_bCheckState:
https://github.com/scummvm/scummvm/blob/v2026.3.0/engines/bagel/hodjnpodj/hnplibs/button.cpp#L1305-L1318
CCheckButton::DrawItem() also draws the X based on m_bCheckState, explaining why the controls look checked:
https://github.com/scummvm/scummvm/blob/v2026.3.0/engines/bagel/hodjnpodj/hnplibs/button.cpp#L1236-L1245
However, the options dialog calls the inherited GetCheck():
https://github.com/scummvm/scummvm/blob/v2026.3.0/engines/bagel/hodjnpodj/pdq/usercfg.cpp#L87-L99
The inherited implementation reads _itemState, not m_bCheckState:
https://github.com/scummvm/scummvm/blob/v2026.3.0/graphics/mfc/button.cpp#L44-L50
Consequently, ClearDialogImage() writes the options as unchecked:
https://github.com/scummvm/scummvm/blob/v2026.3.0/engines/bagel/hodjnpodj/pdq/usercfg.cpp#L426-L442
A possible fix would be to have CCheckButton::GetCheck() return m_bCheckState, or otherwise keep m_bCheckState and _itemState synchronized. CRadioButton may have the same state split and could be worth checking.

Workaround (tested)
With ScummVM closed, manually setting the target’s settings file to the following restores the features:
ShowCategoryNames=Yes
RandomLetters=No
Opening the minigame’s Options dialog and pressing OK overwrites the values again.

The relevant code paths appear unchanged on the current master branch as of 2026-06-26.

Change History (2)

comment:1 by dreammaster, 12 days ago

Resolution: fixed
Status: newclosed

In 0392219a:

BAGEL: MINIGAMES: Fix saving options in Th Gesng Game. Fixes #16883

comment:2 by dreammaster, 12 days ago

Thanks for the report. I did some brief experimentation, and the simplest solution was simply to delete the GetDlgData function entirely, since the checkbox event handlers in the dialog already properly toggle the two flags in question when you check/uncheck the item.

Note: See TracTickets for help on using tickets.