|
Player12
An open source football management simulator
|
#include <cstddef>#include <cstdint>#include <optional>#include <span>#include <string>#include <vector>#include "global/types.h"#include "model/gamedate.h"Go to the source code of this file.
Classes | |
| struct | InboxView |
| Filters of the inbox screen, kept with the career (table InboxView) so they survive a scene change and a reload. More... | |
| struct | InboxMessage |
| A news item for the managed club. More... | |
| class | Inbox |
| Chronological list of messages with read tracking. More... | |
Enumerations | |
| enum class | InboxCategory : std::uint8_t { General = 0 , Match , Injury , Transfer , Contract , Youth , Board , Finance , COUNT } |
| Message categories (values are persisted). More... | |
| enum class | InboxAction : std::uint8_t { None = 0 , RespondOffer , ReplyToPlayer , YouthTrialists , Shortlist , Dilemma } |
| What the manager can do straight from a message. Derived from the title key (see Inbox::actionFor()), so producers only need to add their key to the table in inbox.cpp; the linked player identifies the entity. More... | |
Functions | |
| const char * | inboxCategoryKey (InboxCategory category) |
| std::string | formatLocalized (const std::string &key, const std::vector< std::string > &args) |
| std::string | localizedDate (const std::string &text) |
| std::string | formatMoney (std::int64_t amount) |
|
strong |
What the manager can do straight from a message. Derived from the title key (see Inbox::actionFor()), so producers only need to add their key to the table in inbox.cpp; the linked player identifies the entity.
|
strong |
| std::string formatLocalized | ( | const std::string & | key, |
| const std::vector< std::string > & | args | ||
| ) |
Formats a localised template, substituting {n} with args.
Arguments starting with '@' are language keys; ISO dates ("2027-06-30") are shown with the localised month. Two placeholder forms serve grammar: "{n:di}" puts the Italian preposition and article before club name n ("della Roma", see ClubArticle), and "{n|one|other}" picks a word by whether argument n is 1 ("{0} {0|giorno|giorni}").
| std::string formatMoney | ( | std::int64_t | amount | ) |
Money for a message argument: "€" and the plain amount ("€1250000"), shown by formatLocalized() in the reader's language ("€1.25M", "€ 1,25 mln"), so saved messages follow a later change of language.
| const char * inboxCategoryKey | ( | InboxCategory | category | ) |
Language key naming category (e.g. "INBOX_CAT_MATCH").
| std::string localizedDate | ( | const std::string & | text | ) |
An ISO date ("2027-06-30", GameDateValue::toString()) in the current language, e.g. "30 giu 2027"; any other text is returned unchanged.