Add update_cards_scripts

This commit is contained in:
GenevensiS
2026-05-13 18:09:56 +02:00
parent f4fe9ab6b0
commit 151a04909a
26 changed files with 403 additions and 108 deletions
+7 -1
View File
@@ -10,6 +10,7 @@
#include <data/stylesheet.hpp>
#include <data/game.hpp>
#include <data/field.hpp>
#include <data/update_cards_script.hpp>
#include <util/io/package_manager.hpp>
#include <gui/new_window.hpp> // for selecting stylesheets on load error
@@ -75,7 +76,11 @@ void StyleSheet::validate(Version ver) {
throw Error(_ERROR_1_("no game specified",_TYPE_("stylesheet")));
}
// a stylesheet depends on the game it is made for
requireDependency(game.get());
requireDependency(game.get());
// sort the update_cards_scripts from oldest to newest
std::sort(update_cards_scripts.begin(), update_cards_scripts.end(), [](const auto& a, const auto& b) {
return *a < *b;
});
}
@@ -125,6 +130,7 @@ IMPLEMENT_REFLECTION(StyleSheet) {
extra_card_style.init(extra_card_fields);
}
REFLECT(extra_card_style);
REFLECT_NO_SCRIPT(update_cards_scripts);
}