forked from cafeberry/cafeberry
fix: fixed Xbox 360 build issues
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#include "stdafx.h"
|
||||
#include "XUI_Ctrl_BeaconButton.h"
|
||||
|
||||
HRESULT CXuiCtrlBeaconButton::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
m_buttonId = 0;
|
||||
m_iconId = 0;
|
||||
m_bActive = false;
|
||||
m_bSelected = false;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CXuiCtrlBeaconButton::SetData(int buttonId, int iconId, bool bActive, bool bSelected)
|
||||
{
|
||||
m_buttonId = buttonId;
|
||||
m_iconId = iconId;
|
||||
m_bActive = bActive;
|
||||
m_bSelected = bSelected;
|
||||
|
||||
XuiControlSetEnable( m_hObj, bActive ? TRUE : FALSE );
|
||||
}
|
||||
|
||||
void CXuiCtrlBeaconButton::SetButtonActive(bool bActive)
|
||||
{
|
||||
m_bActive = bActive;
|
||||
XuiControlSetEnable( m_hObj, bActive ? TRUE : FALSE );
|
||||
}
|
||||
|
||||
void CXuiCtrlBeaconButton::SetButtonSelected(bool bSelected)
|
||||
{
|
||||
m_bSelected = bSelected;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
class CXuiCtrlBeaconButton : public CXuiControlImpl
|
||||
{
|
||||
public:
|
||||
XUI_IMPLEMENT_CLASS( CXuiCtrlBeaconButton, L"CXuiCtrlBeaconButton", XUI_CLASS_CONTROL )
|
||||
|
||||
XUI_BEGIN_MSG_MAP()
|
||||
XUI_ON_XM_INIT( OnInit )
|
||||
XUI_END_MSG_MAP()
|
||||
|
||||
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
|
||||
|
||||
public:
|
||||
void SetData(int buttonId, int iconId, bool bActive, bool bSelected);
|
||||
bool IsButtonActive() const { return m_bActive; }
|
||||
bool IsButtonSelected() const { return m_bSelected; }
|
||||
int GetData() const { return m_buttonId; }
|
||||
void SetButtonActive(bool bActive);
|
||||
void SetButtonSelected(bool bSelected);
|
||||
|
||||
private:
|
||||
int m_buttonId;
|
||||
int m_iconId;
|
||||
bool m_bActive;
|
||||
bool m_bSelected;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "XUI_Ctrl_MinecraftHorse.h"
|
||||
|
||||
HRESULT CXuiCtrlMinecraftHorse::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
class CXuiCtrlMinecraftHorse : public CXuiControlImpl
|
||||
{
|
||||
public:
|
||||
XUI_IMPLEMENT_CLASS( CXuiCtrlMinecraftHorse, L"CXuiCtrlMinecraftHorse", XUI_CLASS_CONTROL )
|
||||
|
||||
XUI_BEGIN_MSG_MAP()
|
||||
XUI_ON_XM_INIT( OnInit )
|
||||
XUI_END_MSG_MAP()
|
||||
|
||||
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
|
||||
};
|
||||
@@ -135,9 +135,14 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector<wstri
|
||||
if(pUserDataContainer->slot != NULL)
|
||||
{
|
||||
wstring desc = L"";
|
||||
vector<wstring> *strings = pUserDataContainer->slot->getItem()->getHoverText(Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad], false, unformattedStrings);
|
||||
vector<HtmlString> *rawStrings = pUserDataContainer->slot->getItem()->getHoverText(Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad], false);
|
||||
for(AUTO_VAR(rit, rawStrings->begin()); rit != rawStrings->end(); ++rit)
|
||||
{
|
||||
unformattedStrings.push_back(rit->text);
|
||||
}
|
||||
delete rawStrings;
|
||||
bool firstLine = true;
|
||||
for(AUTO_VAR(it, strings->begin()); it != strings->end(); ++it)
|
||||
for(AUTO_VAR(it, unformattedStrings.begin()); it != unformattedStrings.end(); ++it)
|
||||
{
|
||||
wstring thisString = *it;
|
||||
if(!firstLine)
|
||||
@@ -161,8 +166,6 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector<wstri
|
||||
}
|
||||
desc.append( thisString );
|
||||
}
|
||||
strings->clear();
|
||||
delete strings;
|
||||
return desc;//app.GetString( pUserDataContainer->slot->getItem()->getDescriptionId() );
|
||||
}
|
||||
else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT)
|
||||
|
||||
@@ -96,12 +96,14 @@ void CXuiCtrlSlotList::SetData(int m_iPad, AbstractContainerMenu* menu, int rows
|
||||
|
||||
for(int i = 0; i < slotCount; i++)
|
||||
{
|
||||
CXuiCtrlSlotItemListItem* slotControl;
|
||||
CXuiCtrlSlotItemListItem* slotControl = NULL;
|
||||
GetCXuiCtrlSlotItem(i, &slotControl);
|
||||
|
||||
slotControl->SetSlot( slotControl->m_hObj, menu->getSlot( i + startIndex ) );
|
||||
|
||||
slotControl->SetUserIndex( slotControl->m_hObj, m_iPad );
|
||||
if( slotControl != NULL )
|
||||
{
|
||||
slotControl->SetSlot( slotControl->m_hObj, menu->getSlot( i + startIndex ) );
|
||||
slotControl->SetUserIndex( slotControl->m_hObj, m_iPad );
|
||||
}
|
||||
|
||||
slotControl = NULL;
|
||||
}
|
||||
@@ -214,18 +216,28 @@ void CXuiCtrlSlotList::SetEntrySlot(int row, int column, XUI_CONTROL_NAVIGATE di
|
||||
|
||||
void CXuiCtrlSlotList::Clicked()
|
||||
{
|
||||
CXuiCtrlSlotItemListItem* slot;
|
||||
CXuiCtrlSlotItemListItem* slot = NULL;
|
||||
GetCXuiCtrlSlotItem( GetCurSel() , &slot);
|
||||
|
||||
// To get the press animation
|
||||
slot->Press();
|
||||
if( slot != NULL )
|
||||
{
|
||||
slot->Press();
|
||||
}
|
||||
}
|
||||
|
||||
void CXuiCtrlSlotList::GetCXuiCtrlSlotItem(int itemIndex, CXuiCtrlSlotItemListItem** CXuiCtrlSlotItem)
|
||||
{
|
||||
HXUIOBJ itemControl = this->GetItemControl(itemIndex);
|
||||
VOID *pObj;
|
||||
XuiObjectFromHandle( itemControl, &pObj );
|
||||
HXUIOBJ itemControl = XuiListGetItemControl( m_hObj, itemIndex );
|
||||
if( itemControl == NULL )
|
||||
{
|
||||
itemControl = this->GetItemControl( itemIndex );
|
||||
}
|
||||
|
||||
VOID *pObj = NULL;
|
||||
if( itemControl != NULL )
|
||||
{
|
||||
XuiObjectFromHandle( itemControl, &pObj );
|
||||
}
|
||||
|
||||
*CXuiCtrlSlotItem = (CXuiCtrlSlotItemListItem *)pObj;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled )
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
m_setTime.SetValue( pMinecraft->level->getLevelData()->getTime() % 24000 );
|
||||
m_setTime.SetValue( pMinecraft->level->getLevelData()->getGameTime() % 24000 );
|
||||
m_setFov.SetValue( (int)pMinecraft->gameRenderer->GetFovVal());
|
||||
|
||||
XuiSetTimer(m_hObj,0,DEBUG_OVERLAY_UPDATE_TIME_PERIOD);
|
||||
@@ -261,7 +261,7 @@ HRESULT CScene_DebugOverlay::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotify
|
||||
// tries to predict the time
|
||||
// Only works if we are on the host machine, but shouldn't break if not
|
||||
MinecraftServer::SetTime(pNotifyValueChangedData->nValue);
|
||||
pMinecraft->level->getLevelData()->setTime(pNotifyValueChangedData->nValue);
|
||||
pMinecraft->level->getLevelData()->setGameTime(pNotifyValueChangedData->nValue);
|
||||
}
|
||||
if( hObjSource == m_setFov )
|
||||
{
|
||||
@@ -276,7 +276,7 @@ HRESULT CScene_DebugOverlay::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if(pMinecraft->level != NULL)
|
||||
{
|
||||
m_setTime.SetValue( pMinecraft->level->getLevelData()->getTime() % 24000 );
|
||||
m_setTime.SetValue( pMinecraft->level->getLevelData()->getGameTime() % 24000 );
|
||||
m_setFov.SetValue( (int)pMinecraft->gameRenderer->GetFovVal());
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
@@ -34,8 +34,8 @@ LPCWSTR CScene_Leaderboards::m_TextColumnNameA[7]=
|
||||
const int CScene_Leaderboards::TitleIcons[CScene_Leaderboards::NUM_LEADERBOARDS][7] =
|
||||
{
|
||||
{ XZP_ICON_WALKED, XZP_ICON_FALLEN, Item::minecart_Id, Item::boat_Id, NULL },
|
||||
{ Tile::dirt_Id, Tile::stoneBrick_Id, Tile::sand_Id, Tile::rock_Id, Tile::gravel_Id, Tile::clay_Id, Tile::obsidian_Id },
|
||||
{ Item::egg_Id, Item::wheat_Id, Tile::mushroom1_Id, Tile::reeds_Id, Item::milk_Id, Tile::pumpkin_Id, NULL },
|
||||
{ Tile::dirt_Id, Tile::stoneBrick_Id, Tile::sand_Id, Tile::stone_Id, Tile::gravel_Id, Tile::clay_Id, Tile::obsidian_Id },
|
||||
{ Item::egg_Id, Item::wheat_Id, Tile::mushroom_brown_Id, Tile::reeds_Id, Item::bucket_milk_Id, Tile::pumpkin_Id, NULL },
|
||||
{ XZP_ICON_ZOMBIE, XZP_ICON_SKELETON, XZP_ICON_CREEPER, XZP_ICON_SPIDER, XZP_ICON_SPIDERJOCKEY, XZP_ICON_ZOMBIEPIGMAN, XZP_ICON_SLIME },
|
||||
};
|
||||
|
||||
|
||||
@@ -308,15 +308,21 @@ void CXuiSceneAbstractContainer::GetItemScreenData( ESceneSection eSection, int
|
||||
|
||||
shared_ptr<ItemInstance> CXuiSceneAbstractContainer::getSlotItem(ESceneSection eSection, int iSlot)
|
||||
{
|
||||
CXuiCtrlSlotList *slotList = GetSectionSlotList( eSection );
|
||||
if(slotList == NULL) return NULL;
|
||||
CXuiCtrlSlotItemListItem* pCXuiCtrlSlotItem;
|
||||
GetSectionSlotList( eSection )->GetCXuiCtrlSlotItem( iSlot, &( pCXuiCtrlSlotItem ) );
|
||||
slotList->GetCXuiCtrlSlotItem( iSlot, &( pCXuiCtrlSlotItem ) );
|
||||
if(pCXuiCtrlSlotItem == NULL) return NULL;
|
||||
return pCXuiCtrlSlotItem->getItemInstance( pCXuiCtrlSlotItem->m_hObj );
|
||||
}
|
||||
|
||||
bool CXuiSceneAbstractContainer::isSlotEmpty(ESceneSection eSection, int iSlot)
|
||||
{
|
||||
CXuiCtrlSlotList *slotList = GetSectionSlotList( eSection );
|
||||
if(slotList == NULL) return true;
|
||||
CXuiCtrlSlotItemListItem* pCXuiCtrlSlotItem;
|
||||
GetSectionSlotList( eSection )->GetCXuiCtrlSlotItem( iSlot, &( pCXuiCtrlSlotItem ) );
|
||||
slotList->GetCXuiCtrlSlotItem( iSlot, &( pCXuiCtrlSlotItem ) );
|
||||
if(pCXuiCtrlSlotItem == NULL) return true;
|
||||
return pCXuiCtrlSlotItem->isEmpty( pCXuiCtrlSlotItem->m_hObj );
|
||||
}
|
||||
|
||||
@@ -438,6 +444,37 @@ void CXuiSceneAbstractContainer::SetPointerText(const wstring &description, vect
|
||||
XuiElementSetShow(m_hPointerText,TRUE);
|
||||
}
|
||||
|
||||
void CXuiSceneAbstractContainer::SetPointerText(vector<HtmlString> *description, bool newSlot)
|
||||
{
|
||||
if(description == NULL || description->empty())
|
||||
{
|
||||
m_pointerControl->SetText(L"");
|
||||
XuiElementSetShow(m_hPointerText,FALSE);
|
||||
XuiElementSetShow(m_hPointerTextBkg,FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
wstring combinedText;
|
||||
for(size_t i = 0; i < description->size(); ++i)
|
||||
{
|
||||
combinedText += (*description)[i].text;
|
||||
if(i + 1 < description->size()) combinedText += L"\n";
|
||||
}
|
||||
|
||||
vector<wstring> unformattedStrings;
|
||||
for(size_t i = 0; i < description->size(); ++i)
|
||||
{
|
||||
unformattedStrings.push_back((*description)[i].text);
|
||||
}
|
||||
|
||||
SetPointerText(combinedText, unformattedStrings, newSlot);
|
||||
}
|
||||
|
||||
Slot *CXuiSceneAbstractContainer::getSlot(ESceneSection eSection, int iSlot)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CXuiSceneAbstractContainer::adjustPointerForSafeZone()
|
||||
{
|
||||
D3DXVECTOR2 baseSceneOrigin;
|
||||
|
||||
@@ -77,6 +77,8 @@ public:
|
||||
void setSectionSelectedSlot(ESceneSection eSection, int x, int y);
|
||||
void setFocusToPointer(int iPad);
|
||||
void SetPointerText(const wstring &description, vector<wstring> &unformattedStrings, bool newSlot);
|
||||
virtual void SetPointerText(vector<HtmlString> *description, bool newSlot);
|
||||
virtual Slot *getSlot(ESceneSection eSection, int iSlot);
|
||||
virtual shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot);
|
||||
virtual bool isSlotEmpty(ESceneSection eSection, int iSlot);
|
||||
virtual void adjustPointerForSafeZone();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
|
||||
#include "..\..\..\Minecraft.World\AnvilMenu.h"
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "..\..\MultiPlayerLocalPlayer.h"
|
||||
#include "..\..\Common\Tutorial\Tutorial.h"
|
||||
@@ -47,14 +48,14 @@ HRESULT CXuiSceneAnvil::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Anvil_Menu, this);
|
||||
}
|
||||
|
||||
m_repairMenu = new RepairMenu( initData->inventory, initData->level, initData->x, initData->y, initData->z, pMinecraft->localplayers[m_iPad] );
|
||||
m_repairMenu = new AnvilMenu( initData->inventory, initData->level, initData->x, initData->y, initData->z, pMinecraft->localplayers[m_iPad] );
|
||||
m_repairMenu->addSlotListener(this);
|
||||
|
||||
InitDataAssociations(m_iPad, m_repairMenu);
|
||||
|
||||
delete initData;
|
||||
|
||||
CXuiSceneAbstractContainer::Initialize( m_iPad, m_repairMenu, true, RepairMenu::INV_SLOT_START, eSectionAnvilUsing, eSectionAnvilMax );
|
||||
CXuiSceneAbstractContainer::Initialize( m_iPad, m_repairMenu, true, AnvilMenu::INV_SLOT_START, eSectionAnvilUsing, eSectionAnvilMax );
|
||||
|
||||
//ProfileManager.SetRichPresenceContextValue(m_iPad,CONTEXT_GAME_STATE,CONTEXT_GAME_STATE_FORGING);
|
||||
|
||||
@@ -191,16 +192,16 @@ CXuiCtrlSlotList* CXuiSceneAnvil::GetSectionSlotList( ESceneSection eSection )
|
||||
void CXuiSceneAnvil::InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex /*= 0*/)
|
||||
{
|
||||
// TODO Inventory dimensions need defined as constants
|
||||
m_resultControl->SetData( iPad, menu, 1, 1, RepairMenu::RESULT_SLOT );
|
||||
m_resultControl->SetData( iPad, menu, 1, 1, AnvilMenu::RESULT_SLOT );
|
||||
|
||||
m_ingredient1Control->SetData( iPad, menu, 1, 1, RepairMenu::INPUT_SLOT );
|
||||
m_ingredient2Control->SetData( iPad, menu, 1, 1, RepairMenu::ADDITIONAL_SLOT);
|
||||
m_ingredient1Control->SetData( iPad, menu, 1, 1, AnvilMenu::INPUT_SLOT );
|
||||
m_ingredient2Control->SetData( iPad, menu, 1, 1, AnvilMenu::ADDITIONAL_SLOT);
|
||||
|
||||
//m_litProgressControl->SetUserData( initData->furnace.get() );
|
||||
|
||||
//m_burnProgress->SetUserData( initData->furnace.get() );
|
||||
|
||||
CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, RepairMenu::INV_SLOT_START);
|
||||
CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, AnvilMenu::INV_SLOT_START);
|
||||
}
|
||||
|
||||
void CXuiSceneAnvil::handleEditNamePressed()
|
||||
|
||||
@@ -367,7 +367,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
||||
}
|
||||
|
||||
m_pBossHealthProgress[i].SetRange(0, boss->getMaxHealth() );
|
||||
m_pBossHealthProgress[i].SetValue( boss->getSynchedHealth() );
|
||||
m_pBossHealthProgress[i].SetValue( boss->getHealth() );
|
||||
m_bossHealthVisible[i] = TRUE;
|
||||
|
||||
_UpdateSelectedItemPos(i);
|
||||
@@ -864,7 +864,7 @@ HRESULT CXuiSceneBase::_ShowBackground( unsigned int iPad, BOOL bShow )
|
||||
// are we in the Nether? - Leave the time as 0 if we are, so we show daylight
|
||||
if(pMinecraft->level->dimension->id==0)
|
||||
{
|
||||
i64TimeOfDay = pMinecraft->level->getLevelData()->getTime() % 24000;
|
||||
i64TimeOfDay = pMinecraft->level->getLevelData()->getGameTime() % 24000;
|
||||
}
|
||||
|
||||
if(i64TimeOfDay>14000)
|
||||
@@ -1915,7 +1915,7 @@ HRESULT CXuiSceneBase::ShowSafeArea( BOOL bShow )
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CXuiSceneBase::SetTooltips( unsigned int iPad, int iA, int iB, int iX, int iY , int iLT, int iRT, int iRB, int iLB, int iLS, bool forceUpdate /*= false*/ )
|
||||
HRESULT CXuiSceneBase::SetTooltips( unsigned int iPad, int iA, int iB, int iX, int iY , int iLT, int iRT, int iRB, int iLB, int iLS, int iRS, int iBack, bool forceUpdate /*= false*/ )
|
||||
{
|
||||
if( CXuiSceneBase::Instance != NULL )
|
||||
{
|
||||
|
||||
@@ -389,7 +389,7 @@ public:
|
||||
static HRESULT SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID );
|
||||
static HRESULT SetEnableTooltips( unsigned int iPad, BOOL bVal );
|
||||
static HRESULT ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show );
|
||||
static HRESULT SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, bool forceUpdate = false);
|
||||
static HRESULT SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, int iRS=-1, int iBack=-1, bool forceUpdate = false);
|
||||
static HRESULT RefreshTooltips( unsigned int iPad);
|
||||
static HRESULT EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable );
|
||||
static HRESULT SetTooltipsEnabled( unsigned int iPad, bool bA = true, bool bB = true, bool bX = true, bool bY = true, bool bLT = true, bool bRT = true, bool bLB = true, bool bRB=true, bool bLS=true);
|
||||
|
||||
@@ -0,0 +1,309 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "..\..\..\Minecraft.World\Container.h"
|
||||
#include "..\..\..\Minecraft.World\BeaconMenu.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.effect.h"
|
||||
#include "..\..\..\Minecraft.World\HtmlString.h"
|
||||
#include "..\..\MultiplayerLocalPlayer.h"
|
||||
#include "XUI_Ctrl_SlotList.h"
|
||||
#include "XUI_Scene_Beacon.h"
|
||||
#include "XUI_Ctrl_SlotItemListItem.h"
|
||||
#include "XUI_Ctrl_SlotItem.h"
|
||||
#include "..\..\Common\Tutorial\Tutorial.h"
|
||||
#include "..\..\Common\Tutorial\TutorialMode.h"
|
||||
#include "..\..\Common\Tutorial\TutorialEnum.h"
|
||||
|
||||
#define BEACON_TICK_TIMER_ID 12
|
||||
|
||||
HRESULT CXuiSceneBeacon::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
D3DXVECTOR3 vec;
|
||||
MapChildControls();
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
BeaconScreenInput* initData = (BeaconScreenInput*)pInitData->pvInitData;
|
||||
|
||||
m_beacon = initData->beacon;
|
||||
|
||||
BeaconMenu* menu = new BeaconMenu( initData->inventory, initData->beacon );
|
||||
|
||||
m_iPad=initData->iPad;
|
||||
m_bSplitscreen=initData->bSplitscreen;
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[initData->iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
|
||||
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
|
||||
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Container_Menu, this);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(m_bSplitscreen)
|
||||
{
|
||||
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
|
||||
}
|
||||
|
||||
InitDataAssociations(initData->iPad, menu);
|
||||
|
||||
CXuiSceneAbstractContainer::Initialize( initData->iPad, menu, true, BeaconMenu::INV_SLOT_START, (ESceneSection)0, eSectionBeaconMax );
|
||||
|
||||
m_bIgnoreKeyPresses = false;
|
||||
|
||||
m_initPowerButtons = true;
|
||||
|
||||
XuiSetTimer( m_hObj, BEACON_TICK_TIMER_ID, 50 );
|
||||
|
||||
handleTick();
|
||||
|
||||
delete initData;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CXuiSceneBeacon::OnDestroy()
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[m_iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
|
||||
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CXuiControl* CXuiSceneBeacon::GetSectionControl( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionBeaconItem:
|
||||
return (CXuiControl *)m_paymentControl;
|
||||
break;
|
||||
case eSectionBeaconInventory:
|
||||
return (CXuiControl *)m_inventoryControl;
|
||||
break;
|
||||
case eSectionBeaconUsing:
|
||||
return (CXuiControl *)m_useRowControl;
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierOneOne:
|
||||
return (CXuiControl *)m_primaryTierOneOne;
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierOneTwo:
|
||||
return (CXuiControl *)m_primaryTierOneTwo;
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierTwoOne:
|
||||
return (CXuiControl *)m_primaryTierTwoOne;
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierTwoTwo:
|
||||
return (CXuiControl *)m_primaryTierTwoTwo;
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierThree:
|
||||
return (CXuiControl *)m_primaryTierThree;
|
||||
break;
|
||||
case eSectionBeaconSecondaryOne:
|
||||
return (CXuiControl *)m_secondaryOne;
|
||||
break;
|
||||
case eSectionBeaconSecondaryTwo:
|
||||
return (CXuiControl *)m_secondaryTwo;
|
||||
break;
|
||||
case eSectionBeaconConfirm:
|
||||
return (CXuiControl *)m_confirmButton;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CXuiCtrlSlotList* CXuiSceneBeacon::GetSectionSlotList( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionBeaconItem:
|
||||
return m_paymentControl;
|
||||
break;
|
||||
case eSectionBeaconInventory:
|
||||
return m_inventoryControl;
|
||||
break;
|
||||
case eSectionBeaconUsing:
|
||||
return m_useRowControl;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CXuiSceneBeacon::InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex)
|
||||
{
|
||||
m_paymentControl->SetData( iPad, menu, 1, 1, BeaconMenu::PAYMENT_SLOT );
|
||||
|
||||
int invRows = (BeaconMenu::INV_SLOT_END - BeaconMenu::INV_SLOT_START) / 9;
|
||||
m_inventoryControl->SetData( iPad, menu, invRows, 9, BeaconMenu::INV_SLOT_START );
|
||||
|
||||
m_useRowControl->SetData( iPad, menu, 1, 9, BeaconMenu::USE_ROW_SLOT_START );
|
||||
|
||||
CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, BeaconMenu::INV_SLOT_START);
|
||||
}
|
||||
|
||||
void CXuiSceneBeacon::SetConfirmButtonEnabled(bool enabled)
|
||||
{
|
||||
if(m_confirmButton != NULL)
|
||||
m_confirmButton->SetButtonActive(enabled);
|
||||
}
|
||||
|
||||
void CXuiSceneBeacon::AddPowerButton(int id, int icon, int tier, int count, bool active, bool selected)
|
||||
{
|
||||
switch(tier)
|
||||
{
|
||||
case 0:
|
||||
if(count == 0)
|
||||
{
|
||||
if(m_primaryTierOneOne != NULL) m_primaryTierOneOne->SetData(id, icon, active, selected);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_primaryTierOneTwo != NULL) m_primaryTierOneTwo->SetData(id, icon, active, selected);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(count == 0)
|
||||
{
|
||||
if(m_primaryTierTwoOne != NULL) m_primaryTierTwoOne->SetData(id, icon, active, selected);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_primaryTierTwoTwo != NULL) m_primaryTierTwoTwo->SetData(id, icon, active, selected);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(m_primaryTierThree != NULL) m_primaryTierThree->SetData(id, icon, active, selected);
|
||||
break;
|
||||
case 3:
|
||||
if(count == 0)
|
||||
{
|
||||
if(m_secondaryOne != NULL) m_secondaryOne->SetData(id, icon, active, selected);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_secondaryTwo != NULL) m_secondaryTwo->SetData(id, icon, active, selected);
|
||||
}
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
int CXuiSceneBeacon::GetPowerButtonId(ESceneSection eSection)
|
||||
{
|
||||
switch(eSection)
|
||||
{
|
||||
case eSectionBeaconPrimaryTierOneOne:
|
||||
return m_primaryTierOneOne != NULL ? m_primaryTierOneOne->GetData() : 0;
|
||||
case eSectionBeaconPrimaryTierOneTwo:
|
||||
return m_primaryTierOneTwo != NULL ? m_primaryTierOneTwo->GetData() : 0;
|
||||
case eSectionBeaconPrimaryTierTwoOne:
|
||||
return m_primaryTierTwoOne != NULL ? m_primaryTierTwoOne->GetData() : 0;
|
||||
case eSectionBeaconPrimaryTierTwoTwo:
|
||||
return m_primaryTierTwoTwo != NULL ? m_primaryTierTwoTwo->GetData() : 0;
|
||||
case eSectionBeaconPrimaryTierThree:
|
||||
return m_primaryTierThree != NULL ? m_primaryTierThree->GetData() : 0;
|
||||
case eSectionBeaconSecondaryOne:
|
||||
return m_secondaryOne != NULL ? m_secondaryOne->GetData() : 0;
|
||||
case eSectionBeaconSecondaryTwo:
|
||||
return m_secondaryTwo != NULL ? m_secondaryTwo->GetData() : 0;
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CXuiSceneBeacon::IsPowerButtonSelected(ESceneSection eSection)
|
||||
{
|
||||
switch(eSection)
|
||||
{
|
||||
case eSectionBeaconPrimaryTierOneOne:
|
||||
return m_primaryTierOneOne != NULL ? m_primaryTierOneOne->IsButtonSelected() : false;
|
||||
case eSectionBeaconPrimaryTierOneTwo:
|
||||
return m_primaryTierOneTwo != NULL ? m_primaryTierOneTwo->IsButtonSelected() : false;
|
||||
case eSectionBeaconPrimaryTierTwoOne:
|
||||
return m_primaryTierTwoOne != NULL ? m_primaryTierTwoOne->IsButtonSelected() : false;
|
||||
case eSectionBeaconPrimaryTierTwoTwo:
|
||||
return m_primaryTierTwoTwo != NULL ? m_primaryTierTwoTwo->IsButtonSelected() : false;
|
||||
case eSectionBeaconPrimaryTierThree:
|
||||
return m_primaryTierThree != NULL ? m_primaryTierThree->IsButtonSelected() : false;
|
||||
case eSectionBeaconSecondaryOne:
|
||||
return m_secondaryOne != NULL ? m_secondaryOne->IsButtonSelected() : false;
|
||||
case eSectionBeaconSecondaryTwo:
|
||||
return m_secondaryTwo != NULL ? m_secondaryTwo->IsButtonSelected() : false;
|
||||
};
|
||||
return false;
|
||||
}
|
||||
|
||||
void CXuiSceneBeacon::SetPowerButtonSelected(ESceneSection eSection)
|
||||
{
|
||||
switch(eSection)
|
||||
{
|
||||
case eSectionBeaconPrimaryTierOneOne:
|
||||
case eSectionBeaconPrimaryTierOneTwo:
|
||||
case eSectionBeaconPrimaryTierTwoOne:
|
||||
case eSectionBeaconPrimaryTierTwoTwo:
|
||||
case eSectionBeaconPrimaryTierThree:
|
||||
if(m_primaryTierOneOne != NULL) m_primaryTierOneOne->SetButtonSelected(false);
|
||||
if(m_primaryTierOneTwo != NULL) m_primaryTierOneTwo->SetButtonSelected(false);
|
||||
if(m_primaryTierTwoOne != NULL) m_primaryTierTwoOne->SetButtonSelected(false);
|
||||
if(m_primaryTierTwoTwo != NULL) m_primaryTierTwoTwo->SetButtonSelected(false);
|
||||
if(m_primaryTierThree != NULL) m_primaryTierThree->SetButtonSelected(false);
|
||||
break;
|
||||
case eSectionBeaconSecondaryOne:
|
||||
case eSectionBeaconSecondaryTwo:
|
||||
if(m_secondaryOne != NULL) m_secondaryOne->SetButtonSelected(false);
|
||||
if(m_secondaryTwo != NULL) m_secondaryTwo->SetButtonSelected(false);
|
||||
break;
|
||||
};
|
||||
|
||||
switch(eSection)
|
||||
{
|
||||
case eSectionBeaconPrimaryTierOneOne:
|
||||
if(m_primaryTierOneOne != NULL) m_primaryTierOneOne->SetButtonSelected(true);
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierOneTwo:
|
||||
if(m_primaryTierOneTwo != NULL) m_primaryTierOneTwo->SetButtonSelected(true);
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierTwoOne:
|
||||
if(m_primaryTierTwoOne != NULL) m_primaryTierTwoOne->SetButtonSelected(true);
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierTwoTwo:
|
||||
if(m_primaryTierTwoTwo != NULL) m_primaryTierTwoTwo->SetButtonSelected(true);
|
||||
break;
|
||||
case eSectionBeaconPrimaryTierThree:
|
||||
if(m_primaryTierThree != NULL) m_primaryTierThree->SetButtonSelected(true);
|
||||
break;
|
||||
case eSectionBeaconSecondaryOne:
|
||||
if(m_secondaryOne != NULL) m_secondaryOne->SetButtonSelected(true);
|
||||
break;
|
||||
case eSectionBeaconSecondaryTwo:
|
||||
if(m_secondaryTwo != NULL) m_secondaryTwo->SetButtonSelected(true);
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
HRESULT CXuiSceneBeacon::handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
{
|
||||
if( pTimer->nId == BEACON_TICK_TIMER_ID )
|
||||
{
|
||||
handleTick();
|
||||
bHandled = TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return CXuiSceneAbstractContainer::handleCustomTimer( pTimer, bHandled );
|
||||
}
|
||||
|
||||
void CXuiSceneBeacon::handleTick()
|
||||
{
|
||||
IUIScene_BeaconMenu::handleTick();
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
#pragma once
|
||||
#include "..\Media\xuiscene_beacon.h"
|
||||
#include "XUI_Scene_AbstractContainer.h"
|
||||
#include "XUI_Ctrl_BeaconButton.h"
|
||||
#include "XUI_CustomMessages.h"
|
||||
#include "..\UI\IUIScene_BeaconMenu.h"
|
||||
|
||||
class CXuiSceneBeacon : public CXuiSceneAbstractContainer, public IUIScene_BeaconMenu
|
||||
{
|
||||
public:
|
||||
XUI_IMPLEMENT_CLASS( CXuiSceneBeacon, L"CXuiSceneBeacon", XUI_CLASS_SCENE )
|
||||
|
||||
protected:
|
||||
XUI_BEGIN_MSG_MAP()
|
||||
XUI_ON_XM_INIT( OnInit )
|
||||
XUI_ON_XM_KEYDOWN( OnKeyDown )
|
||||
XUI_ON_XM_DESTROY( OnDestroy )
|
||||
XUI_ON_XM_TIMER( OnTimer )
|
||||
XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer)
|
||||
XUI_ON_XM_TRANSITION_START(OnTransitionStart)
|
||||
XUI_END_MSG_MAP()
|
||||
|
||||
BEGIN_CONTROL_MAP()
|
||||
MAP_CONTROL(IDC_Group, m_sceneGroup)
|
||||
BEGIN_MAP_CHILD_CONTROLS( m_sceneGroup )
|
||||
MAP_OVERRIDE(IDC_Inventory, m_inventoryControl)
|
||||
MAP_OVERRIDE(IDC_UseRow, m_useRowControl)
|
||||
MAP_OVERRIDE(IDC_Pointer, m_pointerControl)
|
||||
MAP_OVERRIDE(IDC_Payment, m_paymentControl)
|
||||
MAP_CONTROL(IDC_PrimaryText, m_PrimaryText)
|
||||
MAP_CONTROL(IDC_SecondaryText, m_SecondaryText)
|
||||
MAP_OVERRIDE(IDC_PrimaryTierOneOne, m_primaryTierOneOne)
|
||||
MAP_OVERRIDE(IDC_PrimaryTierOneTwo, m_primaryTierOneTwo)
|
||||
MAP_OVERRIDE(IDC_PrimaryTierTwoOne, m_primaryTierTwoOne)
|
||||
MAP_OVERRIDE(IDC_PrimaryTierTwoTwo, m_primaryTierTwoTwo)
|
||||
MAP_OVERRIDE(IDC_PrimaryTierThree, m_primaryTierThree)
|
||||
MAP_OVERRIDE(IDC_SecondaryOne, m_secondaryOne)
|
||||
MAP_OVERRIDE(IDC_SecondaryTwo, m_secondaryTwo)
|
||||
MAP_OVERRIDE(IDC_Confirm, m_confirmButton)
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_CONTROL_MAP()
|
||||
|
||||
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
|
||||
HRESULT OnDestroy();
|
||||
virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0);
|
||||
|
||||
virtual void SetConfirmButtonEnabled(bool enabled);
|
||||
virtual void AddPowerButton(int id, int icon, int tier, int count, bool active, bool selected);
|
||||
virtual int GetPowerButtonId(ESceneSection eSection);
|
||||
virtual bool IsPowerButtonSelected(ESceneSection eSection);
|
||||
virtual void SetPowerButtonSelected(ESceneSection eSection);
|
||||
|
||||
virtual void handleTick();
|
||||
virtual HRESULT handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled );
|
||||
|
||||
private:
|
||||
CXuiCtrlSlotList* m_paymentControl;
|
||||
CXuiCtrlBeaconButton* m_primaryTierOneOne;
|
||||
CXuiCtrlBeaconButton* m_primaryTierOneTwo;
|
||||
CXuiCtrlBeaconButton* m_primaryTierTwoOne;
|
||||
CXuiCtrlBeaconButton* m_primaryTierTwoTwo;
|
||||
CXuiCtrlBeaconButton* m_primaryTierThree;
|
||||
CXuiCtrlBeaconButton* m_secondaryOne;
|
||||
CXuiCtrlBeaconButton* m_secondaryTwo;
|
||||
CXuiCtrlBeaconButton* m_confirmButton;
|
||||
CXuiControl m_sceneGroup;
|
||||
CXuiControl m_PrimaryText;
|
||||
CXuiControl m_SecondaryText;
|
||||
|
||||
virtual CXuiControl* GetSectionControl( ESceneSection eSection );
|
||||
virtual CXuiCtrlSlotList* GetSectionSlotList( ESceneSection eSection );
|
||||
};
|
||||
@@ -31,7 +31,7 @@ HRESULT CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
|
||||
ContainerScreenInput* initData = (ContainerScreenInput*)pInitData->pvInitData;
|
||||
|
||||
XuiControlSetText(m_ChestText,app.GetString(initData->container->getName()));
|
||||
XuiControlSetText(m_ChestText,initData->container->getName().c_str());
|
||||
|
||||
ContainerMenu* menu = new ContainerMenu( initData->inventory, initData->container );
|
||||
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "..\..\..\Minecraft.World\Container.h"
|
||||
#include "..\..\..\Minecraft.World\FireworksMenu.h"
|
||||
#include "..\..\MultiplayerLocalPlayer.h"
|
||||
#include "..\..\LocalPlayer.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "XUI_Ctrl_SlotList.h"
|
||||
#include "XUI_Scene_Fireworks.h"
|
||||
#include "XUI_Ctrl_SlotItemListItem.h"
|
||||
#include "XUI_Ctrl_SlotItem.h"
|
||||
#include "..\..\Common\Tutorial\Tutorial.h"
|
||||
#include "..\..\Common\Tutorial\TutorialMode.h"
|
||||
#include "..\..\Common\Tutorial\TutorialEnum.h"
|
||||
|
||||
HRESULT CXuiSceneFireworks::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
D3DXVECTOR3 vec;
|
||||
MapChildControls();
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
FireworksScreenInput* initData = (FireworksScreenInput*)pInitData->pvInitData;
|
||||
|
||||
FireworksMenu* menu = new FireworksMenu( initData->player->inventory, initData->player->level, initData->x, initData->y, initData->z );
|
||||
|
||||
m_iPad=initData->iPad;
|
||||
m_bSplitscreen=initData->bSplitscreen;
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[initData->iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
|
||||
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
|
||||
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Container_Menu, this);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(m_bSplitscreen)
|
||||
{
|
||||
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
|
||||
}
|
||||
|
||||
InitDataAssociations(initData->iPad, menu);
|
||||
|
||||
CXuiSceneAbstractContainer::Initialize( initData->iPad, menu, true, FireworksMenu::INV_SLOT_START, (ESceneSection)0, eSectionFireworksMax );
|
||||
|
||||
m_bIgnoreKeyPresses = false;
|
||||
|
||||
delete initData;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CXuiSceneFireworks::OnDestroy()
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[m_iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
|
||||
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CXuiControl* CXuiSceneFireworks::GetSectionControl( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionFireworksResult:
|
||||
return (CXuiControl *)m_resultControl;
|
||||
break;
|
||||
case eSectionFireworksIngredients:
|
||||
return (CXuiControl *)m_ingredientsControl;
|
||||
break;
|
||||
case eSectionFireworksInventory:
|
||||
return (CXuiControl *)m_inventoryControl;
|
||||
break;
|
||||
case eSectionFireworksUsing:
|
||||
return (CXuiControl *)m_useRowControl;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CXuiCtrlSlotList* CXuiSceneFireworks::GetSectionSlotList( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionFireworksResult:
|
||||
return m_resultControl;
|
||||
break;
|
||||
case eSectionFireworksIngredients:
|
||||
return m_ingredientsControl;
|
||||
break;
|
||||
case eSectionFireworksInventory:
|
||||
return m_inventoryControl;
|
||||
break;
|
||||
case eSectionFireworksUsing:
|
||||
return m_useRowControl;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CXuiSceneFireworks::InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex)
|
||||
{
|
||||
m_resultControl->SetData( iPad, menu, 1, 1, FireworksMenu::RESULT_SLOT );
|
||||
|
||||
m_ingredientsControl->SetData( iPad, menu, 3, 3, FireworksMenu::CRAFT_SLOT_START );
|
||||
|
||||
int invRows = (FireworksMenu::INV_SLOT_END - FireworksMenu::INV_SLOT_START) / 9;
|
||||
m_inventoryControl->SetData( iPad, menu, invRows, 9, FireworksMenu::INV_SLOT_START );
|
||||
|
||||
m_useRowControl->SetData( iPad, menu, 1, 9, FireworksMenu::USE_ROW_SLOT_START );
|
||||
|
||||
CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, FireworksMenu::INV_SLOT_START);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
#include "..\Media\xuiscene_fireworks.h"
|
||||
#include "XUI_Scene_AbstractContainer.h"
|
||||
#include "XUI_CustomMessages.h"
|
||||
#include "..\UI\IUIScene_FireworksMenu.h"
|
||||
|
||||
class CXuiSceneFireworks : public CXuiSceneAbstractContainer, public IUIScene_FireworksMenu
|
||||
{
|
||||
public:
|
||||
XUI_IMPLEMENT_CLASS( CXuiSceneFireworks, L"CXuiSceneFireworks", XUI_CLASS_SCENE )
|
||||
|
||||
protected:
|
||||
XUI_BEGIN_MSG_MAP()
|
||||
XUI_ON_XM_INIT( OnInit )
|
||||
XUI_ON_XM_KEYDOWN( OnKeyDown )
|
||||
XUI_ON_XM_DESTROY( OnDestroy )
|
||||
XUI_ON_XM_TIMER( OnTimer )
|
||||
XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer)
|
||||
XUI_ON_XM_TRANSITION_START(OnTransitionStart)
|
||||
XUI_END_MSG_MAP()
|
||||
|
||||
BEGIN_CONTROL_MAP()
|
||||
MAP_CONTROL(IDC_Group, m_sceneGroup)
|
||||
BEGIN_MAP_CHILD_CONTROLS( m_sceneGroup )
|
||||
MAP_OVERRIDE(IDC_Inventory, m_inventoryControl)
|
||||
MAP_OVERRIDE(IDC_UseRow, m_useRowControl)
|
||||
MAP_OVERRIDE(IDC_Pointer, m_pointerControl)
|
||||
MAP_CONTROL(IDC_InventoryText, m_InventoryText)
|
||||
MAP_OVERRIDE(IDC_Result, m_resultControl)
|
||||
MAP_OVERRIDE(IDC_Ingredients, m_ingredientsControl)
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_CONTROL_MAP()
|
||||
|
||||
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
|
||||
HRESULT OnDestroy();
|
||||
virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0);
|
||||
|
||||
private:
|
||||
CXuiCtrlSlotList* m_resultControl;
|
||||
CXuiCtrlSlotList* m_ingredientsControl;
|
||||
CXuiControl m_sceneGroup;
|
||||
|
||||
virtual CXuiControl* GetSectionControl( ESceneSection eSection );
|
||||
virtual CXuiCtrlSlotList* GetSectionSlotList( ESceneSection eSection );
|
||||
};
|
||||
@@ -0,0 +1,141 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "..\..\..\Minecraft.World\Container.h"
|
||||
#include "..\..\..\Minecraft.World\HopperMenu.h"
|
||||
#include "..\..\MultiplayerLocalPlayer.h"
|
||||
#include "XUI_Ctrl_SlotList.h"
|
||||
#include "XUI_Scene_Hopper.h"
|
||||
#include "XUI_Ctrl_SlotItemListItem.h"
|
||||
#include "XUI_Ctrl_SlotItem.h"
|
||||
#include "..\..\Common\Tutorial\Tutorial.h"
|
||||
#include "..\..\Common\Tutorial\TutorialMode.h"
|
||||
#include "..\..\Common\Tutorial\TutorialEnum.h"
|
||||
|
||||
#define HOPPER_DEFAULT_ROWS 1
|
||||
|
||||
HRESULT CXuiSceneHopper::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
D3DXVECTOR3 vec;
|
||||
MapChildControls();
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
HopperScreenInput* initData = (HopperScreenInput*)pInitData->pvInitData;
|
||||
|
||||
HopperMenu* menu = new HopperMenu( initData->inventory, initData->hopper );
|
||||
|
||||
shared_ptr<Container> hopper = initData->hopper;
|
||||
m_iPad=initData->iPad;
|
||||
m_bSplitscreen=initData->bSplitscreen;
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[initData->iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
|
||||
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
|
||||
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Container_Menu, this);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(m_bSplitscreen)
|
||||
{
|
||||
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
|
||||
}
|
||||
|
||||
float fPointerWidth,fPointerHeight;
|
||||
m_pointerControl->GetBounds(&fPointerWidth, &fPointerHeight);
|
||||
|
||||
float height, width;
|
||||
this->GetBounds( &width, &height );
|
||||
int rowDiff = HOPPER_DEFAULT_ROWS - (hopper->getContainerSize() / 5);
|
||||
height = height - (rowDiff * fPointerHeight);
|
||||
this->SetBounds( width, height );
|
||||
|
||||
D3DXVECTOR3 vPos;
|
||||
this->GetPosition( &vPos );
|
||||
vPos.y = vPos.y + ( (rowDiff * fPointerHeight) / 2 );
|
||||
if(!RenderManager.IsHiDef())
|
||||
{
|
||||
int iY = (int)(vPos.y);
|
||||
iY &= 0xfffffffe;
|
||||
vPos.y = (float)iY;
|
||||
}
|
||||
this->SetPosition( &vPos );
|
||||
|
||||
InitDataAssociations(initData->iPad, menu);
|
||||
|
||||
CXuiSceneAbstractContainer::Initialize( initData->iPad, menu, true, hopper->getContainerSize(), (ESceneSection)0, eSectionHopperMax );
|
||||
|
||||
m_bIgnoreKeyPresses = false;
|
||||
|
||||
delete initData;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CXuiSceneHopper::OnDestroy()
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[m_iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
|
||||
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CXuiControl* CXuiSceneHopper::GetSectionControl( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionHopperContents:
|
||||
return (CXuiControl *)m_hopperControl;
|
||||
break;
|
||||
case eSectionHopperInventory:
|
||||
return (CXuiControl *)m_inventoryControl;
|
||||
break;
|
||||
case eSectionHopperUsing:
|
||||
return (CXuiControl *)m_useRowControl;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CXuiCtrlSlotList* CXuiSceneHopper::GetSectionSlotList( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionHopperContents:
|
||||
return m_hopperControl;
|
||||
break;
|
||||
case eSectionHopperInventory:
|
||||
return m_inventoryControl;
|
||||
break;
|
||||
case eSectionHopperUsing:
|
||||
return m_useRowControl;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CXuiSceneHopper::InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex)
|
||||
{
|
||||
int containerSize = menu->getSize() - 36;
|
||||
if (containerSize <= 0) containerSize = 5;
|
||||
int rows = (containerSize + 4) / 5;
|
||||
|
||||
m_hopperControl->SetData( iPad, menu, rows, 5, 0 );
|
||||
|
||||
CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, containerSize);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
#include "..\Media\xuiscene_hopper.h"
|
||||
#include "XUI_Scene_AbstractContainer.h"
|
||||
#include "XUI_CustomMessages.h"
|
||||
#include "..\UI\IUIScene_HopperMenu.h"
|
||||
|
||||
class CXuiSceneHopper : public CXuiSceneAbstractContainer, public IUIScene_HopperMenu
|
||||
{
|
||||
public:
|
||||
XUI_IMPLEMENT_CLASS( CXuiSceneHopper, L"CXuiSceneHopper", XUI_CLASS_SCENE )
|
||||
|
||||
protected:
|
||||
XUI_BEGIN_MSG_MAP()
|
||||
XUI_ON_XM_INIT( OnInit )
|
||||
XUI_ON_XM_KEYDOWN( OnKeyDown )
|
||||
XUI_ON_XM_DESTROY( OnDestroy )
|
||||
XUI_ON_XM_TIMER( OnTimer )
|
||||
XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer)
|
||||
XUI_ON_XM_TRANSITION_START(OnTransitionStart)
|
||||
XUI_END_MSG_MAP()
|
||||
|
||||
BEGIN_CONTROL_MAP()
|
||||
MAP_CONTROL(IDC_Group, m_sceneGroup)
|
||||
BEGIN_MAP_CHILD_CONTROLS( m_sceneGroup )
|
||||
MAP_OVERRIDE(IDC_Inventory, m_inventoryControl)
|
||||
MAP_OVERRIDE(IDC_UseRow, m_useRowControl)
|
||||
MAP_OVERRIDE(IDC_Pointer, m_pointerControl)
|
||||
MAP_CONTROL(IDC_InventoryText, m_InventoryText)
|
||||
MAP_OVERRIDE(IDC_Hopper, m_hopperControl)
|
||||
MAP_CONTROL(IDC_HopperText, m_HopperText)
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_CONTROL_MAP()
|
||||
|
||||
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
|
||||
HRESULT OnDestroy();
|
||||
virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0);
|
||||
|
||||
private:
|
||||
CXuiCtrlSlotList* m_hopperControl;
|
||||
CXuiControl m_sceneGroup;
|
||||
CXuiControl m_HopperText;
|
||||
|
||||
virtual CXuiControl* GetSectionControl( ESceneSection eSection );
|
||||
virtual CXuiCtrlSlotList* GetSectionSlotList( ESceneSection eSection );
|
||||
};
|
||||
@@ -0,0 +1,147 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "..\..\..\Minecraft.World\Container.h"
|
||||
#include "..\..\..\Minecraft.World\HorseInventoryMenu.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.entity.animal.h"
|
||||
#include "..\..\MultiplayerLocalPlayer.h"
|
||||
#include "XUI_Ctrl_SlotList.h"
|
||||
#include "XUI_Scene_HorseInventory.h"
|
||||
#include "XUI_Ctrl_SlotItemListItem.h"
|
||||
#include "XUI_Ctrl_SlotItem.h"
|
||||
#include "..\..\Common\Tutorial\Tutorial.h"
|
||||
#include "..\..\Common\Tutorial\TutorialMode.h"
|
||||
#include "..\..\Common\Tutorial\TutorialEnum.h"
|
||||
|
||||
HRESULT CXuiSceneHorseInventory::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
D3DXVECTOR3 vec;
|
||||
MapChildControls();
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
HorseScreenInput* initData = (HorseScreenInput*)pInitData->pvInitData;
|
||||
|
||||
m_horse = initData->horse;
|
||||
m_container = initData->container;
|
||||
m_inventory = initData->inventory;
|
||||
|
||||
HorseInventoryMenu* menu = new HorseInventoryMenu( initData->inventory, initData->container, initData->horse );
|
||||
|
||||
m_iPad=initData->iPad;
|
||||
m_bSplitscreen=initData->bSplitscreen;
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[initData->iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
|
||||
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
|
||||
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Container_Menu, this);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(m_bSplitscreen)
|
||||
{
|
||||
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
|
||||
}
|
||||
|
||||
InitDataAssociations(initData->iPad, menu);
|
||||
|
||||
CXuiSceneAbstractContainer::Initialize( initData->iPad, menu, true, EntityHorse::INV_BASE_COUNT, (ESceneSection)0, eSectionHorseMax );
|
||||
|
||||
m_bIgnoreKeyPresses = false;
|
||||
|
||||
delete initData;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CXuiSceneHorseInventory::OnDestroy()
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
#ifdef _XBOX
|
||||
if( pMinecraft->localgameModes[m_iPad] != NULL )
|
||||
{
|
||||
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
|
||||
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CXuiControl* CXuiSceneHorseInventory::GetSectionControl( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionHorseChest:
|
||||
return (CXuiControl *)m_chestControl;
|
||||
break;
|
||||
case eSectionHorseSaddle:
|
||||
return (CXuiControl *)m_saddleControl;
|
||||
break;
|
||||
case eSectionHorseArmor:
|
||||
return (CXuiControl *)m_armorControl;
|
||||
break;
|
||||
case eSectionHorseInventory:
|
||||
return (CXuiControl *)m_inventoryControl;
|
||||
break;
|
||||
case eSectionHorseUsing:
|
||||
return (CXuiControl *)m_useRowControl;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CXuiCtrlSlotList* CXuiSceneHorseInventory::GetSectionSlotList( ESceneSection eSection )
|
||||
{
|
||||
switch( eSection )
|
||||
{
|
||||
case eSectionHorseChest:
|
||||
return m_chestControl;
|
||||
break;
|
||||
case eSectionHorseSaddle:
|
||||
return m_saddleControl;
|
||||
break;
|
||||
case eSectionHorseArmor:
|
||||
return m_armorControl;
|
||||
break;
|
||||
case eSectionHorseInventory:
|
||||
return m_inventoryControl;
|
||||
break;
|
||||
case eSectionHorseUsing:
|
||||
return m_useRowControl;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CXuiSceneHorseInventory::InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex)
|
||||
{
|
||||
m_saddleControl->SetData( iPad, menu, 1, 1, EntityHorse::INV_SLOT_SADDLE );
|
||||
|
||||
m_armorControl->SetData( iPad, menu, 1, 1, EntityHorse::INV_SLOT_ARMOR );
|
||||
|
||||
int chestCount = 0;
|
||||
if(m_horse != NULL && m_horse->isChestedHorse())
|
||||
{
|
||||
chestCount = EntityHorse::INV_DONKEY_CHEST_COUNT;
|
||||
}
|
||||
m_chestControl->SetData( iPad, menu, chestCount / 9, 9, EntityHorse::INV_BASE_COUNT );
|
||||
|
||||
int invStart = EntityHorse::INV_BASE_COUNT + chestCount;
|
||||
int invRows = 3;
|
||||
m_inventoryControl->SetData( iPad, menu, invRows, 9, invStart );
|
||||
|
||||
int useRowStart = invStart + (invRows * 9);
|
||||
m_useRowControl->SetData( iPad, menu, 1, 9, useRowStart );
|
||||
|
||||
CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, EntityHorse::INV_BASE_COUNT + chestCount);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
#include "..\Media\xuiscene_horse.h"
|
||||
#include "XUI_Scene_AbstractContainer.h"
|
||||
#include "XUI_Ctrl_MinecraftHorse.h"
|
||||
#include "XUI_CustomMessages.h"
|
||||
#include "..\UI\IUIScene_HorseInventoryMenu.h"
|
||||
|
||||
class CXuiSceneHorseInventory : public CXuiSceneAbstractContainer, public IUIScene_HorseInventoryMenu
|
||||
{
|
||||
public:
|
||||
XUI_IMPLEMENT_CLASS( CXuiSceneHorseInventory, L"CXuiSceneHorseInventory", XUI_CLASS_SCENE )
|
||||
|
||||
protected:
|
||||
XUI_BEGIN_MSG_MAP()
|
||||
XUI_ON_XM_INIT( OnInit )
|
||||
XUI_ON_XM_KEYDOWN( OnKeyDown )
|
||||
XUI_ON_XM_DESTROY( OnDestroy )
|
||||
XUI_ON_XM_TIMER( OnTimer )
|
||||
XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer)
|
||||
XUI_ON_XM_TRANSITION_START(OnTransitionStart)
|
||||
XUI_END_MSG_MAP()
|
||||
|
||||
BEGIN_CONTROL_MAP()
|
||||
MAP_CONTROL(IDC_Group, m_sceneGroup)
|
||||
BEGIN_MAP_CHILD_CONTROLS( m_sceneGroup )
|
||||
MAP_OVERRIDE(IDC_Inventory, m_inventoryControl)
|
||||
MAP_OVERRIDE(IDC_UseRow, m_useRowControl)
|
||||
MAP_OVERRIDE(IDC_Pointer, m_pointerControl)
|
||||
MAP_CONTROL(IDC_InventoryText, m_InventoryText)
|
||||
MAP_OVERRIDE(IDC_Chest, m_chestControl)
|
||||
MAP_OVERRIDE(IDC_Saddle, m_saddleControl)
|
||||
MAP_OVERRIDE(IDC_Armor, m_armorControl)
|
||||
MAP_CONTROL(IDC_HorseText, m_HorseText)
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_CONTROL_MAP()
|
||||
|
||||
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
|
||||
HRESULT OnDestroy();
|
||||
virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0);
|
||||
|
||||
private:
|
||||
CXuiCtrlSlotList* m_chestControl;
|
||||
CXuiCtrlSlotList* m_saddleControl;
|
||||
CXuiCtrlSlotList* m_armorControl;
|
||||
CXuiControl m_sceneGroup;
|
||||
CXuiControl m_HorseText;
|
||||
|
||||
virtual CXuiControl* GetSectionControl( ESceneSection eSection );
|
||||
virtual CXuiCtrlSlotList* GetSectionSlotList( ESceneSection eSection );
|
||||
};
|
||||
@@ -60,7 +60,7 @@ HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHa
|
||||
initData->player->awardStat(GenericStats::openInventory(), GenericStats::param_noArgs());
|
||||
|
||||
// 4J JEV - Item Picker Menu
|
||||
shared_ptr<SimpleContainer> creativeContainer = shared_ptr<SimpleContainer>(new SimpleContainer( 0, TabSpec::MAX_SIZE + 9 ));
|
||||
shared_ptr<SimpleContainer> creativeContainer = shared_ptr<SimpleContainer>(new SimpleContainer( 0, L"", false, TabSpec::MAX_SIZE + 9 ));
|
||||
itemPickerMenu = new ItemPickerMenu(creativeContainer, initData->player->inventory);
|
||||
|
||||
// 4J JEV - InitDataAssociations.
|
||||
@@ -140,12 +140,20 @@ CXuiControl* CXuiSceneInventoryCreative::GetSectionControl( ESceneSection eSecti
|
||||
{
|
||||
case eSectionInventoryCreativeUsing:
|
||||
return (CXuiControl *)m_useRowControl;
|
||||
break;
|
||||
case eSectionInventoryCreativeSelector:
|
||||
return (CXuiControl *)m_containerControl;
|
||||
break;
|
||||
case eSectionInventoryCreativeTab_0:
|
||||
case eSectionInventoryCreativeTab_1:
|
||||
case eSectionInventoryCreativeTab_2:
|
||||
case eSectionInventoryCreativeTab_3:
|
||||
case eSectionInventoryCreativeTab_4:
|
||||
case eSectionInventoryCreativeTab_5:
|
||||
case eSectionInventoryCreativeTab_6:
|
||||
case eSectionInventoryCreativeTab_7:
|
||||
return &m_hTabGroupA[eSection - eSectionInventoryCreativeTab_0];
|
||||
case eSectionInventoryCreativeSlider:
|
||||
return (CXuiControl *)&m_pageSlider;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.item.trading.h"
|
||||
#include "..\..\..\Minecraft.World\HtmlString.h"
|
||||
#include "..\..\MultiPlayerLocalPlayer.h"
|
||||
#include "..\..\Common\Tutorial\Tutorial.h"
|
||||
#include "..\..\Common\Tutorial\TutorialMode.h"
|
||||
@@ -317,4 +318,25 @@ void CXuiSceneTrading::setOfferDescription(const wstring &name, vector<wstring>
|
||||
offerInfoPos.x = Math::round(highlightPos.x - backgroundWidth - highlightWidth * 0.1);
|
||||
}
|
||||
m_offerInfoControl.SetPosition(&offerInfoPos);
|
||||
}
|
||||
|
||||
void CXuiSceneTrading::setOfferDescription(vector<HtmlString> *description)
|
||||
{
|
||||
if(description == NULL || description->empty())
|
||||
{
|
||||
m_offerInfoControl.SetText(L"");
|
||||
m_offerInfoControl.SetShow(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
wstring combinedText;
|
||||
vector<wstring> unformattedStrings;
|
||||
for(size_t i = 0; i < description->size(); ++i)
|
||||
{
|
||||
combinedText += (*description)[i].text;
|
||||
unformattedStrings.push_back((*description)[i].text);
|
||||
if(i + 1 < description->size()) combinedText += L"\n";
|
||||
}
|
||||
|
||||
setOfferDescription(combinedText, unformattedStrings);
|
||||
}
|
||||
@@ -125,4 +125,5 @@ protected:
|
||||
virtual void setTradeItem(int index, shared_ptr<ItemInstance> item);
|
||||
|
||||
virtual void setOfferDescription(const wstring &name, vector<wstring> &unformattedStrings);
|
||||
virtual void setOfferDescription(vector<HtmlString> *description);
|
||||
};
|
||||
@@ -402,7 +402,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS
|
||||
}
|
||||
else if(temp.find(L"{*StoneIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_pCraftingPic->SetIcon(m_iPad, Tile::rock_Id,0,1,10,31,false);
|
||||
m_pCraftingPic->SetIcon(m_iPad, Tile::stone_Id,0,1,10,31,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user