Fission FSN
Loading...
Searching...
No Matches
gfCMapStateSkin.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: gfCMapStateSkin.h
4*
5* Purpose: Dresses the navigation states on a map from their progress: a locked look, a nav
6* look, a partial progress look and a done look, each a cutout picture per state.
7*
8* Settings (all optional; a look with no root keeps the state's own picture):
9* mapLockedImageRoot / mapNavImageRoot / mapProgressImageRoot / mapDoneImageRoot
10* folder of <prefix><layer>.png cutouts
11* mapLockedPrefix / mapNavPrefix / mapProgressPrefix / mapDonePrefix / mapHitPrefix
12* default LOCK- NAV- STEP- DONE- HIT-; the progress look is <prefix><steps>-<layer>.png
13* and a finished state prefers <donePrefix><rank>-<layer>.png (its medal) when it exists
14* mapHitImageRoot
15* folder of the optional <hitPrefix><layer>.png tap masks; unset looks beside each picture
16* (the done look's beside mapDoneImageRoot)
17* mapLockedTint
18* RRGGBB or RRGGBBAA: a state with no locked picture shows its nav picture in this tint,
19* so one neutral cutout can serve both looks
20* mapNavTintPrefix (default mapTint_)
21* the map level's <prefix><layer> = RRGGBB tints that state's nav picture; unset is untinted.
22* Done and progress pictures are always shown untinted.
23* mapHintEntity / mapHintStringId
24* entity whose text becomes "<done> / <total> <string>"; unset means no hint
25*
26*********************************************************************/
27
28#ifndef gfCMapStateSkinhdr
29#define gfCMapStateSkinhdr
30
31#include <functional>
32
33#include <fsCore/fsStr.h>
34
35class fsCEntity;
36class fsCAppSettings;
37
39{
40public:
41
49
50 static SConfig configGet(const fsCAppSettings* pSettings);
51
52 // A state's progress as the map shows it.
53 struct SStatus
54 {
57 fsStr mRank; // bronze / silver / gold once finished
58 // Optional folder for this state's done look, tried before mapDoneImageRoot (which still supplies
59 // any picture it lacks, and the HIT- tap masks): a game with several picture sets per state can show
60 // the set it was finished in.
62 };
63 // Where a state's progress comes from. By default, its map level (mapSceneRoot); a game with
64 // several pictures per state supplies one that combines them (and may pick each state's done
65 // pictures with SStatus::mDoneRoot). An empty provider restores the default.
66 using StatusProvider = std::function<SStatus(const fsStr& pState)>;
67 static void statusProviderSet(StatusProvider pProvider);
68 static SStatus statusGet(const fsStr& pState);
69
70 // Sets every state's look explicitly. A map that was left and revisited has its saved entity state
71 // restored over whatever was set at creation, so nothing here can assume the starting look.
72 static void apply(fsCEntity* pLevelEnt, const SConfig& pConfig);
73
74 // Applies using the current app settings.
75 static void apply(fsCEntity* pLevelEnt);
76};
77
78#endif
Definition fsCAppSettings.h:22
Definition fsCEntity.h:39
Definition fsStr.h:23
Definition gfCMapStateSkin.h:39
std::function< SStatus(const fsStr &pState)> StatusProvider
Definition gfCMapStateSkin.h:66
static void statusProviderSet(StatusProvider pProvider)
Definition gfCMapStateSkin.cpp:129
static SConfig configGet(const fsCAppSettings *pSettings)
Definition gfCMapStateSkin.cpp:30
static void apply(fsCEntity *pLevelEnt, const SConfig &pConfig)
Definition gfCMapStateSkin.cpp:153
static SStatus statusGet(const fsStr &pState)
Definition gfCMapStateSkin.cpp:134
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
Definition gfCMapStateSkin.h:43
fsStr mHitRoot
Definition gfCMapStateSkin.h:47
fsStr mLockedRoot
Definition gfCMapStateSkin.h:44
fsStr mHintStringId
Definition gfCMapStateSkin.h:46
fsStr mHitPrefix
Definition gfCMapStateSkin.h:45
fsStr mProgressRoot
Definition gfCMapStateSkin.h:44
fsStr mLockedPrefix
Definition gfCMapStateSkin.h:45
fsStr mDoneRoot
Definition gfCMapStateSkin.h:44
fsStr mNavRoot
Definition gfCMapStateSkin.h:44
fsStr mNavPrefix
Definition gfCMapStateSkin.h:45
fsStr mHintEntity
Definition gfCMapStateSkin.h:46
fsStr mLockedTint
Definition gfCMapStateSkin.h:47
fsStr mDonePrefix
Definition gfCMapStateSkin.h:45
fsStr mNavTintPrefix
Definition gfCMapStateSkin.h:47
fsStr mProgressPrefix
Definition gfCMapStateSkin.h:45
Definition gfCMapStateSkin.h:54
fsStr mDoneRoot
Definition gfCMapStateSkin.h:61
fsBool mFinished
Definition gfCMapStateSkin.h:55
fsS32 mStepsCompleted
Definition gfCMapStateSkin.h:56
fsStr mRank
Definition gfCMapStateSkin.h:57