the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 145 lines 3.5 kB view raw
1#include "stdafx.h" 2#include "UI.h" 3#include "UIScene_EULA.h" 4#include "..\..\..\Minecraft.World\StringHelpers.h" 5 6UIScene_EULA::UIScene_EULA(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) 7{ 8 // Setup all the Iggy references we need for this scene 9 initialiseMovie(); 10 11 parentLayer->addComponent(iPad,eUIComponent_Panorama); 12 parentLayer->addComponent(iPad,eUIComponent_Logo); 13 14 m_buttonConfirm.init(app.GetString(IDS_TOOLTIPS_ACCEPT),eControl_Confirm); 15 16#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) 17 wstring EULA = app.GetString(IDS_EULA); 18 EULA.append(L"\r\n"); 19 20#if defined(__PS3__) 21 if(app.IsEuropeanSKU()) 22 { 23 EULA.append(app.GetString(IDS_EULA_SCEE)); 24 // if it's the BD build 25 if(StorageManager.GetBootTypeDisc()) 26 { 27 EULA.append(app.GetString(IDS_EULA_SCEE_BD)); 28 } 29 } 30 else if(app.IsAmericanSKU()) 31 { 32 EULA.append(app.GetString(IDS_EULA_SCEA)); 33 } 34#elif defined __ORBIS__ 35 if(app.IsEuropeanSKU()) 36 { 37 EULA.append(app.GetString(IDS_EULA_SCEE)); 38 // 4J-PB - we can't tell if it's a disc or digital version, so let's show this anyway 39 EULA.append(app.GetString(IDS_EULA_SCEE_BD)); 40 } 41 else if(app.IsAmericanSKU()) 42 { 43 EULA.append(app.GetString(IDS_EULA_SCEA)); 44 } 45#endif 46#else 47 wstring EULA = L""; 48#endif 49 50 vector<wstring> paragraphs; 51 int lastIndex = 0; 52 for ( int index = EULA.find(L"\r\n", lastIndex, 2); 53 index != wstring::npos; 54 index = EULA.find(L"\r\n", lastIndex, 2) 55 ) 56 { 57 paragraphs.push_back( EULA.substr(lastIndex, index-lastIndex) + L" " ); 58 lastIndex = index + 2; 59 } 60 paragraphs.push_back( EULA.substr( lastIndex, EULA.length() - lastIndex ) ); 61 62 for(unsigned int i = 0; i < paragraphs.size(); ++i) 63 { 64 m_labelDescription.addText(paragraphs[i],i == (paragraphs.size() - 1) ); 65 } 66 67 // 4J-PB - If we have a signed in user connected, let's get the DLC now 68 for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) 69 { 70 if( (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ) 71 { 72 if(!app.DLCInstallProcessCompleted() && !app.DLCInstallPending()) 73 { 74 app.StartInstallDLCProcess(i); 75 break; 76 } 77 } 78 } 79 80 m_bIgnoreInput=false; 81 82 //ui.setFontCachingCalculationBuffer(20000); 83 84#ifdef __PSVITA__ 85 ui.TouchBoxRebuild(this); 86#endif 87} 88 89UIScene_EULA::~UIScene_EULA() 90{ 91 m_parentLayer->removeComponent(eUIComponent_Panorama); 92 m_parentLayer->removeComponent(eUIComponent_Logo); 93} 94 95wstring UIScene_EULA::getMoviePath() 96{ 97 return L"EULA"; 98} 99 100void UIScene_EULA::updateTooltips() 101{ 102 ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT ); 103} 104 105void UIScene_EULA::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) 106{ 107 if(m_bIgnoreInput) return; 108 109#ifdef __ORBIS__ 110 // ignore all players except player 0 - it's their profile that is currently being used 111 if(iPad!=0) return; 112#endif 113 114 ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released); 115 116 switch(key) 117 { 118#ifdef __ORBIS__ 119 case ACTION_MENU_TOUCHPAD_PRESS: 120#endif 121 case ACTION_MENU_OK: 122 case ACTION_MENU_DOWN: 123 case ACTION_MENU_UP: 124 case ACTION_MENU_PAGEUP: 125 case ACTION_MENU_PAGEDOWN: 126 case ACTION_MENU_OTHER_STICK_DOWN: 127 case ACTION_MENU_OTHER_STICK_UP: 128 sendInputToMovie(key, repeat, pressed, released); 129 break; 130 } 131} 132 133void UIScene_EULA::handlePress(F64 controlId, F64 childId) 134{ 135 switch((int)controlId) 136 { 137 case eControl_Confirm: 138 //CD - Added for audio 139 ui.PlayUISFX(eSFX_Press); 140 app.SetGameSettings(0,eGameSetting_PS3_EULA_Read,1); 141 ui.NavigateToScene(0,eUIScene_SaveMessage); 142 ui.setFontCachingCalculationBuffer(-1); 143 break; 144 }; 145}