Fixed icon reseting on click

- 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.
This commit is contained in:
ACL 2026-04-17 23:33:43 +02:00
parent db8b4f6bff
commit e852392505
3 changed files with 37 additions and 20 deletions

View file

@ -392,8 +392,17 @@ float KeyboardMouseInput::GetLookY(float sensitivity) const
void KeyboardMouseInput::SetCursorIcon(LPCWSTR cursorName)
{
HCURSOR hCursor = LoadCursorW(nullptr, cursorName);
if (hCursor) SetCursor(hCursor);
HCURSOR hCursor = LoadCursorW(nullptr, cursorName);
if (hCursor)
{
SetCursor(hCursor);
if (g_hWnd)
{
// Update the cursor icon to keep the current one
SetClassLongPtrW(g_hWnd, GCLP_HCURSOR, (LONG_PTR)hCursor);
}
}
}
void KeyboardMouseInput::OnChar(wchar_t c)