Skip to content

Options > Audio as the original's: theme sliders, speakers, own music folder; voice greyed - #119

Closed
MortenLyhr wants to merge 6 commits into
bssth:masterfrom
MortenLyhr:fix/options-audio
Closed

MortenLyhr wants to merge 6 commits into
bssth:masterfrom
MortenLyhr:fix/options-audio

Conversation

@MortenLyhr

Copy link
Copy Markdown
Contributor

Stacked on #87 (fix/options-screen): this branch holds its commits, so merge #87 first (or this merges both). Only the last commit (66d7273) is new.

Wine (the original) OpenCiv4 before OpenCiv4 after
wine before after

Wine and after: the same volumes (20, 0, 10, 19, 1, 10, Music No Sound). The original's speakers list: speakers

What it changes

Sliders. The six volume sliders and the two voice sliders were a stack of little check boxes (yellow bars). They are now the theme's slider (GFC_Control_StandardSlider_Style): its track, the light blue fill on the side the script's control flag names (CF_SLIDER_FILL_DOWN for the volumes: below the grip; CF_SLIDER_FILL_UP for the voice ones: left of it), and the grip. A press sets the slider where it is pressed, and while the button is held the grip follows the mouse from stop to stop, as in the original. The script hears NOTIFY_SLIDER_NEWSTOP at each new stop, so the volume changes at once. There is no click sound: in Wine a drag makes none.

  • The volumes keep the original script's display: a slider shows 19 − volume (the script's 20 - getVolume() - 1), so a volume of 19 or 20 shows at the top, and after a restart the grip is one stop above where it was let go. That is the original's too.
  • The slider is a generic screen widget (addSlider), so BUG's sliders (the options' dot map brightness, the field of view slider) and the World Builder's diplomacy slider (−100 to 100) draw and drag the same way.

Audio Speakers. The list was 15 empty rows. It now has the original's 15 setups (Mono, Stereo, Use System Config, Headphones, Dolby Surround, SRS Circle Surround, 4.0–8.1 Discrete, DirectSound 3D, EAX 2.0, EAX Advanced HD 3.0 and 4.0, as Wine's getSpeakerConfigFromList gives them). The choice is kept in the profile and shown when the tab opens. (The original shows Mono whatever was saved: it compares the saved name, "Stereo", with the list's text keys.) On macOS the sound goes out as the system has it set; Mono mixes both sides together.

Custom Music Folder. Browse opens the system's folder dialog. The folder chosen goes into the path box with the box ticked (the game's own updateMusicPath) and is kept. While ticked, the folder's MP3 and WAV files play in random order instead of the era's soundtrack; ticking, unticking or choosing another folder fades the playing track out and switches at once. A long path is cut at the box's edge.

Voice chat. The original's is GameSpy multiplayer voice, which OpenCiv4 doesn't have. The section is drawn as in the original, with the Mac's own microphones and outputs in the lists and the sliders at 67, but disabled, with the tool tip "OpenCiv4 does not implement voice chat."

Layout. As Wine's: the voice column keeps its width and the speakers and music column takes the rest; the path box fills its row. (The other tabs are pixel for pixel the same as before.)

Kept between games and restarts. The volumes, No Sound boxes, speakers and music folder are in profile.ini, written after every control used, as before. They are the program's, not a game's, so loading another game keeps them (as the original's profile).

Not done: the original's Sound Blaster X-Fi logo (left out by choice).

Testing

  • Wine (plain BtS, WINE_VOLUME=10) and OpenCiv4 side by side with volumes 20/0/10/19/1/10 and Music No Sound: grips and fills at the same places.
  • --keys "<503,280:503,340>" (new: a left-button drag) drags Master in OpenCiv4 through the window's real input; the profile has volume.Master=5; a restart shows it kept.
  • A click on Music's No Sound: nosound.Music=1.
  • A folder chosen (oc4options.folderChosen, as the dialog answers): the path box shows it, the box is ticked, musicPath is kept, and OC4_PLAY_LOG shows the folder's files playing.
  • ctest 14/14; checksums unchanged (D7D43800).
  • Not tested by hand: the folder dialog itself (Browse) and hearing Mono; both need a person at the window.

🤖 Generated with Claude Code

MortenLyhr and others added 6 commits November 20, 2026 13:50
… OpenCiv4's own options on their own tab

The original keeps the player options in its player profile and sends them to the
active player at the start of every game, new or loaded (CvGame::sendPlayerOptions);
OpenCiv4 used the XML's defaults for a new game and the save's own after a load, and
never wrote them to profile.ini. Now Utility holds the profile's (profile.ini player.N),
a choice sent from the options screen goes into it and is written at once.

The options screen's check boxes get the theme's GFC_Control_StandardCheckBox_Style, as
the custom game screen's; W A S D, idle turns and edge scrolling move to an OpenCiv4 tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rges cleanly with bssth#85)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly with bssth#85)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…abs, GFC's box layout

Measured on the original's options screen (Wine, BUG + BULL): the standard window's title bar
with the title at the left, tabs as wide as their words from the left (the theme's tab skins,
the chosen one lighter, a baseline under them), 31 px rows (GFC's default control height),
16 px text, a box's children as wide as they need with the rest to those that expand (the
two columns of player options) or to the spacers (Language at the panel's foot), Restore
Defaults and Exit centred under the panel. Empty panels take no room. CyGTabCtrl's
setActiveTab/getActiveTab work, so a script can open a tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owed

Before the player options were kept as choices, the options screen wrote
every player option it had shown, and it showed those the profile did not
have as off. Such a profile has Wait at End of Turn off (and advisor
pop-ups, Sid's tips) though the player never chose it; with Wait at End of
Turn off the game core ends each turn by itself once a unit has moved, so
turns seemed to end on their own.

The profile now has a version (2). One without it gets, once, the XML's
default for the options that are on by default and off there; every other
choice stays, and from then on off is the player's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ic folder

- Sliders are the theme's (GFC_Control_StandardSlider_Style): track, the light blue fill on
  the side the control flag names (CF_SLIDER_FILL_DOWN / _UP), and the grip, which follows
  the mouse while held (NOTIFY_SLIDER_NEWSTOP to the script at each new stop). They were a
  stack of little check boxes. No click sound, as the original's.
- Audio Speakers lists the original's 15 setups; the choice is kept, Mono plays both sides
  the same.
- Custom Music Folder: Browse opens the system's folder dialog; ticked, the folder's MP3 and
  WAV files play instead of the era's soundtrack, at once.
- Voice chat (the original's GameSpy voice) is shown with the system's devices but disabled,
  with a tool tip saying OpenCiv4 does not implement it.
- The path box gets the row's width as the original's; an edit box's text is kept inside it.
- --keys "<x,y:x2,y2>" drags with the left button (for scripted checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MortenLyhr

MortenLyhr commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Included in bundle 4/6, #148, merged there with its own commits and with its conflicts with the other open PRs resolved (the bundle PR lists them). Closing in favour of #148.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant