Repository navigation
Bundle 4/6: the options screen - #148
Open
MortenLyhr wants to merge 31 commits into
Open
MortenLyhr wants to merge 31 commits into
MortenLyhr wants to merge 31 commits into
Conversation
The original keeps four of the toggles by the minimap in its player profile (Profiles/<name>.pfl, named by CivilizationIV.ini's UserProfile): the plot grid, the bare map, the yields and the scores, as CyUserProfile's getGrid, getMap, getYields and getScores. It writes the file at each click, and every game takes them from there: after a restart, a new game, and a loaded save (a save made with the grid on loads with the profile's grid). The unit and resource icon layers are not kept. (Watched in Wine.) OpenCiv4 now keeps them in its own profile (Documents/My Games/openciv4/ profile.ini) as grid=, map=, yields=, scores=: oc4options gives them to the host when the profile is read, and Screens::frame tells it when one is switched, by its button or its key. The scores toggle works (it did nothing, and the scores showed always), and CyUserProfile / CyInterface read the toggles as they are. New test minimap_toggles (oc4options with a stand-in host): a switched toggle is in profile.ini at once and comes back after a restart and with readFromFile; an older profile gives the defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 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>
… network greyed Measured in the original (Wine, BUG Mod) and made the same: - Profiles: one file each, Profiles/<name>.ini beside profile.ini (the original's Profiles\<name>.pfl), the loaded one named by profile.ini's UserProfile (CivilizationIV.ini's). The drop-down loads one (its options to the sounds, graphics, player options, minimap toggles and clock), Create New Profile writes the options under the typed name and loads it, Delete Profile deletes a file (the loaded one: the first is loaded; the last is kept). profile.ini keeps OpenCiv4's own options, the same whichever is loaded; an older profile.ini becomes the profile "openciv4". - Clock: setClockOn marks the clock just turned on (BUG's NJAGC starts over); getClockText in the user's own short time format (CoreFoundation, as the original takes Windows'), in 24 hours with 24 Hour Clock, with a * while the alarm is set. - Alarm: toggleAlarm sets it hours and minutes from this minute with the "Alarm will go off at 7:06 AM." popup; the getters as the original's (time left in the boxes, -1 when off); at that minute AS2D_ALARM and the "RIIIIIIIIING!" popup. - Broadband / Modem: greyed, with a tooltip saying why (no multiplayer); clicks do nothing. CyGTabCtrl.setEnabled works. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The original asks for a restart after Single Unit Graphics, Full-screen, Graphics Level, High Detail Terrain and Restore Defaults; here every option takes effect at once, so the restart popup is gone. - Graphics Level is the original's preset (measured in Wine): Low/Medium/ High switch the other options and qualities as the original does. - No Enemy Glow: enemies in the active team's land get the selection ring in the original's red (no dots) unless the option is on. - Show City Radius: the original's hatched area border style. - Globe View Buildings Disabled: no city models in the globe view. - Low Resolution Textures: textures from their half size level (the samplers' lowest level), at once. - Anti-Aliasing: real MSAA 2/4/8 on the main target, resolved per pass. - Movie Quality Low: no map drawn behind a playing movie. - Opening Menu: the temporary menu shows the chosen menu's loading picture and plays its music. - Render Quality, Globe Quality and High Detail Terrain are greyed out with a tool tip (no visible effect in the original either). - The options' defaults are read again (getGraphicOptionsInfoByIndex: the old name did not exist, so every default read as off). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nstead of 1 s The original has no such option (its Quick Moves speeds up only the player's own units). With it on, the turn worker waits 150 ms between the other civilizations' updates while one of their moves is shown, instead of the original's 250 ms: a move every 0.6 s, the camera still on each. Off by default, on the options' OpenCiv4 tab, kept in profile.ini as quickEnemyMoves. The game is unchanged (checksums equal). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
Closed
MortenLyhr
force-pushed
the
train/4-options
branch
3 times, most recently
from
November 21, 2026 19:38
a57a76c to
8309bcf
Compare
This was referenced Nov 22, 2026
Owner
|
No tech splash (NoTechSplash), no event messages on the screen (NoEventMessages), autosave every N turns and keep M (AutoSaveInterval 4, MaxAutoSaves 5) or OpenCiv4's own autosaves, field of view (FIELD_OF_VIEW, 0: GlobalDefines.xml's), a frame cap (SetMaxFrameRate). Kept in profile.ini; number boxes take digits only and are kept as typed. The autosaves as seen in the original under Wine (AutoSaveInterval 2, MaxAutoSaves 3, Saves\single\auto listed at the start of each of 16 turns): AutoSave_Initial_<year> at the game's start, then a save every interval's turn named AutoSave_<year> (AutoSave_BC-3920); when one more than the number kept is written, the oldest AutoSave_<year> goes in the same turn; the initial save is not counted and never deleted. Only BC years were seen, so an AD year's name is our guess. The rule is in AutoSaves.h, with a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reens have none) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rt getGameTurnYear) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Quick enemy moves (bssth#137) also speeds the others' walk from bssth#127 to 0.5 s, so each walk ends before the next shown move. - oc4options.py: profile.ini keeps every OpenCiv4 option (bssth#120's ini settings and bssth#137's quickEnemyMoves in _GLOBAL); greyed controls use the node's 'disabled' (bssth#132) where bssth#118 had 'enabled'; _GREY defined once. - minimap_toggles_test.py: reads the loaded profile's own file (bssth#118's Profiles/<name>.ini) as well. - player_options_test.py: the OpenCiv4 tab's options as the bundle has them (bssth#113's single-click city and bssth#130's keep-the-attacker checkboxes in the list). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BUG's options tabs (City Screen, Advisors) ran past the bottom of their window: the tab control's scroll panel (attachScrollPanel) was laid out as high as what it held. It now takes the height its window leaves it, as the original's, and its controls go into a scroll panel there: clipped to it, scrolled by the wheel and the scroll bar on its right, which shows only when they are longer (measured in Wine: the bar over the tan panel's right edge, the panel as wide as without it). How far it is scrolled is kept when the screen is laid out again after a click. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no longer clips what follows The Audio tab's volume sliders lie in a scroll panel inside the tab's: one inside another is as high as what it holds. An edit box in a clipped panel pushed its clip twice and took one off, so everything drawn after it was cut to the edit box (the Options screen's Other tab showed its clock column only, the Audio tab lost Restore Defaults and Exit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The folder comes from profile.ini as UTF-8, but path(std::string) reads it in the system's code page on Windows: a folder named in what that page can't hold played nothing, and a file such as 東京.mp3 made path::string() throw. The folder now goes through pathFromUtf8, the files' paths come back through utf8Path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hole Python 2's str(u'...') raised on a profile name or a music folder that isn't ASCII (the error only printed). They are kept as UTF-8 now, and the files are opened by their unicode names (Windows' wide calls, not the code page). A profile file and profile.ini are written beside themselves first and then moved over the old one, so a crash while writing leaves the old file. Tested with such a name and folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k; one in 25 turns kept - No Documents folder found: no autosave. Before, the path was relative to the working directory, and autoSavesBeyond deleted the AutoSave_ files there. - The settings are set by the options' script and read on the game's thread: now through SharedAutoSaveSettings, behind a mutex. - OpenCiv4's own autosaves kept the turn-25 save only when the interval divided 25; now the first save in each 25 turns is kept (openciv4KeepsForGood, tested). - AutoSaves.h's comment without the date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MortenLyhr
force-pushed
the
train/4-options
branch
from
November 23, 2026 09:00
984e4bb to
c156717
Compare
Contributor
Author
|
Thanks for the review. #148 is rebased on master (bundles 1–3 and the merged standalone PRs are gone from its diff), and each item is fixed:
Clean room: #120's autosave rule was first written from the exe's strings. It was later checked in the running game under Wine, so the code didn't change. Since #148 carries #120's commits, I rewrote that history too: the commits that wrote the rule are now one commit, and its message gives only the Wine run as the source. Checked on macOS: ctest 20/20, and the 100-turn checksum is 🤖 Generated with Claude Code |
…de page On Windows, Python 3's text-mode open() uses cp1252, so writing a profile named 東京 raised UnicodeEncodeError (windows-x64 CI, options_other). The files are now opened in binary mode with the text encoded as UTF-8, and read back the same way, under the game's Python 2.7 and the tests' Python 3 alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Rebased on master (2026-11-23): bundles 1–3 are merged, so this branch is based on master now and shows only its own changes. Merge it before bundles 5 and 6 (#149, #150), which hold it.
Clean room (2026-11-23): #120's history is rewritten. The commits that first wrote the autosave rule from the exe's strings and the commit that re-checked it in Wine are now one commit, whose message gives only the Wine run as the source.
fix/ini-options(#120's branch) is force-pushed with the same history.This PR replaces 7 open PRs, merged here one by one with their own commits (each description stays on its PR, which links here once closed); the conflicts between them are resolved as on the branch we play daily. Merging it closes nothing automatically: each replaced PR will be closed with a link here.
Commits of this bundle's own (on top of the merges):
_GLOBAL); greyed controls use Options -> Graphics: every option as the original's, without a restart #132'sdisabled(Options > Other: profiles, the clock and the alarm as the original's; network greyed #118 hadenabled); the tests read Options > Other: profiles, the clock and the alarm as the original's; network greyed #118's per-profile file and list the tab's options.Checks: macOS build (Release), ctest 19/19 passed; sync checksums
--turns 100 --map Fractal --size STANDARD --seed 7at turn 100 equal master's (D7D43800). Windows: this PR's CI.Autosaves: rule re-checked in the running game (2026-11-22,
3eab86e7)#120 had based the autosaves after the first turn on
stringsfrom the original's exe, against CONTRIBUTING. The rule was watched in the running game under Wine instead (interval 2, 3 kept, 16 turns; see #120's added section). One difference was fixed: the initial autosave is no longer counted among the kept ones, nor deleted. Bundles 5–6 restacked on top by merges. ctest 19/19, sync checksumD7D43800, as before.🤖 Generated with Claude Code