mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-12 20:23:51 +00:00
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:
parent
db8b4f6bff
commit
e852392505
3 changed files with 37 additions and 20 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue