mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
Big leap for key rebinding and crossplatform-ness.
This commit is contained in:
@@ -70,7 +70,7 @@ bool Screen::isInGameScreen()
|
||||
|
||||
void Screen::keyPressed(int key)
|
||||
{
|
||||
if (key == AKEYCODE_MENU)//escape
|
||||
if (m_pMinecraft->m_options.isKey(KM_MENU_CANCEL, key))
|
||||
{
|
||||
m_pMinecraft->setScreen(nullptr);
|
||||
}
|
||||
@@ -78,19 +78,19 @@ void Screen::keyPressed(int key)
|
||||
if (m_buttonTabList.size())
|
||||
{
|
||||
#ifndef ENH_HIGHLIGHT_BY_HOVER
|
||||
if (m_pMinecraft->m_options.m_keyBinds[Options::MENU_NEXT].value == key)
|
||||
if (m_pMinecraft->m_options.isKey(MENU_NEXT, key))
|
||||
{
|
||||
m_tabButtonIndex++;
|
||||
if (m_tabButtonIndex == int(m_buttonTabList.size()))
|
||||
m_tabButtonIndex = 0;
|
||||
}
|
||||
if (m_pMinecraft->m_options.m_keyBinds[Options::MENU_PREVIOUS].value == key)
|
||||
if (m_pMinecraft->m_options.isKey(MENU_PREVIOUS, key))
|
||||
{
|
||||
m_tabButtonIndex--;
|
||||
if (m_tabButtonIndex == -1)
|
||||
m_tabButtonIndex = int(m_buttonTabList.size() - 1);
|
||||
}
|
||||
if (m_pMinecraft->m_options.m_keyBinds[Options::MENU_OK].value == key)
|
||||
if (m_pMinecraft->m_options.isKey(MENU_OK, key))
|
||||
{
|
||||
if (m_buttonTabList[m_tabButtonIndex]->m_bEnabled)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user