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

Modal pre-match / half-time team talk of the managed club. More...

#include <team_talk_dialog.h>

Classes

struct  ToneRow
 

Public Member Functions

void open (const GameController &controller, TeamTalkMoment moment, int own_goals=0, int other_goals=0)
 
bool render (GameController &controller)
 
void renderForMatch (GameController &controller, MatchEngine &engine, TeamID home_id, TeamID away_id)
 
bool isOpen () const
 

Private Member Functions

void renderOptions (GameController &controller)
 
void renderResult () const
 

Private Attributes

TeamTalkMoment moment = TeamTalkMoment::PreMatch
 
int own_goals = 0
 
int other_goals = 0
 
bool open_requested = false
 
bool dismiss_requested = false
 
bool visible = false
 
bool has_result = false
 
bool pre_offered = false
 
bool half_offered = false
 
std::array< float, 2 > applied_talk {}
 
std::string title
 
std::string situation
 
std::vector< std::string > tags
 
std::string mood
 
std::string leaders
 
std::vector< ToneRow > rows
 
std::string result_summary
 
std::string result_counts
 
std::string result_morale
 
ImVec4 result_color
 

Detailed Description

Modal pre-match / half-time team talk of the managed club.

Self-contained: keep one instance per match screen. Either call open() and render() yourself, or let renderForMatch() drive it from the live engine: it opens the pre-match talk at kick-off and the half-time talk at the break.

Each tone shows its predicted reception in this situation (score, stakes, the players' personalities); the result lists how the XI took it. Besides a few morale points, the talk's outcome (GameController::getTeamTalkModifier) reaches the live match: sharper (or shakier) decisions, execution and pressing for the first minutes of the half (MatchEngine::getTeamTalkEffect).

Member Function Documentation

◆ isOpen()

bool TeamTalkDialog::isOpen ( ) const
inline

◆ open()

void TeamTalkDialog::open ( const GameController &  controller,
TeamTalkMoment  moment,
int  own_goals = 0,
int  other_goals = 0 
)

Opens the talk for moment (the score matters at half-time).

◆ render()

bool TeamTalkDialog::render ( GameController &  controller)

Draws the dialog while open.

Returns
True on the frame the talk was given.

◆ renderForMatch()

void TeamTalkDialog::renderForMatch ( GameController &  controller,
MatchEngine &  engine,
TeamID  home_id,
TeamID  away_id 
)

One call per frame from a live match screen: opens the pre-match talk at kick-off and the half-time talk at the break, and withdraws an unanswered talk (without effect) once its moment has passed or the match is over. The match keeps running meanwhile. Talks given (here or before kick-off) are passed on to the engine of the managed side.

◆ renderOptions()

void TeamTalkDialog::renderOptions ( GameController &  controller)
private

◆ renderResult()

void TeamTalkDialog::renderResult ( ) const
private

Member Data Documentation

◆ applied_talk

std::array<float, 2> TeamTalkDialog::applied_talk {}
private

Talk modifiers by half already passed to the engine.

◆ dismiss_requested

bool TeamTalkDialog::dismiss_requested = false
private

◆ half_offered

bool TeamTalkDialog::half_offered = false
private

◆ has_result

bool TeamTalkDialog::has_result = false
private

◆ leaders

std::string TeamTalkDialog::leaders
private

◆ moment

TeamTalkMoment TeamTalkDialog::moment = TeamTalkMoment::PreMatch
private

◆ mood

std::string TeamTalkDialog::mood
private

◆ open_requested

bool TeamTalkDialog::open_requested = false
private

◆ other_goals

int TeamTalkDialog::other_goals = 0
private

◆ own_goals

int TeamTalkDialog::own_goals = 0
private

◆ pre_offered

bool TeamTalkDialog::pre_offered = false
private

◆ result_color

ImVec4 TeamTalkDialog::result_color
private

◆ result_counts

std::string TeamTalkDialog::result_counts
private

◆ result_morale

std::string TeamTalkDialog::result_morale
private

◆ result_summary

std::string TeamTalkDialog::result_summary
private

◆ rows

std::vector<ToneRow> TeamTalkDialog::rows
private

◆ situation

std::string TeamTalkDialog::situation
private

◆ tags

std::vector<std::string> TeamTalkDialog::tags
private

◆ title

std::string TeamTalkDialog::title
private

◆ visible

bool TeamTalkDialog::visible = false
private

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