Fission FSN
Loading...
Searching...
No Matches
gfCMapPopUpGui.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCMapPopUpGui.h
4*
5* Purpose: Pop up for visited levels
6*
7*********************************************************************/
8
9#ifndef fsCMapPopUpGuihdr
10#define fsCMapPopUpGuihdr
11
13
14
16{
17 friend class fsCComponentFactory;
18
19public:
20
21 static const fsCUniqueId mTypeId;
22
23 static void nextLevelStart(const fsStr& pNextLevel);
24
25 static fsStr levelCompletionRankGet(const fsStr& pLevel);
26
27 static fsBool levelFinishedGet(const fsStr& pLevel);
28
29 // The level a map state stands for: <mapSceneRoot><State>/<State>.txt. The mapSceneRoot setting
30 // (default "scenes/") is the folder holding the scenes the map tracks; a game that keeps them in a
31 // collection subfolder (e.g. "scenes/nature/") sets it.
32 static fsStr mapLevelPath(const fsStr& pState);
33
34 // Map rule: the level.txt startState is always open; otherwise a level opens when it, or a state
35 // listed in its neighbours_<State> entry, has completed a step. Everything is open when startState is not set.
36 static fsBool levelUnlockedGet(const fsStr& pLevel);
37
38 // The level file's startState may be "choose": each player picks a home state once, kept in their profile.
39 static fsStr homeStateGet();
40 static void homeStateSet(const fsStr& pState);
42
43 static void levelFinishedSet(const fsStr& pLevel, fsBool pFinished);
44
45 static void bonusBonusTotalGet(const fsStr& pLevel, fsS32& pBonusBonusTotal);
46
47 static void trashTotalGet(const fsStr& pLevel, fsS32& pTrashCount, fsS32& pTrashTotal,
48 fsS32& pLostFoundCount, fsS32& pLostFoundTotal);
49
50 fsBool onButtonClicked(fsCButtonComponent* pButtonComp) override;
51
52 void init(const fsStr& pLevel);
53
54protected:
55
56 static fsIComponent* create(fsCEntity* pParent);
57
58 fsCMapPopUpGui(fsCEntity* pParent);
59 virtual ~fsCMapPopUpGui();
60
61 // Hooks for a game's own card: init() runs the generic card, then initDo() lets the game fill in
62 // and lay out whatever else its card shows. completionStarsInit() may be replaced outright.
63 virtual void initDo() {}
64 virtual void completionStarsInit();
65
66 void textSet(const fsStr& pName, const fsStr& pText) const;
67 void starInit(const fsStr& pName, fsBool pVisible);
68
70
71private:
72
73 fsStr levelNameGet() const;
74 fsStr wallpaperFileNameGet() const;
75 void levelImageInit();
76
77 void stringSet(const fsStr& pTxtBoxName, const fsStr& pStrId, fsStr pNumGot, fsStr pNumTot) const;
78
79 fsF32 mImageWidth; // on-screen width the level picture is scaled to
80
81 fsS32 mTrashCount;
82 fsS32 mTrashTotal;
83 fsS32 mLostFoundCount;
84 fsS32 mLostFoundTotal;
85};
86
87#endif
Definition fsCButtonComponent.h:27
Definition fsCEntity.h:39
virtual void completionStarsInit()
Definition gfCMapPopUpGui.cpp:86
static fsBool homeStatePendingGet()
Definition gfCMapPopUpGui.cpp:155
static void nextLevelStart(const fsStr &pNextLevel)
Definition gfCMapPopUpGui.cpp:40
static fsStr levelCompletionRankGet(const fsStr &pLevel)
Definition gfCMapPopUpGui.cpp:45
static fsBool levelFinishedGet(const fsStr &pLevel)
Definition gfCMapPopUpGui.cpp:135
static fsStr mapLevelPath(const fsStr &pState)
Definition gfCMapPopUpGui.cpp:35
friend class fsCComponentFactory
Definition gfCMapPopUpGui.h:17
static void trashTotalGet(const fsStr &pLevel, fsS32 &pTrashCount, fsS32 &pTrashTotal, fsS32 &pLostFoundCount, fsS32 &pLostFoundTotal)
Definition gfCMapPopUpGui.cpp:55
void init(const fsStr &pLevel)
Definition gfCMapPopUpGui.cpp:195
static fsBool levelUnlockedGet(const fsStr &pLevel)
Definition gfCMapPopUpGui.cpp:160
static fsIComponent * create(fsCEntity *pParent)
Definition gfCMapPopUpGui.cpp:237
static void bonusBonusTotalGet(const fsStr &pLevel, fsS32 &pBonusBonusTotal)
Definition gfCMapPopUpGui.cpp:50
static void levelFinishedSet(const fsStr &pLevel, fsBool pFinished)
Definition gfCMapPopUpGui.cpp:140
virtual void initDo()
Definition gfCMapPopUpGui.h:63
fsStr mTarget
Definition gfCMapPopUpGui.h:69
virtual ~fsCMapPopUpGui()
Definition gfCMapPopUpGui.cpp:253
void starInit(const fsStr &pName, fsBool pVisible)
Definition gfCMapPopUpGui.cpp:78
void textSet(const fsStr &pName, const fsStr &pText) const
Definition gfCMapPopUpGui.cpp:114
fsBool onButtonClicked(fsCButtonComponent *pButtonComp) override
Definition gfCMapPopUpGui.cpp:61
static fsStr homeStateGet()
Definition gfCMapPopUpGui.cpp:145
static void homeStateSet(const fsStr &pState)
Definition gfCMapPopUpGui.cpp:150
fsCMapPopUpGui(fsCEntity *pParent)
Definition gfCMapPopUpGui.cpp:242
static const fsCUniqueId mTypeId
Definition gfCMapPopUpGui.h:21
Definition fsCUniqueId.h:21
fsIComponent(fsCEntity *pParent)
Definition fsIComponent.cpp:86
fsIGuiComponent(fsCEntity *pParent)
Definition fsIGuiComponent.cpp:727
Definition fsStr.h:23
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
float fsF32
Definition fsBaseTypes.h:28