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

Club inbox: pinned decisions with their actions in place, and the information feed with category filters and digest grouping. More...

#include <inbox_scene.h>

Inheritance diagram for InboxScene:
ManagementScene GUIScene

Classes

struct  Decision
 A pending decision with what can be done about it. More...
 
struct  Thread
 One visible row: a single message or a folded digest. More...
 

Public Member Functions

 InboxScene (GUIView *parent)
 
void update (float deltaTime) override
 Updates scene logic.
 
SceneID getID () const override
 Gets the ID of the scene.
 
- Public Member Functions inherited from ManagementScene
 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 onExit ()
 Called when the scene is exited/becomes inactive.
 
virtual void onResize (int width, int height)
 Called when the window is resized.
 

Protected Member Functions

void renderContent () override
 Draws the page body inside the content region.
 
NavSection navSection () const override
 Sidebar entry highlighted for this screen.
 
void refresh () override
 Rebuilds cached view models from the game state.
 
- Protected Member Functions inherited from ManagementScene
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 rebuildThreads ()
 
void rebuildDecisions ()
 
void renderDecisions ()
 
void renderDecision (const Decision &decision)
 
void renderFilters (float width, float height)
 
void renderThreads (float width, float height)
 
void renderReader (float height)
 
void openMessage (size_t messageIndex)
 
void renderReaderActions (const InboxMessage &message)
 
void renderDrawAction (const InboxMessage &message)
 
void renderEntityFilter ()
 
InboxView currentView () const
 
void applyView (const InboxView &view)
 
void storeView ()
 

Private Attributes

std::vector< Thread > threads
 
std::array< size_t, CATEGORY_COUNT > unread_by_category {}
 
std::array< size_t, CATEGORY_COUNT > total_by_category {}
 
int category_filter = -1
 
bool unread_only = false
 
int tab = -1
 
bool followed_only = false
 
std::optional< PlayerID > filter_player
 
std::optional< TeamID > filter_team
 
std::string filter_label
 
InboxView stored_view
 
std::vector< PlayerID > followed
 
size_t followed_unread = 0
 
size_t followed_total = 0
 
bool show_archived = false
 
size_t archived_count = 0
 
std::vector< Decision > decisions
 
std::vector< bool > hidden
 
int selected_thread = -1
 
int expanded_thread = -1
 
size_t selected_message = SIZE_MAX
 
std::uint32_t selected_message_id = 0
 
std::string selected_title
 
std::string selected_body
 
PlayerTalkDialog talk_dialog
 
OfferNegotiationDialog offer_dialog
 
DrawCeremonyDialog draw_dialog
 

Static Private Attributes

static constexpr size_t CATEGORY_COUNT
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Club inbox: pinned decisions with their actions in place, and the information feed with category filters and digest grouping.

Decisions (offers for the club's players, player requests, youth trialists) stay on the Decisions tab until resolved, with negotiate / accept / reject / reply / sign buttons right there; transfer bids open the talks dialog (OfferNegotiationDialog). Read information older than Inbox::ARCHIVE_DAYS moves to the archive.

Routine messages of the same kind that arrive in the same week are folded into one digest row, so a busy matchday reads as a single entry instead of a wall of near-identical notifications.

The filters (tab, category, unread, followed players, one player or club) are kept with the career (InboxView), so they survive a scene change and a reload. Decision moments are answered on the Decisions tab with their effects shown (InboxDilemmaCard).

Constructor & Destructor Documentation

◆ InboxScene()

InboxScene::InboxScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ applyView()

void InboxScene::applyView ( const InboxView &  view)
private

◆ currentView()

InboxView InboxScene::currentView ( ) const
private

The filters as shown now.

◆ getID()

SceneID InboxScene::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.

◆ navSection()

NavSection InboxScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ openMessage()

void InboxScene::openMessage ( size_t  messageIndex)
private

◆ rebuildDecisions()

void InboxScene::rebuildDecisions ( )
private

◆ rebuildThreads()

void InboxScene::rebuildThreads ( )
private

◆ refresh()

void InboxScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderContent()

void InboxScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDecision()

void InboxScene::renderDecision ( const Decision &  decision)
private

◆ renderDecisions()

void InboxScene::renderDecisions ( )
private

◆ renderDrawAction()

void InboxScene::renderDrawAction ( const InboxMessage &  message)
private

Watch the draw: continental draw messages open the ceremony.

◆ renderEntityFilter()

void InboxScene::renderEntityFilter ( )
private

◆ renderFilters()

void InboxScene::renderFilters ( float  width,
float  height 
)
private

◆ renderReader()

void InboxScene::renderReader ( float  height)
private

◆ renderReaderActions()

void InboxScene::renderReaderActions ( const InboxMessage &  message)
private

◆ renderThreads()

void InboxScene::renderThreads ( float  width,
float  height 
)
private

◆ storeView()

void InboxScene::storeView ( )
private

Keeps the filters with the career and rebuilds the feed.

◆ update()

void InboxScene::update ( float  deltaTime)
overridevirtual

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

◆ archived_count

size_t InboxScene::archived_count = 0
private

◆ CATEGORY_COUNT

constexpr size_t InboxScene::CATEGORY_COUNT
staticconstexprprivate
Initial value:
=
static_cast<size_t>(std::to_underlying(InboxCategory::COUNT))

◆ category_filter

int InboxScene::category_filter = -1
private

-1 = all categories.

◆ decisions

std::vector<Decision> InboxScene::decisions
private

◆ draw_dialog

DrawCeremonyDialog InboxScene::draw_dialog
private

◆ expanded_thread

int InboxScene::expanded_thread = -1
private

◆ filter_label

std::string InboxScene::filter_label
private

Name of the filtered player or club.

◆ filter_player

std::optional<PlayerID> InboxScene::filter_player
private

◆ filter_team

std::optional<TeamID> InboxScene::filter_team
private

◆ followed

std::vector<PlayerID> InboxScene::followed
private

◆ followed_only

bool InboxScene::followed_only = false
private

◆ followed_total

size_t InboxScene::followed_total = 0
private

◆ followed_unread

size_t InboxScene::followed_unread = 0
private

◆ hidden

std::vector<bool> InboxScene::hidden
private

Messages hidden from the feed (pending decisions, archive).

◆ offer_dialog

OfferNegotiationDialog InboxScene::offer_dialog
private

◆ selected_body

std::string InboxScene::selected_body
private

◆ selected_message

size_t InboxScene::selected_message = SIZE_MAX
private

◆ selected_message_id

std::uint32_t InboxScene::selected_message_id = 0
private

◆ selected_thread

int InboxScene::selected_thread = -1
private

◆ selected_title

std::string InboxScene::selected_title
private

◆ show_archived

bool InboxScene::show_archived = false
private

◆ stored_view

InboxView InboxScene::stored_view
private

Last view read from or kept with the career.

◆ tab

int InboxScene::tab = -1
private

0 = decisions, 1 = information (-1: pick).

◆ talk_dialog

PlayerTalkDialog InboxScene::talk_dialog
private

◆ threads

std::vector<Thread> InboxScene::threads
private

◆ total_by_category

std::array<size_t, CATEGORY_COUNT> InboxScene::total_by_category {}
private

◆ unread_by_category

std::array<size_t, CATEGORY_COUNT> InboxScene::unread_by_category {}
private

◆ unread_only

bool InboxScene::unread_only = false
private

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