Skip to content

City screen: the camera holds (no drag, wheel, arrows or edge), as the original's - #155

Open
MortenLyhr wants to merge 2 commits into
bssth:masterfrom
MortenLyhr:fix/city-screen-camera-holds
Open

MortenLyhr wants to merge 2 commits into
bssth:masterfrom
MortenLyhr:fix/city-screen-camera-holds

Conversation

@MortenLyhr

Copy link
Copy Markdown
Contributor

In the original's city screen the camera stays on the city (checked in Wine, BtS 3.19):

Input on the city screen Original OpenCiv4 before
Left drag on the map the camera holds; it is a click on the plot where the button went down (that plot is worked or let go, wherever the button comes up; a press outside the city's plots leaves the screen) the map pans
Right drag the camera holds path / Ctrl: the camera turns
Mouse wheel no zoom zooms
Arrow keys Up and Down do nothing; Left and Right go to the previous and next city (the game's keys) the map scrolls
Mouse at the window's edge no scroll scrolls (with the edge-scroll option)

Now, while the city screen is up, OpenCiv4 does not pan on a left drag, turn the view on a right drag, zoom with the wheel (or a gamepad's triggers), or scroll with the arrows, W A S D, the window's edge or a gamepad's stick. A left drag is taken as a click where the button went down, as the original's. The keys still reach the game, so Left and Right still change city.

Original / OpenCiv4
After a left drag up, before
After a left drag up, after
After a left drag up, with the open PRs (tiles can be worked from the city screen): the plot pressed on is worked

Checks

  • ctest 13/13.
  • Sync checksums (--turns 100 --map Fractal --size STANDARD --seed 7) equal master's on all 100 turns (D7D43800): input only.
  • Master alone does not work tiles from the city screen; on the play branch (with the city screen tile PRs) a drag pressed on plot 39,36 or 39,35 worked that plot and the camera held.

🤖 Generated with Claude Code

…e original's

In the original's city screen the camera stays on the city: a left or right
drag, the wheel, the arrow keys and the mouse at the window's edge do not
move it (measured in Wine). A left drag there is a click where it was
pressed (its plot is worked or let go); Left and Right are the game's keys
(previous and next city). OpenCiv4 panned with a left drag, zoomed with the
wheel, turned with Ctrl and the right button, and scrolled with the arrows,
the edge and a gamepad, so the city slid off centre under the panels.

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

bssth commented Nov 23, 2026

Copy link
Copy Markdown
Owner

On the city screen the camera still moves: the gamepad stick's plot-step path sets camera.target directly (MapWindow.cpp:927; the !cityView check at 956 only covers pan), and a middle drag sets orbiting without the cityView check (MapWindow.cpp:2305, 1141).

…mera too

The left stick's plot steps set camera.target themselves, outside the pan
that the city screen already holds, and the middle button started a turn
without looking at the city screen. Both now leave the camera alone there,
as the arrows, the wheel and the left and right drags do (review on bssth#155).

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

Copy link
Copy Markdown
Contributor Author

Thanks, both fixed in 1d5d102:

  • Gamepad plot steps: the left stick's plot-step loop now stops while the city screen is up (i > 0 && !cityView), so it no longer sets camera.target there. The stick's pan was already held.
  • Middle drag: the middle button sets orbiting = down && !cityView, and onMouseMove only turns the camera for orbiting && !cityView, so a middle drag started on the map stops turning once the city screen opens.

The branch still merges into master without a conflict, so I didn't rebase. ctest passes and the 100-turn checksum is unchanged (D7D43800). Our --keys script can't press the middle button or move a gamepad stick, so I couldn't test these two in the running game. I checked them by reading the code.

🤖 Generated with Claude Code

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.

2 participants