the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "UIEnums.h"
3using namespace std;
4class UIScene;
5class UIGroup;
6
7// A layer include a collection of scenes and other components
8class UILayer
9{
10private:
11 vector<UIScene *> m_sceneStack; // Operates as a stack mainly, but we may wish to iterate over all elements
12 vector<UIScene *> m_components; // Other componenents in this scene that to do not conform the the user nav stack, and cannot take focus
13 vector<UIScene *> m_scenesToDelete; // A list of scenes to delete
14 vector<UIScene *> m_scenesToDestroy; // A list of scenes where we want to dump the swf
15
16#ifdef __ORBIS__
17 unordered_map<EUIScene,std::pair<int,bool>,std::hash<int>> m_componentRefCount;
18#else
19 unordered_map<EUIScene,pair<int,bool> > m_componentRefCount;
20#endif
21
22public:
23 bool m_hasFocus; // True if the layer "has focus", should be the only layer in the group
24 bool m_bMenuDisplayed;
25 bool m_bPauseMenuDisplayed;
26 bool m_bContainerMenuDisplayed;
27 bool m_bIgnoreAutosaveMenuDisplayed;
28 bool m_bIgnorePlayerJoinMenuDisplayed;
29
30#ifdef __PSVITA__
31 EUILayer m_iLayer;
32#endif
33
34 UIGroup *m_parentGroup;
35public:
36 UILayer(UIGroup *parent);
37
38 void tick();
39 void render(S32 width, S32 height, C4JRender::eViewportType viewport);
40 void getRenderDimensions(S32 &width, S32 &height);
41
42 void DestroyAll();
43 void ReloadAll(bool force = false);
44
45 // NAVIGATION
46 bool NavigateToScene(int iPad, EUIScene scene, void *initData);
47 bool NavigateBack(int iPad, EUIScene eScene);
48 void removeScene(UIScene *scene);
49 void closeAllScenes();
50 UIScene *GetTopScene();
51
52 bool GetMenuDisplayed();
53 bool IsPauseMenuDisplayed() { return m_bPauseMenuDisplayed; }
54
55 bool IsSceneInStack(EUIScene scene);
56 bool HasFocus(int iPad);
57
58 bool hidesLowerScenes();
59
60 // A component is an element on a layer that displays BELOW other scenes in this layer, but does not engage in any navigation
61 // E.g. you can keep a component active while performing navigation with other scenes on this layer
62 void showComponent(int iPad, EUIScene scene, bool show);
63 bool isComponentVisible(EUIScene scene);
64 UIScene *addComponent(int iPad, EUIScene scene, void *initData = NULL);
65 void removeComponent(EUIScene scene);
66
67 // INPUT
68 void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
69#ifdef __PSVITA__
70 // Current active scene
71 UIScene *getCurrentScene();
72#endif
73 // FOCUS
74
75 bool updateFocusState(bool allowedFocus = false);
76
77public:
78 bool IsFullscreenGroup();
79 C4JRender::eViewportType getViewport();
80
81 virtual void HandleDLCMountingComplete();
82 virtual void HandleDLCInstalled();
83#ifdef _XBOX_ONE
84 virtual void HandleDLCLicenseChange();
85#endif
86 virtual void HandleMessage(EUIMessage message, void *data);
87
88 void handleUnlockFullVersion();
89 UIScene *FindScene(EUIScene sceneType);
90
91 void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic);
92
93};