mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-24 17:03:01 +00:00
Change mouse icon on hover
This commit is contained in:
parent
78d4bc80cf
commit
5f65864000
|
|
@ -1004,6 +1004,15 @@ void UIController::tickInput()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hitCtrl && (hitCtrl->getControlType() == UIControl::eButton || hitCtrl->getControlType() == UIControl::eCheckBox || hitCtrl->getControlType() == UIControl::eButtonList || hitCtrl->getControlType() == UIControl::eSaveList))
|
||||
g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_HAND));
|
||||
else if (hitCtrl && hitCtrl->getControlType() == UIControl::eSlider || hitCtrl && hitCtrl->getControlType() == UIControl::eTexturePackList)
|
||||
g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_SIZEWE));
|
||||
else if (hitCtrl && hitCtrl->getControlType() == UIControl::eTextInput)
|
||||
g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_IBEAM));
|
||||
else if (hitCtrl && hitCtrl->getControlType() == UIControl::eNoControl)
|
||||
g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_ARROW));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -390,6 +390,12 @@ float KeyboardMouseInput::GetLookY(float sensitivity) const
|
|||
return static_cast<float>(-m_mouseDeltaY) * sensitivity;
|
||||
}
|
||||
|
||||
void KeyboardMouseInput::SetCursorIcon(LPCWSTR cursorName)
|
||||
{
|
||||
HCURSOR hCursor = LoadCursorW(nullptr, cursorName);
|
||||
if (hCursor) SetCursor(hCursor);
|
||||
}
|
||||
|
||||
void KeyboardMouseInput::OnChar(wchar_t c)
|
||||
{
|
||||
int next = (m_charBufferHead + 1) % CHAR_BUFFER_SIZE;
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ public:
|
|||
float GetLookX(float sensitivity) const;
|
||||
float GetLookY(float sensitivity) const;
|
||||
|
||||
void SetCursorIcon(LPCWSTR cursorName);
|
||||
|
||||
private:
|
||||
bool m_keyDown[MAX_KEYS];
|
||||
bool m_keyDownPrev[MAX_KEYS];
|
||||
|
|
|
|||
Loading…
Reference in a new issue