the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "UILayer.h"
3#include "UIEnums.h"
4
5class UIComponent_Tooltips;
6class UIComponent_TutorialPopup;
7class UIScene_HUD;
8class UIComponent_PressStartToPlay;
9
10// A group contains a collection of layers for a specific context (e.g. each player has 1 group)
11class UIGroup
12{
13private:
14 UILayer *m_layers[eUILayer_COUNT];
15
16 UIComponent_Tooltips *m_tooltips;
17 UIComponent_TutorialPopup *m_tutorialPopup;
18 UIComponent_PressStartToPlay *m_pressStartToPlay;
19 UIScene_HUD *m_hud;
20
21 C4JRender::eViewportType m_viewportType;
22
23 EUIGroup m_group;
24 int m_iPad;
25
26 bool m_bMenuDisplayed;
27 bool m_bPauseMenuDisplayed;
28 bool m_bContainerMenuDisplayed;
29 bool m_bIgnoreAutosaveMenuDisplayed;
30 bool m_bIgnorePlayerJoinMenuDisplayed;
31
32 // Countdown in ticks to update focus state
33 int m_updateFocusStateCountdown;
34
35 int m_commandBufferList;
36
37public:
38 UIGroup(EUIGroup group, int iPad);
39
40#ifdef __PSVITA__
41 EUIGroup GetGroup() {return m_group;}
42#endif
43 UIComponent_Tooltips *getTooltips() { return m_tooltips; }
44 UIComponent_TutorialPopup *getTutorialPopup() { return m_tutorialPopup; }
45 UIScene_HUD *getHUD() { return m_hud; }
46 UIComponent_PressStartToPlay *getPressStartToPlay() { return m_pressStartToPlay; }
47
48 void DestroyAll();
49 void ReloadAll();
50
51 void tick();
52 void render();
53 bool hidesLowerScenes();
54 void getRenderDimensions(S32 &width, S32 &height);
55
56 // NAVIGATION
57 bool NavigateToScene(int iPad, EUIScene scene, void *initData, EUILayer layer);
58 bool NavigateBack(int iPad, EUIScene eScene, EUILayer eLayer = eUILayer_COUNT);
59 void closeAllScenes();
60 UIScene *GetTopScene(EUILayer layer);
61
62 bool IsSceneInStack(EUIScene scene);
63 bool HasFocus(int iPad);
64
65 bool RequestFocus(UILayer* layerPtr);
66 void UpdateFocusState();
67
68 bool GetMenuDisplayed();
69 bool IsPauseMenuDisplayed() { return m_bPauseMenuDisplayed; }
70 bool IsContainerMenuDisplayed() { return m_bContainerMenuDisplayed; }
71 bool IsIgnoreAutosaveMenuDisplayed() { return m_bIgnoreAutosaveMenuDisplayed; }
72 bool IsIgnorePlayerJoinMenuDisplayed() { return m_bIgnorePlayerJoinMenuDisplayed; }
73
74 // INPUT
75 void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
76
77#ifdef __PSVITA__
78 // Current active scene
79 UIScene *getCurrentScene();
80#endif
81
82 // FOCUS
83 bool getFocusState();
84
85 // A component is an element on a layer that displays BELOW other scenes in this layer, but does not engage in any navigation
86 // E.g. you can keep a component active while performing navigation with other scenes on this layer
87 void showComponent(int iPad, EUIScene scene, EUILayer layer, bool show);
88 UIScene *addComponent(int iPad, EUIScene scene, EUILayer layer);
89 void removeComponent(EUIScene scene, EUILayer layer);
90
91 void SetViewportType(C4JRender::eViewportType type);
92 C4JRender::eViewportType GetViewportType();
93
94 virtual void HandleDLCMountingComplete();
95 virtual void HandleDLCInstalled();
96#ifdef _XBOX_ONE
97 virtual void HandleDLCLicenseChange();
98#endif
99 virtual void HandleMessage(EUIMessage message, void *data);
100
101 bool IsFullscreenGroup();
102
103 void handleUnlockFullVersion();
104
105 void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic);
106
107 unsigned int GetLayerIndex(UILayer* layerPtr);
108
109 int getCommandBufferList();
110 UIScene *FindScene(EUIScene sceneType);
111
112private:
113 void _UpdateFocusState();
114 void updateStackStates();
115};