diff --git a/CMakeLists.txt b/CMakeLists.txt index 5623ed4a..7198d1dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,6 +239,10 @@ set(_item_map_inputs "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/Item.h" ) +if(CMAKE_CROSSCOMPILING AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + string(REPLACE ";" "\\;" _item_map_inputs "${_item_map_inputs}") +endif() + #neo: added ItemNameMap generation add_custom_command( OUTPUT "${CMAKE_BINARY_DIR}/generated/ItemNameMap.h" diff --git a/Minecraft.Client/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h index bfc61bcf..c2ef72c0 100644 --- a/Minecraft.Client/Common/App_enums.h +++ b/Minecraft.Client/Common/App_enums.h @@ -186,6 +186,7 @@ enum eGameSetting eGameSetting_ClassicCrafting, eGameSetting_CaveSounds, eGameSetting_MinecartSounds, + eGameSetting_ControlType, // if enabled hides the save size bar in loadcreatejoinmenu (load tab) eGameSetting_HideSaveSizeBar, }; diff --git a/Minecraft.Client/Common/App_structs.h b/Minecraft.Client/Common/App_structs.h index 6a6e0354..2d54135e 100644 --- a/Minecraft.Client/Common/App_structs.h +++ b/Minecraft.Client/Common/App_structs.h @@ -85,6 +85,7 @@ typedef struct // 0x00000200 - eGameSetting_CustomSkinAnim - on // TU9 // 0x00000400 - eGameSetting_DeathMessages - on + // 0x00070000 - eGameSetting_ControlType - 0..6 // Adding another bitmask to store "special" completion tasks for the tutorial unsigned int uiSpecialTutorialBitmask; diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 06d5239f..e2cb542d 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -2138,6 +2138,14 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV GameSettingsA[iPad]->bSettingsChanged=true; } break; + case eGameSetting_ControlType: + if((GameSettingsA[iPad]->uiBitmaskValues & 0x00070000) != ((ucVal & 0x07) << 16)) + { + GameSettingsA[iPad]->uiBitmaskValues &= ~0x00070000; + GameSettingsA[iPad]->uiBitmaskValues |= (ucVal & 0x07) << 16; + GameSettingsA[iPad]->bSettingsChanged = true; + } + break; case eGameSetting_SplitScreenVertical: if((GameSettingsA[iPad]->usBitmaskValues&0x0100)!=((ucVal&0x01)<<8)) { @@ -2724,6 +2732,8 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) case eGameSetting_ExclusiveFullscreen: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_EXCLUSIVEFULLSCREEN)>>25; + case eGameSetting_ControlType: + return (GameSettingsA[iPad]->uiBitmaskValues & 0x00070000) >> 16; } return 0; diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/PS4HD.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/PS4HD.swf new file mode 100644 index 00000000..2d854158 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/PS4HD.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf new file mode 100644 index 00000000..cd0618b3 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xbox360HD.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xbox360HD.swf new file mode 100644 index 00000000..c18d4ed6 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xbox360HD.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOne.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOne.swf new file mode 100644 index 00000000..464cb346 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOne.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOneHD.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOneHD.swf new file mode 100644 index 00000000..464cb346 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOneHD.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/PS3.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/PS3.swf new file mode 100644 index 00000000..4316c234 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/PS3.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/PS4.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/PS4.swf new file mode 100644 index 00000000..f7c64ef0 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/PS4.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/WiiU.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/WiiU.swf new file mode 100644 index 00000000..11bf53e7 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/WiiU.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/vita.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/vita.swf new file mode 100644 index 00000000..29b08e74 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/vita.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/wiiU.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/wiiU.swf new file mode 100644 index 00000000..11bf53e7 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/wiiU.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf new file mode 100644 index 00000000..8f05344e Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows_bak.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows_bak.swf new file mode 100644 index 00000000..8f05344e Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows_bak.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/xbox360.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/xbox360.swf new file mode 100644 index 00000000..9389645d Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/xbox360.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/xboxOne.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/xboxOne.swf new file mode 100644 index 00000000..6bcdbb6e Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/xboxOne.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu1080.swf index 3e00f59a..2ac01d56 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu1080.swf and b/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu1080.swf differ diff --git a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp index 8a45ee02..5de77e0a 100644 --- a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp +++ b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp @@ -51,6 +51,7 @@ bool ChoiceTask::isCompleted() if(ui.GetMenuDisplayed(tutorial->getPad())) { // If a menu is displayed, then we use the handleUIInput to complete the task + return false; } else { @@ -87,6 +88,8 @@ bool ChoiceTask::isCompleted() } return m_bConfirmMappingComplete || m_bCancelMappingComplete; } + + return false; } eTutorial_CompletionAction ChoiceTask::getCompletionAction() diff --git a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp index 4f60de5f..18852873 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp @@ -5,6 +5,10 @@ UIComponent_Tooltips::UIComponent_Tooltips(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) { + m_lastResizeAwareScreenW = -1.0; + m_lastResizeAwareScreenH = -1.0; + m_lastResizeAwareNudgeActive = false; + for(int i=0;i 720.0f) || (screenW > 1280.0f); + const bool menuContext = ui.GetMenuDisplayed(m_iPad); + if(getSceneResolution() == eSceneResolution_720 && largerThan720Window && menuContext) + { + const F64 widthScale = screenW / 1920.0f; + const F64 heightScale = screenH / 1080.0f; + const F64 nudgeScale = (widthScale > heightScale) ? widthScale : heightScale; + const F64 nudgeX = 31.0 * nudgeScale; + const F64 nudgeY = 16.5 * nudgeScale; + const F64 spacingNudgeX = 20.0 * nudgeScale; + safeLeft = (safeLeft > nudgeX) ? (safeLeft - nudgeX) : 0.0; + safeBottom = (safeBottom > nudgeY) ? (safeBottom - nudgeY) : 0.0; + // remind me to work on the 'margin' nudge + // they dont seem very effective at the moment + safeRight += spacingNudgeX; + } + } +#endif + break; } setSafeZone(safeTop, safeBottom, safeLeft, safeRight); @@ -141,6 +169,37 @@ void UIComponent_Tooltips::tick() { UIScene::tick(); +#ifdef _WINDOWS64 + if(!m_bSplitscreen && !ui.IsReloadingSkin()) + { + const F64 screenW = ui.getScreenWidth(); + const F64 screenH = ui.getScreenHeight(); + const bool largerThan720Window = (screenH > 720.0f) || (screenW > 1280.0f); + const bool nudgeActive = (getSceneResolution() == eSceneResolution_720) && largerThan720Window && ui.GetMenuDisplayed(m_iPad); + + F64 dW = screenW - m_lastResizeAwareScreenW; + if(dW < 0.0) dW = -dW; + F64 dH = screenH - m_lastResizeAwareScreenH; + if(dH < 0.0) dH = -dH; + + const F64 baseW = (m_lastResizeAwareScreenW > 1.0) ? m_lastResizeAwareScreenW : 1.0; + const F64 baseH = (m_lastResizeAwareScreenH > 1.0) ? m_lastResizeAwareScreenH : 1.0; + const bool significantResize = + (m_lastResizeAwareScreenW < 0.0) || (m_lastResizeAwareScreenH < 0.0) || + (dW >= 20.0) || (dH >= 20.0) || + ((dW / baseW) >= 0.01) || ((dH / baseH) >= 0.01); + + if(significantResize || (nudgeActive != m_lastResizeAwareNudgeActive)) + { + updateSafeZone(); + _Relayout(); + m_lastResizeAwareScreenW = screenW; + m_lastResizeAwareScreenH = screenH; + m_lastResizeAwareNudgeActive = nudgeActive; + } + } +#endif + // set the opacity of the tooltip items unsigned char ucAlpha=app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_InterfaceOpacity); float fVal; @@ -368,6 +427,10 @@ void UIComponent_Tooltips::_Relayout() IggyDataValue result; IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcUpdateLayout, 0 , nullptr ); +#ifdef _WINDOWS64 + doHorizontalResizeCheck(); +#endif + #ifdef __PSVITA__ // rebuild touchboxes ui.TouchBoxRebuild(this); diff --git a/Minecraft.Client/Common/UI/UIComponent_Tooltips.h b/Minecraft.Client/Common/UI/UIComponent_Tooltips.h index f8db9439..db5e769b 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Tooltips.h +++ b/Minecraft.Client/Common/UI/UIComponent_Tooltips.h @@ -7,6 +7,12 @@ class UIComponent_Tooltips : public UIScene private: bool m_bSplitscreen; +#ifdef _WINDOWS64 + F64 m_lastResizeAwareScreenW; + F64 m_lastResizeAwareScreenH; + bool m_lastResizeAwareNudgeActive; +#endif + protected: typedef struct _TooltipValues { diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 86161e97..2e19cdfd 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -186,6 +186,50 @@ static void RADLINK DeallocateFunction ( void * alloc_callback_user_data , void LeaveCriticalSection(&controller->m_Allocatorlock); } +#ifdef _WINDOWS64 +static wstring GetControlTypeSkinPath(int controlType, bool hd) +{ + const wchar_t *skinName = L"PS4"; + + switch(controlType) + { + case 0: + skinName = L"windows"; + break; + case 1: + skinName = L"xboxOne"; + break; + case 2: + skinName = L"xbox360"; + break; + case 3: + skinName = L"vita"; + break; + case 4: + skinName = L"PS3"; + break; + case 5: + skinName = L"PS4"; + break; + case 6: + skinName = L"WiiU"; + break; + case 7: + skinName = L"Switch"; + break; + default: + break; + } + + if(hd) + { + return wstring(L"Graphics\\ControlType\\HD\\") + skinName + L"HD.swf"; + } + + return wstring(L"Graphics\\ControlType\\") + skinName + L".swf"; +} +#endif + UIController::UIController() { m_uiDebugConsole = nullptr; @@ -582,10 +626,26 @@ void UIController::loadSkins() m_iggyLibraries[eLibrary_Default] = loadSkin(L"skin.swf", L"skin.swf"); #elif defined _WINDOWS64 - // HD platform skin — required by skinHD*.swf (1080p scene SWFs) - m_iggyLibraries[eLibrary_Platform] = loadSkin(L"skinHDWin.swf", L"platformskinHD.swf"); - // Non-HD platform skin — required by skin*.swf (720p/480p scene SWFs) - m_iggyLibraries[eLibraryFallback_Platform] = loadSkin(L"skinWin.swf", L"platformskin.swf"); + // emulate control type skins + const int controlType = app.GetGameSettings(ProfileManager.GetPrimaryPad(), eGameSetting_ControlType); + wstring platformSkinHD = GetControlTypeSkinPath(controlType, true); + wstring platformSkin = GetControlTypeSkinPath(controlType, false); + + m_iggyLibraries[eLibrary_Platform] = loadSkin(platformSkinHD, L"platformskinHD.swf"); + if(m_iggyLibraries[eLibrary_Platform] == IGGY_INVALID_LIBRARY) + { + m_iggyLibraries[eLibrary_Platform] = loadSkin(platformSkin, L"platformskinHD.swf"); + } + + m_iggyLibraries[eLibraryFallback_Platform] = loadSkin(platformSkin, L"platformskin.swf"); + if(m_iggyLibraries[eLibraryFallback_Platform] == IGGY_INVALID_LIBRARY) + { + m_iggyLibraries[eLibraryFallback_Platform] = loadSkin(L"Graphics\\ControlType\\windows.swf", L"platformskin.swf"); + } + if(m_iggyLibraries[eLibrary_Platform] == IGGY_INVALID_LIBRARY) + { + m_iggyLibraries[eLibrary_Platform] = loadSkin(L"Graphics\\ControlType\\HD\\windowsHD.swf", L"platformskin.swf"); + } // Non-HD skin set (720p/480p scenes import these) m_iggyLibraries[eLibraryFallback_GraphicsDefault] = loadSkin(L"skinGraphics.swf", L"skinGraphics.swf"); @@ -2643,6 +2703,11 @@ void UIController::DisplayGamertag(unsigned int iPad, bool show) void UIController::SetSelectedItem(unsigned int iPad, const wstring &name) { + // control type settings are already disabled whilst in-game + // this just serves as an additional check just incase the removal of the option doesnt work for some reason + if(IsReloadingSkin()) + return; + EUIGroup group; if( app.GetGameStarted() ) @@ -2656,7 +2721,12 @@ void UIController::SetSelectedItem(unsigned int iPad, const wstring &name) group = eUIGroup_Fullscreen; } bool handled = false; - if(m_groups[static_cast(group)]->getHUD()) m_groups[static_cast(group)]->getHUD()->SetSelectedLabel(name); + + auto pHUD = m_groups[static_cast(group)]->getHUD(); + if(pHUD && pHUD->hasMovie()) + { + pHUD->SetSelectedLabel(name); + } } void UIController::UpdateSelectedItemPos(unsigned int iPad) diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index e696b1ab..58934161 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -294,7 +294,16 @@ void UIScene::loadMovie() moviePath.append(L"Vita.swf"); m_loadedResolution = eSceneResolution_Vita; #elif defined _WINDOWS64 - if(ui.getScreenHeight() > 720.0f) + int primaryPad = ProfileManager.GetPrimaryPad(); + if(primaryPad < 0 || primaryPad >= XUSER_MAX_COUNT) + primaryPad = 0; + const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType); + const bool force720ForControlType = (controlType == 3 || controlType == 4 || controlType == 6); + // tutorial popups + HUD elements have inaccuracies + crashes that we need to fix here + const bool isTutorialPopupMovie = (moviePath.find(L"TutorialPopup") == 0); + const bool isHUDMovie = (moviePath.find(L"HUD") == 0); + const bool use1080 = (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie || isHUDMovie); + if(use1080) { moviePath.append(L"1080.swf"); m_loadedResolution = eSceneResolution_1080; diff --git a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp index fe0add7d..9031cb92 100644 --- a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp @@ -6,7 +6,7 @@ #include "..\..\..\Minecraft.World\net.minecraft.world.item.h" #include "..\..\..\Minecraft.World\net.minecraft.stats.h" #include "..\..\..\Minecraft.World\net.minecraft.world.effect.h" -#include "..\..\MultiplayerLocalPlayer.h" +#include "..\..\MultiPlayerLocalPlayer.h" #include "..\..\Minecraft.h" #include "..\..\Options.h" #include "..\..\EntityRenderDispatcher.h" diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp index e56004a9..e7b5bea0 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp @@ -224,7 +224,6 @@ void UIScene_SettingsOptionsMenu::handleInput(int iPad, int key, bool repeat, bo if(pressed) { setGameSettings(); - navigateBack(); } break; case ACTION_MENU_OK: diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp index 93ce6cf0..c418ff9b 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp @@ -3,10 +3,23 @@ #include "UI.h" #include "UIScene_SettingsUIMenu.h" +int UIScene_SettingsUIMenu::m_iControlTypeSettingA[8]= +{ + IDS_CONTROLTYPE_KBM, + IDS_CONTROLTYPE_XBOXONE, + IDS_CONTROLTYPE_XBOX360, + IDS_CONTROLTYPE_VITA, + IDS_CONTROLTYPE_PLAYSTATION3, + IDS_CONTROLTYPE_PLAYSTATION4, + IDS_CONTROLTYPE_WIIU, + IDS_CONTROLTYPE_SWITCH, +}; + UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) { // Setup all the Iggy references we need for this scene initialiseMovie(); + m_bControlTypeChanged = false; m_bNotInGame=(Minecraft::GetInstance()->level==nullptr); @@ -20,6 +33,7 @@ UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void *initData, UILayer m_checkboxShowSplitscreenGamertags.init(app.GetString(IDS_CHECKBOX_DISPLAY_SPLITSCREENGAMERTAGS),eControl_ShowSplitscreenGamertags,(app.GetGameSettings(m_iPad,eGameSetting_DisplaySplitscreenGamertags)!=0)); m_checkboxShowClassicCrafting.init(app.GetString(IDS_CHECKBOX_CLASSICCRAFTING), eControl_ShowClassicCrafting, (app.GetGameSettings(m_iPad, eGameSetting_ClassicCrafting) != 0)); // label is hardcoded for now (no IDS_* yet) + m_checkboxHideLoadCreateJoinSaveSizeBar.init(L"Hide world disk space bar", eControl_HideSaveSizeBar, (app.GetGameSettings(m_iPad, eGameSetting_HideSaveSizeBar) != 0)); WCHAR TempString[256]; @@ -32,9 +46,13 @@ UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void *initData, UILayer swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); m_sliderUISize.init(TempString,eControl_UISize,1,3,app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); + swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); m_sliderUISizeSplitscreen.init(TempString,eControl_UISizeSplitscreen,1,3,app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_CONTROLTYPE ),app.GetString(m_iControlTypeSettingA[app.GetGameSettings(m_iPad,eGameSetting_ControlType)])); + m_sliderControlType.init(TempString,eControl_ControlType,0,7,app.GetGameSettings(m_iPad,eGameSetting_ControlType)); + doHorizontalResizeCheck(); bool bInGame=(Minecraft::GetInstance()->level!=nullptr); @@ -55,6 +73,7 @@ UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void *initData, UILayer // hide things we don't want the splitscreen player changing removeControl(&m_checkboxShowSplitscreenGamertags, true); } + removeControl(&m_sliderControlType, true); } if(bRemoveInGameGamertags) @@ -118,6 +137,8 @@ void UIScene_SettingsUIMenu::handleInput(int iPad, int key, bool repeat, bool pr case ACTION_MENU_CANCEL: if(pressed) { + const bool reloadControlTypeSkin = m_bControlTypeChanged; + // check the checkboxes app.SetGameSettings(m_iPad,eGameSetting_DisplayHUD,m_checkboxDisplayHUD.IsChecked()?1:0); app.SetGameSettings(m_iPad,eGameSetting_DisplayHand,m_checkboxDisplayHand.IsChecked()?1:0); @@ -129,6 +150,10 @@ void UIScene_SettingsUIMenu::handleInput(int iPad, int key, bool repeat, bool pr app.SetGameSettings(m_iPad, eGameSetting_HideSaveSizeBar, m_checkboxHideLoadCreateJoinSaveSizeBar.IsChecked() ? 1 : 0); navigateBack(); + if(reloadControlTypeSkin) + { + ui.ReloadSkin(); + } } break; case ACTION_MENU_OK: @@ -197,6 +222,15 @@ void UIScene_SettingsUIMenu::handleSliderMove(F64 sliderId, F64 currentValue) ui.UpdateSelectedItemPos(m_iPad); } + break; + case eControl_ControlType: + m_sliderControlType.handleSliderMove(value); + app.SetGameSettings(m_iPad,eGameSetting_ControlType,value); + m_bControlTypeChanged = true; + + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_CONTROLTYPE ),app.GetString(m_iControlTypeSettingA[value])); + m_sliderControlType.setLabel(TempString); + break; } } diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h index 2dd91b22..31623249 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h @@ -4,6 +4,8 @@ class UIScene_SettingsUIMenu : public UIScene { +protected: + static int m_iControlTypeSettingA[8]; private: enum EControls { @@ -18,11 +20,13 @@ private: eControl_ShowClassicCrafting, eControl_HideSaveSizeBar, eControl_UISize, - eControl_UISizeSplitscreen + eControl_UISizeSplitscreen, + eControl_ControlType, }; UIControl_CheckBox m_checkboxDisplayHUD, m_checkboxDisplayHand, m_checkboxDisplayAnimatedCharacter, m_checkboxShowSplitscreenGamertags, m_checkboxShowClassicCrafting, m_checkboxShowTooltips, m_checkboxInGameGamertags, m_checkboxHideLoadCreateJoinSaveSizeBar; // Checkboxes - UIControl_Slider m_sliderInterfaceOpacity, m_sliderSensitivityInMenu, m_sliderUISize, m_sliderUISizeSplitscreen; // Sliders + UIControl_Slider m_sliderInterfaceOpacity, m_sliderSensitivityInMenu, m_sliderUISize, m_sliderUISizeSplitscreen, m_sliderControlType; // Sliders + bool m_bControlTypeChanged; UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) UI_MAP_ELEMENT( m_checkboxDisplayHUD, "DisplayHUD") UI_MAP_ELEMENT( m_checkboxDisplayHand, "DisplayHand") @@ -39,6 +43,7 @@ private: UI_MAP_ELEMENT( m_sliderUISize, "UISize") UI_MAP_ELEMENT( m_sliderUISizeSplitscreen, "UISizeSplitscreen") + UI_MAP_ELEMENT( m_sliderControlType, "ControlType") UI_END_MAP_ELEMENTS_AND_NAMES() bool m_bNotInGame; diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 48af6508..c756043b 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -1504,7 +1504,7 @@ static Minecraft* InitialiseMinecraftRuntime() return nullptr; app.InitGameSettings(); - app.InitialiseTips(); + app.InitialiseTips(); return pMinecraft; } @@ -1760,6 +1760,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } g_bResizeReady = true; + ui.ReloadSkin(); + //app.TemporaryCreateGameStart(); //Sleep(10000); diff --git a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index f3841e62..722098a4 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -6104,6 +6104,10 @@ Would you like to unlock the full game now? Difficulty + + Control Type + + Music @@ -6140,6 +6144,38 @@ Would you like to unlock the full game now? Hard + + Keyboard & Mouse + + + + Xbox One + + + + Xbox 360 + + + + PlayStation Vita + + + + PlayStation 3 + + + + PlayStation 4 + + + + Wii U + + + + Nintendo Switch + + In this mode, the player regains health over time, and there are no enemies in the environment. diff --git a/build-linux.sh b/build-linux.sh index d5357932..2da391a7 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -78,7 +78,7 @@ do_cmake_configure() { local winsdk="$XWIN_CACHE/splat" local toolchain toolchain="$(write_toolchain)" - local c_flags="/MT -Wno-non-pod-varargs -fms-compatibility -fms-extensions --target=x86_64-pc-windows-msvc \ + local c_flags="/MT -w -Wno-non-pod-varargs -fms-compatibility -fms-extensions --target=x86_64-pc-windows-msvc \ -imsvc $winsdk/crt/include \ -imsvc $winsdk/sdk/include/ucrt \ -imsvc $winsdk/sdk/include/um \