allow import_image to accept script images
import_image and download_image no longer save the set or require it to have been saved once
console panel now tries to output toJson() before falling back to toCode()
This commit is contained in:
GenevensiS
2026-05-14 13:50:02 +02:00
parent 6f4fc0066d
commit 76af996f0a
9 changed files with 78 additions and 40 deletions
+3 -2
View File
@@ -224,10 +224,11 @@ void Set::validate(Version file_app_version) {
// update cards with stylesheet update_cards_scripts
for (int i = 0; i < cards.size(); ++i) {
CardP& card = cards[i];
StyleSheetP stylesheet = stylesheetForP(card);
StyleSheetP stylesheet = card->stylesheet ? card->stylesheet : stylesheetForP(card);
Version stylesheet_version = card->stylesheet_version.isZero() ? this->stylesheet_version : card->stylesheet_version;
for (int j = 0; j < stylesheet->update_cards_scripts.size(); ++j) {
UpdateCardsScriptP& script = stylesheet->update_cards_scripts[j];
if (card->stylesheet_version >= script->before_version) continue;
if (stylesheet_version >= script->before_version) continue;
vector<CardP> new_cards = script->perform(*this, card);
if (!new_cards.empty()) {
FOR_EACH(new_card, new_cards) {