1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fixed missing translation strings on loading campaign save

- campaign header now contains text container and stores campaign texts
- map header now contains text container instead of inheriting it
- moved text container registration logic to a wraper class
- fixed registration of copied text containers (from copied map header)
This commit is contained in:
Ivan Savenko
2024-01-15 13:10:25 +02:00
parent d3a1cdb97a
commit c7897300c0
9 changed files with 67 additions and 25 deletions

View File

@@ -192,7 +192,7 @@ struct DLL_LINKAGE TriggeredEvent
};
/// The map header holds information about loss/victory condition,map format, version, players, height, width,...
class DLL_LINKAGE CMapHeader: public TextLocalizationContainer
class DLL_LINKAGE CMapHeader
{
void setupEvents();
public:
@@ -240,13 +240,14 @@ public:
/// translations for map to be transferred over network
JsonNode translations;
TextContainerRegistrable texts;
void registerMapStrings();
template <typename Handler>
void serialize(Handler & h, const int Version)
{
h & static_cast<TextLocalizationContainer&>(*this);
h & texts;
h & version;
h & mods;
h & name;