Player12
An open source football management simulator
Loading...
Searching...
No Matches
HelpScene Class Reference

Help screen: getting started, the keyboard shortcuts in force and a searchable glossary. Opened from the command palette, the Help shortcut or the main menu; in a career it can replay the welcome tour. More...

#include <help_scene.h>

Inheritance diagram for HelpScene:
GUIScene

Classes

struct  ShortcutRow
 

Public Member Functions

 HelpScene (GUIView *guiView_ptr, bool inCareer, std::optional< std::size_t > focusTerm=std::nullopt)
 
void onEnter () override
 Called when the scene is entered/becomes active.
 
void update (float) override
 Updates scene logic.
 
void render () override
 Renders the scene.
 
SceneID getID () const override
 Gets the ID of the scene.
 
- Public Member Functions inherited from GUIScene
 GUIScene (GUIView *guiView_ptr)
 Constructs a new GUIScene.
 
virtual ~GUIScene ()=default
 Destroys the GUIScene.
 
virtual void handleEvent (const SDL_Event &event)
 Handles SDL events for the scene.
 
virtual void onExit ()
 Called when the scene is exited/becomes inactive.
 
virtual void onResume ()
 Called when an overlay above this scene closes and it becomes the active scene again. Screens use it to refresh cached view models after a match, a transfer or any other state change made elsewhere.
 
virtual void onResize (int width, int height)
 Called when the window is resized.
 
virtual std::optional< NavEntry > historyEntry () const
 How to open this screen again from the navigation history, or nothing for scenes outside it (menus, team selection, the live match).
 

Private Member Functions

void renderStart ()
 
void renderShortcuts ()
 
void renderGlossary ()
 
void rebuildShortcuts ()
 
void leave ()
 
void filterTerms ()
 

Private Attributes

bool in_career = false
 
std::optional< std::size_t > focus_term
 
bool focus_pending = false
 
std::optional< float > focus_screen_y
 
std::array< char, 64 > query {}
 
std::string filtered_query
 
std::vector< std::size_t > matches
 
std::vector< ShortcutRow > shortcut_rows
 
std::uint32_t shortcuts_revision = 0
 
std::vector< std::string > search_text
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Member Functions inherited from GUIScene
SDL_Renderer * getRenderer () const
 Gets the SDL renderer.
 
SDL_Window * getWindow () const
 Gets the SDL window.
 
GUIView * getGuiView () const
 Gets the associated GUIView.
 
void changeScene (std::unique_ptr< GUIScene > newScene)
 Requests a scene change.
 
void quit ()
 Requests the application to quit.
 
- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Help screen: getting started, the keyboard shortcuts in force and a searchable glossary. Opened from the command palette, the Help shortcut or the main menu; in a career it can replay the welcome tour.

Constructor & Destructor Documentation

◆ HelpScene()

HelpScene::HelpScene ( GUIView *  guiView_ptr,
bool  inCareer,
std::optional< std::size_t >  focusTerm = std::nullopt 
)
Parameters
inCareerLeaving pops back to the career (else the main menu).
focusTermGlossary term to scroll to and highlight.

Member Function Documentation

◆ filterTerms()

void HelpScene::filterTerms ( )
private

◆ getID()

SceneID HelpScene::getID ( ) const
inlineoverridevirtual

Gets the ID of the scene.

Returns
The SceneID of this scene.

GUIView uses this identifier to apply match-specific event and scene behavior.

Implements GUIScene.

◆ leave()

void HelpScene::leave ( )
private

◆ onEnter()

void HelpScene::onEnter ( )
overridevirtual

Called when the scene is entered/becomes active.

Reimplemented from GUIScene.

◆ rebuildShortcuts()

void HelpScene::rebuildShortcuts ( )
private

◆ render()

void HelpScene::render ( )
overridevirtual

Renders the scene.

Implements GUIScene.

◆ renderGlossary()

void HelpScene::renderGlossary ( )
private

◆ renderShortcuts()

void HelpScene::renderShortcuts ( )
private

◆ renderStart()

void HelpScene::renderStart ( )
private

◆ update()

void HelpScene::update ( float  deltaTime)
inlineoverridevirtual

Updates scene logic.

Parameters
deltaTimeThe time elapsed since the last update.

Implements GUIScene.

Friends And Related Symbol Documentation

◆ GameFlowTest_GUIFlowLifecycle_Test

friend class GameFlowTest_GUIFlowLifecycle_Test
friend

Member Data Documentation

◆ filtered_query

std::string HelpScene::filtered_query
private

◆ focus_pending

bool HelpScene::focus_pending = false
private

◆ focus_screen_y

std::optional<float> HelpScene::focus_screen_y
private

Where the focused term is drawn.

◆ focus_term

std::optional<std::size_t> HelpScene::focus_term
private

◆ in_career

bool HelpScene::in_career = false
private

◆ matches

std::vector<std::size_t> HelpScene::matches
private

◆ query

std::array<char, 64> HelpScene::query {}
private

◆ search_text

std::vector<std::string> HelpScene::search_text
private

Lower-case "term definition" text per glossary entry, for search.

◆ shortcut_rows

std::vector<ShortcutRow> HelpScene::shortcut_rows
private

◆ shortcuts_revision

std::uint32_t HelpScene::shortcuts_revision = 0
private

The documentation for this class was generated from the following files: