diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a43994725008e35fceb984d5549df9c8cea470.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp')
| -rw-r--r-- | Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp b/Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp new file mode 100644 index 00000000..998679ca --- /dev/null +++ b/Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp @@ -0,0 +1,121 @@ +#include "stdafx.h" +#include "UI.h" +#include "UIScene_NewUpdateMessage.h" +#include "..\..\..\Minecraft.World\StringHelpers.h" + +UIScene_NewUpdateMessage::UIScene_NewUpdateMessage(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) +{ + // Setup all the Iggy references we need for this scene + initialiseMovie(); + + parentLayer->addComponent(iPad,eUIComponent_Panorama); + parentLayer->addComponent(iPad,eUIComponent_Logo); + + m_buttonConfirm.init(app.GetString(IDS_TOOLTIPS_ACCEPT),eControl_Confirm); + + wstring message = app.GetString(IDS_TITLEUPDATE); + message.append(L"\r\n"); + + message=app.FormatHTMLString(m_iPad,message); + + vector<wstring> paragraphs; + int lastIndex = 0; + for ( int index = message.find(L"\r\n", lastIndex, 2); + index != wstring::npos; + index = message.find(L"\r\n", lastIndex, 2) + ) + { + paragraphs.push_back( message.substr(lastIndex, index-lastIndex) + L" " ); + lastIndex = index + 2; + } + paragraphs.push_back( message.substr( lastIndex, message.length() - lastIndex ) ); + + for(unsigned int i = 0; i < paragraphs.size(); ++i) + { + m_labelDescription.addText(paragraphs[i],i == (paragraphs.size() - 1) ); + } + + m_bIgnoreInput=false; + +#ifdef __PSVITA__ + ui.TouchBoxRebuild(this); +#endif +} + +UIScene_NewUpdateMessage::~UIScene_NewUpdateMessage() +{ + m_parentLayer->removeComponent(eUIComponent_Panorama); + m_parentLayer->removeComponent(eUIComponent_Logo); +} + +wstring UIScene_NewUpdateMessage::getMoviePath() +{ + return L"EULA"; +} + +void UIScene_NewUpdateMessage::updateTooltips() +{ + ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT ); +} + +void UIScene_NewUpdateMessage::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) +{ + if(m_bIgnoreInput) return; + +#ifdef __ORBIS__ + // ignore all players except player 0 - it's their profile that is currently being used + if(iPad!=0) return; +#endif + + ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released); + + switch(key) + { + case ACTION_MENU_B: + { + int iVal=app.GetGameSettings(m_iPad,eGameSetting_DisplayUpdateMessage); + if(iVal>0) iVal--; + + // set the update text as seen, by clearing the flag + app.SetGameSettings(m_iPad,eGameSetting_DisplayUpdateMessage,iVal); + // force a profile write + app.CheckGameSettingsChanged(true,m_iPad); + ui.NavigateBack(m_iPad); + } + break; +#ifdef __ORBIS__ + case ACTION_MENU_TOUCHPAD_PRESS: +#endif + case ACTION_MENU_OK: + case ACTION_MENU_DOWN: + case ACTION_MENU_UP: + case ACTION_MENU_PAGEUP: + case ACTION_MENU_PAGEDOWN: + case ACTION_MENU_OTHER_STICK_DOWN: + case ACTION_MENU_OTHER_STICK_UP: + sendInputToMovie(key, repeat, pressed, released); + break; + } +} + +void UIScene_NewUpdateMessage::handlePress(F64 controlId, F64 childId) +{ + switch((int)controlId) + { + case eControl_Confirm: + { + //CD - Added for audio + ui.PlayUISFX(eSFX_Press); + + int iVal=app.GetGameSettings(m_iPad,eGameSetting_DisplayUpdateMessage); + if(iVal>0) iVal--; + + // set the update text as seen, by clearing the flag + app.SetGameSettings(m_iPad,eGameSetting_DisplayUpdateMessage,iVal); + // force a profile write + app.CheckGameSettingsChanged(true,m_iPad); + ui.NavigateBack(m_iPad); + } + break; + }; +} |
