shared_ptr -> std::shared_ptr

This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
This commit is contained in:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -20,8 +20,8 @@ int SlotProgressControl::GetValue()
if( pvUserData != NULL )
{
SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData;
shared_ptr<ItemInstance> item = shared_ptr<ItemInstance>();
std::shared_ptr<ItemInstance> item = std::shared_ptr<ItemInstance>();
if( pUserDataContainer->slot != NULL )
{
@@ -68,8 +68,8 @@ void SlotProgressControl::GetRange(int *pnRangeMin, int *pnRangeMax)
if( pvUserData != NULL )
{
SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData;
shared_ptr<ItemInstance> item = shared_ptr<ItemInstance>();
std::shared_ptr<ItemInstance> item = std::shared_ptr<ItemInstance>();
if( pUserDataContainer->slot != NULL )
{

View File

@@ -8,7 +8,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
CXuiCtrlCraftIngredientSlot::CXuiCtrlCraftIngredientSlot()
CXuiCtrlCraftIngredientSlot::CXuiCtrlCraftIngredientSlot()
{
m_iID=0;
m_Desc=NULL;
@@ -23,7 +23,7 @@ CXuiCtrlCraftIngredientSlot::CXuiCtrlCraftIngredientSlot()
HRESULT CXuiCtrlCraftIngredientSlot::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled)
{
HRESULT hr=S_OK;
return hr;
}
//-----------------------------------------------------------------------------
@@ -48,10 +48,10 @@ HRESULT CXuiCtrlCraftIngredientSlot::OnCustomMessage_GetSlotItem(CustomMessage_G
}
HRESULT CXuiCtrlCraftIngredientSlot::OnGetSourceText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled)
{
{
pGetSourceTextData->szText=m_Desc;
bHandled = TRUE;
return S_OK;
}
@@ -72,7 +72,7 @@ void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCo
m_item = nullptr;
m_iID=iId;
m_iAuxVal=iAuxVal;
// 4J Stu - For clocks and compasses we set the aux value to a special one that signals we should use a default texture
// rather than the dynamic one for the player
// not right... auxvals for diggables are damage values, can be a lot higher
@@ -92,7 +92,7 @@ void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCo
XuiElementSetShow(m_hObj,bShow);
}
void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow)
void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, std::shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow)
{
if(item == NULL) SetIcon(iPad, 0,0,0,0,0,false,false,bShow);
else

View File

@@ -16,7 +16,7 @@ public:
virtual ~CXuiCtrlCraftIngredientSlot() { };
void SetRedBox(BOOL bVal);
void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha, bool bDecorations, bool isFoil = false, BOOL bShow=TRUE);
void SetIcon(int iPad, shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE);
void SetIcon(int iPad, std::shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE);
void SetDescription(LPCWSTR Desc);
protected:
@@ -31,7 +31,7 @@ protected:
HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled);
private:
shared_ptr<ItemInstance> m_item;
std::shared_ptr<ItemInstance> m_item;
int m_iID;
int m_iAuxVal;
int m_iCount;

View File

@@ -100,7 +100,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &b
// Annoyingly, XUI renders everything to a z of 0 so if we want to render anything that needs the z-buffer on top of it, then we need to clear it.
// Clear just the region required for this control.
D3DRECT clearRect;
D3DRECT clearRect;
clearRect.x1 = (int)(matrix._41) - 2;
clearRect.y1 = (int)(matrix._42) - 2;
clearRect.x2 = (int)(matrix._41 + ( bwidth * matrix._11 )) + 2;
@@ -201,7 +201,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &b
//HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled )
//{
// HXUIDC hDC = pRenderData->hDC;
//
//
// RenderManager.Set_matrixDirty();
//
// Minecraft *minecraft = Minecraft::GetInstance();
@@ -306,7 +306,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &b
void CXuiCtrlEnchantmentBook::tickBook()
{
EnchantmentMenu *menu = m_containerScene->getMenu();
shared_ptr<ItemInstance> current = menu->getSlot(0)->getItem();
std::shared_ptr<ItemInstance> current = menu->getSlot(0)->getItem();
if (!ItemInstance::matches(current, last))
{
last = current;
@@ -328,7 +328,7 @@ void CXuiCtrlEnchantmentBook::tickBook()
{
shouldBeOpen = true;
}
}
}
if (shouldBeOpen) open += 0.2f;
else open -= 0.2f;

View File

@@ -42,7 +42,7 @@ private:
float m_fScale,m_fAlpha;
int m_iPad;
CXuiSceneEnchant *m_containerScene;
shared_ptr<ItemInstance> last;
std::shared_ptr<ItemInstance> last;
float m_fScreenWidth,m_fScreenHeight;
float m_fRawWidth,m_fRawHeight;

View File

@@ -124,7 +124,7 @@ HRESULT CXuiCtrlMinecraftSlot::OnGetSourceImage(XUIMessageGetSourceImage* pData,
// if the id is greater than or equal to 32000, then it's an xzp icon, not a game icon
if(m_iID<32000)
{
{
// 4J Stu - Some parent controls may overide this, others will leave it as what we passed in
m_iPad = GET_SLOTDISPLAY_USERINDEX_FROM_DATA_BITMASK(MsgGetSlotItem.iDataBitField);
@@ -188,7 +188,7 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa
{
HXUIDC hDC = pRenderData->hDC;
CXuiControl xuiControl(m_hObj);
if(m_item == NULL) m_item = shared_ptr<ItemInstance>( new ItemInstance(m_iID, m_iCount, m_iAuxVal) );
if(m_item == NULL) m_item = std::shared_ptr<ItemInstance>( new ItemInstance(m_iID, m_iCount, m_iAuxVal) );
// build and render with the game call
@@ -208,15 +208,15 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa
// we might want separate x & y scales here
float scaleX = bwidth / 16.0f;
float scaleY = bheight / 16.0f;
float scaleY = bheight / 16.0f;
// apply any scale in the matrix too
scaleX *= matrix._11;
scaleY *= matrix._22;
scaleY *= matrix._22;
// Annoyingly, XUI renders everything to a z of 0 so if we want to render anything that needs the z-buffer on top of it, then we need to clear it.
// Clear just the region required for this control.
D3DRECT clearRect;
D3DRECT clearRect;
clearRect.x1 = (int)(matrix._41) - 2;
clearRect.y1 = (int)(matrix._42) - 2;
clearRect.x2 = (int)(matrix._41 + ( bwidth * matrix._11 )) + 2;
@@ -253,7 +253,7 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa
//Make sure that pMinecraft->player is the correct player so that player specific rendering
// eg clock and compass, are rendered correctly
shared_ptr<MultiplayerLocalPlayer> oldPlayer = pMinecraft->player;
std::shared_ptr<MultiplayerLocalPlayer> oldPlayer = pMinecraft->player;
if( m_iPad >= 0 && m_iPad < XUSER_MAX_COUNT ) pMinecraft->player = pMinecraft->localplayers[m_iPad];
@@ -281,8 +281,8 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa
if(m_bDecorations)
{
if((scaleX!=1.0f) ||(scaleY!=1.0f))
{
glPushMatrix();
{
glPushMatrix();
glScalef(scaleX, scaleY, 1.0f);
int iX= (int)(0.5f+((float)x)/scaleX);
int iY= (int)(0.5f+((float)y)/scaleY);
@@ -317,7 +317,7 @@ void CXuiCtrlMinecraftSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, i
// aux value for diggers can go as high as 1561
//const _Tier *_Tier::DIAMOND = new _Tier(3, 1561, 8, 3); //
// setMaxDamage(tier->getUses());
// setMaxDamage(tier->getUses());
// int ItemInstance::getDamageValue()
// {
@@ -343,7 +343,7 @@ void CXuiCtrlMinecraftSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, i
XuiElementSetShow(m_hObj,bShow);
}
void CXuiCtrlMinecraftSlot::SetIcon(int iPad, shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow)
void CXuiCtrlMinecraftSlot::SetIcon(int iPad, std::shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow)
{
m_item = item;
m_isFoil = item->isFoil();

View File

@@ -23,7 +23,7 @@ public:
void renderGuiItem(Font *font, Textures *textures,ItemInstance *item, int x, int y);
void RenderItem();
void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,BOOL bShow, bool isFoil);
void SetIcon(int iPad, shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE);
void SetIcon(int iPad, std::shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE);
protected:
@@ -38,7 +38,7 @@ protected:
HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled);
private:
shared_ptr<ItemInstance> m_item;
std::shared_ptr<ItemInstance> m_item;
BOOL m_bDirty;
INT m_iPassThroughDataAssociation;
INT m_iPassThroughIdAssociation;

View File

@@ -36,7 +36,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnDestroy( HXUIOBJ hObj )
HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled)
{
shared_ptr<ItemInstance> item = shared_ptr<ItemInstance>();
std::shared_ptr<ItemInstance> item = std::shared_ptr<ItemInstance>();
void* pvUserData;
XuiElementGetUserData( hObj, &pvUserData );
@@ -49,7 +49,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, Cust
}
else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
if(player != NULL) item = player->inventory->getCarried();
}
@@ -64,7 +64,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, Cust
// 11 bits - auxval
// 6 bits - count
// 6 bits - scale
pData->iDataBitField = MAKE_SLOTDISPLAY_DATA_BITMASK(pUserDataContainer->m_iPad, (int)(31*pUserDataContainer->m_fAlpha),true,item->GetCount(),7,item->popTime);
pData->iDataBitField = MAKE_SLOTDISPLAY_DATA_BITMASK(pUserDataContainer->m_iPad, (int)(31*pUserDataContainer->m_fAlpha),true,item->GetCount(),7,item->popTime);
}
else
{
@@ -93,7 +93,7 @@ void CXuiCtrlSlotItemCtrlBase::SetUserIndex( HXUIOBJ hObj, int iPad )
XuiElementGetUserData( hObj, &pvUserData );
SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData;
pUserDataContainer->m_iPad = iPad;
}
@@ -103,7 +103,7 @@ void CXuiCtrlSlotItemCtrlBase::SetAlpha( HXUIOBJ hObj, float fAlpha )
XuiElementGetUserData( hObj, &pvUserData );
SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData;
pUserDataContainer->m_fAlpha = fAlpha;
}
@@ -119,7 +119,7 @@ bool CXuiCtrlSlotItemCtrlBase::isEmpty( HXUIOBJ hObj )
}
else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
if(player != NULL) return player->inventory->getCarried() == NULL;
}
@@ -146,7 +146,7 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector<wstri
}
else
{
firstLine = false;
firstLine = false;
wchar_t formatted[256];
eMinecraftColour rarityColour = pUserDataContainer->slot->getItem()->getRarity()->color;
int colour = app.GetHTMLColour(rarityColour);
@@ -156,7 +156,7 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector<wstri
colour = app.GetHTMLColour(eTextColor_RenamedItemTitle);
}
swprintf(formatted, 256, L"<font color=\"#%08x\">%s</font>",colour,thisString.c_str());
swprintf(formatted, 256, L"<font color=\"#%08x\">%s</font>",colour,thisString.c_str());
thisString = formatted;
}
desc.append( thisString );
@@ -167,10 +167,10 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector<wstri
}
else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
if(player != NULL)
{
shared_ptr<ItemInstance> item = player->inventory->getCarried();
std::shared_ptr<ItemInstance> item = player->inventory->getCarried();
if(item != NULL) return app.GetString( item->getDescriptionId() );
}
@@ -178,7 +178,7 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector<wstri
return L"";
}
shared_ptr<ItemInstance> CXuiCtrlSlotItemCtrlBase::getItemInstance( HXUIOBJ hObj )
std::shared_ptr<ItemInstance> CXuiCtrlSlotItemCtrlBase::getItemInstance( HXUIOBJ hObj )
{
void* pvUserData;
XuiElementGetUserData( hObj, &pvUserData );
@@ -190,7 +190,7 @@ shared_ptr<ItemInstance> CXuiCtrlSlotItemCtrlBase::getItemInstance( HXUIOBJ hObj
}
else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
if(player != NULL) return player->inventory->getCarried();
}
@@ -221,7 +221,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInpu
XUIMessage message;
XUIMessageInput messageInput;
XuiMessageInput( &message, &messageInput, XUI_KEYDOWN, pInputData->dwKeyCode, pInputData->wch, pInputData->dwFlags, pInputData->UserIndex );
if (HRESULT_SUCCEEDED(hr))
@@ -268,7 +268,7 @@ int CXuiCtrlSlotItemCtrlBase::GetObjectCount( HXUIOBJ hObj )
}
else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] );
if(player != NULL && player->inventory->getCarried() != NULL)
{
iCount = player->inventory->getCarried()->count;
@@ -309,7 +309,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj
}
else if(pThisUserDataContainer->m_iPad >= 0 && pThisUserDataContainer->m_iPad < XUSER_MAX_COUNT)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pThisUserDataContainer->m_iPad] );
std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pThisUserDataContainer->m_iPad] );
if(player != NULL && player->inventory->getCarried() != NULL)
{
iThisID = player->inventory->getCarried()->id;
@@ -336,7 +336,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj
}
else if(pOtherUserDataContainer->m_iPad >= 0 && pOtherUserDataContainer->m_iPad < XUSER_MAX_COUNT)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pOtherUserDataContainer->m_iPad] );
std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pOtherUserDataContainer->m_iPad] );
if(player != NULL && player->inventory->getCarried() != NULL)
{
iOtherID = player->inventory->getCarried()->id;
@@ -358,7 +358,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj
// 4J WESTY : Pointer Prototype : Added to support prototype only.
// Returns number of items that can still be stacked into this slot.
int CXuiCtrlSlotItemCtrlBase::GetEmptyStackSpace( HXUIOBJ hObj )
int CXuiCtrlSlotItemCtrlBase::GetEmptyStackSpace( HXUIOBJ hObj )
{
int iResult = 0;

View File

@@ -29,9 +29,9 @@ private:
public:
// We define a lot of functions as virtual. These should be implemented to call the protected version by
// passing in the HXUIOBJ of the control as the first parameter. We do not have access to that normally
// due to the inheritance structure
// due to the inheritance structure
virtual HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) = 0;
virtual HRESULT OnDestroy() = 0;
virtual HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) = 0;
@@ -49,7 +49,7 @@ public:
wstring GetItemDescription( HXUIOBJ hObj, vector<wstring> &unformattedStrings );
shared_ptr<ItemInstance> getItemInstance( HXUIOBJ hObj );
std::shared_ptr<ItemInstance> getItemInstance( HXUIOBJ hObj );
Slot *getSlot( HXUIOBJ hObj );
// 4J WESTY : Pointer Prototype : Added to support prototype only.
@@ -64,9 +64,9 @@ public:
// 4J WESTY : Pointer Prototype : Added to support prototype only.
bool IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj );
protected:
protected:
HRESULT OnInit( HXUIOBJ hObj, XUIMessageInit* pInitData, BOOL& bHandled );
HRESULT OnDestroy( HXUIOBJ hObj );
HRESULT OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled);

View File

@@ -8,13 +8,13 @@
#define XM_INVENTORYUPDATED_MESSAGE XM_USER + 5
#define XM_TMS_DLCFILE_RETRIEVED_MESSAGE XM_USER + 6
#define XM_TMS_BANFILE_RETRIEVED_MESSAGE XM_USER + 7
#define XM_TMS_ALLFILES_RETRIEVED_MESSAGE XM_USER + 8
#define XM_TMS_ALLFILES_RETRIEVED_MESSAGE XM_USER + 8
#define XM_CUSTOMTICKSCENE_MESSAGE XM_USER + 9
#define XM_GETSLOTITEM_MESSAGE XM_USER + 10
typedef struct
{
shared_ptr<ItemInstance> item;
std::shared_ptr<ItemInstance> item;
// Legacy values for compatibility
int iDataBitField;

View File

@@ -9,7 +9,7 @@
#include "..\..\Common\GameRules\ConsoleGameRules.h"
#include "XUI_DebugItemEditor.h"
#ifdef _DEBUG_MENUS_ENABLED
#ifdef _DEBUG_MENUS_ENABLED
HRESULT CScene_DebugItemEditor::OnInit( XUIMessageInit *pInitData, BOOL &bHandled )
{
MapChildControls();
@@ -22,7 +22,7 @@ HRESULT CScene_DebugItemEditor::OnInit( XUIMessageInit *pInitData, BOOL &bHandle
if(m_item!=NULL)
{
m_icon->SetIcon(m_iPad, m_item->id,m_item->getAuxValue(),m_item->count,10,31,false,m_item->isFoil());
m_icon->SetIcon(m_iPad, m_item->id,m_item->getAuxValue(),m_item->count,10,31,false,m_item->isFoil());
m_itemName.SetText( app.GetString( Item::items[m_item->id]->getDescriptionId(m_item) ) );
m_itemId .SetText( _toString<int>(m_item->id).c_str() );
@@ -59,8 +59,8 @@ HRESULT CScene_DebugItemEditor::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH
m_slot->set(m_item);
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player != NULL && player->connection) player->connection->send( shared_ptr<ContainerSetSlotPacket>( new ContainerSetSlotPacket(m_menu->containerId, m_slot->index, m_item) ) );
std::shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player != NULL && player->connection) player->connection->send( std::shared_ptr<ContainerSetSlotPacket>( new ContainerSetSlotPacket(m_menu->containerId, m_slot->index, m_item) ) );
}
// kill the crafting xui
app.NavigateBack(m_iPad);
@@ -76,7 +76,7 @@ HRESULT CScene_DebugItemEditor::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH
HRESULT CScene_DebugItemEditor::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled)
{
if(m_item == NULL) m_item = shared_ptr<ItemInstance>( new ItemInstance(0,1,0) );
if(m_item == NULL) m_item = std::shared_ptr<ItemInstance>( new ItemInstance(0,1,0) );
if(hObjSource == m_itemId)
{
int id = 0;
@@ -107,7 +107,7 @@ HRESULT CScene_DebugItemEditor::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINot
if(!value.empty()) data = _fromString<int>( value );
m_item->set4JData(data);
}
m_icon->SetIcon(m_iPad, m_item->id,m_item->getAuxValue(),m_item->count,10,31,false,m_item->isFoil());
m_itemName.SetText( app.GetString( Item::items[m_item->id]->getDescriptionId(m_item) ) );

View File

@@ -8,7 +8,7 @@ using namespace std;
class CScene_DebugItemEditor : public CXuiSceneImpl
{
#ifdef _DEBUG_MENUS_ENABLED
#ifdef _DEBUG_MENUS_ENABLED
public:
typedef struct _ItemEditorInput
{
@@ -18,7 +18,7 @@ public:
} ItemEditorInput;
private:
int m_iPad;
shared_ptr<ItemInstance> m_item;
std::shared_ptr<ItemInstance> m_item;
Slot *m_slot;
AbstractContainerMenu *m_menu;

View File

@@ -50,7 +50,7 @@ HRESULT CScene_InGameHostOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHand
CXuiSceneBase::ShowLogo( m_iPad, FALSE );
//SentientManager.RecordMenuShown(m_iPad, eUIScene_CreateWorldMenu, 0);
return S_OK;
@@ -74,11 +74,11 @@ HRESULT CScene_InGameHostOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
// Send update settings packet to server
if(hostOptions != app.GetGameHostOption(eGameHostOption_All) )
{
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
Minecraft *pMinecraft = Minecraft::GetInstance();
std::shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player != NULL && player->connection)
{
player->connection->send( shared_ptr<ServerSettingsChangedPacket>( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions) ) );
player->connection->send( std::shared_ptr<ServerSettingsChangedPacket>( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions) ) );
}
}

View File

@@ -58,7 +58,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
if(thisPlayer != NULL) m_isHostPlayer = thisPlayer->IsHost() == TRUE;
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
std::shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
if(!m_isHostPlayer && !localPlayer->isModerator() )
{
m_gameOptionsButton.SetEnable(FALSE);
@@ -77,7 +77,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
int keyA = -1;
ui.SetTooltips( m_iPad, keyA,IDS_TOOLTIPS_BACK,keyX,-1);
CXuiSceneBase::ShowDarkOverlay( m_iPad, TRUE );
SetTimer( TOOLTIP_TIMERID , INGAME_INFO_TOOLTIP_TIMER );
@@ -179,11 +179,11 @@ HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress*
ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A);
if( hObjPressed == playersList )
{
{
INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId( m_players[ playersList.GetCurSel() ] );
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
std::shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
bool isOp = m_isHostPlayer || localPlayer->isModerator();
bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0;
@@ -220,7 +220,7 @@ HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress*
}
}
else if( hObjPressed == m_gameOptionsButton )
{
{
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_InGameHostOptionsMenu);
}
return S_OK;
@@ -330,7 +330,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSour
}
HRESULT hr;
HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon;
HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon;
hButton = playersList.GetItemControl(pGetSourceTextData->iItem);
hr=XuiControlGetVisual(hButton,&hVisual);
@@ -415,7 +415,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSour
XuiElementFindNamedFrame(hVoiceIcon, L"NotSpeaking", &playFrame);
}
}
if(playFrame < 0)
{
XuiElementFindNamedFrame(hVoiceIcon, L"Normal", &playFrame);
@@ -465,8 +465,8 @@ void CScene_InGameInfo::updateTooltips()
int keyA = -1;
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
std::shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
bool isOp = m_isHostPlayer || localPlayer->isModerator();
bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0;
bool trust = app.GetGameHostOption(eGameHostOption_TrustPlayers) != 0;
@@ -524,12 +524,12 @@ int CScene_InGameInfo::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMes
delete pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
{
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[iPad];
std::shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[iPad];
if(localPlayer != NULL && localPlayer->connection)
{
localPlayer->connection->send( shared_ptr<KickPlayerPacket>( new KickPlayerPacket(smallId) ) );
localPlayer->connection->send( std::shared_ptr<KickPlayerPacket>( new KickPlayerPacket(smallId) ) );
}
}

View File

@@ -141,7 +141,7 @@ HRESULT CScene_InGamePlayerOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHa
m_checkboxes[eControl_HostInvisible].SetText( app.GetString(IDS_CAN_INVISIBLE) );
m_checkboxes[eControl_HostInvisible].SetCheck(checked);
bool inCreativeMode = Player::getPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode) != 0;
if(inCreativeMode)
{
@@ -191,7 +191,7 @@ HRESULT CScene_InGamePlayerOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHa
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
CXuiSceneBase::ShowLogo( m_iPad, FALSE );
CXuiSceneBase::ShowLogo( m_iPad, FALSE );
g_NetworkManager.RegisterPlayerChangedCallback(m_iPad, &CScene_InGamePlayerOptions::OnPlayerChanged, this);
@@ -276,11 +276,11 @@ HRESULT CScene_InGamePlayerOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL&
if(originalPrivileges != m_playerPrivileges)
{
// Send update settings packet to server
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
Minecraft *pMinecraft = Minecraft::GetInstance();
std::shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player != NULL && player->connection)
{
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( m_networkSmallId, -1, m_playerPrivileges) ) );
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( m_networkSmallId, -1, m_playerPrivileges) ) );
}
}
@@ -334,12 +334,12 @@ int CScene_InGamePlayerOptions::KickPlayerReturned(void *pParam,int iPad,C4JStor
delete pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
{
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[iPad];
std::shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[iPad];
if(localPlayer != NULL && localPlayer->connection)
{
localPlayer->connection->send( shared_ptr<KickPlayerPacket>( new KickPlayerPacket(smallId) ) );
localPlayer->connection->send( std::shared_ptr<KickPlayerPacket>( new KickPlayerPacket(smallId) ) );
}
// Fix for #61494 - [CRASH]: TU7: Code: Multiplayer: Title may crash while kicking a player from an online game.
@@ -478,22 +478,22 @@ void CScene_InGamePlayerOptions::resetCheatCheckboxes()
if (!m_editingSelf)
{
m_checkboxes[eControl_HostInvisible].SetEnable(isModerator);
m_checkboxes[eControl_HostInvisible].SetCheck( isModerator
m_checkboxes[eControl_HostInvisible].SetCheck( isModerator
&& (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanToggleInvisible) != 0) );
// NOT CREATIVE MODE.
{
m_checkboxes[eControl_HostFly].SetEnable(isModerator);
m_checkboxes[eControl_HostFly].SetCheck( isModerator
m_checkboxes[eControl_HostFly].SetCheck( isModerator
&& (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanToggleFly) != 0) );
m_checkboxes[eControl_HostHunger].SetEnable(isModerator);
m_checkboxes[eControl_HostHunger].SetCheck( isModerator
m_checkboxes[eControl_HostHunger].SetCheck( isModerator
&& (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanToggleClassicHunger) != 0) );
}
m_checkboxes[eControl_CheatTeleport].SetEnable(isModerator);
m_checkboxes[eControl_CheatTeleport].SetCheck( isModerator
m_checkboxes[eControl_CheatTeleport].SetCheck( isModerator
&& (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanTeleport) != 0) );
}
}

View File

@@ -24,7 +24,7 @@
#include "XUI_Ctrl_SlotItem.h"
#include "XUI_Ctrl_SlotItemListItem.h"
#include "XUI_Scene_AbstractContainer.h"
#ifdef _DEBUG_MENUS_ENABLED
#ifdef _DEBUG_MENUS_ENABLED
#include "XUI_DebugItemEditor.h"
#endif
@@ -44,14 +44,14 @@ void CXuiSceneAbstractContainer::PlatformInitialize(int iPad, int startIndex)
// We may have varying depths of controls here, so base off the pointers parent
HXUIOBJ parent;
XuiElementGetBounds( m_pointerControl->m_hObj, &fPointerWidth, &fPointerHeight );
XuiElementGetBounds( m_pointerControl->m_hObj, &fPointerWidth, &fPointerHeight );
XuiElementGetParent( m_pointerControl->m_hObj, &parent );
m_pointerControl->SetShow(TRUE);
XuiElementGetBounds( parent, &fPanelWidth, &fPanelHeight );
XuiElementGetBounds( parent, &fPanelWidth, &fPanelHeight );
// Get size of pointer
m_fPointerImageOffsetX = floor(fPointerWidth/2.0f);
m_fPointerImageOffsetY = floor(fPointerHeight/2.0f);
m_fPanelMinX = 0.0f;
m_fPanelMaxX = fPanelWidth;
m_fPanelMinY = 0.0f;
@@ -97,13 +97,13 @@ void CXuiSceneAbstractContainer::PlatformInitialize(int iPad, int startIndex)
m_pointerPos.x = newPointerPos.x;
m_pointerPos.y = newPointerPos.y;
#ifdef USE_POINTER_ACCEL
#ifdef USE_POINTER_ACCEL
m_fPointerVelX = 0.0f;
m_fPointerVelY = 0.0f;
m_fPointerAccelX = 0.0f;
m_fPointerAccelY = 0.0f;
#endif
// Add timer to poll controller stick input at 60Hz
HRESULT timerResult = SetTimer( POINTER_INPUT_TIMER_ID, ( 1000 / 60 ) );
assert( timerResult == S_OK );
@@ -114,7 +114,7 @@ void CXuiSceneAbstractContainer::PlatformInitialize(int iPad, int startIndex)
for ( int iSection = m_eFirstSection; iSection < m_eMaxSection; ++iSection )
{
ESceneSection eSection = ( ESceneSection )( iSection );
if(!IsSectionSlotList(eSection)) continue;
// Get dimensions of this section.
@@ -153,7 +153,7 @@ int CXuiSceneAbstractContainer::getSectionRows(ESceneSection eSection)
return GetSectionSlotList( eSection )->GetRows();
}
// Adding this so we can turn off the pointer text background, since it flickers on then off at the start of a scene where a tutorial popup is
// Adding this so we can turn off the pointer text background, since it flickers on then off at the start of a scene where a tutorial popup is
HRESULT CXuiSceneAbstractContainer::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled )
{
if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK;
@@ -306,7 +306,7 @@ void CXuiSceneAbstractContainer::GetItemScreenData( ESceneSection eSection, int
}
}
shared_ptr<ItemInstance> CXuiSceneAbstractContainer::getSlotItem(ESceneSection eSection, int iSlot)
std::shared_ptr<ItemInstance> CXuiSceneAbstractContainer::getSlotItem(ESceneSection eSection, int iSlot)
{
CXuiCtrlSlotItemListItem* pCXuiCtrlSlotItem;
GetSectionSlotList( eSection )->GetCXuiCtrlSlotItem( iSlot, &( pCXuiCtrlSlotItem ) );
@@ -327,7 +327,7 @@ HRESULT CXuiSceneAbstractContainer::OnTimer( XUIMessageTimer *pTimer, BOOL& bHan
// Update pointer from stick input on timer.
if ( pTimer->nId == POINTER_INPUT_TIMER_ID )
{
onMouseTick();
D3DXVECTOR3 pointerPos;
pointerPos.x = m_pointerPos.x;
@@ -348,7 +348,7 @@ HRESULT CXuiSceneAbstractContainer::OnTimer( XUIMessageTimer *pTimer, BOOL& bHan
hr = handleCustomTimer( pTimer, bHandled );
}
return hr;
}
}
HRESULT CXuiSceneAbstractContainer::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled)
{
@@ -443,7 +443,7 @@ void CXuiSceneAbstractContainer::adjustPointerForSafeZone()
D3DXVECTOR2 baseSceneOrigin;
float baseWidth, baseHeight;
if(CXuiSceneBase::GetBaseSceneSafeZone( m_iPad, baseSceneOrigin, baseWidth, baseHeight))
{
{
D3DXMATRIX pointerBackgroundMatrix;
XuiElementGetFullXForm( m_hPointerTextBkg, &pointerBackgroundMatrix);

View File

@@ -25,7 +25,7 @@ protected:
CXuiCtrlSlotList* m_useRowControl;
CXuiCtrlSlotItem* m_pointerControl;
CXuiControl m_InventoryText;
HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled);
// Timer function to poll stick input and update pointer position.
HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled );
@@ -64,7 +64,7 @@ public:
HXUIOBJ m_hPointerText;
HXUIOBJ m_hPointerTextBkg;
HXUIOBJ m_hPointerImg;
virtual int getSectionColumns(ESceneSection eSection);
virtual int getSectionRows(ESceneSection eSection);
virtual CXuiControl* GetSectionControl( ESceneSection eSection ) = 0;
@@ -77,7 +77,7 @@ public:
void setSectionSelectedSlot(ESceneSection eSection, int x, int y);
void setFocusToPointer(int iPad);
void SetPointerText(const wstring &description, vector<wstring> &unformattedStrings, bool newSlot);
virtual shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot);
virtual std::shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot);
virtual bool isSlotEmpty(ESceneSection eSection, int iSlot);
virtual void adjustPointerForSafeZone();
};

View File

@@ -215,7 +215,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
}
else
{
shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
std::shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
EnderDragonRenderer::bossInstance = nullptr;
m_ticksWithNoBoss = 0;

View File

@@ -30,12 +30,12 @@ HRESULT CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
Minecraft *pMinecraft = Minecraft::GetInstance();
ContainerScreenInput* initData = (ContainerScreenInput*)pInitData->pvInitData;
XuiControlSetText(m_ChestText,app.GetString(initData->container->getName()));
ContainerMenu* menu = new ContainerMenu( initData->inventory, initData->container );
shared_ptr<Container> container = initData->container;
std::shared_ptr<Container> container = initData->container;
m_iPad=initData->iPad;
m_bSplitscreen=initData->bSplitscreen;
@@ -61,7 +61,7 @@ HRESULT CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
// Adjust the height to show the correct number of container rows
float height, width;
this->GetBounds( &width, &height );
this->GetBounds( &width, &height );
int rowDiff = CONTAINER_DEFAULT_ROWS - rows;
//height = height - (rowDiff * ROW_HEIGHT);
height = height - (rowDiff * fPointerHeight);
@@ -103,7 +103,7 @@ HRESULT CXuiSceneContainer::OnDestroy()
#endif
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss.
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
return S_OK;
}
@@ -156,7 +156,7 @@ void CXuiSceneContainer::InitDataAssociations(int iPad, AbstractContainerMenu *m
// TODO Inventory dimensions need defined as constants
m_containerControl->SetData( iPad, menu, rows, 9, 0 );
CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, containerSize);
}

View File

@@ -22,7 +22,7 @@
//////////////////////////////////////////////////////////////////////////
//
//
//
//
//////////////////////////////////////////////////////////////////////////
CXuiSceneCraftingPanel::CXuiSceneCraftingPanel()
@@ -46,10 +46,10 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
m_iPad=pCraftingPanelData->iPad;
m_bSplitscreen=pCraftingPanelData->bSplitscreen;
HRESULT hr = S_OK;
HRESULT hr = S_OK;
MapChildControls();
if(m_iContainerType==RECIPE_TYPE_2x2)
{
// TODO Inventory dimensions need defined as constants
@@ -74,7 +74,7 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
// if we are in splitscreen, then we need to figure out if we want to move this scene
if(m_bSplitscreen)
{
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
}
XuiElementSetShow(m_hGrid,TRUE);
@@ -84,7 +84,7 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
if(m_iContainerType==RECIPE_TYPE_3x3)
{
m_pCursors=m_pHSlotsCraftingTableCursors;
m_iIngredientsMaxSlotC = m_iIngredients3x3SlotC;
for(int i=0;i<m_iIngredients3x3SlotC;i++)
{
@@ -108,7 +108,7 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
else
{
m_pCursors=m_pHSlotsCraftingCursors;
m_iIngredientsMaxSlotC = m_iIngredients2x2SlotC;
for(int i=0;i<m_iIngredients2x2SlotC;i++)
{
@@ -131,7 +131,7 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
}
}
// display the first group tab
// display the first group tab
m_hTabGroupA[m_iGroupIndex].SetShow(TRUE);
// store the slot 0 position
@@ -192,8 +192,8 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
//////////////////////////////////////////////////////////////////////////
HRESULT CXuiSceneCraftingPanel::OnTransitionEnd( XUIMessageTransition *pTransData, BOOL& bHandled )
{
// are we being destroyed? If so, don't do anything
if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY )
// are we being destroyed? If so, don't do anything
if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY )
{
return S_OK;
}
@@ -222,7 +222,7 @@ HRESULT CXuiSceneCraftingPanel::OnTransitionEnd( XUIMessageTransition *pTransDat
// Display the tooltips
ui.SetTooltips(m_iPad, IDS_TOOLTIPS_CREATE,IDS_TOOLTIPS_EXIT, IDS_TOOLTIPS_SHOW_INVENTORY,-1,-1,-1,-2, IDS_TOOLTIPS_CHANGE_GROUP);
CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE );
CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE );
// Check which recipes are available with the resources we have
CheckRecipesAvailable();
@@ -241,7 +241,7 @@ HRESULT CXuiSceneCraftingPanel::OnCustomMessage_InventoryUpdated()
{
// Display the tooltips
ui.SetTooltips(m_iPad, IDS_TOOLTIPS_CREATE,IDS_TOOLTIPS_EXIT, IDS_TOOLTIPS_SHOW_INVENTORY,-1,-1,-1,-2, IDS_TOOLTIPS_CHANGE_GROUP);
CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE );
CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE );
// Check which recipes are available with the resources we have
CheckRecipesAvailable();
@@ -359,7 +359,7 @@ HRESULT CXuiSceneCraftingPanel::OnDestroy()
}
#endif
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
return S_OK;
@@ -417,21 +417,21 @@ void CXuiSceneCraftingPanel::hideAllIngredientsSlots()
}
}
void CXuiSceneCraftingPanel::setCraftHSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha)
void CXuiSceneCraftingPanel::setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha)
{
m_pHSlotsBrushImageControl[iIndex]->SetIcon(iPad, item, 9, uiAlpha, false);
//m_pHSlotsBrushImageControl[iIndex]->SetPassThroughDataAssociation(MAKE_SLOTDISPLAY_ITEM_BITMASK(item->id,item->getAuxValue(),item->isFoil()),MAKE_SLOTDISPLAY_DATA_BITMASK (iPad, uiAlpha, false, item->GetCount(), 9,0) );
//m_pHSlotsBrushImageControl[iIndex]->SetShow(TRUE);
}
void CXuiSceneCraftingPanel::setCraftVSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha)
void CXuiSceneCraftingPanel::setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha)
{
m_pVSlotsBrushImageControl[iIndex]->SetIcon(iPad, item, 9, uiAlpha, false);
//m_pVSlotsBrushImageControl[iIndex]->SetPassThroughDataAssociation(MAKE_SLOTDISPLAY_ITEM_BITMASK(item->id,item->getAuxValue(),item->isFoil()),MAKE_SLOTDISPLAY_DATA_BITMASK (iPad, uiAlpha, false, item->GetCount(), 9,0) );
//m_pVSlotsBrushImageControl[iIndex]->SetShow(TRUE);
}
void CXuiSceneCraftingPanel::setCraftingOutputSlotItem(int iPad, shared_ptr<ItemInstance> item)
void CXuiSceneCraftingPanel::setCraftingOutputSlotItem(int iPad, std::shared_ptr<ItemInstance> item)
{
if(item == NULL)
{
@@ -448,7 +448,7 @@ void CXuiSceneCraftingPanel::setCraftingOutputSlotRedBox(bool show)
m_pCraftingOutput->SetRedBox(show?TRUE:FALSE);
}
void CXuiSceneCraftingPanel::setIngredientSlotItem(int iPad, int index, shared_ptr<ItemInstance> item)
void CXuiSceneCraftingPanel::setIngredientSlotItem(int iPad, int index, std::shared_ptr<ItemInstance> item)
{
if(item == NULL)
{
@@ -465,7 +465,7 @@ void CXuiSceneCraftingPanel::setIngredientSlotRedBox(int index, bool show)
m_pCraftingIngredientA[index]->SetRedBox(show?TRUE:FALSE);
}
void CXuiSceneCraftingPanel::setIngredientDescriptionItem(int iPad, int index, shared_ptr<ItemInstance> item)
void CXuiSceneCraftingPanel::setIngredientDescriptionItem(int iPad, int index, std::shared_ptr<ItemInstance> item)
{
m_pCraftIngredientDescA[index]->SetIcon(iPad, item->id,item->getAuxValue(),item->GetCount(),8,31,TRUE,item->isFoil(),FALSE);
}
@@ -524,7 +524,7 @@ void CXuiSceneCraftingPanel::UpdateMultiPanel()
// turn off the inventory
XuiElementSetShow(m_hGridInventory,FALSE);
XuiElementSetShow(m_DescriptionText,TRUE);
XuiElementSetShow(m_InventoryText,FALSE);
XuiElementSetShow(m_InventoryText,FALSE);
break;
case DISPLAY_INGREDIENTS:
// turn off all the descriptions
@@ -544,7 +544,7 @@ void CXuiSceneCraftingPanel::UpdateMultiPanel()
{
XuiControlSetText(m_InventoryText,app.GetString(IDS_INGREDIENTS));
XuiElementSetShow(m_InventoryText,TRUE);
}
}
break;
}
}

View File

@@ -3,7 +3,7 @@ using namespace std;
#include "../media/xuiscene_craftingpanel_2x2.h"
#include "XUI_Ctrl_MinecraftSlot.h"
#include "..\..\..\Minecraft.World\Recipy.h"
#include "..\..\..\Minecraft.World\Recipy.h"
#include "XUI_Ctrl_CraftIngredientSlot.h"
#include "..\..\..\Minecraft.World\Item.h"
#include "XUI_CustomMessages.h"
@@ -137,7 +137,7 @@ public:
MAP_CONTROL(IDC_CraftingOutputRed,m_hCraftOutput)
END_MAP_CHILD_CONTROLS()
MAP_CONTROL(IDC_InventoryGrid, m_hGridInventory)
BEGIN_MAP_CHILD_CONTROLS(m_hGridInventory)
MAP_OVERRIDE(IDC_Inventory, m_inventoryControl)
@@ -182,13 +182,13 @@ protected:
virtual void hideAllHSlots();
virtual void hideAllVSlots();
virtual void hideAllIngredientsSlots();
virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha);
virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha);
virtual void setCraftingOutputSlotItem(int iPad, shared_ptr<ItemInstance> item);
virtual void setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha);
virtual void setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha);
virtual void setCraftingOutputSlotItem(int iPad, std::shared_ptr<ItemInstance> item);
virtual void setCraftingOutputSlotRedBox(bool show);
virtual void setIngredientSlotItem(int iPad, int index, shared_ptr<ItemInstance> item);
virtual void setIngredientSlotItem(int iPad, int index, std::shared_ptr<ItemInstance> item);
virtual void setIngredientSlotRedBox(int index, bool show);
virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr<ItemInstance> item);
virtual void setIngredientDescriptionItem(int iPad, int index, std::shared_ptr<ItemInstance> item);
virtual void setIngredientDescriptionRedBox(int index, bool show);
virtual void setIngredientDescriptionText(int index, LPCWSTR text);
virtual void setShowCraftHSlot(int iIndex, bool show);
@@ -200,6 +200,6 @@ protected:
virtual void scrollDescriptionDown();
virtual void updateHighlightAndScrollPositions();
virtual void updateVSlotPositions(int iSlots, int i);
virtual void UpdateMultiPanel();
};

View File

@@ -33,7 +33,7 @@ HRESULT CXuiSceneInventory::OnInit( XUIMessageInit *pInitData, BOOL &bHandled )
{
if(m_bSplitscreen)
{
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
}
}
@@ -57,7 +57,7 @@ HRESULT CXuiSceneInventory::OnInit( XUIMessageInit *pInitData, BOOL &bHandled )
initData->player->awardStat(GenericStats::openInventory(), GenericStats::param_noArgs());
CXuiSceneAbstractContainer::Initialize( initData->iPad, menu, false, InventoryMenu::INV_SLOT_START, eSectionInventoryUsing, eSectionInventoryMax, initData->bNavigateBack );
delete initData;
float fWidth;
@@ -86,7 +86,7 @@ HRESULT CXuiSceneInventory::OnDestroy()
}
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss.
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
return S_OK;
}
@@ -154,7 +154,7 @@ void CXuiSceneInventory::updateEffectsDisplay()
{
// Update with the current effects
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<LocalPlayer> player = pMinecraft->localplayers[m_iPad];
std::shared_ptr<LocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player == NULL) return;
@@ -185,7 +185,7 @@ void CXuiSceneInventory::updateEffectsDisplay()
if(i > 0) position.y -= fNextEffectYOffset; // Stack from the bottom
m_hEffectDisplayA[i]->SetPosition(&position);
MobEffectInstance *effect = *it;
MobEffect *mobEffect = MobEffect::effects[effect->getId()];

View File

@@ -43,7 +43,7 @@ HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHa
{
if(m_bSplitscreen)
{
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
}
}
@@ -60,12 +60,12 @@ 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 ));
std::shared_ptr<SimpleContainer> creativeContainer = std::shared_ptr<SimpleContainer>(new SimpleContainer( 0, TabSpec::MAX_SIZE + 9 ));
itemPickerMenu = new ItemPickerMenu(creativeContainer, initData->player->inventory);
// 4J JEV - InitDataAssociations.
m_containerControl->SetData( initData->iPad, itemPickerMenu, TabSpec::rows, TabSpec::columns, 0, TabSpec::MAX_SIZE );
m_useRowControl->SetData( initData->iPad, itemPickerMenu, 1, 9, TabSpec::MAX_SIZE, TabSpec::MAX_SIZE + 9 );
m_useRowControl->SetData( initData->iPad, itemPickerMenu, 1, 9, TabSpec::MAX_SIZE, TabSpec::MAX_SIZE + 9 );
m_pointerControl->SetUserIndex(m_pointerControl->m_hObj, initData->iPad);
// Initialize superclass.
@@ -79,7 +79,7 @@ HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHa
m_fPointerMinY += containerPos.y;
// 4J JEV - Settup Tabs
for (int i = 0; i < eCreativeInventoryTab_COUNT; i++)
for (int i = 0; i < eCreativeInventoryTab_COUNT; i++)
{
m_hTabGroupA[i].SetShow(FALSE);
}
@@ -103,7 +103,7 @@ HRESULT CXuiSceneInventoryCreative::OnDestroy()
#endif
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss.
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
return S_OK;
}
@@ -115,8 +115,8 @@ HRESULT CXuiSceneInventoryCreative::OnDestroy()
//////////////////////////////////////////////////////////////////////////
HRESULT CXuiSceneInventoryCreative::OnTransitionEnd( XUIMessageTransition *pTransData, BOOL& bHandled )
{
// are we being destroyed? If so, don't do anything
if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY )
// are we being destroyed? If so, don't do anything
if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY )
{
return S_OK;
}
@@ -199,7 +199,7 @@ void CXuiSceneInventoryCreative::updateScrollCurrentPage(int currentPage, int pa
m_scrollUp.SetShow(currentPage > 1);
m_scrollUp.PlayOptionalVisual(L"ScrollMore",L"EndScrollMore");
m_scrollDown.SetShow(currentPage < pageCount);
m_scrollDown.PlayOptionalVisual(L"ScrollMore",L"EndScrollMore");

View File

@@ -19,11 +19,11 @@
HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
{
MapChildControls();
//XuiControlSetText(m_villagerText,app.GetString(IDS_VILLAGER));
XuiControlSetText(m_inventoryLabel,app.GetString(IDS_INVENTORY));
XuiControlSetText(m_requiredLabel,app.GetString(IDS_REQUIRED_ITEMS_FOR_TRADE));
Minecraft *pMinecraft = Minecraft::GetInstance();
@@ -36,7 +36,7 @@ HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
if(m_bSplitscreen)
{
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
}
if( pMinecraft->localgameModes[m_iPad] != NULL )
@@ -65,7 +65,7 @@ HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
// store the slot 0 highlight position
m_tradingSelector.GetPosition(&m_vSelectorInitialPos);
//app.SetRichPresenceContextValue(m_iPad,CONTEXT_GAME_STATE_FORGING);
XuiSetTimer(m_hObj,TRADING_UPDATE_TIMER_ID,TRADING_UPDATE_TIMER_TIME);
@@ -86,7 +86,7 @@ HRESULT CXuiSceneTrading::OnDestroy()
}
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss.
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
return S_OK;
}
@@ -245,17 +245,17 @@ void CXuiSceneTrading::setTradeRedBox(int index, bool show)
m_tradeHSlots[index]->SetRedBox(show?TRUE:FALSE);
}
void CXuiSceneTrading::setRequest1Item(shared_ptr<ItemInstance> item)
void CXuiSceneTrading::setRequest1Item(std::shared_ptr<ItemInstance> item)
{
m_request1Control->SetIcon(getPad(), item, 12, 31, true);
}
void CXuiSceneTrading::setRequest2Item(shared_ptr<ItemInstance> item)
void CXuiSceneTrading::setRequest2Item(std::shared_ptr<ItemInstance> item)
{
m_request2Control->SetIcon(getPad(), item, 12, 31, true);
}
void CXuiSceneTrading::setTradeItem(int index, shared_ptr<ItemInstance> item)
void CXuiSceneTrading::setTradeItem(int index, std::shared_ptr<ItemInstance> item)
{
m_tradeHSlots[index]->SetIcon(getPad(), item, 12, 31, true);
}
@@ -299,7 +299,7 @@ void CXuiSceneTrading::setOfferDescription(const wstring &name, vector<wstring>
XuiElementSetBounds(m_hOfferInfoText,xuiRect.right+4.0f+4.0f,xuiRect.bottom+4.0f+4.0f); // edge graphics are 8 pixels, text is centred
m_offerInfoControl.SetShow(TRUE);
D3DXVECTOR3 highlightPos, offerInfoPos;
float highlightWidth, highlightHeight;
m_tradingSelector.GetPosition(&highlightPos);

View File

@@ -83,7 +83,7 @@ protected:
MAP_OVERRIDE(IDC_Inventory, m_inventoryControl)
MAP_OVERRIDE(IDC_UseRow, m_useRowControl)
END_MAP_CHILD_CONTROLS()
END_MAP_CHILD_CONTROLS()
END_MAP_CHILD_CONTROLS()
END_CONTROL_MAP()
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
@@ -120,9 +120,9 @@ protected:
virtual void setRequest2RedBox(bool show);
virtual void setTradeRedBox(int index, bool show);
virtual void setRequest1Item(shared_ptr<ItemInstance> item);
virtual void setRequest2Item(shared_ptr<ItemInstance> item);
virtual void setTradeItem(int index, shared_ptr<ItemInstance> item);
virtual void setRequest1Item(std::shared_ptr<ItemInstance> item);
virtual void setRequest2Item(std::shared_ptr<ItemInstance> item);
virtual void setTradeItem(int index, std::shared_ptr<ItemInstance> item);
virtual void setOfferDescription(const wstring &name, vector<wstring> &unformattedStrings);
};

View File

@@ -11,13 +11,13 @@
HRESULT CScene_SignEntry::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
{
MapChildControls();
XuiControlSetText(m_ButtonDone,app.GetString(IDS_DONE));
XuiControlSetText(m_labelEditSign,app.GetString(IDS_EDIT_SIGN_MESSAGE));
SignEntryScreenInput* initData = (SignEntryScreenInput*)pInitData->pvInitData;
m_sign = initData->sign;
CXuiSceneBase::ShowDarkOverlay( initData->iPad, TRUE );
CXuiSceneBase::ShowLogo( initData->iPad, FALSE);
ui.SetTooltips( initData->iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
@@ -65,7 +65,7 @@ HRESULT CScene_SignEntry::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p
for(int i=0;i<4;i++)
{
wstring temp=m_signRows[i].GetText();
m_sign->SetMessage(i,temp);
m_sign->SetMessage(i,temp);
}
m_sign->setChanged();
@@ -74,10 +74,10 @@ HRESULT CScene_SignEntry::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p
// need to send the new data
if (pMinecraft->level->isClientSide)
{
shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[pNotifyPressData->UserIndex];
std::shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[pNotifyPressData->UserIndex];
if(player != NULL && player->connection && player->connection->isStarted())
{
player->connection->send( shared_ptr<SignUpdatePacket>( new SignUpdatePacket(m_sign->x, m_sign->y, m_sign->z, m_sign->IsVerified(), m_sign->IsCensored(), m_sign->GetMessages()) ) );
player->connection->send( std::shared_ptr<SignUpdatePacket>( new SignUpdatePacket(m_sign->x, m_sign->y, m_sign->z, m_sign->IsVerified(), m_sign->IsCensored(), m_sign->GetMessages()) ) );
}
}
app.CloseXuiScenes(pNotifyPressData->UserIndex);
@@ -103,7 +103,7 @@ HRESULT CScene_SignEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled
app.CloseXuiScenes(pInputData->UserIndex);
rfHandled = TRUE;
CXuiSceneBase::PlayUISFX(eSFX_Back);
break;
}

View File

@@ -43,7 +43,7 @@ public:
XUI_IMPLEMENT_CLASS( CScene_SignEntry, L"CScene_SignEntry", XUI_CLASS_SCENE )
private:
shared_ptr<SignTileEntity> m_sign;
std::shared_ptr<SignTileEntity> m_sign;
D3DXVECTOR3 m_OriginalPosition;
};

View File

@@ -61,7 +61,7 @@ HRESULT CScene_Teleport::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
g_NetworkManager.RegisterPlayerChangedCallback(m_iPad, &CScene_Teleport::OnPlayerChanged, this);
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
CXuiSceneBase::ShowDarkOverlay( m_iPad, TRUE );
return S_OK;
@@ -104,11 +104,11 @@ HRESULT CScene_Teleport::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pN
ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A);
if( hObjPressed == playersList )
{
{
INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId( m_players[ playersList.GetCurSel() ] );
INetworkPlayer *thisPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(m_iPad);
shared_ptr<GameCommandPacket> packet;
std::shared_ptr<GameCommandPacket> packet;
if(m_teleportToPlayer)
{
packet = TeleportCommand::preparePacket(thisPlayer->GetUID(),selectedPlayer->GetUID());
@@ -186,7 +186,7 @@ HRESULT CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSource
}
HRESULT hr;
HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon;
HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon;
hButton = playersList.GetItemControl(pGetSourceTextData->iItem);
hr=XuiControlGetVisual(hButton,&hVisual);
@@ -271,7 +271,7 @@ HRESULT CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSource
XuiElementFindNamedFrame(hVoiceIcon, L"NotSpeaking", &playFrame);
}
}
if(playFrame < 0)
{
XuiElementFindNamedFrame(hVoiceIcon, L"Normal", &playFrame);

View File

@@ -53,7 +53,7 @@ HRESULT CScene_TextEntry::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyVal
if(pValueChangedData->nValue==10)
{
LPCWSTR pText = m_EditText.GetText();
if(pText)
{
wstring wText = pText;
@@ -61,7 +61,7 @@ HRESULT CScene_TextEntry::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyVal
}
app.NavigateBack(m_iPad);
rfHandled = TRUE;
rfHandled = TRUE;
}
return S_OK;
@@ -86,7 +86,7 @@ HRESULT CScene_TextEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled
app.NavigateBack(m_iPad);
rfHandled = TRUE;
}
}
break;
case VK_PAD_B:
@@ -125,7 +125,7 @@ HRESULT CScene_TextEntry::InterpretString(wstring &wsText)
case eCommand_Teleport:
{
int x,z;
#ifdef __PS3__
// 4J Stu - The Xbox version uses swscanf_s which isn't available in GCC.
swscanf(wsText.c_str(), L"%40s%c%d%c%d", wchCommand,wchSep,&x,wchSep,&z);
@@ -146,9 +146,9 @@ HRESULT CScene_TextEntry::InterpretString(wstring &wsText)
}
break;
case eCommand_Give:
{
{
int iItem,iCount;
#ifdef __PS3__
// 4J Stu - The Xbox version uses swscanf_s which isn't available in GCC.
swscanf(wsText.c_str(), L"%40s%c%d%c%d", wchCommand,wchSep,&iItem,wchSep,&iCount);
@@ -158,7 +158,7 @@ HRESULT CScene_TextEntry::InterpretString(wstring &wsText)
app.DebugPrintf("eCommand_Give, item=%d count=%d\n",iItem,iCount);
Minecraft *pMinecraft=Minecraft::GetInstance();
for(int i=0;i<iCount;i++)
pMinecraft->localplayers[m_iPad]->drop(); // shared_ptr<ItemInstance>(new ItemInstance( iItem, 1, 0 )) );
pMinecraft->localplayers[m_iPad]->drop(); // std::shared_ptr<ItemInstance>(new ItemInstance( iItem, 1, 0 )) );
}
break;

View File

@@ -23,7 +23,7 @@ HRESULT CScene_TutorialPopup::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
// if we are in splitscreen, then we need to figure out if we want to move this scene
if(app.GetLocalPlayerCount()>1)
{
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
}
m_textFontSize = _fromString<int>( m_fontSizeControl.GetText() );
@@ -143,7 +143,7 @@ void CScene_TutorialPopup::UpdateInteractScenePosition(bool visible)
}
HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR desc, LPCWSTR title, bool allowFade, bool isReminder)
{
{
HRESULT hr = S_OK;
m_interactScene = interactScene;
if( interactScene != m_lastInteractSceneMoved ) m_lastInteractSceneMoved = NULL;
@@ -289,7 +289,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS
if( icon != TUTORIAL_NO_ICON )
{
bool itemIsFoil = false;
itemIsFoil = (shared_ptr<ItemInstance>(new ItemInstance(icon,1,iAuxVal)))->isFoil();
itemIsFoil = (std::shared_ptr<ItemInstance>(new ItemInstance(icon,1,iAuxVal)))->isFoil();
if(!itemIsFoil) itemIsFoil = isFoil;
m_pCraftingPic->SetIcon(m_iPad, icon,iAuxVal,1,10,31,false,itemIsFoil);
@@ -322,7 +322,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS
}
bool itemIsFoil = false;
itemIsFoil = (shared_ptr<ItemInstance>(new ItemInstance(iconId,1,iAuxVal)))->isFoil();
itemIsFoil = (std::shared_ptr<ItemInstance>(new ItemInstance(iconId,1,iAuxVal)))->isFoil();
if(!itemIsFoil) itemIsFoil = isFoil;
m_pCraftingPic->SetIcon(m_iPad, iconId,iAuxVal,1,10,31,false,itemIsFoil);
@@ -330,7 +330,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS
temp.replace(iconTagStartPos, iconEndPos - iconTagStartPos + closeTag.length(), L"");
}
}
// remove any icon text
else if(temp.find(L"{*CraftingTableIcon*}")!=wstring::npos)
{
@@ -410,7 +410,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS
m_pCraftingPic->SetIcon(m_iPad, 0,0,0,0,0,false,false,FALSE);
}
}
BOOL iconShowAtEnd = m_pCraftingPic->IsShown();
if(iconShowAtStart != iconShowAtEnd)
{
@@ -432,7 +432,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS
}
m_description.SetBounds(fDescWidth, fDescHeight);
}
return temp;
}
@@ -463,7 +463,7 @@ wstring CScene_TutorialPopup::_SetImage(wstring &desc)
// hide the icon slot
m_image.SetShow( FALSE );
}
BOOL imageShowAtEnd = m_image.IsShown();
if(imageShowAtStart != imageShowAtEnd)
{
@@ -485,7 +485,7 @@ wstring CScene_TutorialPopup::_SetImage(wstring &desc)
}
m_description.SetBounds(fDescWidth, fDescHeight);
}
return desc;
}