Get rid of MSVC's __int64
Use either int64_t, uint64_t or long long and unsigned long long, defined as per C++11 standard
This commit is contained in:
@@ -55,7 +55,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
CreateWorldMenuInitData *params = (CreateWorldMenuInitData *)pInitData->pvInitData;
|
||||
|
||||
m_MoreOptionsParams.bGenerateOptions=TRUE;
|
||||
m_MoreOptionsParams.bStructures=TRUE;
|
||||
m_MoreOptionsParams.bStructures=TRUE;
|
||||
m_MoreOptionsParams.bFlatWorld=FALSE;
|
||||
m_MoreOptionsParams.bBonusChest=FALSE;
|
||||
m_MoreOptionsParams.bPVP = TRUE;
|
||||
@@ -96,7 +96,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
{
|
||||
// The profile settings say Online, but either the player is offline, or they are not allowed to play online
|
||||
m_MoreOptionsParams.bOnlineSettingChangedBySystem=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonGameMode.SetText(app.GetString(IDS_GAMEMODE_SURVIVAL));
|
||||
@@ -104,7 +104,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
|
||||
m_CurrentDifficulty=app.GetGameSettings(m_iPad,eGameSetting_Difficulty);
|
||||
m_SliderDifficulty.SetValue(m_CurrentDifficulty);
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty]));
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty]));
|
||||
m_SliderDifficulty.SetText(TempString);
|
||||
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
|
||||
@@ -135,7 +135,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
m_NewWorld.SetEnable(true);
|
||||
|
||||
m_EditWorldName.SetTextLimit(XCONTENT_MAX_DISPLAYNAME_LENGTH);
|
||||
|
||||
|
||||
wstring wWorldName = m_EditWorldName.GetText();
|
||||
|
||||
// set the caret to the end of the default text
|
||||
@@ -148,7 +148,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
|
||||
XuiSetTimer(m_hObj,GAME_CREATE_ONLINE_TIMER_ID,GAME_CREATE_ONLINE_TIMER_TIME);
|
||||
XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME);
|
||||
|
||||
|
||||
TelemetryManager->RecordMenuShown(m_iPad, eUIScene_CreateWorldMenu, 0);
|
||||
|
||||
// 4J-PB - Load up any texture pack data we have locally in the XZP
|
||||
@@ -176,7 +176,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
m_pTexturePacksList->SetSelectionChangedHandle(m_hObj);
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
HRESULT hr;
|
||||
for(unsigned int i = 0; i < texturePacksCount; ++i)
|
||||
@@ -189,7 +189,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.fEnabled = TRUE;
|
||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||
if(pDLCTexPack)
|
||||
{
|
||||
@@ -297,7 +297,7 @@ HRESULT CScene_MultiGameCreate::OnDestroy()
|
||||
app.RemoveMemoryTPDFile(app.TMSFileA[i].iConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
app.FreeLocalTMSFiles(eTMSFileType_TexturePack);
|
||||
|
||||
return S_OK;
|
||||
@@ -338,7 +338,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
||||
|
||||
// DLC might have been corrupt
|
||||
if(ullOfferID_Full!=0LL)
|
||||
{
|
||||
{
|
||||
TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF);
|
||||
|
||||
UINT uiIDA[3];
|
||||
@@ -374,7 +374,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
||||
// if the profile data has been changed, then force a profile write (we save the online/invite/friends of friends settings)
|
||||
// It seems we're allowed to break the 5 minute rule if it's the result of a user action
|
||||
// check the checkboxes
|
||||
|
||||
|
||||
// Only save the online setting if the user changed it - we may change it because we're offline, but don't want that saved
|
||||
if(!m_MoreOptionsParams.bOnlineSettingChangedBySystem)
|
||||
{
|
||||
@@ -389,15 +389,15 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
||||
if(m_MoreOptionsParams.dwTexturePack!=0)
|
||||
{
|
||||
// texture pack hasn't been set yet, so check what it will be
|
||||
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||
|
||||
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||
|
||||
if(pTexturePack==NULL)
|
||||
{
|
||||
// corrupt DLC so set it to the default textures
|
||||
m_MoreOptionsParams.dwTexturePack=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
m_pDLCPack=pTexturePack->getDLCPack();
|
||||
// do we have a license?
|
||||
if(m_pDLCPack && !m_pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" ))
|
||||
@@ -439,11 +439,11 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == TRUE)
|
||||
{
|
||||
{
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
uiIDA[1]=IDS_CONFIRM_CANCEL;
|
||||
@@ -478,7 +478,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
{
|
||||
m_bIgnoreInput = false;
|
||||
@@ -495,7 +495,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
||||
}
|
||||
}
|
||||
else if(hObjPressed==m_MoreOptions)
|
||||
{
|
||||
{
|
||||
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_LaunchMoreOptionsMenu,&m_MoreOptionsParams);
|
||||
}
|
||||
else if(hObjPressed == m_ButtonGameMode)
|
||||
@@ -527,7 +527,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
if(ProfileManager.IsSignedIn(iPad))
|
||||
{
|
||||
{
|
||||
ULONGLONG ullIndexA[1];
|
||||
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId());
|
||||
|
||||
@@ -542,7 +542,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS
|
||||
|
||||
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
|
||||
|
||||
// the license change coming in when the offer has been installed will cause this scene to refresh
|
||||
// the license change coming in when the offer has been installed will cause this scene to refresh
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -629,12 +629,12 @@ HRESULT CScene_MultiGameCreate::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINot
|
||||
// Enable the done button when we have all of the necessary information
|
||||
wstring wWorldName = m_EditWorldName.GetText();
|
||||
BOOL bHasWorldName = ( wWorldName.length()!=0);
|
||||
m_NewWorld.SetEnable(bHasWorldName);
|
||||
m_NewWorld.SetEnable(bHasWorldName);
|
||||
}
|
||||
else if(hObjSource==m_SliderDifficulty.GetSlider() )
|
||||
{
|
||||
app.SetGameSettings(m_iPad,eGameSetting_Difficulty,pValueChangedData->nValue);
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue]));
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue]));
|
||||
m_SliderDifficulty.SetText(TempString);
|
||||
}
|
||||
|
||||
@@ -656,11 +656,11 @@ HRESULT CScene_MultiGameCreate::OnControlNavigate(XUIMessageControlNavigate *pCo
|
||||
|
||||
HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
{
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
switch(pTimer->nId)
|
||||
{
|
||||
|
||||
|
||||
|
||||
case GAME_CREATE_ONLINE_TIMER_ID:
|
||||
{
|
||||
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
@@ -693,7 +693,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID:
|
||||
{
|
||||
// also check for any new texture packs info being available
|
||||
@@ -718,7 +718,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
|
||||
PBYTE pbImageData=NULL;
|
||||
|
||||
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.iData = m_iConfigA[i];
|
||||
HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
||||
app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]);
|
||||
@@ -734,7 +734,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
|
||||
bool bAllDone=true;
|
||||
for(int i=0;i<m_iTexturePacksNotInstalled;i++)
|
||||
{
|
||||
if(m_iConfigA[i]!=-1)
|
||||
if(m_iConfigA[i]!=-1)
|
||||
{
|
||||
bAllDone = false;
|
||||
}
|
||||
@@ -756,7 +756,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora
|
||||
{
|
||||
CScene_MultiGameCreate* pClass = (CScene_MultiGameCreate*)pParam;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
|
||||
@@ -780,7 +780,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
@@ -816,7 +816,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
||||
if(ProfileManager.IsSignedIn(iPad))
|
||||
{
|
||||
DWORD dwLocalUsersMask = 0;
|
||||
|
||||
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
bool noPrivileges = false;
|
||||
|
||||
@@ -835,7 +835,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
|
||||
if(isClientSide && (noPrivileges || noUGC) )
|
||||
{
|
||||
if( noUGC )
|
||||
@@ -863,7 +863,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
pClass->SetShow( TRUE );
|
||||
}
|
||||
@@ -884,7 +884,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
||||
|
||||
// create the world and launch
|
||||
wstring wWorldName = pClass->m_EditWorldName.GetText();
|
||||
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
// Make our next save default to the name of the level
|
||||
StorageManager.SetSaveTitle((wchar_t *)wWorldName.c_str());
|
||||
@@ -904,11 +904,11 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
||||
|
||||
// start the game
|
||||
bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==TRUE);
|
||||
__int64 seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements
|
||||
int64_t seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements
|
||||
|
||||
if (wSeed.length() != 0)
|
||||
{
|
||||
__int64 value = 0;
|
||||
int64_t value = 0;
|
||||
unsigned int len = (unsigned int)wSeed.length();
|
||||
|
||||
//Check if the input string contains a numerical value
|
||||
@@ -923,7 +923,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
||||
|
||||
//If the input string is a numerical value, convert it to a number
|
||||
if( isNumber )
|
||||
value = _fromString<__int64>(wSeed);
|
||||
value = _fromString<int64_t>(wSeed);
|
||||
|
||||
//If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it
|
||||
if( value != 0 )
|
||||
@@ -948,7 +948,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
||||
param->seed = seedValue;
|
||||
param->saveData = NULL;
|
||||
param->texturePackId = pClass->m_MoreOptionsParams.dwTexturePack;
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
pMinecraft->skins->selectTexturePackById(pClass->m_MoreOptionsParams.dwTexturePack);
|
||||
//pMinecraft->skins->updateUI();
|
||||
@@ -956,7 +956,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
||||
app.SetGameHostOption(eGameHostOption_Difficulty,Minecraft::GetInstance()->options->difficulty);
|
||||
app.SetGameHostOption(eGameHostOption_FriendsOfFriends,pClass->m_MoreOptionsParams.bAllowFriendsOfFriends);
|
||||
app.SetGameHostOption(eGameHostOption_Gamertags,app.GetGameSettings(pClass->m_iPad,eGameSetting_GamertagsVisible)?1:0);
|
||||
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_BedrockFog,app.GetGameSettings(pClass->m_iPad,eGameSetting_BedrockFog)?1:0);
|
||||
|
||||
// CXuiList listObject;
|
||||
@@ -999,7 +999,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionStart( XUIMessageTransition *pTransi
|
||||
if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK;
|
||||
|
||||
if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO)
|
||||
{
|
||||
{
|
||||
m_SliderDifficulty.SetValueDisplay(FALSE);
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionEnd( XUIMessageTransition *pTransiti
|
||||
{
|
||||
}
|
||||
else if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO)
|
||||
{
|
||||
{
|
||||
if(m_bSetup && m_texturePackDescDisplayed)
|
||||
{
|
||||
XUITimeline *timeline;
|
||||
@@ -1054,7 +1054,7 @@ HRESULT CScene_MultiGameCreate::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotif
|
||||
if(hObjSource == m_pTexturePacksList->m_hObj)
|
||||
{
|
||||
UpdateTexturePackDescription(pNotifySelChangedData->iItem);
|
||||
|
||||
|
||||
// 4J-JEV: Removed expand description check, taken care of elsewhere.
|
||||
}
|
||||
|
||||
@@ -1205,9 +1205,9 @@ void CScene_MultiGameCreate::UpdateCurrentTexturePack()
|
||||
StorageManager.RequestMessageBox(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE, IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CScene_MultiGameCreate::TexturePackDialogReturned,this,app.GetStringTable());
|
||||
}
|
||||
|
||||
// do set the texture pack id, and on the user pressing create world, check they have it
|
||||
// do set the texture pack id, and on the user pressing create world, check they have it
|
||||
m_MoreOptionsParams.dwTexturePack = ListItem.iData;
|
||||
return ;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1221,7 +1221,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
||||
pClass->m_currentTexturePackIndex = pClass->m_pTexturePacksList->GetCurSel();
|
||||
// Exit with or without saving
|
||||
// Decline means install full version of the texture pack in this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// we need to enable background downloading for the DLC
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
|
||||
@@ -1248,7 +1248,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
||||
ullIndexA[0]=pDLCInfo->ullOfferID_Trial;
|
||||
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pClass->m_bIgnoreInput=false;
|
||||
return 0;
|
||||
@@ -1274,12 +1274,12 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCInstalled()
|
||||
}
|
||||
|
||||
HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete()
|
||||
{
|
||||
{
|
||||
// refill the texture pack list
|
||||
m_pTexturePacksList->SetSelectionChangedHandle(m_hObj);
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
HRESULT hr;
|
||||
for(unsigned int i = 0; i < texturePacksCount; ++i)
|
||||
@@ -1292,7 +1292,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete()
|
||||
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.fEnabled = TRUE;
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
||||
|
||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||
|
||||
@@ -42,13 +42,13 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
|
||||
m_iTexturePacksNotInstalled=0;
|
||||
m_iConfigA=NULL;
|
||||
|
||||
|
||||
XuiControlSetText(m_LabelNoGames,app.GetString(IDS_NO_GAMES_FOUND));
|
||||
XuiControlSetText(m_GamesList,app.GetString(IDS_JOIN_GAME));
|
||||
XuiControlSetText(m_SavesList,app.GetString(IDS_START_GAME));
|
||||
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
@@ -64,17 +64,17 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
|
||||
m_bRetrievingSaveInfo=false;
|
||||
m_bSaveTransferInProgress=false;
|
||||
|
||||
|
||||
// check for a default custom cloak in the global storage
|
||||
// 4J-PB - changed to a config file
|
||||
// if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
// {
|
||||
// {
|
||||
// app.InstallDefaultCape();
|
||||
// }
|
||||
|
||||
m_initData= new JoinMenuInitData();
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
|
||||
XPARTY_USER_LIST partyList;
|
||||
|
||||
if((XPartyGetUserList( &partyList ) != XPARTY_E_NOT_IN_PARTY ) && (partyList.dwUserCount>1))
|
||||
@@ -90,7 +90,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
if(m_bInParty) iLB = IDS_TOOLTIPS_PARTY_GAMES;
|
||||
|
||||
XuiSetTimer(m_hObj,JOIN_LOAD_ONLINE_TIMER_ID,JOIN_LOAD_ONLINE_TIMER_TIME);
|
||||
|
||||
|
||||
m_iSaveInfoC=0;
|
||||
|
||||
VOID *pObj;
|
||||
@@ -110,7 +110,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
{
|
||||
// if we're waiting for DLC to mount, don't fill the save list. The custom message on end of dlc mounting will do that
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
|
||||
|
||||
|
||||
m_iChangingSaveGameInfoIndex = 0;
|
||||
@@ -135,7 +135,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
// saving is disabled, but we should still be able to load from a selected save device
|
||||
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_CHANGEDEVICE,-1,-1,-1,iLB,IDS_TOOLTIPS_DELETESAVE);
|
||||
|
||||
|
||||
GetSaveInfo();
|
||||
}
|
||||
else
|
||||
@@ -153,7 +153,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
// 4J-PB - we need to check that there is enough space left to create a copy of the save (for a rename)
|
||||
bool bCanRename = StorageManager.EnoughSpaceForAMinSaveGame();
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_CHANGEDEVICE,-1,-1,-1,-1,bCanRename?IDS_TOOLTIPS_SAVEOPTIONS:IDS_TOOLTIPS_DELETESAVE);
|
||||
|
||||
|
||||
GetSaveInfo();
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
|
||||
// 4J Stu - Fix for #12530 -TCR 001 BAS Game Stability: Title will crash if the player disconnects while starting a new world and then opts to play the tutorial once they have been returned to the Main Menu.
|
||||
MinecraftServer::resetFlags();
|
||||
|
||||
|
||||
// If we're not ignoring input, then we aren't still waiting for the DLC to mount, and can now check for corrupt dlc. Otherwise this will happen when the dlc has finished mounting.
|
||||
if( !m_bIgnoreInput)
|
||||
{
|
||||
@@ -191,7 +191,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
bool bTexturePackAlreadyListed;
|
||||
bool bNeedToGetTPD=false;
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
//CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
//HRESULT hr;
|
||||
|
||||
@@ -295,7 +295,7 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons()
|
||||
// increment the count of the mash-up pack worlds in the save list
|
||||
m_iMashUpButtonsC++;
|
||||
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
|
||||
DWORD dwImageBytes;
|
||||
DWORD dwImageBytes;
|
||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
||||
HXUIBRUSH hXuiBrush;
|
||||
|
||||
@@ -353,8 +353,8 @@ HRESULT CScene_MultiGameJoinLoad::GetSaveInfo( )
|
||||
ListInfo.fEnabled=TRUE;
|
||||
ListInfo.iData = -1;
|
||||
m_pSavesList->AddData(ListInfo);
|
||||
}
|
||||
m_pSavesList->SetCurSelVisible(0);
|
||||
}
|
||||
m_pSavesList->SetCurSelVisible(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -419,7 +419,7 @@ int CScene_MultiGameJoinLoad::DeviceRemovedDialogReturned(void *pParam,int iPad,
|
||||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam;
|
||||
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
{
|
||||
StorageManager.SetSaveDisabled(true);
|
||||
StorageManager.SetSaveDeviceSelected(ProfileManager.GetPrimaryPad(),false);
|
||||
@@ -462,7 +462,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
||||
//CScene_MultiGameInfo::JoinMenuInitData *initData = new CScene_MultiGameInfo::JoinMenuInitData();
|
||||
m_initData->iPad = m_iPad;
|
||||
m_initData->selectedSession = currentSessions.at( nIndex );
|
||||
|
||||
|
||||
// check that we have the texture pack available
|
||||
// If it's not the default texture pack
|
||||
if(m_initData->selectedSession->data.texturePackParentId!=0)
|
||||
@@ -513,7 +513,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
// Reset the background downloading, in case we changed it by attempting to download a texture pack
|
||||
@@ -536,7 +536,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
||||
CXuiCtrl4JList::LIST_ITEM_INFO info = m_pSavesList->GetData(iIndex);
|
||||
|
||||
if(iIndex == JOIN_LOAD_CREATE_BUTTON_INDEX)
|
||||
{
|
||||
{
|
||||
app.SetTutorialMode( false );
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
@@ -571,7 +571,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// check if this is a damaged save
|
||||
if(m_pSavesList->GetData(iIndex).bIsDamaged)
|
||||
{
|
||||
@@ -582,7 +582,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
||||
StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,this, app.GetStringTable());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
app.SetTutorialMode( false );
|
||||
if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled())
|
||||
{
|
||||
@@ -605,7 +605,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -632,11 +632,11 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
||||
|
||||
app.NavigateBack(XUSER_INDEX_ANY);
|
||||
rfHandled = TRUE;
|
||||
break;
|
||||
break;
|
||||
case VK_PAD_X:
|
||||
|
||||
// Change device
|
||||
// Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage
|
||||
// Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage
|
||||
// device, and repeatedly backs out of the SD screen, disconnects from LIVE, and then selects a SD, the title crashes.
|
||||
m_bIgnoreInput=true;
|
||||
StorageManager.SetSaveDevice(&CScene_MultiGameJoinLoad::DeviceSelectReturned,this,true);
|
||||
@@ -657,7 +657,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
||||
{
|
||||
// save transfer - make sure they want to overwrite a save that is up there
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
{
|
||||
// 4J-PB - required for a delete of the save if it's found to be a corrupted save
|
||||
DWORD nIndex = m_pSavesList->GetCurSel();
|
||||
m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(nIndex).iIndex;
|
||||
@@ -668,13 +668,13 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
||||
|
||||
ui.RequestMessageBox(IDS_SAVE_TRANSFER_TITLE, IDS_SAVE_TRANSFER_TEXT, uiIDA, 2, pInputData->UserIndex,&CScene_MultiGameJoinLoad::SaveTransferDialogReturned,this, app.GetStringTable());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VK_PAD_RSHOULDER:
|
||||
if(DoesSavesListHaveFocus())
|
||||
{
|
||||
m_bIgnoreInput = true;
|
||||
|
||||
|
||||
int iIndex=m_SavesList.GetCurSel();
|
||||
m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(iIndex).iIndex;
|
||||
|
||||
@@ -755,19 +755,19 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled)
|
||||
{
|
||||
|
||||
|
||||
CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, TRUE );
|
||||
// start the texture pack timer again
|
||||
XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME);
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
// re-enable button presses
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
@@ -812,7 +812,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
@@ -901,7 +901,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTransitionStart( XUIMessageTransition *pTran
|
||||
if(pTransition->dwTransType == XUI_TRANSITION_BACKTO)
|
||||
{
|
||||
// Can't call this here because if you back out of the load info screen and then go back in and load a game, it will attempt to use the dlc as it's running a mount of the dlc
|
||||
|
||||
|
||||
// block input if we're waiting for DLC to install, and wipe the saves list. The end of dlc mounting custom message will fill the list again
|
||||
if(app.StartInstallDLCProcess(m_iPad)==false)
|
||||
{
|
||||
@@ -925,14 +925,14 @@ HRESULT CScene_MultiGameJoinLoad::OnFontRendererChange()
|
||||
// update the tooltips
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should the the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
if( DoesGamesListHaveFocus() )
|
||||
{
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
@@ -986,12 +986,12 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotify
|
||||
// update the tooltips
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should the the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
if( DoesGamesListHaveFocus() )
|
||||
{
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
@@ -1118,7 +1118,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesListCallback(LPVOID lpParam)
|
||||
// check this there's no save transfer in progress
|
||||
if(!pClass->m_bSaveTransferInProgress)
|
||||
{
|
||||
pClass->UpdateGamesList();
|
||||
pClass->UpdateGamesList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1150,12 +1150,12 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
||||
delete (*it);
|
||||
}
|
||||
currentSessions.clear();
|
||||
|
||||
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should show the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
|
||||
if( DoesGamesListHaveFocus() )
|
||||
@@ -1163,7 +1163,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
@@ -1282,7 +1282,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
||||
// is it in the tpd data ?
|
||||
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
{
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
@@ -1291,7 +1291,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
||||
{
|
||||
pbImageData = tp->getPackIcon(dwImageBytes);
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
{
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
@@ -1303,7 +1303,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
||||
XuiCreateTextureBrushFromMemory(m_DefaultMinecraftIconData,m_DefaultMinecraftIconSize,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(memcmp( &selectedSessionId, &sessionInfo->sessionId, sizeof(SessionID) ) == 0)
|
||||
{
|
||||
@@ -1324,14 +1324,14 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear
|
||||
|
||||
if(m_searches>0)
|
||||
--m_searches;
|
||||
|
||||
|
||||
if(m_searches==0)
|
||||
{
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should show the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
|
||||
if( DoesGamesListHaveFocus() )
|
||||
@@ -1374,7 +1374,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear
|
||||
}
|
||||
|
||||
unsigned int startOffset = m_GamesList.GetItemCount();
|
||||
//m_GamesList.InsertItems(startOffset,dwNumResults);
|
||||
//m_GamesList.InsertItems(startOffset,dwNumResults);
|
||||
//m_GamesList.SetEnable(TRUE);
|
||||
//XuiElementSetDisableFocusRecursion( m_GamesList.m_hObj, FALSE);
|
||||
|
||||
@@ -1449,7 +1449,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( m_GamesList.GetItemCount() == 0)
|
||||
{
|
||||
m_LabelNoGames.SetShow( TRUE );
|
||||
@@ -1537,14 +1537,14 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue)
|
||||
{
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should show the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
if( pClass->DoesGamesListHaveFocus() )
|
||||
{
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
else if(pClass->DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( pClass->m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
@@ -1593,7 +1593,7 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue)
|
||||
pClass->GetSaveInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_SELECTDEVICE,iY,-1,-1,iLB,iRB);
|
||||
// clear the saves list
|
||||
pClass->m_pSavesList->RemoveAllData();
|
||||
@@ -1623,11 +1623,11 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue)
|
||||
|
||||
HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
{
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
switch(pTimer->nId)
|
||||
{
|
||||
|
||||
|
||||
|
||||
case JOIN_LOAD_ONLINE_TIMER_ID:
|
||||
{
|
||||
XPARTY_USER_LIST partyList;
|
||||
@@ -1673,7 +1673,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
|
||||
{
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
@@ -1737,7 +1737,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
|
||||
|
||||
//CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
// for each iConfig, check if the data is available, and add it to the List, then remove it from the viConfig
|
||||
|
||||
|
||||
for(int i=0;i<m_iTexturePacksNotInstalled;i++)
|
||||
{
|
||||
if(m_iConfigA[i]!=-1)
|
||||
@@ -1760,7 +1760,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
|
||||
bool bAllDone=true;
|
||||
for(int i=0;i<m_iTexturePacksNotInstalled;i++)
|
||||
{
|
||||
if(m_iConfigA[i]!=-1)
|
||||
if(m_iConfigA[i]!=-1)
|
||||
{
|
||||
bAllDone = false;
|
||||
}
|
||||
@@ -1878,25 +1878,25 @@ int CScene_MultiGameJoinLoad::DeleteSaveDataReturned(void *pParam,bool bSuccess)
|
||||
pClass->m_iSaveInfoC=0;
|
||||
pClass->GetSaveInfo();
|
||||
}
|
||||
|
||||
|
||||
pClass->m_bIgnoreInput=false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
{
|
||||
{
|
||||
// Load data from disc
|
||||
//File saveFile( L"Tutorial\\Tutorial" );
|
||||
//LoadSaveFromDisk(&saveFile);
|
||||
|
||||
// clear out the app's terrain features list
|
||||
app.ClearTerrainFeaturePosition();
|
||||
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
// Make our next save default to the name of the level
|
||||
StorageManager.SetSaveTitle(levelGen->getDefaultSaveName().c_str());
|
||||
|
||||
|
||||
bool isClientSide = false;
|
||||
bool isPrivate = false;
|
||||
int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
@@ -1918,7 +1918,7 @@ void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
if(levelGen->requiresTexturePack())
|
||||
{
|
||||
param->texturePackId = levelGen->getRequiredTexturePackId();
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
pMinecraft->skins->selectTexturePackById(param->texturePackId);
|
||||
//pMinecraft->skins->updateUI();
|
||||
@@ -1939,7 +1939,7 @@ void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
}
|
||||
|
||||
void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile)
|
||||
{
|
||||
{
|
||||
// we'll only be coming in here when the tutorial is loaded now
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
@@ -1947,12 +1947,12 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile)
|
||||
// Make our next save default to the name of the level
|
||||
StorageManager.SetSaveTitle(saveFile->getName().c_str());
|
||||
|
||||
__int64 fileSize = saveFile->length();
|
||||
int64_t fileSize = saveFile->length();
|
||||
FileInputStream fis(*saveFile);
|
||||
byteArray ba(fileSize);
|
||||
fis.read(ba);
|
||||
fis.close();
|
||||
|
||||
|
||||
bool isClientSide = false;
|
||||
bool isPrivate = false;
|
||||
int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
@@ -1962,7 +1962,7 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile)
|
||||
isClientSide = false;
|
||||
maxPlayers = 4;
|
||||
}
|
||||
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId());
|
||||
|
||||
g_NetworkManager.HostGame(0,isClientSide,isPrivate,maxPlayers,0);
|
||||
@@ -1992,7 +1992,7 @@ int CScene_MultiGameJoinLoad::DeleteSaveDialogReturned(void *pParam,int iPad,C4J
|
||||
{
|
||||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam;
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
{
|
||||
if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled())
|
||||
{
|
||||
@@ -2017,7 +2017,7 @@ int CScene_MultiGameJoinLoad::SaveTransferDialogReturned(void *pParam,int iPad,C
|
||||
{
|
||||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam;
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// upload the save
|
||||
|
||||
@@ -2042,7 +2042,7 @@ int CScene_MultiGameJoinLoad::SaveTransferDialogReturned(void *pParam,int iPad,C
|
||||
int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter )
|
||||
{
|
||||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad *) lpParameter;
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
pMinecraft->progressRenderer->progressStart(IDS_SAVE_TRANSFER_TITLE);
|
||||
pMinecraft->progressRenderer->progressStage( IDS_SAVE_TRANSFER_UPLOADING );
|
||||
@@ -2092,7 +2092,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter
|
||||
StorageManager.GetSaveCacheFileInfo(iIndex,XContentData);
|
||||
StorageManager.GetSaveCacheFileInfo(iIndex,&pbImageData,&dwImageBytes);
|
||||
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save
|
||||
if(pbImageData==NULL)
|
||||
{
|
||||
@@ -2143,7 +2143,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter
|
||||
|
||||
return 0;
|
||||
}
|
||||
// change text for completion confirmation
|
||||
// change text for completion confirmation
|
||||
pMinecraft->progressRenderer->progressStage( IDS_SAVE_TRANSFER_UPLOADCOMPLETE );
|
||||
|
||||
// done
|
||||
@@ -2180,7 +2180,7 @@ void CScene_MultiGameJoinLoad::UploadFile(CScene_MultiGameJoinLoad *pClass, char
|
||||
C4JStorage::TMS_FILETYPE_BINARY,
|
||||
C4JStorage::TMS_UGCTYPE_NONE,
|
||||
filename,
|
||||
(CHAR *)data,
|
||||
(CHAR *)data,
|
||||
size,
|
||||
&CScene_MultiGameJoinLoad::TransferComplete,pClass, 0,
|
||||
&CScene_MultiGameJoinLoad::Progress,pClass);
|
||||
@@ -2219,7 +2219,7 @@ bool CScene_MultiGameJoinLoad::WaitForTransferComplete( CScene_MultiGameJoinLoad
|
||||
// cancelled
|
||||
return false;
|
||||
}
|
||||
Sleep(50);
|
||||
Sleep(50);
|
||||
// update the progress
|
||||
pMinecraft->progressRenderer->progressStagePercentage((unsigned int)(pClass->m_fProgress*100.0f));
|
||||
}
|
||||
@@ -2235,7 +2235,7 @@ int CScene_MultiGameJoinLoad::SaveOptionsDialogReturned(void *pParam,int iPad,C4
|
||||
|
||||
// results switched for this dialog
|
||||
// EMessage_ResultAccept means cancel
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption)
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption)
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultDecline) // rename
|
||||
{
|
||||
@@ -2302,9 +2302,9 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue)
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
||||
uiIDA[1]=IDS_CONFIRM_OK;
|
||||
StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2,
|
||||
StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2,
|
||||
pClass->m_iPad,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,pClass, app.GetStringTable());
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2366,7 +2366,7 @@ int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet)
|
||||
|
||||
if(eLoadStatus==C4JStorage::ELoadGame_DeviceRemoved)
|
||||
{
|
||||
// disable saving
|
||||
// disable saving
|
||||
StorageManager.SetSaveDisabled(true);
|
||||
StorageManager.SetSaveDeviceSelected(ProfileManager.GetPrimaryPad(),false);
|
||||
UINT uiIDA[1];
|
||||
@@ -2375,11 +2375,11 @@ int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet)
|
||||
}
|
||||
#else
|
||||
// rename the save
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
pClass->m_bIgnoreInput=false;
|
||||
}
|
||||
|
||||
@@ -2400,7 +2400,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataForRenameReturned(void *pParam,bool bC
|
||||
StorageManager.GetSaveCacheFileInfo(pClass->m_iChangingSaveGameInfoIndex-pClass->m_iDefaultButtonsC,XContentData);
|
||||
StorageManager.GetSaveCacheFileInfo(pClass->m_iChangingSaveGameInfoIndex-pClass->m_iDefaultButtonsC,&pbImageData,&dwImageBytes);
|
||||
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save
|
||||
if(pbImageData==NULL)
|
||||
{
|
||||
@@ -2456,7 +2456,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4
|
||||
|
||||
// Exit with or without saving
|
||||
// Decline means install full version of the texture pack in this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// we need to enable background downloading for the DLC
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
|
||||
@@ -2480,7 +2480,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4
|
||||
ullIndexA[0]=pDLCInfo->ullOfferID_Trial;
|
||||
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pClass->m_bIgnoreInput=false;
|
||||
return 0;
|
||||
@@ -2489,7 +2489,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4
|
||||
HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled()
|
||||
{
|
||||
// mounted DLC may have changed
|
||||
|
||||
|
||||
if(app.StartInstallDLCProcess(m_iPad)==false)
|
||||
{
|
||||
// not doing a mount, so re-enable input
|
||||
@@ -2508,7 +2508,7 @@ HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled()
|
||||
}
|
||||
|
||||
HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete()
|
||||
{
|
||||
{
|
||||
|
||||
VOID *pObj;
|
||||
XuiObjectFromHandle( m_SavesList, &pObj );
|
||||
@@ -2534,7 +2534,7 @@ HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete()
|
||||
|
||||
int iY=-1;
|
||||
if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
@@ -2627,7 +2627,7 @@ void CScene_MultiGameJoinLoad::UpdateTooltips()
|
||||
// 4J-PB - we need to check that there is enough space left to create a copy of the save (for a rename)
|
||||
bool bCanRename = StorageManager.EnoughSpaceForAMinSaveGame();
|
||||
|
||||
if(bCanRename)
|
||||
if(bCanRename)
|
||||
{
|
||||
iRB=IDS_TOOLTIPS_SAVEOPTIONS;
|
||||
}
|
||||
@@ -2694,11 +2694,11 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave
|
||||
pbCurrentImagePtr=pbImageData+InfoA[i].dwImageOffset;
|
||||
hr=XuiCreateTextureBrushFromMemory(pbCurrentImagePtr,InfoA[i].dwImageBytes,&hXuiBrush);
|
||||
pClass->m_pSavesList->UpdateGraphic(i+pClass->m_iDefaultButtonsC,hXuiBrush );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// we could put in a damaged save icon here
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
|
||||
@@ -2724,7 +2724,7 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave
|
||||
// It's possible that the games list is updated but we haven't displayed it yet as we were still waiting on saves list to load
|
||||
// This is to fix a bug where joining a game before the saves list has loaded causes a crash when this callback is called
|
||||
// as the scene no longer exists
|
||||
pClass->UpdateGamesList();
|
||||
pClass->UpdateGamesList();
|
||||
|
||||
// Fix for #45154 - Frontend: DLC: Content can only be downloaded from the frontend if you have not joined/exited multiplayer
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO);
|
||||
|
||||
@@ -36,7 +36,7 @@ HRESULT CXuiSceneBase::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
MapChildControls();
|
||||
|
||||
// Display the tooltips
|
||||
HRESULT hr = S_OK;
|
||||
HRESULT hr = S_OK;
|
||||
CXuiElement xuiElement = m_hObj;
|
||||
HXUIOBJ hTemp;
|
||||
|
||||
@@ -169,7 +169,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
||||
|
||||
// make sure there's not a mount going on before using the textures
|
||||
if(bCheckTexturePack && app.DLCInstallProcessCompleted() )
|
||||
{
|
||||
{
|
||||
TexturePack *tPack = pMinecraft->skins->getSelected();
|
||||
|
||||
if(tPack->getId()!=app.GetRequiredTexturePackID())
|
||||
@@ -186,7 +186,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
||||
|
||||
pMinecraft->skins->selectTexturePackById(app.GetRequiredTexturePackID());
|
||||
|
||||
// probably had background downloads enabled, so turn them off
|
||||
// probably had background downloads enabled, so turn them off
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO);
|
||||
}
|
||||
else
|
||||
@@ -223,7 +223,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
||||
{
|
||||
if(pMinecraft->localplayers[i] != NULL && pMinecraft->localplayers[i]->dimension == 1 && !ui.GetMenuDisplayed(i) && app.GetGameSettings(i,eGameSetting_DisplayHUD))
|
||||
{
|
||||
int iGuiScale;
|
||||
int iGuiScale;
|
||||
|
||||
if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN)
|
||||
{
|
||||
@@ -234,7 +234,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
||||
iGuiScale=app.GetGameSettings(i,eGameSetting_UISizeSplitscreen);
|
||||
}
|
||||
m_BossHealthGroup[i].SetShow(TRUE);
|
||||
m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) );
|
||||
m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) );
|
||||
|
||||
if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN)
|
||||
{
|
||||
@@ -364,7 +364,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pBossHealthProgress[i].SetRange(0, boss->getMaxHealth() );
|
||||
m_pBossHealthProgress[i].SetValue( boss->getSynchedHealth() );
|
||||
@@ -468,15 +468,15 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
||||
XUIMessage xuiMsg;
|
||||
CustomMessage_TickScene( &xuiMsg );
|
||||
XuiSendMessage( app.GetCurrentHUDScene(i), &xuiMsg );
|
||||
|
||||
|
||||
bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(i) && !(app.GetXuiAction(i)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(i,eGameSetting_DisplayHUD)!=0;
|
||||
if(bDisplayGui && pMinecraft->localplayers[i] != NULL)
|
||||
{
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE);
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -495,18 +495,18 @@ HRESULT CXuiSceneBase::_SetEnableTooltips( unsigned int iPad, BOOL bVal )
|
||||
HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiTooltip, int iTextID )
|
||||
{
|
||||
ASSERT( uiTooltip < BUTTONS_TOOLTIP_MAX );
|
||||
|
||||
|
||||
XUIRect xuiRect, xuiRectSmall;
|
||||
HRESULT hr=S_OK;
|
||||
LPCWSTR pString=NULL;
|
||||
float fWidth,fHeight;
|
||||
|
||||
|
||||
// Want to be able to show just a button (for RB LB)
|
||||
if(iTextID>=0)
|
||||
{
|
||||
pString=app.GetString(iTextID);
|
||||
}
|
||||
|
||||
|
||||
if(hTooltipText[iPad][uiTooltip]==NULL)
|
||||
{
|
||||
HXUIOBJ hObj=NULL;
|
||||
@@ -514,7 +514,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti
|
||||
hr=XuiElementGetChildById(hObj,L"text_ButtonText",&hTooltipText[iPad][uiTooltip]);
|
||||
hr=XuiElementGetPosition(hTooltipText[iPad][uiTooltip],&m_vPosTextInTooltip[uiTooltip]);
|
||||
}
|
||||
|
||||
|
||||
if(hTooltipTextSmall[iPad][uiTooltip]==NULL)
|
||||
{
|
||||
HXUIOBJ hObj=NULL;
|
||||
@@ -525,8 +525,8 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti
|
||||
|
||||
if(iTextID>=0)
|
||||
{
|
||||
hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect);
|
||||
|
||||
hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect);
|
||||
|
||||
// Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic)
|
||||
XuiElementGetBounds(m_Buttons[iPad][uiTooltip].m_hObj,&fWidth, &fHeight);
|
||||
XuiElementSetBounds(m_Buttons[iPad][uiTooltip].m_hObj,xuiRect.right+1+m_vPosTextInTooltip[uiTooltip].x,fHeight);
|
||||
@@ -537,7 +537,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti
|
||||
|
||||
|
||||
hr=XuiTextPresenterMeasureText(hTooltipTextSmall[iPad][uiTooltip], pString, &xuiRectSmall);
|
||||
|
||||
|
||||
// Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic)
|
||||
XuiElementGetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,&fWidth, &fHeight);
|
||||
XuiElementSetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,xuiRectSmall.right+1+m_vPosTextInTooltipSmall[uiTooltip].x,fHeight);
|
||||
@@ -749,7 +749,7 @@ HRESULT CXuiSceneBase::_SetTooltipsEnabled( unsigned int iPad, bool bA, bool bB,
|
||||
m_Buttons[iPad][BUTTON_TOOLTIP_LB].SetEnable( bLB );
|
||||
m_Buttons[iPad][BUTTON_TOOLTIP_RB].SetEnable( bRB );
|
||||
m_Buttons[iPad][BUTTON_TOOLTIP_LS].SetEnable( bLS );
|
||||
|
||||
|
||||
m_ButtonsSmall[iPad][BUTTON_TOOLTIP_A].SetEnable( bA );
|
||||
m_ButtonsSmall[iPad][BUTTON_TOOLTIP_B].SetEnable( bB );
|
||||
m_ButtonsSmall[iPad][BUTTON_TOOLTIP_X].SetEnable( bX );
|
||||
@@ -860,7 +860,7 @@ HRESULT CXuiSceneBase::_ShowBackground( unsigned int iPad, BOOL bShow )
|
||||
|
||||
if(bShow && pMinecraft->level!=NULL)
|
||||
{
|
||||
__int64 i64TimeOfDay =0;
|
||||
int64_t i64TimeOfDay =0;
|
||||
// are we in the Nether? - Leave the time as 0 if we are, so we show daylight
|
||||
if(pMinecraft->level->dimension->id==0)
|
||||
{
|
||||
@@ -945,11 +945,11 @@ HRESULT CXuiSceneBase::_ShowPressStart(unsigned int iPad)
|
||||
int nStart, nEnd;
|
||||
// XuiElementFindNamedFrame( m_hObj, L"StartFlash", &nStart );
|
||||
// XuiElementFindNamedFrame( m_hObj, L"EndFlash", &nEnd );
|
||||
// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
XuiElementFindNamedFrame( hObj, L"StartFlash", &nStart );
|
||||
XuiElementFindNamedFrame( hObj, L"EndFlash", &nEnd );
|
||||
XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
|
||||
XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -960,7 +960,7 @@ HRESULT CXuiSceneBase::_HidePressStart()
|
||||
|
||||
HRESULT CXuiSceneBase::_UpdateAutosaveCountdownTimer(unsigned int uiSeconds)
|
||||
{
|
||||
WCHAR wcAutosaveCountdown[100];
|
||||
WCHAR wcAutosaveCountdown[100];
|
||||
swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds);
|
||||
m_TrialTimer.SetText(wcAutosaveCountdown);
|
||||
return S_OK;
|
||||
@@ -974,7 +974,7 @@ HRESULT CXuiSceneBase::_ShowAutosaveCountdownTimer(BOOL bVal)
|
||||
|
||||
HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad)
|
||||
{
|
||||
WCHAR wcTime[20];
|
||||
WCHAR wcTime[20];
|
||||
|
||||
DWORD dwTimeTicks=(DWORD)app.getTrialTimer();
|
||||
|
||||
@@ -982,7 +982,7 @@ HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad)
|
||||
{
|
||||
dwTimeTicks=m_dwTrialTimerLimitSecs;
|
||||
}
|
||||
|
||||
|
||||
dwTimeTicks=m_dwTrialTimerLimitSecs-dwTimeTicks;
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
@@ -1038,7 +1038,7 @@ bool CXuiSceneBase::_PressStartPlaying(unsigned int iPad)
|
||||
HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position )
|
||||
{
|
||||
// turn off the empty quadrant logo
|
||||
if(m_hEmptyQuadrantLogo!=NULL)
|
||||
if(m_hEmptyQuadrantLogo!=NULL)
|
||||
{
|
||||
XuiElementSetShow(m_hEmptyQuadrantLogo,FALSE);
|
||||
}
|
||||
@@ -1086,12 +1086,12 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen
|
||||
XuiElementSetShow( m_TooltipGroupSmall[iPad].m_hObj, TRUE);
|
||||
}
|
||||
|
||||
if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
|
||||
{
|
||||
if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
|
||||
{
|
||||
//640x480 ->1280x720
|
||||
scale.x = 2.0f; scale.y = 1.5f; scale.z = 1.0f;
|
||||
XuiElementSetScale(m_hObj, &scale);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -1127,7 +1127,7 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen
|
||||
// No position adjustment
|
||||
case e_BaseScene_Fullscreen:
|
||||
tooltipsPos.x=SAFEZONE_HALF_WIDTH;
|
||||
tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight;
|
||||
tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight;
|
||||
crouchIconPos.x=SAFEZONE_HALF_WIDTH;
|
||||
crouchIconPos.y=SAFEZONE_HALF_HEIGHT;
|
||||
fBackWidth=XUI_BASE_SCENE_WIDTH;
|
||||
@@ -1303,7 +1303,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
||||
|
||||
|
||||
// Only adjust if fullscreen for now, leaving code to move others if required, but it's too far up the screen when on the bottom quadrants
|
||||
if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) &&
|
||||
if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) &&
|
||||
(RenderManager.IsHiDef() || RenderManager.IsWidescreen()) )
|
||||
{
|
||||
D3DXVECTOR3 selectedItemPos;
|
||||
@@ -1328,17 +1328,17 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
||||
|
||||
// The move applies to the whole scene, so we'll need to move tooltips back in some cases
|
||||
|
||||
selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight;
|
||||
selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight;
|
||||
selectedItemPos.x = XUI_BASE_SCENE_WIDTH_HALF - (fSelectedItemWidth/2.0f);
|
||||
|
||||
// Adjust selectedItemPos based on what gui is displayed
|
||||
|
||||
|
||||
// 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival
|
||||
// 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival
|
||||
float fYOffset=0.0f;
|
||||
|
||||
unsigned char ucGuiScale=app.GetGameSettings(iPad,eGameSetting_UISize) + 2;
|
||||
|
||||
|
||||
if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer())
|
||||
{
|
||||
// SURVIVAL MODE - Move up further because of hearts, shield and xp
|
||||
@@ -1353,7 +1353,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
||||
default: // 2
|
||||
fYOffset = -94.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1368,7 +1368,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
||||
default: // 2
|
||||
fYOffset = -58.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1425,14 +1425,14 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
||||
// 4J-PB - If it's in split screen vertical, adjust the position
|
||||
// Adjust selectedItemPos based on what gui is displayed
|
||||
if((m_playerBaseScenePosition[iPad]==e_BaseScene_Left) || (m_playerBaseScenePosition[iPad]==e_BaseScene_Right))
|
||||
{
|
||||
{
|
||||
float scale=0.5f;
|
||||
selectedItemPos.y -= (scale * 88.0f);
|
||||
if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer())
|
||||
{
|
||||
selectedItemPos.y -= (scale * 80.0f);
|
||||
}
|
||||
|
||||
|
||||
// 4J-PB - selected the gui scale based on the slider settings
|
||||
unsigned char ucGuiScale;
|
||||
float fYOffset=0.0f;
|
||||
@@ -1455,7 +1455,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
||||
default: // 2
|
||||
fYOffset = 85.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
selectedItemPos.y+=fYOffset;
|
||||
}
|
||||
|
||||
@@ -1606,7 +1606,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay )
|
||||
{
|
||||
// The host decides whether these are on or off
|
||||
if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0)
|
||||
{
|
||||
{
|
||||
if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localplayers[iPad]!=NULL)
|
||||
{
|
||||
wstring wsGamertag = convStringToWstring( ProfileManager.GetGamertag(iPad));
|
||||
@@ -1621,7 +1621,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay )
|
||||
}
|
||||
// The host decides whether these are on or off
|
||||
if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0)
|
||||
{
|
||||
{
|
||||
XuiElementSetShow(m_hGamerTagA[iPad],bDisplay);
|
||||
|
||||
// set the opacity of the gamertag
|
||||
@@ -1712,11 +1712,11 @@ void CXuiSceneBase::_HideAllGameUIElements()
|
||||
m_uiSelectedItemOpacityCountDown[i] = 0;
|
||||
m_selectedItemA[i].SetShow(FALSE);
|
||||
m_selectedItemSmallA[i].SetShow(FALSE);
|
||||
|
||||
|
||||
m_BossHealthGroup[i].SetShow(FALSE);
|
||||
m_bossHealthVisible[i] = FALSE;
|
||||
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
|
||||
_DisplayGamertag(i,FALSE);
|
||||
}
|
||||
@@ -1845,12 +1845,12 @@ void CXuiSceneBase::ReLayout( unsigned int iPad )
|
||||
if( i>0 && lastVisible!=-1 )
|
||||
{
|
||||
float width, height;
|
||||
XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height);
|
||||
XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height);
|
||||
|
||||
// 4J Stu - This is for horizontal layout, will need changed if we do vertical layout
|
||||
lastPos.x += width + m_iTooltipSpacingGap;
|
||||
|
||||
XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height);
|
||||
XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height);
|
||||
// 4J Stu - This is for horizontal layout, will need changed if we do vertical layout
|
||||
lastPosSmall.x += width + m_iTooltipSpacingGapSmall;
|
||||
}
|
||||
@@ -1948,15 +1948,15 @@ HRESULT CXuiSceneBase::SetTooltips( unsigned int iPad, int iA, int iB, int iX, i
|
||||
}
|
||||
else
|
||||
{
|
||||
// does the tooltip need to change?
|
||||
// does the tooltip need to change?
|
||||
if(CXuiSceneBase::Instance->m_iCurrentTooltipTextID[iPad][i]!=iTooptipsA[i] || forceUpdate)
|
||||
{
|
||||
CXuiSceneBase::Instance->SetTooltipText(iPad, i, iTooptipsA[i] );
|
||||
}
|
||||
}
|
||||
CXuiSceneBase::Instance->_ShowTooltip(iPad, i, true );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
@@ -2067,14 +2067,14 @@ HRESULT CXuiSceneBase::SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScen
|
||||
}
|
||||
|
||||
HRESULT CXuiSceneBase::UpdatePlayerBasePositions()
|
||||
{
|
||||
{
|
||||
EBaseScenePosition padPositions[XUSER_MAX_COUNT];
|
||||
|
||||
for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
padPositions[idx] = e_BaseScene_NotSet;
|
||||
}
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
// If the game is not started (or is being held paused for a bit) then display all scenes fullscreen
|
||||
@@ -2134,7 +2134,7 @@ HRESULT CXuiSceneBase::UpdatePlayerBasePositions()
|
||||
padPositions[idx] = e_BaseScene_Right;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
|
||||
padPositions[idx] = e_BaseScene_Top_Left;
|
||||
padPositions[idx] = e_BaseScene_Top_Left;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
padPositions[idx] = e_BaseScene_Top_Right;
|
||||
@@ -2168,7 +2168,7 @@ void CXuiSceneBase::UpdateSelectedItemPos(int iPad)
|
||||
CXuiSceneBase::Instance->_UpdateSelectedItemPos(iPad);
|
||||
}
|
||||
|
||||
HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad)
|
||||
HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad)
|
||||
{
|
||||
return CXuiSceneBase::Instance->_GetPlayerBaseScene(iPad);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user