mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added clone() function to Value.
Added support for per-card styling git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@430 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+16
-2
@@ -19,14 +19,18 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA ValueP>);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Card
|
||||
|
||||
Card::Card() {
|
||||
Card::Card()
|
||||
: has_styling(false)
|
||||
{
|
||||
if (!game_for_reading()) {
|
||||
throw InternalError(_("game_for_reading not set"));
|
||||
}
|
||||
data.init(game_for_reading()->card_fields);
|
||||
}
|
||||
|
||||
Card::Card(const Game& game) {
|
||||
Card::Card(const Game& game)
|
||||
: has_styling(false)
|
||||
{
|
||||
data.init(game.card_fields);
|
||||
}
|
||||
|
||||
@@ -55,6 +59,16 @@ void mark_dependency_member(const Card& card, const String& name, const Dependen
|
||||
|
||||
IMPLEMENT_REFLECTION(Card) {
|
||||
REFLECT(stylesheet);
|
||||
REFLECT(has_styling);
|
||||
if (has_styling) {
|
||||
if (stylesheet) {
|
||||
REFLECT_IF_READING styling_data.init(stylesheet->styling_fields);
|
||||
REFLECT(styling_data);
|
||||
} else if (stylesheet_for_reading()) {
|
||||
REFLECT_IF_READING styling_data.init(stylesheet_for_reading()->styling_fields);
|
||||
REFLECT(styling_data);
|
||||
}
|
||||
}
|
||||
REFLECT(notes);
|
||||
REFLECT_NO_SCRIPT(extra_data); // don't allow scripts to depend on style specific data
|
||||
REFLECT_NAMELESS(data);
|
||||
|
||||
Reference in New Issue
Block a user