Skip to content

Change cursor icon on hovering over different UI elements#1522

Open
PUFFMON wants to merge 4 commits intoMCLCE:mainfrom
PUFFMON:KBM-Icons
Open

Change cursor icon on hovering over different UI elements#1522
PUFFMON wants to merge 4 commits intoMCLCE:mainfrom
PUFFMON:KBM-Icons

Conversation

@PUFFMON
Copy link
Copy Markdown

@PUFFMON PUFFMON commented Apr 16, 2026

Description

When playing using keyboard and Mouse, the mouse cursor's icon will change depending on what UI element is hovering on:

  • Basic menu buttons (Settings, main menu, etc) - POINTING HAND IDC_HAND.
image
  • Text inputs (World name and seed) - I BEAM IDC_IBEAM.
image
  • Sliders (World size and some settings) - RESIZE HORIZONTAL IDC_SIZEWE.
image
  • 🚫 Icon (Disabled checkBox) - DENY SIGN IDC_NO.
image
  • None - DEFAULT ARROW IDC_ARROW.

Changes

Previous Behavior

The cursor always used the Arrow icon.

Root Cause

The behaviour wasn't programmed.

Fix Implementation

I added a new function inside KeyboardAndMouseInput script that changes the icon of the cursor. This function is called in UIController.cpp inside tickInput.

AI Use Disclosure

No AI was used

Current known issues

  • (FIXED, NEEDS TESTING) The cursor icon resets when clicking.
  • Test if the cursor icons work correctly on other OS (Linux, MacOS...)

@PUFFMON
Copy link
Copy Markdown
Author

PUFFMON commented Apr 16, 2026

Fixed Button lists not updating the mouse icon. This fix also fixes the How to Play list,

@codeHusky codeHusky self-assigned this Apr 17, 2026
PUFFMON added 2 commits April 17, 2026 21:48
+ comments to mark this snippet
- Moved the whole icon updater snippet to a new function inside UIController so it can be called outside tickInput.
- Made a new variable inside tickInput function for the same reason.
- Modified SetCursorIcon inside KeyboardMouseInput so it gets the current icon instead of reloading the cursor.
@PUFFMON
Copy link
Copy Markdown
Author

PUFFMON commented Apr 17, 2026

This PR should be feature complete. It needs some testing to make sure no errors happen and then it should be ready for merge

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.

3 participants