Repository navigation
Leave Go To (and every interface mode) when the selection changes, as the original - #156
Merged
Merged
Conversation
The interface mode (Go To, Route To, Ping, ...) stayed on when W, the unit bar or a click selected another unit, so the next click sent the new unit there. The original (Wine) goes back to selection mode whenever the selection list is cleared or changed, even when the same unit is selected again, and when a city is selected. Interface::leaveInterfaceMode() is called from clearSelectionList, insertIntoSelectionList, removeFromSelectionList, selectAll and selectCity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
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.
Pressing G puts the interface in Go To mode (
INTERFACEMODE_GO_TO). If another unit was then selected, with W, the unit bar or a click, OpenCiv4 stayed in Go To, and the next click sent the new unit there.In the original BtS, the interface goes back to selection mode as soon as the selection list is cleared or changed. That holds for Go To, Route To, Ping, and a mode set by a script. It was checked in the original game under Wine by logging
CyInterface().getInterfaceMode()on every game update:The change is in the host's
Interface. A newleaveInterfaceMode()is called fromclearSelectionList, frominsertIntoSelectionList(when a unit is inserted or the list was cleared), fromremoveFromSelectionList, fromselectAlland fromselectCity.CvGame::handleActionselects the group before it sets the mode, so G and Shift/Alt modes that select the stack first still work.Checked: ctest; the 100-turn checksums (
--turns 100 --map Fractal --size STANDARD --seed 7) match master'sD7D43800. OpenCiv4 with--keys "~GW[66,47]"andOC4_PLAY_LOG=1: before,INTERFACEMODE_GO_TO at 66,47: done(the new unit sent off); after, the click selects instead.Related: #97 (Route To path), #108 (Go To path look). Conflicts with neither.
🤖 Generated with Claude Code