Fission FSN
Loading...
Searching...
No Matches
gfCParkCatalogueGui.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: gfCParkCatalogueGui.h
4*
5* Purpose: Minimal catalogue-listing GUI for gfTimeCore - proves
6* gfICatalogueGui wiring (Phase 3 gate: "catalogue GUI
7* lists buildings"). No currency/purchase-confirmation
8* presentation yet - that's Phase 5 (GUI screens).
9*
10* closeButton (Phase 6) is the only addition since - the
11* base gfICatalogueGui/fsIGuiComponent have no generic
12* dismiss mechanism, and this is opened as a modal
13* overlay from gfCParkHudGui's shop button mid-play.
14*
15*********************************************************************/
16
17#ifndef gfCParkCatalogueGuihdr
18#define gfCParkCatalogueGuihdr
19
21
23
25{
26 friend class fsCComponentFactory;
27
28public:
29
30 static const fsCUniqueId mTypeId;
31
32protected:
33
34 void catalogueLoadDo() override;
35
36 // Keeps unaffordable item buttons tinted red as coins are earned/spent
37 // while the shop stays open - affordability can't be baked in once at
38 // itemInfoSetDo time.
39 void updateDo(fsS32 pDeltaMs) override;
40
41 // Populates each item button's icon/name/price from the catalogue entry.
42 // Handles categories as well as items: the shop's top level lists the
43 // buildings/staff categories, not items, so a purely item-shaped
44 // implementation would leave that first screen blank.
45 void itemInfoSetDo(fsS32 pEntIndex, fsS32 pChildIndex) const override;
46
47 // Base refresh plus back-button visibility - the catalogue root has no
48 // parent to return to, so the button is hidden there rather than left dead.
49 void buttonsRefresh() override;
50 void onScrollSelection(fsS32 pDirection) override;
51
52 // Arms or changes the placement tool while leaving the catalogue visible.
53 void itemSelect(const gfICatalogueEntry* pShopItem) override;
54
55 void initialiseFromVariableTableDo(const fsCVariableTable& pVars) override;
56 fsBool onButtonClicked(fsCButtonComponent* pButtonComp) override;
57
58 static fsIComponent* const create(fsCEntity* const pParent);
59 gfCParkCatalogueGui(fsCEntity* const pParent);
60 virtual ~gfCParkCatalogueGui();
61
62private:
63
64 // "Back" only means something below the catalogue root, so the button is
65 // hidden at the top level rather than left there doing nothing.
66 void backButtonVisibilityRefresh() const;
67 void pagingButtonVisibilityRefresh() const;
68 void affordabilityRefresh() const;
69};
70
71#endif
Definition fsCButtonComponent.h:27
Definition fsCEntity.h:39
Definition fsCUniqueId.h:21
Definition fsCVariableTable.h:27
Definition fsIComponent.h:26
static fsIComponent *const create(fsCEntity *const pParent)
Definition gfCParkCatalogueGui.cpp:371
virtual ~gfCParkCatalogueGui()
Definition gfCParkCatalogueGui.cpp:381
void onScrollSelection(fsS32 pDirection) override
Definition gfCParkCatalogueGui.cpp:308
friend class fsCComponentFactory
Definition gfCParkCatalogueGui.h:26
void catalogueLoadDo() override
Definition gfCParkCatalogueGui.cpp:45
void itemSelect(const gfICatalogueEntry *pShopItem) override
Definition gfCParkCatalogueGui.cpp:333
void initialiseFromVariableTableDo(const fsCVariableTable &pVars) override
Definition gfCParkCatalogueGui.cpp:154
fsBool onButtonClicked(fsCButtonComponent *pButtonComp) override
Definition gfCParkCatalogueGui.cpp:343
void buttonsRefresh() override
Definition gfCParkCatalogueGui.cpp:253
void updateDo(fsS32 pDeltaMs) override
Definition gfCParkCatalogueGui.cpp:173
gfCParkCatalogueGui(fsCEntity *const pParent)
Definition gfCParkCatalogueGui.cpp:376
void itemInfoSetDo(fsS32 pEntIndex, fsS32 pChildIndex) const override
Definition gfCParkCatalogueGui.cpp:52
static const fsCUniqueId mTypeId
Definition gfCParkCatalogueGui.h:30
Definition gfICatalogueEntry.h:18
gfICatalogueGui(fsCEntity *pParent)
Definition gfICatalogueGui.cpp:266
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20