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:
+9
-6
@@ -91,6 +91,14 @@ StyleSheetP Set::stylesheetForP(const CardP& card) {
|
||||
else return stylesheet;
|
||||
}
|
||||
|
||||
IndexMap<FieldP, ValueP>& Set::stylingDataFor(const StyleSheet& stylesheet) {
|
||||
return styling_data.get(stylesheet.name(), stylesheet.styling_fields);
|
||||
}
|
||||
IndexMap<FieldP, ValueP>& Set::stylingDataFor(const CardP& card) {
|
||||
if (card && card->has_styling) return card->styling_data;
|
||||
else return stylingDataFor(stylesheetFor(card));
|
||||
}
|
||||
|
||||
String Set::typeName() const { return _("set"); }
|
||||
|
||||
// fix values for versions < 0.2.7
|
||||
@@ -144,6 +152,7 @@ IMPLEMENT_REFLECTION(Set) {
|
||||
}
|
||||
WITH_DYNAMIC_ARG(game_for_reading, game.get());
|
||||
REFLECT(stylesheet);
|
||||
WITH_DYNAMIC_ARG(stylesheet_for_reading, stylesheet.get());
|
||||
REFLECT_N("set_info", data);
|
||||
if (stylesheet) {
|
||||
REFLECT_N("styling", styling_data);
|
||||
@@ -202,12 +211,6 @@ void Set::clearOrderCache() {
|
||||
order_cache.clear();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Styling
|
||||
|
||||
IndexMap<FieldP, ValueP>& Set::stylingDataFor(const StyleSheet& stylesheet) {
|
||||
return styling_data.get(stylesheet.name(), stylesheet.styling_fields);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : SetView
|
||||
|
||||
SetView::SetView() {}
|
||||
|
||||
Reference in New Issue
Block a user