mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 05:57:00 -04:00
fixed: version number propagates to included files
magic pack template now uses 'pack type' instead of 'pack item' git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1331 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+19
-19
@@ -1,47 +1,47 @@
|
|||||||
|
|
||||||
############################################################## Card pack items
|
############################################################## Card pack types
|
||||||
|
|
||||||
pack item:
|
pack type:
|
||||||
name: basic land
|
name: basic land
|
||||||
select: cyclic
|
select: cyclic
|
||||||
filter: card.rarity == "basic land" and not is_token_card() # can be shifted
|
filter: card.rarity == "basic land" and not is_token_card() # can be shifted
|
||||||
pack item:
|
pack type:
|
||||||
name: common
|
name: common
|
||||||
filter: card.rarity == "common" and not is_token_card() and not is_shifted_card()
|
filter: card.rarity == "common" and not is_token_card() and not is_shifted_card()
|
||||||
pack item:
|
pack type:
|
||||||
name: uncommon
|
name: uncommon
|
||||||
filter: card.rarity == "uncommon" and not is_token_card() and not is_shifted_card()
|
filter: card.rarity == "uncommon" and not is_token_card() and not is_shifted_card()
|
||||||
pack item:
|
pack type:
|
||||||
name: rare
|
name: rare
|
||||||
filter: card.rarity == "rare" and not is_token_card() and not is_shifted_card()
|
filter: card.rarity == "rare" and not is_token_card() and not is_shifted_card()
|
||||||
pack item:
|
pack type:
|
||||||
name: mythic rare
|
name: mythic rare
|
||||||
filter: card.rarity == "mythic rare" and not is_token_card() and not is_shifted_card()
|
filter: card.rarity == "mythic rare" and not is_token_card() and not is_shifted_card()
|
||||||
pack item:
|
pack type:
|
||||||
name: special
|
name: special
|
||||||
filter: card.rarity == "special" and not is_token_card() # can be shifted
|
filter: card.rarity == "special" and not is_token_card() # can be shifted
|
||||||
|
|
||||||
pack item:
|
pack type:
|
||||||
name: shifted common
|
name: shifted common
|
||||||
filter: card.rarity == "common" and not is_token_card() and is_shifted_card()
|
filter: card.rarity == "common" and not is_token_card() and is_shifted_card()
|
||||||
pack item:
|
pack type:
|
||||||
name: shifted uncommon
|
name: shifted uncommon
|
||||||
filter: card.rarity == "uncommon" and not is_token_card() and is_shifted_card()
|
filter: card.rarity == "uncommon" and not is_token_card() and is_shifted_card()
|
||||||
pack item:
|
pack type:
|
||||||
name: shifted rare
|
name: shifted rare
|
||||||
filter:
|
filter:
|
||||||
( card.rarity == "rare" or
|
( card.rarity == "rare" or
|
||||||
card.rarity == "mythic rare" # We've got to put shifted mythic rares somewhere
|
card.rarity == "mythic rare" # We've got to put shifted mythic rares somewhere
|
||||||
) and not is_token_card() and is_shifted_card()
|
) and not is_token_card() and is_shifted_card()
|
||||||
|
|
||||||
pack item:
|
pack type:
|
||||||
name: token / rulestip
|
name: token / rulestip
|
||||||
filter: is_token_card()
|
filter: is_token_card()
|
||||||
|
|
||||||
############################################################## shifted/special if possible
|
############################################################## shifted/special if possible
|
||||||
|
|
||||||
# shifted common if they exist, otherwise a normal common
|
# shifted common if they exist, otherwise a normal common
|
||||||
pack item:
|
pack type:
|
||||||
name: shifted common or else common
|
name: shifted common or else common
|
||||||
selectable: false
|
selectable: false
|
||||||
select: first
|
select: first
|
||||||
@@ -49,7 +49,7 @@ pack item:
|
|||||||
item: common
|
item: common
|
||||||
|
|
||||||
# basic land if it exist, otherwise a common
|
# basic land if it exist, otherwise a common
|
||||||
pack item:
|
pack type:
|
||||||
name: basic land or else common
|
name: basic land or else common
|
||||||
selectable: false
|
selectable: false
|
||||||
select: first
|
select: first
|
||||||
@@ -57,7 +57,7 @@ pack item:
|
|||||||
item: common
|
item: common
|
||||||
|
|
||||||
# special if it exist, otherwise a common
|
# special if it exist, otherwise a common
|
||||||
pack item:
|
pack type:
|
||||||
name: special or else common
|
name: special or else common
|
||||||
selectable: false
|
selectable: false
|
||||||
select: first
|
select: first
|
||||||
@@ -65,7 +65,7 @@ pack item:
|
|||||||
item: common
|
item: common
|
||||||
|
|
||||||
# shifted uncommon/rare if they exist, otherwise a normal uncommon
|
# shifted uncommon/rare if they exist, otherwise a normal uncommon
|
||||||
pack item:
|
pack type:
|
||||||
name: shifted uncommon or rare or else uncommon
|
name: shifted uncommon or rare or else uncommon
|
||||||
selectable: false
|
selectable: false
|
||||||
select: first
|
select: first
|
||||||
@@ -74,7 +74,7 @@ pack item:
|
|||||||
|
|
||||||
############################################################## Randomized selections
|
############################################################## Randomized selections
|
||||||
|
|
||||||
pack item:
|
pack type:
|
||||||
name: mythic rare or rare
|
name: mythic rare or rare
|
||||||
selectable: false
|
selectable: false
|
||||||
# In Shards of Alara there are 15 mythic rares and 53 rares.
|
# In Shards of Alara there are 15 mythic rares and 53 rares.
|
||||||
@@ -96,7 +96,7 @@ pack item:
|
|||||||
name: rare
|
name: rare
|
||||||
probability: 2
|
probability: 2
|
||||||
|
|
||||||
pack item:
|
pack type:
|
||||||
name: shifted uncommon or rare
|
name: shifted uncommon or rare
|
||||||
selectable: false
|
selectable: false
|
||||||
select: nonempty
|
select: nonempty
|
||||||
@@ -110,7 +110,7 @@ pack item:
|
|||||||
############################################################## Common proportions of cards
|
############################################################## Common proportions of cards
|
||||||
|
|
||||||
# of the common slots, 3/10 will be shifted, 1/10 will be special
|
# of the common slots, 3/10 will be shifted, 1/10 will be special
|
||||||
pack item:
|
pack type:
|
||||||
name: common sometimes shifted or special
|
name: common sometimes shifted or special
|
||||||
selectable: false
|
selectable: false
|
||||||
# TODO: Perhaps use some kind of proportional system here as well?
|
# TODO: Perhaps use some kind of proportional system here as well?
|
||||||
@@ -127,7 +127,7 @@ pack item:
|
|||||||
item: special or else common
|
item: special or else common
|
||||||
|
|
||||||
# of the uncommon slots, 1/3 will be shifted, 1/4 of that will be shifted rares instead
|
# of the uncommon slots, 1/3 will be shifted, 1/4 of that will be shifted rares instead
|
||||||
pack item:
|
pack type:
|
||||||
name: uncommon sometimes shifted
|
name: uncommon sometimes shifted
|
||||||
selectable: false
|
selectable: false
|
||||||
select: cyclic
|
select: cyclic
|
||||||
|
|||||||
@@ -30,14 +30,18 @@ Reader::Reader(const InputStreamP& input, Packaged* package, const String& filen
|
|||||||
handleAppVersion();
|
handleAppVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
Reader::Reader(Packaged* pkg, const String& filename, bool ignore_invalid)
|
Reader::Reader(Reader* parent, Packaged* pkg, const String& filename, bool ignore_invalid)
|
||||||
: indent(0), expected_indent(0), state(OUTSIDE)
|
: indent(0), expected_indent(0), state(OUTSIDE)
|
||||||
, ignore_invalid(ignore_invalid)
|
, ignore_invalid(ignore_invalid)
|
||||||
, filename(filename), package(pkg), line_number(0), previous_line_number(0)
|
, filename(filename), package(pkg), line_number(0), previous_line_number(0)
|
||||||
, input(package_manager.openFileFromPackage(package, filename))
|
, input(package_manager.openFileFromPackage(package, filename))
|
||||||
{
|
{
|
||||||
moveNext();
|
moveNext();
|
||||||
|
// in an included file, use the app version of the parent if we have none
|
||||||
handleAppVersion();
|
handleAppVersion();
|
||||||
|
if (file_app_version == 0) {
|
||||||
|
file_app_version = parent->file_app_version;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reader::addAlias(Version end_version, const Char* a, const Char* b) {
|
void Reader::addAlias(Version end_version, const Char* a, const Char* b) {
|
||||||
@@ -53,7 +57,7 @@ void Reader::handleIgnore(int end_version, const Char* a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Reader::handleAppVersion() {
|
void Reader::handleAppVersion() {
|
||||||
if (enterBlock(_("mse_version"))) {
|
if (enterBlock(_("mse_version"))) {
|
||||||
handle(file_app_version);
|
handle(file_app_version);
|
||||||
if (app_version < file_app_version) {
|
if (app_version < file_app_version) {
|
||||||
handle_warning(_ERROR_2_("newer version", filename, file_app_version.toString()), false);
|
handle_warning(_ERROR_2_("newer version", filename, file_app_version.toString()), false);
|
||||||
|
|||||||
@@ -32,18 +32,18 @@ typedef shared_ptr<wxInputStream> InputStreamP;
|
|||||||
* object that was just read.
|
* object that was just read.
|
||||||
*/
|
*/
|
||||||
class Reader {
|
class Reader {
|
||||||
|
private:
|
||||||
|
/// Construct a reader that reads a file in a package
|
||||||
|
/** Used for "include file" keys.
|
||||||
|
* package can be nullptr
|
||||||
|
*/
|
||||||
|
Reader(Reader* parent, Packaged* package, const String& filename, bool ignore_invalid = false);
|
||||||
public:
|
public:
|
||||||
/// Construct a reader that reads from the given input stream
|
/// Construct a reader that reads from the given input stream
|
||||||
/** filename is used only for error messages
|
/** filename is used only for error messages
|
||||||
*/
|
*/
|
||||||
Reader(const InputStreamP& input, Packaged* package = nullptr, const String& filename = wxEmptyString, bool ignore_invalid = false);
|
Reader(const InputStreamP& input, Packaged* package = nullptr, const String& filename = wxEmptyString, bool ignore_invalid = false);
|
||||||
|
|
||||||
/// Construct a reader that reads a file in a package
|
|
||||||
/** Used for "include file" keys.
|
|
||||||
* package can be nullptr
|
|
||||||
*/
|
|
||||||
Reader(Packaged* package, const String& filename, bool ignore_invalid = false);
|
|
||||||
|
|
||||||
~Reader() { showWarnings(); }
|
~Reader() { showWarnings(); }
|
||||||
|
|
||||||
/// Tell the reflection code we are reading
|
/// Tell the reflection code we are reading
|
||||||
@@ -182,7 +182,7 @@ class Reader {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void unknownKey(T& v) {
|
void unknownKey(T& v) {
|
||||||
if (key == _("include file")) {
|
if (key == _("include file")) {
|
||||||
Reader reader(package, value, ignore_invalid);
|
Reader reader(this, package, value, ignore_invalid);
|
||||||
reader.handle_greedy(v);
|
reader.handle_greedy(v);
|
||||||
moveNext();
|
moveNext();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user