|
Player12
An open source football management simulator
|
Modal one-to-one conversation with a managed player. More...
#include <player_talk_dialog.h>
Classes | |
| struct | OptionRow |
| struct | PromiseLine |
| struct | Section |
Public Member Functions | |
| void | open (GameController &controller, PlayerID player_id) |
| bool | render (GameController &controller) |
| void | inboxAction (GameController &controller, const InboxMessage &message) |
| bool | isOpen () const |
Private Member Functions | |
| void | rebuild (const GameController &controller) |
| void | renderHeader () const |
| void | renderOptions (GameController &controller) |
| void | renderResult () const |
| void | choose (GameController &controller, TalkOption option) |
Private Attributes | |
| PlayerID | player_id = 0 |
| bool | open_requested = false |
| bool | visible = false |
| bool | has_result = false |
| std::string | title |
| std::string | subtitle |
| std::string | morale_text |
| std::string | trust_text |
| float | morale = 0.0f |
| float | trust = 0.0f |
| std::string | request_text |
| std::string | story_text |
| std::vector< PromiseLine > | promises |
| std::vector< Section > | sections |
| std::string | reaction_text |
| ImVec4 | reaction_color |
| std::string | reply_text |
| std::vector< std::string > | consequences |
Modal one-to-one conversation with a managed player.
Self-contained: a scene keeps one instance, calls open() from a button and render() every frame (inside its ImGui window). The dialog lists the conversation lines grouped by topic with the predicted reaction, cooldowns and why a line is unavailable, the player's open request and his promises with progress; after a line it shows his reply and what changed. One line per conversation: talks are meant to be rare and to matter.
All text is built when the dialog opens or a line is held, never per frame.
|
private |
| void PlayerTalkDialog::inboxAction | ( | GameController & | controller, |
| const InboxMessage & | message | ||
| ) |
Inbox helper: a "Reply" button for messages from a player who waits for an answer (request or story); opens the dialog when clicked.
|
inline |
| void PlayerTalkDialog::open | ( | GameController & | controller, |
| PlayerID | player_id | ||
| ) |
Opens the conversation (shown from the next render()).
|
private |
| bool PlayerTalkDialog::render | ( | GameController & | controller | ) |
Draws the dialog while open.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |