mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Magic Workstation spoiler format export
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@216 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -143,13 +143,13 @@ SetP MtgEditorFileFormat::importSet(const String& filename) {
|
||||
target = ¤t_card->value<TextValue>(_("power")).value;
|
||||
} else if (line == _("#TOUGHNESS#####")) { // toughness
|
||||
target = ¤t_card->value<TextValue>(_("toughness")).value;
|
||||
} else if (line == _("#ILLUSTRATION##") || line == _("#ILLUSTRATION8#")) { // image
|
||||
} else if (line == _("#ILLUSTRATION##") || line == _("#ILLUSTRATION8#")) { // image
|
||||
target = 0;
|
||||
line = file.ReadLine();
|
||||
if (!wxFileExists(line)) {
|
||||
// based on card name and date
|
||||
line = filter1(filename) + set_date + _("/") +
|
||||
filter2(current_card->value<TextValue>(_("name")).value()) + card_date + _(".jpg");
|
||||
filter2(current_card->value<TextValue>(_("name")).value) + card_date + _(".jpg");
|
||||
}
|
||||
// copy image into set
|
||||
if (wxFileExists(line)) {
|
||||
@@ -177,16 +177,16 @@ SetP MtgEditorFileFormat::importSet(const String& filename) {
|
||||
|
||||
// set defaults for artist and copyright to that of the first card
|
||||
if (!set->cards.empty()) {
|
||||
String artist = set->cards[0]->value<TextValue>(_("illustrator")).value();
|
||||
String copyright = set->cards[0]->value<TextValue>(_("copyright")) .value();
|
||||
String artist = set->cards[0]->value<TextValue>(_("illustrator")).value;
|
||||
String copyright = set->cards[0]->value<TextValue>(_("copyright")) .value;
|
||||
set->value<TextValue>(_("artist")) .value.assign(artist);
|
||||
set->value<TextValue>(_("copyright")).value.assign(copyright);
|
||||
// which cards have this value?
|
||||
FOR_EACH(card, set->cards) {
|
||||
Defaultable<String>& card_artist = card->value<TextValue>(_("illustrator")).value;
|
||||
Defaultable<String>& card_copyright = card->value<TextValue>(_("copyright")) .value;
|
||||
if (card_artist() == artist) card_artist.makeDefault();
|
||||
if (card_copyright() == copyright) card_copyright.makeDefault();
|
||||
if (card_artist == artist) card_artist.makeDefault();
|
||||
if (card_copyright == copyright) card_copyright.makeDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ String MtgEditorFileFormat::filter2(const String& str) {
|
||||
|
||||
void MtgEditorFileFormat::untag(const CardP& card, const String& field) {
|
||||
Defaultable<String>& value = card->value<TextValue>(field).value;
|
||||
value.assignDontChangeDefault(untag_no_escape(value()));
|
||||
value.assignDontChangeDefault(untag_no_escape(value));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user