the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 153 lines 4.3 kB view raw
1// Minecraft.cpp : Defines the entry point for the application. 2// 3 4#include "stdafx.h" 5 6#include <assert.h> 7#include "..\XUI\XUI_Intro.h" 8 9#define TIMELINE_NORMAL 0 10#define TIMELINE_ESRBFADE 1 11#define TIMELINE_LOGOSFADE 2 12 13//---------------------------------------------------------------------------------- 14// Performs initialization tasks - retrieves controls. 15//---------------------------------------------------------------------------------- 16HRESULT CScene_Intro::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) 17{ 18 MapChildControls(); 19 20 // We may need to display a ratings image for a while at the start... 21 m_bWantsToSkip=false; 22 m_iTimeline=TIMELINE_NORMAL; 23 24 // 4J-PB - We can't check to see if the version is a trial or full game until after 5 seconds... 25 // The reason that this is a requirement is that there is a problem that occasionally happens *only* in the production 26 // environment (not partnernet or cert), where if you don�t wait 5 seconds, you can run into an issue where the timing 27 // of the call fails and the game is always identified as being the trial version even if you have upgraded to the full version. 28 // -Joe Dunavant 29 30 // start a timer for the required 5 seconds, plus an extra bit to allow the lib timer to enable the xcontent license check call 31#ifdef _CONTENT_PACKAGE 32 m_bSkippable=false; 33 XuiSetTimer( m_hObj,0,5200); 34#else 35 m_bSkippable=true; 36#endif 37 38 return S_OK; 39} 40 41//---------------------------------------------------------------------------------- 42// Handler for the button press message. 43//---------------------------------------------------------------------------------- 44HRESULT CScene_Intro::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) 45{ 46 // This assumes all buttons can only be pressed with the A button 47 ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); 48 49 50 return S_OK; 51} 52 53HRESULT CScene_Intro::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) 54{ 55 ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); 56 57 static bool bPressed=false; 58 59 if(bPressed==false) 60 { 61 if(m_bSkippable) 62 { 63 // stop the animation 64 XuiElementStopTimeline(m_hObj,TRUE); 65 app.NavigateToScene(XUSER_INDEX_ANY,eUIScene_SaveMessage); 66 app.SetIntroRunning(false); 67 } 68 else 69 { 70 m_bWantsToSkip=true; 71 } 72 73 bPressed=true; 74 } 75 76 return S_OK; 77} 78 79HRESULT CScene_Intro::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled) 80{ 81 int nStart, nEnd; 82 83 if(m_bSkippable && m_bWantsToSkip) 84 { 85 // straight to the game 86 app.NavigateToScene(XUSER_INDEX_ANY,eUIScene_SaveMessage); 87 app.SetIntroRunning(false); 88 } 89 else 90 { 91 switch(m_iTimeline) 92 { 93 case TIMELINE_NORMAL: 94 { 95 // 4J-PB - lots of discussions over this because Brazil is in the NA region. This is what I have been advised to do... 96 //if(ProfileManager.RegionIsNorthAmerica()) 97 if(ProfileManager.LocaleIsUSorCanada()) 98 { 99 m_iTimeline=TIMELINE_ESRBFADE; 100 XuiElementFindNamedFrame( m_hObj, L"ESRBFade", &nStart ); 101 XuiElementFindNamedFrame( m_hObj, L"ESRBFadeEnd", &nEnd ); 102 XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, FALSE, TRUE ); 103 } 104 else 105 { 106 m_iTimeline=TIMELINE_LOGOSFADE; 107 XuiElementFindNamedFrame( m_hObj, L"StartFade", &nStart ); 108 XuiElementFindNamedFrame( m_hObj, L"EndFade", &nEnd ); 109 XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, FALSE, TRUE ); 110 } 111 } 112 break; 113 114 case TIMELINE_ESRBFADE: 115 if(m_bWantsToSkip && m_bSkippable) 116 { 117 app.NavigateToScene(XUSER_INDEX_ANY,eUIScene_SaveMessage); 118 app.SetIntroRunning(false); 119 } 120 else 121 { 122 m_iTimeline=TIMELINE_LOGOSFADE; 123 XuiElementFindNamedFrame( m_hObj, L"StartFade", &nStart ); 124 XuiElementFindNamedFrame( m_hObj, L"EndFade", &nEnd ); 125 XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, FALSE, TRUE ); 126 } 127 break; 128 case TIMELINE_LOGOSFADE: 129 app.NavigateToScene(XUSER_INDEX_ANY,eUIScene_SaveMessage); 130 app.SetIntroRunning(false); 131 break; 132 } 133 } 134 135 return S_OK; 136} 137 138 139HRESULT CScene_Intro::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) 140{ 141 HRESULT hr=XuiKillTimer(m_hObj,0); 142 m_bSkippable=true; 143 144 if(m_bWantsToSkip) 145 { 146 // stop the animation 147 XuiElementStopTimeline(m_hObj,TRUE); 148 app.NavigateToScene(XUSER_INDEX_ANY,eUIScene_SaveMessage); 149 app.SetIntroRunning(false); 150 } 151 152 return hr; 153}