Page MenuHomeWildfire Games

Let GUI elements change the cursor when hovered
Needs ReviewPublic

Authored by wraitii on Nov 3 2020, 6:16 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This is fairly self explanatory. This diff lets UI elements change the mouse cursor when hovered.
Here is a demonstration for input fields, by changing the ModernInput style.

Drawback:

  • For now, cursors aren't a stack, so when leaving the input field, it resets to the default cursor. I don't think we really have 'sticky' cursors except perhaps in the game session (i.e. in game), so it ought not be a real problem, but we could change it if desired.

See #539 for a related issue.

Test Plan

This is relatively straightforward but we probably could implement a few more out of the box.

Event Timeline

wraitii created this revision.Nov 3 2020, 6:16 PM
Vulcan added a comment.Nov 3 2020, 6:16 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/3354/display/redirect

Vulcan added a comment.Nov 3 2020, 6:17 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2801/display/redirect

Vulcan added a comment.Nov 3 2020, 6:18 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1702/display/redirect

wraitii requested review of this revision.Nov 3 2020, 6:18 PM
vladislavbelov added inline comments.
source/gui/CGUI.cpp
161

Why accessing the private field directly? Also !pNearest->m_Cursor.empty().

162

cursor_draw ignores missed files. We need to report missed cursors somehow.

WARNING: Failed to draw cursor 'input-lbeam'