A lot of messy, copypasted boilerplate has been bundled together into a single function.
Programmers can now fire up a Match Race, the most basic type of gameplay, from menu code in only four steps (other modes take a little more attention):
- **M_MenuToLevelPreamble(UINT8 - splitscreen players #, boolean - false to extend wipe/true for short wipe)**
- set restoremenu
- D_MapChange(...)
- M_ClearMenus(...)
Includes the following fixes:
- Encore no longer has over-long wipes when started from menu, only standard-length
- "Boss Intro" and Encore start-of-round sounds will always play, even if no Title Card is drawn
- No long wipe when restarting a Time Attack run
- Auto Encore and Auto Gamespeed are no longer accidentially forced if you've manually changed them to Off and Gear 2 before starting netgame
- Built off g_fast_forward to utilise a lot of existing structure
- Only does steps of 5 seconds and therefore isn't precise, but that's better than having to rewatch/fastforward through the entire thing
- No single frame step back or general in-motion rewind preview, but that was all overkill
- Empty `demo.titlename` case
- Don't try to save demo of name `.lmp`
- Doesn't fall back to anything, because emptying out the name field can be reasonably treated as not wanting to save
- `demo.titlename` consists only of invalid characters
- Don't try to save demo of name `-.lmp`
- Falls back to the default demo title, because the user clearly wanted to save and just happened to provide invalid text
- V_SLIDEIN: For (G_IsTitleCardAvailable == false)/(versus at map start == true) contexts, use timeinmap instead of leveltime
- Don't reset timeinmap when reloading gamestate, so it's more functionally equivalent to lt_ticker
These two changes also fix the hypothetical issue of titlecard-less custom gametypes having weird HUD state on late netgame join.
Timeinmap is exclusively used for HUD, as is st_fadein. timeinmap also doesn't increment under g_fastforward, therefore the best candidate to tie together
- 1P
- "-Watching-" in thin font
- Player name in free play font
- 2P
- Player name in free play font, transparent
- 4P
- Unchanged (player name in thin font, transparent)
- Remove V_HUDTRANS (Tally makes it fully transparent)
- Embed button codes instead of drawing them separately (fixes minor alignment issues)
- Fade in over 1 second (visual flair)
- When a nextmapoverride is in play, do not insert the just-played map into the GP Rank
- Put all the behaviour that determines which Round icon to show in exactly one places
Also, fix a bug where it would show the skin realname for a spectating player's tally instead of the ROUND text.
- Gametypes have "GPpic" and "GPpicMini" parameters
- These are shown in contexts where a Round Number would be shown in GP, but an eventmode is under way.
- Instead of having different rules to show up on the pause menu, titlecard, and tally/intermission...
- Pause Menu Roundqueue, Tally, and Intermission have all been aligned to the same rules.
- As long as the titlecard is standard, it will show the GP Pic per those rules. (GTR_SPECIALSTART and GTR_BOSS still have their unique behaviour here)
- Avoid iterating displayplayers to find view number and
prefer R_GetViewNumber.
- Iterate over all matching displayplayers if necessary,
instead of stopping at the first match.
- V_HUDTRANS does not fade if combined with V_SLIDEIN
(since sliding elements are not supposed to fade).
- If not V_SPLITSCREEN, uses most opaque fade value among
splitscreen players (since Tally will fade back out for
specific players).
TODO: This is steenky.
Essentially immediately tint the geometry and players the latest possible place it is safe to do so, with the magic of the software-exclusive fade.
This would ideally be handled with a shader so that GL and any future hwr2-native renderer can get in on the action too.