Repository navigation
Options screen as the original's; player options kept in the profile - #87
Closed
MortenLyhr wants to merge 5 commits into
Closed
MortenLyhr wants to merge 5 commits into
MortenLyhr wants to merge 5 commits into
Conversation
… 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>
Contributor
Author
|
One more commit ( 🤖 Generated with Claude Code |
This was referenced Nov 20, 2026
Closed
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What it changes
Player options are kept, as in the original. The original keeps the Game tab's options (Wait at End of Turn, Quick Combat, Automated Workers Leave Forests, …) in the player's profile (
Profiles/<name>.pfl). The game core sends the profile's options to the active player at the first update of every game, new or loaded (CvGame::sendPlayerOptions;m_bPlayerOptionsSentisn't saved), and again at each hot-seat switch. So a save's own options are overwritten by the profile's.OpenCiv4 gave the game core the XML defaults for a new game and the save's own options after a load (
setProfileOptionsFromPlayer), and never wrote them toprofile.ini, so every choice was lost at the next game.Utilitynow holds the profile's player options (profile.iniplayer.N=, 0 = the XML default).getPlayerOptionanswers from them, andsendPlayerOptionwrites into them too, at the main menu as well.oc4optionsgives them to the host when the profile is read, and writes the file after every control used on the options screen (the original writes its profile at each click). Restore Defaults on the Game tab resets them and sends the defaults to the player.CyUserProfile.getPlayerOptionreads the profile, not the active player.The window looks like the original's (measured on a Wine picture of the same screen with BUG + BULL):
oc4wbalready draws the WorldBuilder's tool window.GFC_Control_StandardCheckBox_Style, as the custom game screen draws them. Rows are 31 px (GFC's default control height) and the text is 16 px (the theme's size 3).CyGTabCtrl.setActiveTab/getActiveTabwork, so a script can open a tab.OpenCiv4's own options get a tab of their own. Pan the map with W A S D, End idle turns automatically, and Scroll the map at the screen edge were on the Game tab, which the original doesn't have. They are now on a fifth tab, "OpenCiv4", after the original's four, so the Game tab is the original's.
Profiles the old screen wrote get the defaults it never showed (
a4ea00b). Master's options screen showed every player option the profile lacked as off, and saved it so: those profiles have Wait at End of Turn, advisor pop-ups and Sid's tips off though never chosen. With Wait at End of Turn off the game core ends each turn by itself once a unit has moved (CvGame::updateTestEndTurn, as the original), which looked like turns ending on their own. The profile now hasversion=2; one without it gets, once, the XML's default for the options that are on by default; every other choice stays.How it was checked
ctestpasses: 14/14 (macOS, Release), with the newplayer_optionstest (oc4options.pywith a stand-in host, run by Python 3). It checks:profile.iniat once, and the host has it after a restartversion=2) gets the default-on options once, and keeps every other choiceGame results unchanged:
--turns 100 --map Fractal --size STANDARD --seed 7gives the same checksum as master on every turn, ending atD7D43800.In the game (
testgames/shots/options/oc4-check.sh, its own Documents folder):On master, none of this is kept.
Pictures: Wine | before | after for each tab in
compare-options/.Original saves still load: not affected (nothing in the saves changes).
Pictures (Wine | before | after, BUG + BULL)
Game

Graphics

Audio

Other

The OpenCiv4 tab

Before, a script could not open another tab (
setActiveTabdid nothing), so the before picture is the Game tab each time.Left, seen but not done: the tab words are a shade heavier than Wine's; the Graphics tab's vertical divider and the Network panel's background (Other tab) aren't drawn; sliders and radio buttons are still OpenCiv4's simple stand-ins.
🤖 Generated with Claude Code