diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index e14ed156..4eaf444f 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -1365,7 +1365,7 @@ void ClientConnection::handleChat(shared_ptr packet) break; case ChatPacket::e_ChatCannotPlaceLava: displayOnGui = false; - app.SetGlobalXuiAction(eAppAction_DisplayLavaMessage); + app.SetGlobalUIAction(eAppAction_DisplayLavaMessage); break; case ChatPacket::e_ChatDeathInFire: message=app.GetString(IDS_DEATH_INFIRE); diff --git a/Minecraft.Client/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h index 72f3bfbf..a72a68e5 100644 --- a/Minecraft.Client/Common/App_enums.h +++ b/Minecraft.Client/Common/App_enums.h @@ -31,7 +31,7 @@ enum eFont eFont_None, // to fallback to nothing }; -enum eXuiAction +enum eUIAction { eAppAction_Idle=0, eAppAction_SaveGame, @@ -112,21 +112,21 @@ enum eTMSAction // The server runs on its own thread, so we need to call its actions there rather than where all other Xui actions are performed // In general these are debugging options -enum eXuiServerAction +enum eUIServerAction { - eXuiServerAction_Idle=0, - eXuiServerAction_DropItem, // Debug - eXuiServerAction_SaveGame, - eXuiServerAction_AutoSaveGame, - eXuiServerAction_SpawnMob, // Debug - eXuiServerAction_PauseServer, - eXuiServerAction_ToggleRain, // Debug - eXuiServerAction_ToggleThunder, // Debug - eXuiServerAction_ServerSettingChanged_Gamertags, - eXuiServerAction_ServerSettingChanged_Difficulty, - eXuiServerAction_ExportSchematic, //Debug - eXuiServerAction_ServerSettingChanged_BedrockFog, - eXuiServerAction_SetCameraLocation, //Debug + eUIServerAction_Idle=0, + eUIServerAction_DropItem, // Debug + eUIServerAction_SaveGame, + eUIServerAction_AutoSaveGame, + eUIServerAction_SpawnMob, // Debug + eUIServerAction_PauseServer, + eUIServerAction_ToggleRain, // Debug + eUIServerAction_ToggleThunder, // Debug + eUIServerAction_ServerSettingChanged_Gamertags, + eUIServerAction_ServerSettingChanged_Difficulty, + eUIServerAction_ExportSchematic, //Debug + eUIServerAction_ServerSettingChanged_BedrockFog, + eUIServerAction_SetCameraLocation, //Debug }; enum eGameSetting diff --git a/Minecraft.Client/Common/App_structs.h b/Minecraft.Client/Common/App_structs.h index bcbd4cb4..76f4167f 100644 --- a/Minecraft.Client/Common/App_structs.h +++ b/Minecraft.Client/Common/App_structs.h @@ -138,9 +138,9 @@ typedef std::vector VBANNEDLIST; typedef struct { int iPad; - eXuiAction action; + eUIAction action; } -XuiActionParam; +UIActionParam; // tips typedef struct diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index 68c34d16..90eeb9f8 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -1100,7 +1100,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter ) { #ifdef __DISABLE_MILES__ return 0; -#endif +#else SoundEngine *soundEngine = (SoundEngine *)lpParameter; soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0); @@ -1111,6 +1111,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter ) } #endif return 0; +#endif } ///////////////////////////////////////////// @@ -1118,13 +1119,12 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter ) // playMusicTick // ///////////////////////////////////////////// +#ifndef __PSVITA__ // AP - vita will update the music during the mixer callback void SoundEngine::playMusicTick() { -// AP - vita will update the music during the mixer callback -#ifndef __PSVITA__ playMusicUpdate(); -#endif } +#endif // AP - moved to a separate function so it can be called from the mixer callback on Vita void SoundEngine::playMusicUpdate() @@ -1156,10 +1156,6 @@ void SoundEngine::playMusicUpdate() if(m_musicID!=-1) { // start playing it - - -#if ( defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ ) - #ifdef __PS3__ // 4J-PB - Need to check if we are a patched BD build if(app.GetBootedFromDiscPatch()) @@ -1171,13 +1167,12 @@ void SoundEngine::playMusicUpdate() { sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath ); } -#else +#elif (defined __PSVITA__ || __ORBIS__) sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath ); -#endif - #else strcpy((char *)m_szStreamName,m_szMusicPath); #endif + // are we using a mash-up pack? //if(pMinecraft && !pMinecraft->skins->isUsingDefaultSkin() && pMinecraft->skins->getSelected()->hasAudio()) if(Minecraft::GetInstance()->skins->getSelected()->hasAudio()) @@ -1249,32 +1244,11 @@ void SoundEngine::playMusicUpdate() SetIsPlayingStreamingCDMusic(false); m_MusicType=eMusicType_Game; m_StreamingAudioInfo.bIs3D=false; - } + } else if(m_musicIDgetString(iID); } -void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param) +void CMinecraftApp::SetAction(int iPad, eUIAction action, LPVOID param) { - if( ( m_eXuiAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_EthernetDisconnected ) ) + if( ( m_eUIAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_EthernetDisconnected ) ) { - app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action); + app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action); } - else if( ( m_eXuiAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_ExitWorld ) ) + else if( ( m_eUIAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_ExitWorld ) ) { - app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action); + app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action); } - else if(m_eXuiAction[iPad] == eAppAction_ExitWorldCapturedThumbnail && action != eAppAction_Idle) + else if(m_eUIAction[iPad] == eAppAction_ExitWorldCapturedThumbnail && action != eAppAction_Idle) { - app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action); + app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action); } else { - app.DebugPrintf("Changing App action for pad %d from %d to %d\n", iPad, m_eXuiAction[iPad], action); - m_eXuiAction[iPad]=action; - m_eXuiActionParam[iPad] = param; + app.DebugPrintf("Changing App action for pad %d from %d to %d\n", iPad, m_eUIAction[iPad], action); + m_eUIAction[iPad]=action; + m_eUIActionParam[iPad] = param; } } @@ -344,30 +344,6 @@ void CMinecraftApp::SetAppPaused(bool val) m_bIsAppPaused = val; } -void CMinecraftApp::HandleButtonPresses() -{ - for(int i=0;i<4;i++) - { - HandleButtonPresses(i); - } -} - -void CMinecraftApp::HandleButtonPresses(int iPad) -{ - - // // test an update of the profile data - // void *pData=ProfileManager.GetGameDefinedProfileData(iPad); - // - // unsigned char *pchData= (unsigned char *)pData; - // int iCount=0; - // for(int i=0;i player,bool bNavigateBack) { bool success = true; @@ -753,7 +729,7 @@ void CMinecraftApp::InitGameSettings() { for(int i=0;ibSettingsChanged=bWriteProfile; #endif @@ -899,8 +874,7 @@ int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETT return 0; } -#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) - +#if !(defined _WINDOWS64) wstring CMinecraftApp::toStringOptionsStatus(const C4JStorage::eOptionsCallback &eStatus) { #ifndef _CONTENT_PACKAGE @@ -1227,9 +1201,6 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat { // This might be from a version during testing of new profile updates app.DebugPrintf("Don't know what to do with this profile version!\n"); -#ifndef _CONTENT_PACKAGE - // __debugbreak(); -#endif GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu @@ -1352,7 +1323,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) // Game Host only (and for now we can't change the diff while in game, so this shouldn't happen) if(bInGame && g_NetworkManager.IsHost() && (iPad==ProfileManager.GetPrimaryPad())) { - app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_Difficulty); + app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_Difficulty); } } else @@ -1418,7 +1389,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) { // Update the Game Host setting if you are the host and you are in-game app.SetGameHostOption(eGameHostOption_Gamertags,((GameSettingsA[iPad]->usBitmaskValues&0x0008)!=0)?1:0); - app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_Gamertags); + app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_Gamertags); PlayerList *players = MinecraftServer::getInstance()->getPlayerList(); for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3) @@ -1494,7 +1465,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) { // Update the Game Host setting if you are the host and you are in-game app.SetGameHostOption(eGameHostOption_BedrockFog,GetGameSettings(iPad,eGameSetting_BedrockFog)?1:0); - app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_BedrockFog); + app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_BedrockFog); } } break; @@ -2588,21 +2559,21 @@ int CMinecraftApp::DisplaySavingMessage(void *pParam, C4JStorage::ESavingMessage void CMinecraftApp::SetActionConfirmed(LPVOID param) { - XuiActionParam *actionInfo = (XuiActionParam *)param; + UIActionParam *actionInfo = (UIActionParam *)param; app.SetAction(actionInfo->iPad, actionInfo->action); } -void CMinecraftApp::HandleXuiActions(void) +void CMinecraftApp::HandleUIActions(void) { - eXuiAction eAction; + eUIAction eAction; eTMSAction eTMS; LPVOID param; Minecraft *pMinecraft=Minecraft::GetInstance(); shared_ptr player; // are there any global actions to deal with? - eAction = app.GetGlobalXuiAction(); + eAction = app.GetGlobalUIAction(); if(eAction!=eAppAction_Idle) { switch(eAction) @@ -2613,7 +2584,7 @@ void CMinecraftApp::HandleXuiActions(void) UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestErrorMessage( IDS_CANT_PLACE_NEAR_SPAWN_TITLE, IDS_CANT_PLACE_NEAR_SPAWN_TEXT, uiIDA,1,XUSER_INDEX_ANY); - if(result != C4JStorage::EMessage_Busy) SetGlobalXuiAction(eAppAction_Idle); + if(result != C4JStorage::EMessage_Busy) SetGlobalUIAction(eAppAction_Idle); } break; @@ -2625,8 +2596,8 @@ void CMinecraftApp::HandleXuiActions(void) // are there any app actions to deal with? for(int i=0;ilocalplayers[i]->respawn(); // If the respawn requires a dimension change then the action will have changed - //if(app.GetXuiAction(i) == eAppAction_Respawn) + //if(app.GetUIAction(i) == eAppAction_Respawn) //{ // SetAction(i,eAppAction_Idle); // CloseXuiScenes(i); @@ -7365,7 +7336,7 @@ void CMinecraftApp::EnterSaveNotificationSection() if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE); } } } @@ -7383,7 +7354,7 @@ void CMinecraftApp::LeaveSaveNotificationSection() if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); } } } @@ -7412,14 +7383,14 @@ int CMinecraftApp::RemoteSaveThreadProc( void* lpParameter ) pMinecraft->progressRenderer->progressStage( -1 ); pMinecraft->progressRenderer->progressStagePercentage(0); - while( !app.GetGameStarted() && app.GetXuiAction( ProfileManager.GetPrimaryPad() ) == eAppAction_WaitRemoteServerSaveComplete ) + while( !app.GetGameStarted() && app.GetUIAction( ProfileManager.GetPrimaryPad() ) == eAppAction_WaitRemoteServerSaveComplete ) { // Tick all the games connections pMinecraft->tickAllConnections(); Sleep( 100 ); } - if( app.GetXuiAction( ProfileManager.GetPrimaryPad() ) != eAppAction_WaitRemoteServerSaveComplete ) + if( app.GetUIAction( ProfileManager.GetPrimaryPad() ) != eAppAction_WaitRemoteServerSaveComplete ) { // Something cancelled us? return ERROR_CANCELLED; diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index a3198be5..56fc5898 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -114,7 +114,6 @@ public: static const int USER_SR = 6; static const int USER_UI = 7; // 4J Stu - This also makes it appear on the UI console - void HandleButtonPresses(); bool IntroRunning() { return m_bIntroRunning;} void SetIntroRunning(bool bSet) {m_bIntroRunning=bSet;} #ifdef _CONTENT_PACKAGE @@ -160,17 +159,17 @@ public: eGameMode GetGameMode() { return m_eGameMode;} void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;} - eXuiAction GetGlobalXuiAction() {return m_eGlobalXuiAction;} - void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;} - eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];} - void SetAction(int iPad, eXuiAction action, LPVOID param = NULL); + eUIAction GetGlobalUIAction() {return m_eGlobalUIAction;} + void SetGlobalUIAction(eUIAction action) {m_eGlobalUIAction=action;} + eUIAction GetUIAction(int iPad) {return m_eUIAction[iPad];} + void SetAction(int iPad, eUIAction action, LPVOID param = NULL); void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; } eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];} - eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];} - LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];} - void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;} - eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;} - void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;} + eUIServerAction GetUIServerAction(int iPad) {return m_eUIServerAction[iPad];} + LPVOID GetUIServerActionParam(int iPad) {return m_eUIServerActionParam[iPad];} + void SetUIServerAction(int iPad, eUIServerAction action, LPVOID param = NULL) {m_eUIServerAction[iPad]=action; m_eUIServerActionParam[iPad] = param;} + eUIServerAction GetGlobalUIServerAction() {return m_eGlobalUIServerAction;} + void SetGlobalUIServerAction(eUIServerAction action) {m_eGlobalUIServerAction=action;} DisconnectPacket::eDisconnectReason GetDisconnectReason() { return m_disconnectReason; } void SetDisconnectReason(DisconnectPacket::eDisconnectReason bVal) { m_disconnectReason = bVal; } @@ -184,7 +183,7 @@ public: // 4J Stu - Added so that we can call this when a confirmation box is selected static void SetActionConfirmed(LPVOID param); - void HandleXuiActions(void); + void HandleUIActions(void); // 4J Stu - Functions used for Minecon and other promo work bool GetLoadSavesFromFolderEnabled() { return m_bLoadSavesFromFolderEnabled; } @@ -446,8 +445,6 @@ private: VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT]; - void HandleButtonPresses(int iPad); - bool m_bResourcesLoaded; // Global string table for this application. @@ -514,13 +511,13 @@ private: // To avoid problems with threads being kicked off from xuis that alter things that may be in progress within the run_middle, // we'll action these at the end of the game loop - eXuiAction m_eXuiAction[XUSER_MAX_COUNT]; + eUIAction m_eUIAction[XUSER_MAX_COUNT]; eTMSAction m_eTMSAction[XUSER_MAX_COUNT]; - LPVOID m_eXuiActionParam[XUSER_MAX_COUNT]; - eXuiAction m_eGlobalXuiAction; - eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT]; - LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT]; - eXuiServerAction m_eGlobalXuiServerAction; + LPVOID m_eUIActionParam[XUSER_MAX_COUNT]; + eUIAction m_eGlobalUIAction; + eUIServerAction m_eUIServerAction[XUSER_MAX_COUNT]; + LPVOID m_eUIServerActionParam[XUSER_MAX_COUNT]; + eUIServerAction m_eGlobalUIServerAction; bool m_bLiveLinkRequired; diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index b9ed927b..821f3338 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -1173,11 +1173,11 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME ); #endif - while( app.GetXuiServerAction(ProfileManager.GetPrimaryPad() ) != eXuiServerAction_Idle && !MinecraftServer::serverHalted() ) + while( app.GetUIServerAction(ProfileManager.GetPrimaryPad() ) != eUIServerAction_Idle && !MinecraftServer::serverHalted() ) { Sleep(10); } - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE); // wait for the server to be in a non-ticking state pServer->m_serverPausedEvent->WaitForSignal(INFINITE); @@ -1333,7 +1333,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) // Start the game again app.SetGameStarted(true); - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); app.SetChangingSessionType(false); app.SetReallyChangingSessionType(false); diff --git a/Minecraft.Client/Common/UI/IUIScene_HUD.cpp b/Minecraft.Client/Common/UI/IUIScene_HUD.cpp index d7852627..6d5b2274 100644 --- a/Minecraft.Client/Common/UI/IUIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_HUD.cpp @@ -170,7 +170,7 @@ void IUIScene_HUD::updateFrameTick() } SetOpacity(fVal); - bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(iPad) && !(app.GetXuiAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(iPad,eGameSetting_DisplayHUD)!=0; + bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(iPad) && !(app.GetUIAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(iPad,eGameSetting_DisplayHUD)!=0; if(bDisplayGui && pMinecraft->localplayers[iPad] != NULL) { SetVisible(true); diff --git a/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp index c8d38e0b..4f783b3b 100644 --- a/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp @@ -354,11 +354,11 @@ int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) bool bAutosave=(bool)lpParameter; if(bAutosave) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_AutoSaveGame); } else { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_SaveGame); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_SaveGame); } // Share AABB & Vec3 pools with default (main thread) - should be ok as long as we don't tick the main thread whilst this thread is running @@ -374,7 +374,7 @@ int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) { app.SetGameStarted(false); - while( app.GetXuiServerAction(ProfileManager.GetPrimaryPad() ) != eXuiServerAction_Idle && !MinecraftServer::serverHalted() ) + while( app.GetUIServerAction(ProfileManager.GetPrimaryPad() ) != eUIServerAction_Idle && !MinecraftServer::serverHalted() ) { Sleep(10); } diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index d4542973..b3deee8e 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -184,17 +184,6 @@ UIController::UIController() InitializeCriticalSection(&m_Allocatorlock); #endif - // 4J Stu - This is a bit of a hack until we change the Minecraft initialisation to store the proper screen size for other platforms -#if defined _DURANGO || defined __ORBIS__ - m_fScreenWidth = 1920.0f; - m_fScreenHeight = 1080.0f; - m_bScreenWidthSetup = true; -#else - m_fScreenWidth = 1280.0f; - m_fScreenHeight = 720.0f; - m_bScreenWidthSetup = false; -#endif - for(unsigned int i = 0; i < eLibrary_Count; ++i) { m_iggyLibraries[i] = IGGY_INVALID_LIBRARY; @@ -257,6 +246,7 @@ void UIController::SetSystemUIShowing(LPVOID lpParam,bool bVal) // SETUP void UIController::preInit(S32 width, S32 height) { + //str1k3r - 4J previously hardcoded this in UIController(), this is already set per platform so just use this :3 m_fScreenWidth = width; m_fScreenHeight = height; m_bScreenWidthSetup = true; @@ -500,14 +490,14 @@ void UIController::tick() } #ifdef _WINDOWS64 - GetControllerType(); + GetControllerSwf(); #endif } //str1k3r - PS3 & PS4 icons are broken in some spots, therefore they wont be included yet #ifdef _WINDOWS64 //str1k3r - this is what actually does all the autoswitching -void UIController::GetControllerType() +void UIController::GetControllerSwf() { EControllerType ControllerType = InputManager.GetControllerType(0); wstring controlTooltipsPath = L""; @@ -521,7 +511,6 @@ void UIController::GetControllerType() case EControllerType_Xbox360: controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\XboxHDControls.swf" : L"ControlTooltips\\XboxControls.swf"; break; - case EControllerType_Default: case EControllerType_XboxOne: controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf"; break; @@ -539,6 +528,9 @@ void UIController::GetControllerType() controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\SwitchHDControls.swf" : L"ControlTooltips\\SwitchControls.swf"; break; */ + case EControllerType_Default: //str1k3r - this is going to get a custom swf soon + controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf"; + break; default: controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\Windows64HDControls.swf" : L"ControlTooltips\\Windows64Controls.swf"; break; @@ -569,7 +561,6 @@ wstring UIController::GetTooltipSkinPath() { case EControllerType_Xbox360: return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\XboxHDControls.swf" : L"ControlTooltips\\XboxControls.swf"; - case EControllerType_Default: case EControllerType_XboxOne: return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf"; /* @@ -582,6 +573,8 @@ wstring UIController::GetTooltipSkinPath() case EControllerType_Switch: return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\SwitchHDControls.swf" : L"ControlTooltips\\SwitchControls.swf"; */ + case EControllerType_Default: + return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf"; default: return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\Windows64HDControls.swf" : L"ControlTooltips\\Windows64Controls.swf"; break; @@ -601,12 +594,12 @@ void UIController::loadSkins() #elif defined __PSVITA__ platformSkinPath = L"skinVita.swf"; #elif defined _WINDOWS64 - if(m_fScreenWidth >= 1920.0f) + if(ui.getScreenWidth() >= 1920.0f) { tooltipsSkinPath = GetTooltipSkinPath(); platformSkinPath = L"skinHDWin.swf"; } - else if (m_fScreenWidth >= 960.0f && m_fScreenWidth < 1280.0f) //str1k3r - we need to check this to make sure we dont load the vita skin on 720p + else if (ui.getScreenWidth() >= 960.0f && ui.getScreenWidth() < 1280.0f) //str1k3r - we need to check this to make sure we dont load the vita skin on 720p { tooltipsSkinPath = GetTooltipSkinPath(); platformSkinPath = L"skinWinVita.swf"; @@ -639,7 +632,7 @@ void UIController::loadSkins() // str1k3r - Fixes 720p/480p Crashes on Windows64, also allows this to be used on 1080p consoles instead of just Windows64 // This also cleans up some 4J code and turns 3 if statements into 1. - if (m_fScreenWidth >= 1920.0f) + if (ui.getScreenWidth() >= 1920.0f) { m_iggyLibraries[eLibrary_Platform] = loadSkin(platformSkinPath, L"platformskinHD.swf"); m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.swf"); diff --git a/Minecraft.Client/Common/UI/UIController.h b/Minecraft.Client/Common/UI/UIController.h index 815209e4..e779dbad 100644 --- a/Minecraft.Client/Common/UI/UIController.h +++ b/Minecraft.Client/Common/UI/UIController.h @@ -204,7 +204,7 @@ public: virtual void tick(); private: - void GetControllerType(); + void GetControllerSwf(); wstring GetTooltipSkinPath(); void loadSkins(); IggyLibrary loadSkin(const wstring &skinPath, const wstring &skinName); @@ -236,6 +236,8 @@ public: // RENDERING float getScreenWidth() { return m_fScreenWidth; } float getScreenHeight() { return m_fScreenHeight; } + void setScreenWidth(float w) { m_fScreenWidth = w; } + void setScreenHeight(float h) { m_fScreenHeight = h; } virtual void render() = 0; void getRenderDimensions(C4JRender::eViewportType viewport, S32 &width, S32 &height); diff --git a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp index 1344c631..c079b9ab 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp @@ -100,7 +100,7 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) else if(m_data->endZ < 0 && m_data->endZ%2 ==0) m_data->endZ+=1; - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(), eXuiServerAction_ExportSchematic, (void *)m_data); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(), eUIServerAction_ExportSchematic, (void *)m_data); navigateBack(); } diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index c93916a0..3cdd0bb2 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -167,7 +167,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) { app.DebugPrintf("UIScene_DebugOverlay::handlePress for itemsList: %f\n", childId); int id = childId; - //app.SetXuiServerAction(m_iPad, eXuiServerAction_DropItem, (void *)m_itemIds[id]); + //app.SetUIServerAction(m_iPad, eUIServerAction_DropItem, (void *)m_itemIds[id]); ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad()); conn->send( GiveItemCommand::preparePacket(dynamic_pointer_cast(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_itemIds[id]) ); } @@ -177,7 +177,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) int id = childId; if(idgetConnection(ProfileManager.GetPrimaryPad()); conn->send( ToggleDownfallCommand::preparePacket() ); } break; case eControl_Thunder: - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_ToggleThunder); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_ToggleThunder); break; case eControl_ResetTutorial: Tutorial::debugResetPlayerSavedProgress( ProfileManager.GetPrimaryPad() ); diff --git a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp index 936b2364..6a6f4acd 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp @@ -91,8 +91,8 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) switch((int)controlId) { case eControl_Teleport: - app.SetXuiServerAction( ProfileManager.GetPrimaryPad(), - eXuiServerAction_SetCameraLocation, + app.SetUIServerAction( ProfileManager.GetPrimaryPad(), + eUIServerAction_SetCameraLocation, (void *)currentPosition); break; case eControl_CamX: diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index a4863e39..72dd14b5 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -161,7 +161,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer } #endif -#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) || defined(_DURANGO) +#if (defined __PS3__ || __ORBIS__ || __PSVITA__ || _DURANGO || _WINDOWS64) // Always clear the saves when we enter this menu StorageManager.ClearSavesInfo(); #endif diff --git a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp index ceb92473..2e6ccfa3 100644 --- a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp @@ -94,7 +94,7 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE); } TelemetryManager->RecordMenuShown(m_iPad, eUIScene_PauseMenu, 0); @@ -367,7 +367,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed if( iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); } ui.PlayUISFX(eSFX_Back); @@ -473,7 +473,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed bool bCanScreenshot = true; for(int j=0; j < XUSER_MAX_COUNT;++j) { - if(app.GetXuiAction(j) == eAppAction_SocialPostScreenshot) + if(app.GetUIAction(j) == eAppAction_SocialPostScreenshot) { bCanScreenshot = false; break; @@ -511,7 +511,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) case BUTTON_PAUSE_RESUMEGAME: if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); } navigateBack(); break; diff --git a/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp b/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp index 5a5e6a4e..9126984c 100644 --- a/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp +++ b/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp @@ -126,7 +126,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress if(nIndexUserIndex, eXuiServerAction_DropItem, (void *)id); + //app.SetUIServerAction(pNotifyPressData->UserIndex, eUIServerAction_DropItem, (void *)id); ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad()); conn->send( GiveItemCommand::preparePacket(dynamic_pointer_cast(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), id) ); } @@ -136,7 +136,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress nIndex = m_mobs.GetCurSel(); if(nIndexgetConnection(ProfileManager.GetPrimaryPad()); conn->send( ToggleDownfallCommand::preparePacket() ); } else if( hObjPressed == m_toggleThunder ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_ToggleThunder); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_ToggleThunder); } else if( hObjPressed == m_resetTutorial ) { diff --git a/Minecraft.Client/Common/XUI/XUI_DebugSchematicCreator.cpp b/Minecraft.Client/Common/XUI/XUI_DebugSchematicCreator.cpp index 66279d1f..dc829a53 100644 --- a/Minecraft.Client/Common/XUI/XUI_DebugSchematicCreator.cpp +++ b/Minecraft.Client/Common/XUI/XUI_DebugSchematicCreator.cpp @@ -76,7 +76,7 @@ HRESULT CScene_DebugSchematicCreator::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINo #endif m_data->compressionType = Compression::eCompressionType_RLE; - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(), eXuiServerAction_ExportSchematic, (void *)m_data); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(), eUIServerAction_ExportSchematic, (void *)m_data); NavigateBack(); rfHandled = TRUE; diff --git a/Minecraft.Client/Common/XUI/XUI_DebugSetCamera.cpp b/Minecraft.Client/Common/XUI/XUI_DebugSetCamera.cpp index 2227e895..d94a6324 100644 --- a/Minecraft.Client/Common/XUI/XUI_DebugSetCamera.cpp +++ b/Minecraft.Client/Common/XUI/XUI_DebugSetCamera.cpp @@ -68,8 +68,8 @@ HRESULT CScene_DebugSetCamera::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPre if (hObjPressed == m_teleport) { - app.SetXuiServerAction( ProfileManager.GetPrimaryPad(), - eXuiServerAction_SetCameraLocation, + app.SetUIServerAction( ProfileManager.GetPrimaryPad(), + eUIServerAction_SetCameraLocation, (void *)currentPosition); rfHandled = TRUE; } diff --git a/Minecraft.Client/Common/XUI/XUI_PauseMenu.cpp b/Minecraft.Client/Common/XUI/XUI_PauseMenu.cpp index 4de74d1f..c93a8861 100644 --- a/Minecraft.Client/Common/XUI/XUI_PauseMenu.cpp +++ b/Minecraft.Client/Common/XUI/XUI_PauseMenu.cpp @@ -152,7 +152,7 @@ HRESULT UIScene_PauseMenu::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE); } TelemetryManager->RecordMenuShown(m_iPad, eUIScene_PauseMenu, 0); @@ -190,7 +190,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* case BUTTON_PAUSE_RESUMEGAME: if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); } app.CloseXuiScenes(pNotifyPressData->UserIndex); break; @@ -441,7 +441,7 @@ HRESULT UIScene_PauseMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); } CXuiSceneBase::PlayUISFX(eSFX_Back); @@ -477,7 +477,7 @@ HRESULT UIScene_PauseMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle bool bCanScreenshot = true; for(int j=0; j < XUSER_MAX_COUNT;++j) { - if(app.GetXuiAction(j) == eAppAction_SocialPostScreenshot) + if(app.GetUIAction(j) == eAppAction_SocialPostScreenshot) { bCanScreenshot = false; break; @@ -579,7 +579,7 @@ HRESULT UIScene_PauseMenu::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) { if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); } app.CloseXuiScenes(m_iPad); @@ -610,7 +610,7 @@ int UIScene_PauseMenu::BanGameDialogReturned(void *pParam,int iPad,C4JStorage::E if(result==C4JStorage::EMessage_ResultDecline) { // 4J Stu - Only do this if we are currently idle, don't want the (relatively) low priority ban task overriding something else - if(app.GetXuiAction(iPad) == eAppAction_Idle) app.SetAction(iPad,eAppAction_BanLevel); + if(app.GetUIAction(iPad) == eAppAction_Idle) app.SetAction(iPad,eAppAction_BanLevel); } return 0; } @@ -702,7 +702,7 @@ HRESULT UIScene_PauseMenu::OnDestroy() if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() ) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); } return S_OK; @@ -974,11 +974,11 @@ int UIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) bool bAutosave=(bool)lpParameter; if(bAutosave) { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_AutoSaveGame); } else { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_SaveGame); + app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_SaveGame); } // Share AABB & Vec3 pools with default (main thread) - should be ok as long as we don't tick the main thread whilst this thread is running @@ -994,7 +994,7 @@ int UIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) { app.SetGameStarted(false); - while( app.GetXuiServerAction(ProfileManager.GetPrimaryPad() ) != eXuiServerAction_Idle && !MinecraftServer::serverHalted() ) + while( app.GetUIServerAction(ProfileManager.GetPrimaryPad() ) != eUIServerAction_Idle && !MinecraftServer::serverHalted() ) { Sleep(10); } diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp index 891e51b5..1ab03049 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp @@ -164,7 +164,7 @@ void CXuiSceneBase::_TickAllBaseScenes() for(int i=0;ilocalplayers[i] != NULL) { XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE); diff --git a/Minecraft.Client/Durango/ApplicationView.cpp b/Minecraft.Client/Durango/ApplicationView.cpp index eec8fff4..b52f6f15 100644 --- a/Minecraft.Client/Durango/ApplicationView.cpp +++ b/Minecraft.Client/Durango/ApplicationView.cpp @@ -296,7 +296,7 @@ void ApplicationView::OnResuming(Platform::Object^ sender, Platform::Object^ arg { // Bit specific but we want to avoid switching to offline if the primary player has signed out // (and AFAIK there's no other way to find out until a few ticks time) - if (app.GetXuiAction(0) != eAppAction_PrimaryPlayerSignedOut) + if (app.GetUIAction(0) != eAppAction_PrimaryPlayerSignedOut) { // We've lost the party so switch to offline, previously we exited the world here but this seems friendlier app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_EthernetDisconnected); diff --git a/Minecraft.Client/Durango/Durango_Minecraft.cpp b/Minecraft.Client/Durango/Durango_Minecraft.cpp index c664584e..a7021f16 100644 --- a/Minecraft.Client/Durango/Durango_Minecraft.cpp +++ b/Minecraft.Client/Durango/Durango_Minecraft.cpp @@ -633,7 +633,7 @@ void oldWinMainTick() PIXEndNamedEvent(); // Any threading type things to deal with from the xui side? - app.HandleXuiActions(); + app.HandleUIActions(); // 4J-PB - Update the trial timer display if we are in the trial version if(!ProfileManager.IsFullVersion()) diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index a43f83f0..6387e9c5 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -1335,10 +1335,7 @@ void GameRenderer::renderLevel(float a, __int64 until) // 4J Stu - When rendering entities, in the end if the dragon is hurt or we have a lot of entities we can end up wrapping // our index into the temp Vec3 cache and overwrite the one that was storing the camera position // Fix for #77745 - TU9: Content: Gameplay: Items and mobs not belonging to end world are disappearing when Enderdragon is damaged. - Vec3 *cameraPosTemp = cameraEntity->getPos(a); - cameraPos->x = cameraPosTemp->x; - cameraPos->y = cameraPosTemp->y; - cameraPos->z = cameraPosTemp->z; + Vec3 *cameraPos = cameraEntity->getPos(a); levelRenderer->renderEntities(cameraPos, frustum, a); #ifdef __PSVITA__ // AP - make sure we're using the Alpha cut out effect for particles diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index ac8301f4..67832849 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -184,7 +184,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) } // 4J-PB - turn off the slot display if a xui menu is up, or if we're autosaving - bool bDisplayGui=!ui.GetMenuDisplayed(iPad) && !(app.GetXuiAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail); + bool bDisplayGui=!ui.GetMenuDisplayed(iPad) && !(app.GetUIAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail); // if tooltips are off, set the y offset to zero if(app.GetGameSettings(iPad,eGameSetting_Tooltips)==0 && bDisplayGui) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index a68d915f..70848a94 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1215,7 +1215,7 @@ void Minecraft::run_middle() { // if the pause menu is up for the primary player, don't autosave // If saving isn't disabled, and the main player has a app action running , or has any crafting or containers open, don't autosave - if(!StorageManager.GetSaveDisabled() && (app.GetXuiAction(ProfileManager.GetPrimaryPad())==eAppAction_Idle) ) + if(!StorageManager.GetSaveDisabled() && (app.GetUIAction(ProfileManager.GetPrimaryPad())==eAppAction_Idle) ) { if(!ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()) && !ui.IsIgnoreAutosaveMenuDisplayed(ProfileManager.GetPrimaryPad())) { @@ -1660,7 +1660,6 @@ void Minecraft::run_middle() if(i!=0) { InputManager.Tick(); - app.HandleButtonPresses(); } ticks++; @@ -1784,7 +1783,7 @@ void Minecraft::run_middle() RenderManager.InternalScreenCapture(); #endif // check to see if we need to capture a screenshot for the save game thumbnail - switch(app.GetXuiAction(i)) + switch(app.GetUIAction(i)) { case eAppAction_ExitWorldCapturedThumbnail: case eAppAction_SaveGameCapturedThumbnail: @@ -1813,7 +1812,7 @@ void Minecraft::run_middle() // Do we need to capture a screenshot for a social post? for( int i = 0; i < XUSER_MAX_COUNT; i++ ) { - if(app.GetXuiAction(i)==eAppAction_SocialPostScreenshot) + if(app.GetUIAction(i)==eAppAction_SocialPostScreenshot) { app.CaptureScreenshot(i); } @@ -3638,7 +3637,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) // printf("Input Detected!\n"); // // // see if we can react to this - // if(app.GetXuiAction(iPad)==eAppAction_Idle) + // if(app.GetUIAction(iPad)==eAppAction_Idle) // { // app.SetAction(iPad,eAppAction_DebugText,(LPVOID)wchInput); // } diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 1a35b6fd..f433bb6c 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -1344,16 +1344,16 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) } // Process delayed actions - eXuiServerAction eAction; + eUIServerAction eAction; LPVOID param; for(int i=0;isave(true, Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame)); + level->save(true, Minecraft::GetInstance()->progressRenderer, (eAction==eUIServerAction_AutoSaveGame)); players->broadcastAll( shared_ptr( new UpdateProgressPacket(33 + (j*33) ) ) ); } @@ -1426,11 +1426,11 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) { saveGameRules(); - levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame)); + levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, (eAction==eUIServerAction_AutoSaveGame)); } app.LeaveSaveNotificationSection(); break; - case eXuiServerAction_DropItem: + case eUIServerAction_DropItem: // Find the player, and drop the id at their feet { shared_ptr player = players->players.at(0); @@ -1438,7 +1438,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) player->drop( shared_ptr( new ItemInstance(id, 1, 0 ) ) ); } break; - case eXuiServerAction_SpawnMob: + case eUIServerAction_SpawnMob: { shared_ptr player = players->players.at(0); eINSTANCEOF factory = (eINSTANCEOF)((size_t)param); @@ -1448,38 +1448,38 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) player->level->addEntity(mob); } break; - case eXuiServerAction_PauseServer: + case eUIServerAction_PauseServer: m_isServerPaused = ( (size_t) param == TRUE ); if( m_isServerPaused ) { m_serverPausedEvent->Set(); } break; - case eXuiServerAction_ToggleRain: + case eUIServerAction_ToggleRain: { bool isRaining = levels[0]->getLevelData()->isRaining(); levels[0]->getLevelData()->setRaining(!isRaining); levels[0]->getLevelData()->setRainTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2); } break; - case eXuiServerAction_ToggleThunder: + case eUIServerAction_ToggleThunder: { bool isThundering = levels[0]->getLevelData()->isThundering(); levels[0]->getLevelData()->setThundering(!isThundering); levels[0]->getLevelData()->setThunderTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2); } break; - case eXuiServerAction_ServerSettingChanged_Gamertags: + case eUIServerAction_ServerSettingChanged_Gamertags: players->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_OPTIONS, app.GetGameHostOption(eGameHostOption_Gamertags)) ) ); break; - case eXuiServerAction_ServerSettingChanged_BedrockFog: + case eUIServerAction_ServerSettingChanged_BedrockFog: players->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, app.GetGameHostOption(eGameHostOption_All)) ) ); break; - case eXuiServerAction_ServerSettingChanged_Difficulty: + case eUIServerAction_ServerSettingChanged_Difficulty: players->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_DIFFICULTY, Minecraft::GetInstance()->options->difficulty) ) ); break; - case eXuiServerAction_ExportSchematic: + case eUIServerAction_ExportSchematic: #ifndef _CONTENT_PACKAGE app.EnterSaveNotificationSection(); @@ -1510,7 +1510,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) app.LeaveSaveNotificationSection(); #endif break; - case eXuiServerAction_SetCameraLocation: + case eUIServerAction_SetCameraLocation: #ifndef _CONTENT_PACKAGE { DebugSetCameraPosition *pos = (DebugSetCameraPosition *)param; @@ -1533,7 +1533,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) break; } - app.SetXuiServerAction(i,eXuiServerAction_Idle); + app.SetUIServerAction(i,eUIServerAction_Idle); } Sleep(1); diff --git a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp index 4bf5c6dc..6af48085 100644 --- a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp +++ b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp @@ -799,7 +799,7 @@ int main(int argc, const char *argv[] ) PIXEndNamedEvent(); // Any threading type things to deal with from the xui side? - app.HandleXuiActions(); + app.HandleUIActions(); // 4J-PB - Update the trial timer display if we are in the trial version if(!ProfileManager.IsFullVersion()) diff --git a/Minecraft.Client/PSVita/PSVita_Minecraft.cpp b/Minecraft.Client/PSVita/PSVita_Minecraft.cpp index d428e762..5299745d 100644 --- a/Minecraft.Client/PSVita/PSVita_Minecraft.cpp +++ b/Minecraft.Client/PSVita/PSVita_Minecraft.cpp @@ -490,13 +490,10 @@ int main() app.loadStringTable(); // Vita - //g_iScreenWidth = 720; - //g_iScreenHeight = 408; + //ui.init(720, 408); // Vita native - //g_iScreenWidth = 960; - //g_iScreenHeight = 544; - ui.init(720, 408); + ui.init(960, 544); //////////////// // Initialise // @@ -720,8 +717,6 @@ int main() } } - pMinecraft->soundEngine->playMusicTick(); - ui.tick(); ui.render(); @@ -783,7 +778,7 @@ int main() PIXEndNamedEvent(); // Any threading type things to deal with from the xui side? - app.HandleXuiActions(); + app.HandleUIActions(); // 4J-PB - Update the trial timer display if we are in the trial version if(!ProfileManager.IsFullVersion()) diff --git a/Minecraft.Client/PreStitchedTextureMap.cpp b/Minecraft.Client/PreStitchedTextureMap.cpp index 06e4c299..c9d074b2 100644 --- a/Minecraft.Client/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/PreStitchedTextureMap.cpp @@ -228,7 +228,7 @@ void PreStitchedTextureMap::makeTextureAnimated(TexturePack *texturePack, Stitch if(first->getWidth() != tex->getWidth() || first->getHeight() != tex->getHeight()) { app.DebugPrintf("%ls - first w - %d, h - %d, tex w - %d, h - %d\n",textureFileName.c_str(),first->getWidth(),tex->getWidth(),first->getHeight(),tex->getHeight()); - __debugbreak(); + //__debugbreak(); } #endif diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index cbf55574..cc910a5c 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -888,7 +888,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, ui.CheckMenuDisplayed(); // Any threading type things to deal with from the xui side? - app.HandleXuiActions(); + app.HandleUIActions(); isF11Pressed = (GetAsyncKeyState(VK_F11) & 0x8000) != 0; diff --git a/Minecraft.Client/Windows64/Windows64_UIController.cpp b/Minecraft.Client/Windows64/Windows64_UIController.cpp index 19e23261..02294eab 100644 --- a/Minecraft.Client/Windows64/Windows64_UIController.cpp +++ b/Minecraft.Client/Windows64/Windows64_UIController.cpp @@ -95,12 +95,37 @@ void ConsoleUIController::render() #endif } -//str1k3r - update gdraw resolution -void ConsoleUIController::updateResolution(S32 w, S32 h) -{ -#ifdef _ENABLEIGGY - gdraw_D3D11_SetRendertargetSize(w, h); -#endif +//str1k3r - since we have to update the resolution in 3 spots this just updates them all +void ConsoleUIController::updateResolution(int w, int h) +{ +#ifdef _ENABLEIGGY + S32 currentWidth = ui.getScreenWidth(); + S32 currentHeight = ui.getScreenHeight(); + + ui.setScreenWidth(w); + ui.setScreenHeight(h); + gdraw_D3D11_SetRendertargetSize(w, h); + /*gdraw_D3D11_setViewport_4J(); + + if(w != currentWidth || h != currentHeight) + { + + // PIEBOT: we buy junk code + int argumentRes = (w >= 1920.0f) ? 1920 : + (w >= 1280) ? 1280 : + (w >= 960.0f) ? 960 : + 480; + + int currentRes = (currentWidth >= 1920.0f) ? 1920 : + (currentWidth >= 1280.0f) ? 1280 : + (currentWidth >= 960.0f) ? 960 : + 480; + + if (argumentRes != currentRes) + ui.ReloadSkins(); + }*/ +#endif + RenderManager.setResolution(w, h); } void ConsoleUIController::beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion) diff --git a/Minecraft.Client/Windows64/Windows64_UIController.h b/Minecraft.Client/Windows64/Windows64_UIController.h index a16652d2..bcda4056 100644 --- a/Minecraft.Client/Windows64/Windows64_UIController.h +++ b/Minecraft.Client/Windows64/Windows64_UIController.h @@ -12,7 +12,7 @@ public: void render(); //str1k3r - updateResolution is a Windows64 exlusive thingy :3 - void updateResolution(S32 w, S32 h); + void updateResolution(int w, int h); void beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion); virtual CustomDrawData *setupCustomDraw(UIScene *scene, IggyCustomDrawCallbackRegion *region); virtual CustomDrawData *calculateCustomDraw(IggyCustomDrawCallbackRegion *region); diff --git a/Minecraft.Client/Xbox/Xbox_Minecraft.cpp b/Minecraft.Client/Xbox/Xbox_Minecraft.cpp index 364854d8..9e166a26 100644 --- a/Minecraft.Client/Xbox/Xbox_Minecraft.cpp +++ b/Minecraft.Client/Xbox/Xbox_Minecraft.cpp @@ -718,8 +718,6 @@ int __cdecl main() } #endif - app.HandleButtonPresses(); - // store the minecraft renderstates, and re-set them after the xui render GetRenderAndSamplerStates(pDevice,RenderStateA,SamplerStateA); @@ -821,7 +819,7 @@ int __cdecl main() hr = XuiTimersRun(); // Any threading type things to deal with from the xui side? - app.HandleXuiActions(); + app.HandleUIActions(); PIXEndNamedEvent(); // 4J-PB - Update the trial timer display if we are in the trial version diff --git a/Minecraft.World/EnderEyeItem.cpp b/Minecraft.World/EnderEyeItem.cpp index 5112adf7..b6ccd3dc 100644 --- a/Minecraft.World/EnderEyeItem.cpp +++ b/Minecraft.World/EnderEyeItem.cpp @@ -167,7 +167,7 @@ bool EnderEyeItem::TestUse(shared_ptr itemInstance, Level *level, // // app.DebugPrintf("=== FOUND stronghold in terrain features list\n"); // -// app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_StrongholdPosition); +// app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_StrongholdPosition); // } // else {