Repository navigation
Minimap toggles kept in the player's profile, as in the original - #85
Closed
MortenLyhr wants to merge 1 commit into
Closed
MortenLyhr wants to merge 1 commit into
MortenLyhr wants to merge 1 commit 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>
This was referenced Nov 20, 2026
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
The buttons by the minimap switch the plot grid, the bare map, the tile yields and the scores (and the unit and resource icon layers). In OpenCiv4 they started off in every game, and the scores button did nothing.
The original keeps four of them in the player's profile:
Profiles/<name>.pflin the user'sMy Games/Beyond the Sword(a binary file, named byUserProfile = ...inCivilizationIV.ini). The Python reads them back throughCyUserProfile().getGrid(),getMap(),getYields()andgetScores(), asCvMainInterface.updateGlobeLayersdoes for the buttons' states. Watched under Wine:.pflis written at each click, not when the game exits.OpenCiv4 now does the same in the profile it already has (
Documents/My Games/openciv4/profile.ini, beside the graphic options and volumes), asgrid=,map=,yields=andscores=. Defaults are the original's: everything off except the scores.oc4optionsgives them to the host when the profile is read (oc4host.load_map_toggles).Screens::framenotices when one has been switched, by its button or its key (Ctrl+T, Ctrl+B, Ctrl+Y), and hasoc4optionswrite the file at once.CONTROL_SCORESnow hides and shows the scores (Interface::toggleScoresVisiblewas a stub,isScoresVisiblealways false).CyUserProfileandCyInterface(isScoresVisible,isYieldVisibleMode, thetoggle...calls) read the toggles as they are.How it was checked
ctestpasses: 14/14 (macOS, Release), with the newminimap_toggles(oc4options.pywith a stand-in host, run by Python 3 when CMake finds it). It checks that a switched toggle is inprofile.iniat once, comes back after a restart and withreadFromFile, and that an older profile without the keys gives the defaults. It fails on master.--turns 100 --map Fractal --size STANDARD --seed 7gives the same checksum as master on every turn, ending atD7D43800(interface only).OC4_DOCUMENTS):grid=1 yields=1 scores=0.🤖 Generated with Claude Code