the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "../media/xuiscene_tutorialpopup.h"
3#include "XUI_CustomMessages.h"
4
5class Tutorial;
6class CXuiCtrlCraftIngredientSlot;
7
8#define TUTORIAL_POPUP_FADE_TIMER_ID 0
9#define TUTORIAL_POPUP_MOVE_SCENE_TIMER_ID 1
10#define TUTORIAL_POPUP_MOVE_SCENE_TIME 500
11
12class CScene_TutorialPopup : public CXuiSceneImpl
13{
14private:
15 Tutorial *tutorial;
16
17 // A scene that may be displayed behind the popup that the player is using, that will need shifted so we can see it clearly.
18 CXuiScene *m_interactScene, *m_lastInteractSceneMoved;
19 bool m_lastSceneMovedLeft;
20 bool m_bAllowFade;
21
22 int m_iPad;
23
24 CXuiHtmlControl m_description;
25 CXuiCtrlCraftIngredientSlot *m_pCraftingPic;
26 CXuiControl m_title;
27 CXuiImageElement m_image;
28
29 CXuiControl m_fontSizeControl;
30
31 int m_textFontSize;
32 D3DXVECTOR3 m_OriginalPosition;
33
34protected:
35 // Message map. Here we tie messages to message handlers.
36 XUI_BEGIN_MSG_MAP()
37 XUI_ON_XM_INIT( OnInit )
38 XUI_ON_XM_TIMER(OnTimer)
39 XUI_ON_XM_DESTROY( OnDestroy )
40 XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer)
41 XUI_END_MSG_MAP()
42
43 // Control mapping to objects
44 BEGIN_CONTROL_MAP()
45 MAP_CONTROL(IDC_Title, m_title)
46 MAP_CONTROL(IDC_Description, m_description)
47 MAP_OVERRIDE(IDC_XuiInventoryPic, m_pCraftingPic)
48 MAP_CONTROL(IDC_XuiImage, m_image)
49 MAP_CONTROL(IDC_FontSize, m_fontSizeControl)
50
51 END_CONTROL_MAP()
52
53 HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
54 HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled);
55 HRESULT OnDestroy();
56 HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled);
57public:
58
59 // Define the class. The class name must match the ClassOverride property
60 // set for the scene in the UI Authoring tool.
61 XUI_IMPLEMENT_CLASS( CScene_TutorialPopup, L"CScene_TutorialPopup", XUI_CLASS_SCENE )
62
63private:
64 HRESULT _SetDescription(CXuiScene *interactScene, LPCWSTR desc, LPCWSTR title, bool allowFade, bool isReminder);
65 wstring _SetIcon(int icon, int iAuxVal, bool isFoil, LPCWSTR desc);
66 wstring _SetImage(wstring &desc);
67 HRESULT _SetVisible(bool show);
68 bool _IsSceneVisible();
69 void UpdateInteractScenePosition(bool visible);
70
71public:
72 static HRESULT SetDescription(int iPad, TutorialPopupInfo *info);
73 static wstring ParseDescription(int iPad, wstring &text);
74
75 static HRESULT SetSceneVisible(int iPad, bool show);
76 static bool IsSceneVisible(int iPad);
77
78};