the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 73 lines 2.2 kB view raw
1#pragma once 2 3#define CREDITS_TICK_TIMER_ID (6) // Arbitrary timer ID used to tick credits for scrolling. 4 5#define MAX_CREDIT_STRINGS 360 6// 213 7 8#include "..\UI\UIStructs.h" 9 10class CScene_Credits : public CXuiSceneImpl 11{ 12protected: 13 // Control and Element wrapper objects. 14 15 // Message map. Here we tie messages to message handlers. 16 XUI_BEGIN_MSG_MAP() 17 XUI_ON_XM_INIT( OnInit ) 18 XUI_ON_XM_KEYDOWN(OnKeyDown) 19 XUI_ON_XM_NOTIFY_PRESS_EX(OnNotifyPressEx) 20 XUI_ON_XM_CONTROL_NAVIGATE(OnControlNavigate) 21 XUI_ON_XM_TIMER( OnTimer ) 22 XUI_ON_XM_DESTROY( OnDestroy ) 23 XUI_END_MSG_MAP() 24 25 // Control mapping to objects 26 BEGIN_CONTROL_MAP() 27 28 END_CONTROL_MAP() 29 30 HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); 31 HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); 32 HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); 33 HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); 34 HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); 35 HRESULT OnDestroy(); 36 37private: 38 39 40 struct STextType 41 { 42 // Array of pointers to text elements. 43 CXuiControl** m_appTextElements; 44 45 int m_iNextFreeElement; 46 int m_iNumUsedElements; 47 int m_iMaxElements; 48 }; 49 50 STextType m_aTextTypes[ eNumTextTypes ]; 51 52 int m_iCurrDefIndex; // Index of last created text def. 53 float m_fMoveSinceLastDef; // How far have credits scrolled since we last created a new text item. 54 float m_fMoveToNextDef; // How far we need to move before starting next text item. 55 int m_iNumTextDefs; // Total number of text defs in the credits. 56 57 float CREDITS_SCREEN_MIN_Y;// ( 200.0f ) // Y pos at which credits are removed from top of screen. 58 float CREDITS_SCREEN_MAX_Y;// ( 630.0f ) // Y pos at which credits appear at bottom of screen. 59 float CREDITS_FADE_HEIGHT;// ( 100.0f ) // Height over which credits fade in or fade out. 60 61 float gs_aLineSpace[ eNumTextTypes ]; 62 63public: 64 static SCreditTextItemDef gs_aCreditDefs[MAX_CREDIT_STRINGS]; 65 66 // Define the class. The class name must match the ClassOverride property 67 // set for the scene in the UI Authoring tool. 68 XUI_IMPLEMENT_CLASS( CScene_Credits, L"CScene_Credits", XUI_CLASS_SCENE ) 69 70 71 72}; 73