zscript-doc/api/inter/StatusScreen.md

425 lines
7.5 KiB
Markdown
Raw Permalink Normal View History

2018-12-29 16:05:19 -08:00
# StatusScreen
The base class for intermission status screens. Any status screen used by
`MAPINFO`/GameInfo must be derived from this class.
2018-12-29 16:05:19 -08:00
Status screens have four stages:
2019-08-14 03:31:41 -07:00
* `STATCOUNT`, where the stats are counted and displayed.
* `SHOWNEXTLOC`, where the next map is shown as "ENTERING (map name)" and in episodic maps, the world map.
* `NOSTATE`, at the very end of this process, where the last frame is drawn and the intermission is exited.
* `LEAVINGINTERMISSION`, which is used only to signify that all stages are done and the status screen has been exited.
2018-12-29 16:05:19 -08:00
2019-04-10 06:12:18 -07:00
These are provided as constants in `StatusScreen`. The starting stage is `STATCOUNT`.
2018-12-29 16:05:19 -08:00
```
class StatusScreen : Object abstract play
2018-12-29 16:05:19 -08:00
{
2019-08-14 03:32:51 -07:00
const NG_STATSY;
const SHOWNEXTLOCDELAY;
const SP_STATSX;
const SP_STATSY;
const SP_TIMEX;
const SP_TIMEY;
const TITLEY;
InterBackground BG;
WBPlayerStruct Plrs[MAXPLAYERS];
WBStartStruct Wbs;
int AccelerateStage;
int BCnt;
int Cnt;
int Cnt_Deaths[MAXPLAYERS];
int Cnt_Frags[MAXPLAYERS];
int Cnt_Items[MAXPLAYERS];
int Cnt_Kills[MAXPLAYERS];
int Cnt_Par;
int Cnt_Pause;
int Cnt_Secret[MAXPLAYERS];
int Cnt_Time;
int Cnt_Total_Time;
int CurState;
int DoFrags;
int Me;
int NG_State;
bool NoAutoStartMap;
bool PlayerReady[MAXPLAYERS];
int Player_Deaths[MAXPLAYERS];
bool Snl_PointerOn;
int SP_State;
float ShadowAlpha;
int Total_Deaths;
int Total_Frags;
PatchInfo Entering;
PatchInfo Finished;
PatchInfo MapName;
textureid Items;
textureid Kills;
textureid P_Secret;
textureid Par;
textureid Secret;
textureid Sucks;
textureid Timepic;
string LNameTexts[2];
int DrawCharPatch(Font fnt, int charcode, int x, int y, int translation = Font.CR_UNTRANSLATED, bool nomove = false);
void DrawEL();
int DrawLF();
int DrawName(int y, textureid tex, string levelname);
int DrawNum(Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED);
int DrawPatchText(int y, PatchInfo pinfo, string stringname);
void DrawPercent(Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED);
void DrawTime(int x, int y, int t, bool no_sucks = false);
bool AutoSkip();
virtual void Drawer();
virtual void End();
virtual void Start(WBStartStruct wbs_);
virtual void StartMusic();
virtual void Ticker();
protected virtual void DrawNoState();
protected virtual void DrawShowNextLoc();
protected virtual void DrawStats();
protected virtual void InitNoState();
protected virtual void InitShowNextLoc();
protected virtual void InitStats();
protected virtual void UpdateNoState();
protected virtual void UpdateShowNextLoc();
protected virtual void UpdateStats();
protected void CheckForAccelerate();
protected int FragSum(int playernum);
static int, int, int GetPlayerWidths();
static color GetRowColor(PlayerInfo player, bool highlight);
static void GetSortedPlayers(in out array<int> sorted, bool teamplay);
static void PlaySound(sound snd);
2018-12-29 16:05:19 -08:00
}
```
2019-08-14 03:31:41 -07:00
### `NG_STATSY`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `SHOWNEXTLOCDELAY`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `SP_STATSX`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `SP_STATSY`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `SP_TIMEX`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `SP_TIMEY`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `TITLEY`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The Y position (in 320x200 pixels) to draw the top of the "finished" and
"entering" texts. Used by `DrawEL` and `DrawLF`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `BG`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The `InterBackground` object for this intermission, set by `Start` with the
initial `Wbs` object.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Plrs`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The value of `Wbs.Plyr` when `Start` was called. Usually not changed, so
essentially equivalent to `Wbs.Plyr`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Wbs`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The `WBStartStruct` passed to this class via the `Start` function.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `AccelerateStage`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Used to signify to the current stage that it should go quicker or be skipped
entirely.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `BCnt`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Deaths`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Frags`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Items`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Kills`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Par`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Pause`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Secret`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Time`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Cnt_Total_Time`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `CurState`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The current stage the intermission is in.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DoFrags`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Me`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The value of `Wbs.PNum` when `Start` was called. Usually not changed, so
essentially equivalent to `Wbs.PNum`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `NG_State`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `NoAutoStartMap`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `PlayerReady`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Used in networked games to signify when each player is ready to continue to the
next map. Set by `CheckForAccelerate`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Player_Deaths`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Snl_PointerOn`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `SP_State`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Used in single-player status screens during the `STATCOUNT` stage for
indicating the current round of statistics to count up.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `ShadowAlpha`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Total_Deaths`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Total_Frags`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Entering`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Finished`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `MapName`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Items`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The "ITEMS" (default `WIOSTI`) graphic.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Kills`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The "KILLS" (default `WIOSTK`) graphic.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `P_Secret`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The "SECRET" (default `WISCRT2`) graphic.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Par`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The "PAR" (default `WIPAR`) graphic.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Secret`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The "SCRT" (default `WIOSTS`) graphic.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Sucks`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The "SUCKS" (default `WISUCKS`) graphic.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Timepic`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The "TIME" (default `WITIME`) graphic.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `LNameTexts`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawCharPatch`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawEL`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawLF`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawName`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawNum`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawPatchText`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawPercent`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawTime`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `AutoSkip`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Drawer`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `WI_Drawer`, which is called every frame when `GameState` is
`GS_INTERMISSION`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `End`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called when the intermission should end. Default behaviour is to set `CurState`
to `LEAVINGINTERMISSION` and remove bots in death-match. Generally,
`Level.WorldDone` should be called directly after this.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Start`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `WI_Start` after the `WBStartStruct` is populated, sounds are stopped
and the screen blend is set to black. Sets up initial values and runs
`InitStats`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `StartMusic`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called in the first tick by `Ticker` to set the intermission music.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Ticker`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `WI_Ticker`, which is called every game tick when `GameState` is
`GS_INTERMISSION`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawNoState`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `Drawer` when `CurState` is `NOSTATE` or any other non-state.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawShowNextLoc`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `Drawer` when `CurState` is `SHOWNEXTLOC` and, by default,
`DrawNoState` after setting `Snl_PointerOn` to `true`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `DrawStats`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `Drawer` directly after drawing the animated background when
`CurState` is `STATCOUNT`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `InitNoState`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `UpdateShowNextLoc` to initiate the `NOSTATE` stage.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `InitShowNextLoc`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `UpdateStats` to initiate the `SHOWNEXTLOC` stage.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `InitStats`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `Start` to initiate the `STATCOUNT` stage.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `UpdateNoState`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `Ticker` when `CurState` is `NOSTATE` or any other non-state. Exits
the intermission by calling `End` and `Level.WorldDone` when appropriate.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `UpdateShowNextLoc`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `Ticker` when `CurState` is `SHOWNEXTLOC`. Runs `InitNoState` when
appropriate and alternates `Snl_PointerOn`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `UpdateStats`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Called by `Ticker` when `CurState` is `STATCOUNT`. Runs `InitShowNextLoc`
when appropriate.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `CheckForAccelerate`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Updates the values of `AccelerateStage` and `PlayerReady` according to each
player's inputs.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `FragSum`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Returns the number of frags player `playernum` has accumulated against all
currently in-game players. This is different from `WBPlayerStruct.FragCount`
because it is counted dynamically, i.e. if a player leaves the count will be
changed. This is only useful for game modes where frags do not count as score.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetPlayerWidths`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetRowColor`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetSortedPlayers`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `PlaySound`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Plays a UI sound at full volume using `S_Sound`.
2018-12-29 16:05:19 -08:00
<!-- EOF -->