mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix creative inventory scroll for both mouse wheel and controller
The mouse scroll wheel was not working in the creative inventory at all. UIController remaps wheel input from OTHER_STICK to UP/DOWN for KBM users, but the base container menu handler consumed UP/DOWN for grid navigation before it could reach the creative menu's page scrolling logic in handleAdditionalKeyPress. Fixed by detecting scroll wheel input on UP/DOWN in the base handler and forwarding it as OTHER_STICK to handleAdditionalKeyPress instead. Also fixed the controller right stick scrolling way too fast: it was jumping TabSpec::rows (5) rows per tick at 100ms repeat rate, which blew through the entire item list almost instantly. Reduced to 1 row per tick so scrolling feels controlled on both input methods.
This commit is contained in:
parent
129223d502
commit
cb2b532f70
|
|
@ -1486,12 +1486,26 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_MENU_UP:
|
case ACTION_MENU_UP:
|
||||||
|
#ifdef _WINDOWS64
|
||||||
|
if (g_KBMInput.WasMouseWheelConsumed())
|
||||||
|
{
|
||||||
|
handleAdditionalKeyPress(ACTION_MENU_OTHER_STICK_UP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
//ui.PlayUISFX(eSFX_Focus);
|
//ui.PlayUISFX(eSFX_Focus);
|
||||||
m_eCurrTapState = eTapStateUp;
|
m_eCurrTapState = eTapStateUp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_MENU_DOWN:
|
case ACTION_MENU_DOWN:
|
||||||
|
#ifdef _WINDOWS64
|
||||||
|
if (g_KBMInput.WasMouseWheelConsumed())
|
||||||
|
{
|
||||||
|
handleAdditionalKeyPress(ACTION_MENU_OTHER_STICK_DOWN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
//ui.PlayUISFX(eSFX_Focus);
|
//ui.PlayUISFX(eSFX_Focus);
|
||||||
m_eCurrTapState = eTapStateDown;
|
m_eCurrTapState = eTapStateDown;
|
||||||
|
|
|
||||||
|
|
@ -1099,13 +1099,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction)
|
||||||
break;
|
break;
|
||||||
case ACTION_MENU_OTHER_STICK_DOWN:
|
case ACTION_MENU_OTHER_STICK_DOWN:
|
||||||
{
|
{
|
||||||
int pageStep = TabSpec::rows;
|
int pageStep = 1;
|
||||||
#ifdef _WINDOWS64
|
|
||||||
if (g_KBMInput.WasMouseWheelConsumed())
|
|
||||||
{
|
|
||||||
pageStep = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
m_tabPage[m_curTab] += pageStep;
|
m_tabPage[m_curTab] += pageStep;
|
||||||
if(m_tabPage[m_curTab] >= specs[m_curTab]->getPageCount())
|
if(m_tabPage[m_curTab] >= specs[m_curTab]->getPageCount())
|
||||||
{
|
{
|
||||||
|
|
@ -1119,13 +1113,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction)
|
||||||
break;
|
break;
|
||||||
case ACTION_MENU_OTHER_STICK_UP:
|
case ACTION_MENU_OTHER_STICK_UP:
|
||||||
{
|
{
|
||||||
int pageStep = TabSpec::rows;
|
int pageStep = 1;
|
||||||
#ifdef _WINDOWS64
|
|
||||||
if (g_KBMInput.WasMouseWheelConsumed())
|
|
||||||
{
|
|
||||||
pageStep = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
m_tabPage[m_curTab] -= pageStep;
|
m_tabPage[m_curTab] -= pageStep;
|
||||||
if(m_tabPage[m_curTab] < 0)
|
if(m_tabPage[m_curTab] < 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue