|
coastline 0.0.4
|
The menus, drawn with the import of a release. More...
#include <menus.h>
Public Member Functions | |
| ~Menus () | |
| Release front-end resources before the configuration and renderer are destroyed. | |
| Menus (const Menus &)=delete | |
| Prevent copying active front-end resources and screen progress. | |
| Menus & | operator= (const Menus &)=delete |
| Prevent assignment of active front-end resources and screen progress. | |
| void | Restart () |
| Show the main menu again, as the splash screens and the attract demo switch to it. | |
| bool | IsMainMenu () const |
| MenusEnd | Frame (SceneRenderer &renderer, float seconds, const std::array< MenuButtons, 2 > &players, bool secondController, const PaintShopInput &pointer) |
| Run a frame of the screen that shows and draw it. | |
| bool | DrawsPointer () const |
| bool | TakesText () const |
| int | ControlledPlayers () const |
| RaceSetup | ChosenRace () const |
| std::optional< std::filesystem::path > | CarImages (int car) const |
| void | FinishRace (RaceEnd end, const RaceResults &results, bool sfxVolumeAdjusted=false) |
| Go on from a race that Frame() started, as FinishRace() of the console goes on: to the results screen, to the next season of the championship, or to the main menu. | |
| void | FinishCredits () |
| Show the options menu again after the race of the credits it started. | |
| void | SetMenuMusic (std::function< void()> play) |
| Set the routine that starts the music module of the menus, which the main menu calls as it opens after a module of fewer channels, the module of a race. | |
| void | SetOptionOverrides (GameConfig overrides) |
| Display temporary command-line values and disable matching Options entries. | |
Static Public Member Functions | |
| static std::unique_ptr< Menus > | Load (SceneRenderer &renderer, const std::filesystem::path &release, const std::filesystem::path &saves, const std::filesystem::path &cache, GameConfig &config, const std::filesystem::path &configPath, ConfigSaver &configSaver, std::span< const std::filesystem::path > dataRoots={}, std::string_view assetPack={}, std::string_view unitsRegion={}, const nlohmann::json &packSettings=nlohmann::json::object()) |
| Read the assets of the menu screens and the items of each screen. | |
The menus, drawn with the import of a release.
| coastline::Menus::~Menus | ( | ) |
Release front-end resources before the configuration and renderer are destroyed.
|
delete |
Prevent copying active front-end resources and screen progress.
|
static |
Read the assets of the menu screens and the items of each screen.
| renderer | The renderer that draws them. |
| release | The selected cartridge directory, n64/base of the prepared assets. |
| saves | The directory of the saves, the data directory of the game, with the Controller Pak and the frames of the ghost car. |
| cache | The cache directory of the game, for the images of the painted cars. |
| config | The settings of BossRally.ini, with the cars the players chose last. The settings outlive the menus. |
| configPath | The file of the settings, written whenever a player chooses a car. |
| configSaver | The thread that writes the settings. The thread outlives the menus. |
| dataRoots | The imported data roots for available packs and cartridge regions. |
| assetPack | The active pack, or empty to use the configured pack. |
| unitsRegion | The explicit CLI region for automatic units, or empty to use locale. |
| packSettings | Asset-pack menu heading, idle timeout, and attract-demo preferences. |
Prevent assignment of active front-end resources and screen progress.
| void coastline::Menus::Restart | ( | ) |
Show the main menu again, as the splash screens and the attract demo switch to it.
|
inline |
| MenusEnd coastline::Menus::Frame | ( | SceneRenderer & | renderer, |
| float | seconds, | ||
| const std::array< MenuButtons, 2 > & | players, | ||
| bool | secondController, | ||
| const PaintShopInput & | pointer ) |
Run a frame of the screen that shows and draw it.
| renderer | The renderer of the frame, between Begin() and End(). |
| seconds | The time of the frame. |
| players | The presses of the first and the second controller. |
| secondController | Whether a device is bound to the second port. |
| pointer | The buttons, the stick, and the mouse of the first player, as the paint shop and the dialogs of the Controller Pak read them. |
| bool coastline::Menus::DrawsPointer | ( | ) | const |
| bool coastline::Menus::TakesText | ( | ) | const |
| int coastline::Menus::ControlledPlayers | ( | ) | const |
| RaceSetup coastline::Menus::ChosenRace | ( | ) | const |
| std::optional< std::filesystem::path > coastline::Menus::CarImages | ( | int | car | ) | const |
| car | The race-engine car index. |
| void coastline::Menus::FinishRace | ( | RaceEnd | end, |
| const RaceResults & | results, | ||
| bool | sfxVolumeAdjusted = false ) |
Go on from a race that Frame() started, as FinishRace() of the console goes on: to the results screen, to the next season of the championship, or to the main menu.
| end | How the race ended. |
| results | The results of the race, read when it ended with RaceEnd::Results. |
| sfxVolumeAdjusted | Whether the pause menu changed SFX volume during the race, even if later restored to its initial level. |
| void coastline::Menus::FinishCredits | ( | ) |
Show the options menu again after the race of the credits it started.
|
inline |
Set the routine that starts the music module of the menus, which the main menu calls as it opens after a module of fewer channels, the module of a race.
| play | The routine, or empty for none. |
|
inline |
Display temporary command-line values and disable matching Options entries.
| overrides | Per-run settings that are never written to the user's INI file. |