forked from cafeberry/cafeberry
added some kbm stuff
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "MultiPlayerLocalPlayer.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "UIScene_AnvilMenu.h"
|
||||
#include "DirectTextEdit.h"
|
||||
|
||||
UIScene_AnvilMenu::UIScene_AnvilMenu(int iPad, void *_initData, UILayer *parentLayer) : UIScene_AbstractContainerMenu(iPad, parentLayer)
|
||||
{
|
||||
@@ -170,6 +171,7 @@ void UIScene_AnvilMenu::GetPositionOfSection( ESceneSection eSection, UIVec2D* p
|
||||
pPosition->y = m_slotListResult.getYPos();
|
||||
break;
|
||||
case eSectionAnvilName:
|
||||
m_textInputAnvil.UpdateControl();
|
||||
pPosition->x = m_textInputAnvil.getXPos();
|
||||
pPosition->y = m_textInputAnvil.getYPos();
|
||||
break;
|
||||
@@ -196,26 +198,32 @@ void UIScene_AnvilMenu::GetItemScreenData( ESceneSection eSection, int iItemInde
|
||||
case eSectionAnvilItem1:
|
||||
sectionSize.x = m_slotListItem1.getWidth();
|
||||
sectionSize.y = m_slotListItem1.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListItem1, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilItem2:
|
||||
sectionSize.x = m_slotListItem2.getWidth();
|
||||
sectionSize.y = m_slotListItem2.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListItem2, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilResult:
|
||||
sectionSize.x = m_slotListResult.getWidth();
|
||||
sectionSize.y = m_slotListResult.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListResult, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilName:
|
||||
m_textInputAnvil.UpdateControl();
|
||||
sectionSize.x = m_textInputAnvil.getWidth();
|
||||
sectionSize.y = m_textInputAnvil.getHeight();
|
||||
break;
|
||||
case eSectionAnvilInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
@@ -239,6 +247,16 @@ void UIScene_AnvilMenu::GetItemScreenData( ESceneSection eSection, int iItemInde
|
||||
else
|
||||
{
|
||||
GetPositionOfSection(eSection, pPosition);
|
||||
if (eSection == eSectionAnvilName)
|
||||
{
|
||||
UIControl *pMainPanel = GetMainPanel();
|
||||
if (pMainPanel)
|
||||
{
|
||||
pMainPanel->UpdateControl();
|
||||
pPosition->x += pMainPanel->getXPos();
|
||||
pPosition->y += pMainPanel->getYPos();
|
||||
}
|
||||
}
|
||||
pSize->x = sectionSize.x;
|
||||
pSize->y = sectionSize.y;
|
||||
}
|
||||
@@ -316,7 +334,10 @@ int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
|
||||
{
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t) );
|
||||
InputManager.GetText(pchText);
|
||||
#ifdef _WINDOWS64
|
||||
if (!DirectTextEdit::TakeText(pchText, 128))
|
||||
#endif
|
||||
InputManager.GetText(pchText);
|
||||
pClass->setEditNameValue((wchar_t *)pchText);
|
||||
pClass->m_itemName = (wchar_t *)pchText;
|
||||
pClass->updateItemName();
|
||||
@@ -326,6 +347,12 @@ int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
|
||||
|
||||
void UIScene_AnvilMenu::handleEditNamePressed()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
DirectTextEdit::Begin(&m_textInputAnvil, GetMainPanel(), m_textInputAnvil.getLabel(), 30,
|
||||
C_4JInput::EKeyboardMode_Default,
|
||||
&UIScene_AnvilMenu::KeyboardCompleteCallback, this);
|
||||
return;
|
||||
#endif
|
||||
setIgnoreInput(true);
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||
int language = XGetLanguage();
|
||||
|
||||
Reference in New Issue
Block a user