Opened 14 years ago

Last modified 4 years ago

#539 new defect

Game cursor state is not consistently reset — at Version 20

Reported by: Sergio Fabian Vier Owned by:
Priority: Nice to Have Milestone: Backlog
Component: UI – In-game Keywords: patch
Cc: Yves Patch:

Description (last modified by Nicolas)

When you are playing, select a soldier and click over a tree, appear an wood icon. If you press ESC key and quit of the game to main menu, this icon persist in this place

Edit: The same bug can occur when pressing F10 to open the in-game menu

If you want simply reproduce the problem : select one citizen, hovering the mover over a tree, delete this citizen

Change History (21)

comment:1 by (none), 14 years ago

Milestone: Unclassified

Milestone Unclassified deleted

comment:2 by Andrew, 14 years ago

Milestone: OS Alpha 2

comment:3 by Kieran P, 14 years ago

Resolution: invalid
Status: newclosed

comment:4 by Kieran P, 14 years ago

No longer valid. In the next release, ESC closes menus, it doesn't open them.

comment:5 by Philip Taylor, 14 years ago

Milestone: OS Alpha 2OS Alpha 3
Resolution: invalid
Status: closedreopened

The same bug can occur when pressing F10 to open the in-game menu (the cursor doesn't change back to default unless you move the mouse, and if you somehow exit to the main menu without moving the mouse then I believe it'll be stuck on the wrong cursor since nothing will try to reset it).

I'm not certain what's the best solution. Maybe the cursor changes should be scoped to the current GUI page, so session cursors can't leak out, and/or maybe we should send mouse movement events when showing/hiding pages (even if the mouse didn't really move), so the session code doesn't forget to set its cursor after changes.

comment:6 by Andrew, 14 years ago

Owner: set to Andrew
Status: reopenednew

comment:7 by Kieran P, 14 years ago

Priority: trivialminor

comment:8 by Kieran P, 14 years ago

Owner: Andrew removed

comment:9 by Kieran P, 13 years ago

Description: modified (diff)

comment:10 by historic_bruno, 13 years ago

Technically this could happen anytime you switch GUI object focus without moving the mouse. Hard to do now, but if we add something like tab focus switching between GUI elements, then you'd potentially see this more often. Maybe scoping the cursor somehow is most correct, but it seems like just as good or better of a solution to send an extra message when GUI focus changes (assume the mouse should move to cause this, even when it doesn't).

I've not looked in great depth at the code responsible for this, but perhaps key presses in addition to mouse movement, could trigger a cursor update.

comment:11 by Philip Taylor, 13 years ago

With focus changing, e.g. when opening the chat box under the mouse, the cursor doesn't change to the correct (default) cursor until the next input event (e.g. the key release event). I think input.js handleInputBeforeGui is setting mouseIsOverObject which determines whether to show the default cursor or the world-interaction cursor; the problem is that the mouse might become over an object (e.g. when the chat box pops up) without handleInputBeforeGui being called so it doesn't notice.

Maybe we should add some new engine function so updateCursor can tell if the mouse is currently over an object, rather than relying on the value from the last call to handleInputBeforeGui.

I don't think the same solution would work for the issue when exiting to the main menu, though - in that case the session GUI code stops running entirely so there's nothing to revert the cursor.

comment:12 by Kieran P, 13 years ago

Milestone: Alpha 3Alpha 4

comment:13 by Kieran P, 13 years ago

Priority: Nice to HaveIf Time Permits

comment:14 by Kieran P, 13 years ago

Milestone: Alpha 4Alpha 5

comment:15 by Kieran P, 13 years ago

Milestone: Alpha 5Backlog

comment:16 by historic_bruno, 12 years ago

Keywords: gui simple added

comment:17 by historic_bruno, 12 years ago

Summary: take wrong icon (pointer) in menu of the gameGame cursor state is not consistently reset

comment:18 by historic_bruno, 11 years ago

#1904 was a duplicate of this.

comment:19 by Yves, 10 years ago

I can't reproduce it anymore as described in this ticket, but I can still reproduce it this way:

  1. Start a singleplayer scenario match against the AI
  2. Enable the developer overlay (menu->settings->developer overlay)and select "reveal map" and "control all units"
  3. Delete all enemy units except one
  4. Send your units to kill the remaining enemy while selecting a female citizen and hovering the mouse over a tree
  5. Ehen the enemy resigns, the icon won't change

in reply to:  description comment:20 by Nicolas, 10 years ago

Description: modified (diff)

If you want simply reproduce the problem : select one citizen, hovering the mover over a tree, delete this citizen

Last edited 10 years ago by Nicolas (previous) (diff)

by Nicolas, 10 years ago

Attachment: patch.patch added
Note: See TracTickets for help on using tickets.