Create real careers from the native wizard and preserve manager presentation (by Codex)
This commit is contained in:
1 parent
738ecc7a09
commit
ce1535fe2d
38 files changed
+466
-75
No files matched your search
@@ -64,6 +64,7 @@ AlmanacClub club_of(const ModernState& g, int team) {
|
||||
AlmanacManager manager_of(const ModernState& g, int manager) {
|
||||
AlmanacManager m;
|
||||
m.index = manager;
|
||||
if (const auto* p = g.manager_presentation(manager)) { m.name = p->name; return m; }
|
||||
const size_t at = size_t(manager) * kManagerRecord + 0xa8; // the manager's name (30 bytes)
|
||||
for (size_t i = 0; i < 30 && at + i < g.manager_records.size() && g.manager_records[at + i]; ++i)
|
||||
m.name.push_back(char(g.manager_records[at + i]));
|
||||
|
||||
@@ -82,6 +82,18 @@ struct ModernState : GameState {
|
||||
std::string career_id;
|
||||
std::vector<std::string> manager_ids;
|
||||
uint32_t manager_serial = 0;
|
||||
// Optional Modern-only display metadata, keyed by stable manager identity.
|
||||
// Original records remain byte-compatible and are the fallback for older saves.
|
||||
struct ManagerPresentation {
|
||||
std::string id, name, portrait_style = "photo";
|
||||
bool operator==(const ManagerPresentation&) const = default;
|
||||
};
|
||||
std::vector<ManagerPresentation> manager_presentations;
|
||||
const ManagerPresentation* manager_presentation(int slot) const {
|
||||
if (slot < 0 || size_t(slot) >= manager_ids.size()) return nullptr;
|
||||
for (const auto& p : manager_presentations) if (p.id == manager_ids[size_t(slot)]) return &p;
|
||||
return nullptr;
|
||||
}
|
||||
// The press journal (content/press_journal.hpp): business events the almanac cannot give
|
||||
// (transfers, contracts, toto, seasons, managers), noted once when they happen and saved, so
|
||||
// the interface's news keep their ids. `data` is the event's facts as JSON text.
|
||||
|
||||
Reference in new issue
Block a user