mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-23 10:13:02 +00:00
Cross sign icon for disabled checkBox elements
+ comments to mark this snippet
This commit is contained in:
parent
fe7cd25b85
commit
db8b4f6bff
|
|
@ -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<UIControl_CheckBox *>(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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue