Player12
An open source football management simulator
Loading...
Searching...
No Matches
ManagementScene Class Referenceabstract

Base class for every in-career screen. More...

#include <management_scene.h>

Inheritance diagram for ManagementScene:
GUIScene AwardsScene CalendarScene CallUpScene ClubScene DataHubScene DelegationScene FixturesScene InboxScene InternationalScene LineupScene MainGameScene ManagerScene MatchReportScene MedicalScene NewsScene OppositionScene PlayerCompareScene PlayerProfileScene PreseasonScene RecordsScene ReservesScene RosterScene ScoutingScene SquadPlannerScene StaffScene StandingsScene StrategyScene TimelineScene TrainingScene TransferMarketScene YouthScene

Classes

struct  PaletteEntry
 

Public Member Functions

 ManagementScene (GUIView *guiViewPtr)
 
void render () final
 Renders the scene.
 
void onEnter () override
 Called when the scene is entered/becomes active.
 
void onResume () override
 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.
 
void handleEvent (const SDL_Event &event) override
 
std::optional< NavEntry > historyEntry () const override
 
- Public Member Functions inherited from GUIScene
 GUIScene (GUIView *guiView_ptr)
 Constructs a new GUIScene.
 
virtual ~GUIScene ()=default
 Destroys the GUIScene.
 
virtual void update (float deltaTime)=0
 Updates scene logic.
 
virtual void onExit ()
 Called when the scene is exited/becomes inactive.
 
virtual void onResize (int width, int height)
 Called when the window is resized.
 
virtual SceneID getID () const =0
 Gets the ID of the scene.
 

Protected Member Functions

virtual void renderContent ()=0
 Draws the page body inside the content region.
 
virtual NavSection navSection () const =0
 Sidebar entry highlighted for this screen.
 
virtual void refresh ()
 Rebuilds cached view models from the game state.
 
virtual std::optional< EditorContext > editorContext () const
 
void showToast (std::string message, bool isError=false)
 Shows a short confirmation message in the top bar.
 
HolidayDialog & holidayDialog ()
 Holiday planner and return report of this screen.
 
- 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.
 

Private Member Functions

void renderSidebar (bool collapsed)
 
void renderSidebarFlyout ()
 Screens of the hovered hub beside the collapsed sidebar.
 
void renderTopBar (float height)
 
void renderPalette ()
 
void renderMainMenuConfirm ()
 
void handleShortcuts ()
 
void renderSwipeIndicator ()
 
void openPalette ()
 
void buildPaletteIndex ()
 
void filterPalette ()
 
void activatePaletteEntry (const PaletteEntry &entry)
 
void syncClubAccent () const
 
void pollSaveStatus ()
 

Private Attributes

std::string toast_message
 
float toast_seconds = 0.0f
 
bool toast_is_error = false
 
std::string save_label
 
float save_poll_seconds = 0.0f
 
bool save_failed = false
 
bool palette_requested = false
 
bool palette_focus_input = false
 
std::array< char, 64 > palette_query {}
 
std::string palette_filtered_query
 
std::vector< PaletteEntry > palette_entries
 
std::vector< size_t > palette_matches
 
std::vector< NextAction > palette_actions
 
int palette_selection = 0
 
SwipeGesture::Step pending_history_step = SwipeGesture::Step::NONE
 
bool main_menu_confirm_requested = false
 
HolidayDialog holiday_dialog
 
bool sidebar_nav_overflow = false
 
int flyout_hub = -1
 
ImVec2 flyout_anchor {}
 
float flyout_grace = 0.0f
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 
class GameFlowTest_ManagementScreensMidSeason_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Base class for every in-career screen.

Draws the persistent shell (sidebar navigation, top bar with club, date, balance and the context-aware Continue button, command palette and keyboard shortcuts) and delegates the page body to renderContent().

Constructor & Destructor Documentation

◆ ManagementScene()

ManagementScene::ManagementScene ( GUIView *  guiViewPtr)
explicit

Member Function Documentation

◆ activatePaletteEntry()

void ManagementScene::activatePaletteEntry ( const PaletteEntry &  entry)
private

◆ buildPaletteIndex()

void ManagementScene::buildPaletteIndex ( )
private

◆ editorContext()

virtual std::optional< EditorContext > ManagementScene::editorContext ( ) const
inlineprotectedvirtual

Override for new/custom data domains. Record filtering and related items belong to the page; schema discovery remains inside the generic editor.

◆ filterPalette()

void ManagementScene::filterPalette ( )
private

◆ handleEvent()

void ManagementScene::handleEvent ( const SDL_Event &  event)
overridevirtual

Mouse side buttons and the sideways touchpad swipe (Back / Forward).

Reimplemented from GUIScene.

◆ handleShortcuts()

void ManagementScene::handleShortcuts ( )
private

◆ historyEntry()

std::optional< NavEntry > ManagementScene::historyEntry ( ) const
overridevirtual

The screen's sidebar section; detail screens override it.

Reimplemented from GUIScene.

Reimplemented in MatchReportScene, PlayerCompareScene, PlayerProfileScene, and RosterScene.

◆ holidayDialog()

HolidayDialog & ManagementScene::holidayDialog ( )
inlineprotected

Holiday planner and return report of this screen.

◆ navSection()

◆ onEnter()

void ManagementScene::onEnter ( )
overridevirtual

Called when the scene is entered/becomes active.

Reimplemented from GUIScene.

◆ onResume()

void ManagementScene::onResume ( )
overridevirtual

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.

Reimplemented from GUIScene.

Reimplemented in TransferMarketScene.

◆ openPalette()

void ManagementScene::openPalette ( )
private

◆ pollSaveStatus()

void ManagementScene::pollSaveStatus ( )
private

◆ refresh()

◆ render()

void ManagementScene::render ( )
finalvirtual

Renders the scene.

Implements GUIScene.

◆ renderContent()

◆ renderMainMenuConfirm()

void ManagementScene::renderMainMenuConfirm ( )
private

◆ renderPalette()

void ManagementScene::renderPalette ( )
private

◆ renderSidebar()

void ManagementScene::renderSidebar ( bool  collapsed)
private

◆ renderSidebarFlyout()

void ManagementScene::renderSidebarFlyout ( )
private

Screens of the hovered hub beside the collapsed sidebar.

◆ renderSwipeIndicator()

void ManagementScene::renderSwipeIndicator ( )
private

Arrow bubble at the window edge while a sideways swipe is under way.

◆ renderTopBar()

void ManagementScene::renderTopBar ( float  height)
private

◆ showToast()

void ManagementScene::showToast ( std::string  message,
bool  isError = false 
)
protected

Shows a short confirmation message in the top bar.

◆ syncClubAccent()

void ManagementScene::syncClubAccent ( ) const
private

Friends And Related Symbol Documentation

◆ GameFlowTest_GUIFlowLifecycle_Test

friend class GameFlowTest_GUIFlowLifecycle_Test
friend

◆ GameFlowTest_ManagementScreensMidSeason_Test

friend class GameFlowTest_ManagementScreensMidSeason_Test
friend

Member Data Documentation

◆ flyout_anchor

ImVec2 ManagementScene::flyout_anchor {}
private

◆ flyout_grace

float ManagementScene::flyout_grace = 0.0f
private

Seconds left once the mouse has left.

◆ flyout_hub

int ManagementScene::flyout_hub = -1
private

Hub whose flyout is open beside the collapsed sidebar (-1: none).

◆ holiday_dialog

HolidayDialog ManagementScene::holiday_dialog
private

◆ main_menu_confirm_requested

bool ManagementScene::main_menu_confirm_requested = false
private

◆ palette_actions

std::vector<NextAction> ManagementScene::palette_actions
private

◆ palette_entries

std::vector<PaletteEntry> ManagementScene::palette_entries
private

◆ palette_filtered_query

std::string ManagementScene::palette_filtered_query
private

◆ palette_focus_input

bool ManagementScene::palette_focus_input = false
private

◆ palette_matches

std::vector<size_t> ManagementScene::palette_matches
private

◆ palette_query

std::array<char, 64> ManagementScene::palette_query {}
private

◆ palette_requested

bool ManagementScene::palette_requested = false
private

◆ palette_selection

int ManagementScene::palette_selection = 0
private

◆ pending_history_step

SwipeGesture::Step ManagementScene::pending_history_step = SwipeGesture::Step::NONE
private

Back / Forward asked for by a side button or swipe, done next frame.

◆ save_failed

bool ManagementScene::save_failed = false
private

◆ save_label

std::string ManagementScene::save_label
private

Top-bar save indicator, refreshed about once per second.

◆ save_poll_seconds

float ManagementScene::save_poll_seconds = 0.0f
private

◆ sidebar_nav_overflow

bool ManagementScene::sidebar_nav_overflow = false
private

Whether the sidebar navigation needed scrolling last frame.

◆ toast_is_error

bool ManagementScene::toast_is_error = false
private

◆ toast_message

std::string ManagementScene::toast_message
private

◆ toast_seconds

float ManagementScene::toast_seconds = 0.0f
private

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