diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index a67dbe817..326cb7bfc 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -5,6 +5,7 @@ #include "UIScene.h" #include "UIControl_Slider.h" #include "UIControl_TexturePackList.h" +#include "UIControl_CheckBox.h" #include "../../../Minecraft.World/StringHelpers.h" #include "../../LocalPlayer.h" #include "../../DLCTexturePack.h" @@ -1005,12 +1006,21 @@ void UIController::tickInput() } } - if (hitCtrl && (hitCtrl->getControlType() == UIControl::eButton || hitCtrl->getControlType() == UIControl::eCheckBox || hitCtrl->getControlType() == UIControl::eButtonList)) + // Set cursor icon based on hovered UI element (WinUser.h) + if (hitCtrl && (hitCtrl->getControlType() == UIControl::eButton || hitCtrl->getControlType() == UIControl::eButtonList)) g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_HAND)); - else if (hitCtrl && hitCtrl->getControlType() == UIControl::eSlider || hitCtrl && hitCtrl->getControlType() == UIControl::eTexturePackList) + else if (hitCtrl && (hitCtrl->getControlType() == UIControl::eSlider || 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::eCheckBox) // Show the cross sign shaped cursor only when the checkbox is disabled/grayed out + { + UIControl_CheckBox *pCheck = static_cast(hitCtrl); + if (pCheck && !pCheck->IsEnabled()) + g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_NO)); + else + g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_HAND)); + } else if (hitCtrl && hitCtrl->getControlType() == UIControl::eNoControl) g_KBMInput.SetCursorIcon(MAKEINTRESOURCEW(IDC_ARROW)); }