the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 103 lines 3.2 kB view raw
1#pragma once 2 3#include "UIScene.h" 4 5#define TUTORIAL_POPUP_FADE_TIMER_ID 0 6#define TUTORIAL_POPUP_MOVE_SCENE_TIMER_ID 1 7#define TUTORIAL_POPUP_MOVE_SCENE_TIME 500 8 9 10class UIComponent_TutorialPopup : public UIScene 11{ 12private: 13 // A scene that may be displayed behind the popup that the player is using, that will need shifted so we can see it clearly. 14 UIScene *m_interactScene, *m_lastInteractSceneMoved; 15 bool m_lastSceneMovedLeft; 16 bool m_bAllowFade; 17 Tutorial *m_tutorial; 18 shared_ptr<ItemInstance> m_iconItem; 19 bool m_iconIsFoil; 20 //int m_iLocalPlayerC; 21 22 bool m_bContainerMenuVisible; 23 bool m_bSplitscreenGamertagVisible; 24 25 // Maps to values in AS 26 enum EIcons 27 { 28 e_ICON_TYPE_IGGY = 0, 29 e_ICON_TYPE_ARMOUR = 1, 30 e_ICON_TYPE_BREWING = 2, 31 e_ICON_TYPE_DECORATION = 3, 32 e_ICON_TYPE_FOOD = 4, 33 e_ICON_TYPE_MATERIALS = 5, 34 e_ICON_TYPE_MECHANISMS = 6, 35 e_ICON_TYPE_MISC = 7, 36 e_ICON_TYPE_REDSTONE_AND_TRANSPORT = 8, 37 e_ICON_TYPE_STRUCTURES = 9, 38 e_ICON_TYPE_TOOLS = 10, 39 e_ICON_TYPE_TRANSPORT = 11, 40 }; 41 42 EIcons m_iconType; 43 44public: 45 UIComponent_TutorialPopup(int iPad, void *initData, UILayer *parentLayer); 46 47protected: 48 UIControl_Label m_labelDescription, m_labelTitle; 49 UIControl m_controlIconHolder; 50 UIControl m_controlExitScreenshot; 51 IggyName m_funcAdjustLayout, m_funcSetupIconHolder; 52 UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) 53 UI_MAP_ELEMENT( m_labelTitle, "Title") 54 UI_MAP_ELEMENT( m_labelDescription, "Description") 55 UI_MAP_ELEMENT( m_controlIconHolder, "IconHolder") 56 UI_MAP_ELEMENT( m_controlExitScreenshot, "ExitScreenShot") 57 58 UI_MAP_NAME( m_funcAdjustLayout, L"AdjustLayout") 59 UI_MAP_NAME( m_funcSetupIconHolder, L"SetupIconHolder") 60 UI_END_MAP_ELEMENTS_AND_NAMES() 61 62 virtual wstring getMoviePath(); 63 64public: 65 virtual EUIScene getSceneType() { return eUIComponent_TutorialPopup;} 66 67 // Returns true if this scene handles input 68 virtual bool stealsFocus() { return false; } 69 70 // Returns true if this scene has focus for the pad passed in 71 virtual bool hasFocus(int iPad) { return false; } 72 73 // Returns true if lower scenes in this scenes layer, or in any layer below this scenes layers should be hidden 74 virtual bool hidesLowerScenes() { return false; } 75 76 virtual void handleReload(); 77 78 void SetContainerMenuVisible(bool bContainerMenuVisible) { m_bContainerMenuVisible = bContainerMenuVisible; } 79 void UpdateTutorialPopup(); 80 81 void SetTutorial( Tutorial *tutorial ) { m_tutorial = tutorial; } 82 void SetTutorialDescription(TutorialPopupInfo *info); 83 void RemoveInteractSceneReference(UIScene *scene); 84 void SetVisible(bool visible); 85 bool IsVisible(); 86 87 // RENDERING 88 virtual void render(S32 width, S32 height, C4JRender::eViewportType viewport); 89 90 virtual void customDraw(IggyCustomDrawCallbackRegion *region); 91 92protected: 93 void handleTimerComplete(int id); 94 95private: 96 void _SetDescription(UIScene *interactScene, const wstring &desc, const wstring &title, bool allowFade, bool isReminder); 97 wstring _SetIcon(int icon, int iAuxVal, bool isFoil, LPCWSTR desc); 98 wstring _SetImage(wstring &desc); 99 wstring ParseDescription(int iPad, wstring &text); 100 void UpdateInteractScenePosition(bool visible); 101 102 void setupIconHolder(EIcons icon); 103};