Fission FSN
Loading...
Searching...
No Matches
fsCSplashScreenGui.h
Go to the documentation of this file.
1/********************************************************************
2*
3* Created: 24/3/2014 14:57
4*
5* File: fsCSplashScreenGui.h
6*
7* Author: Mick Waites
8*
9* Purpose: Displays copyright screens before the main Guis are
10* presented.
11*
12*********************************************************************/
13
14#ifndef fsCSplashScreenGuihdr
15#define fsCSplashScreenGuihdr
16
17#include <vector>
18
20#include <fsCore/fsStr.h>
21
23
24class fsCEntity;
25class fsINode;
27
28
30{
31 friend class fsCComponentFactory;
32
33public:
34
35 static const fsCUniqueId mTypeId;
36
37protected:
38
39 void initialiseFromVariableTableDo(const fsCVariableTable& pVars) override;
40 void updateDo(fsS32 pDeltaMs) override;
41
42 void listenersRegisterDo() override;
43 void listenersDeregisterDo() override;
44 fsBool messageProcessDo(const fsCUniqueId& pMessageType,
45 const fsIMessageDispatcher::sMessageParameters& pParam) override;
46
47 static fsIComponent* create(fsCEntity* pParent);
48
50 virtual ~fsCSplashScreenGui();
51
52private:
53
54 void nextScreenPrepare();
55 void nextScreenPresent();
56 void nextGuiLoad();
57
58 void variablesRead(const fsCVariableTable& pVars);
59 void screenFileNamesRead(const fsCVariableTable& pVars);
60 void firstScreenDisplay();
61
62 std::vector<fsStr> mScreens;
63
64 fsStr mNextGui;
65
66 fsISpriteComponent* mSprComp;
67
68 fsS32 mCurrentScreenIndex;
69
70 fsS32 mMinDurationMs;
71 fsS32 mMaxDurationMs;
72
73 fsS32 mTimeOnCurrentScreen;
74
75 // Guards against nextGuiLoad() firing more than once. With zero
76 // configured screens, firstScreenDisplay() calls nextGuiLoad()
77 // straight away without ever advancing mCurrentScreenIndex, so
78 // updateDo()'s "mCurrentScreenIndex == 0" check kept re-entering it
79 // every single frame - each call created another main-menu instance
80 // and re-destroyed the (already-destroyed) parent entity.
81 fsBool mNextGuiLoaded;
82};
83
84#endif
Definition fsCEntity.h:39
fsBool messageProcessDo(const fsCUniqueId &pMessageType, const fsIMessageDispatcher::sMessageParameters &pParam) override
Definition fsCSplashScreenGui.cpp:150
friend class fsCComponentFactory
Definition fsCSplashScreenGui.h:31
void listenersDeregisterDo() override
Definition fsCSplashScreenGui.cpp:138
virtual ~fsCSplashScreenGui()
Definition fsCSplashScreenGui.cpp:180
fsCSplashScreenGui(fsCEntity *pParent)
Definition fsCSplashScreenGui.cpp:169
static fsIComponent * create(fsCEntity *pParent)
Definition fsCSplashScreenGui.cpp:164
void initialiseFromVariableTableDo(const fsCVariableTable &pVars) override
Definition fsCSplashScreenGui.cpp:18
void listenersRegisterDo() override
Definition fsCSplashScreenGui.cpp:144
static const fsCUniqueId mTypeId
Definition fsCSplashScreenGui.h:35
void updateDo(fsS32 pDeltaMs) override
Definition fsCSplashScreenGui.cpp:122
Definition fsCUniqueId.h:21
Definition fsCVariableTable.h:27
fsIComponent(fsCEntity *pParent)
Definition fsIComponent.cpp:86
fsIMessageListenerGuiComponent(fsCEntity *pParent, fsS32 pPriority)
Definition fsIMessageListenerGuiComponent.cpp:4
Definition fsINode.h:30
Definition fsISpriteComponent.h:23
Definition fsStr.h:23
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
Definition fsIMessageDispatcher.h:32