mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 13:37:00 -04:00
implemented 'default set style', so that doesn't have to be duplicated for each style
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@224 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -41,54 +41,6 @@ init script:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
############################################################## Set info fields
|
|
||||||
info style:
|
|
||||||
title:
|
|
||||||
padding left: 2
|
|
||||||
font:
|
|
||||||
size: 16
|
|
||||||
symbol:
|
|
||||||
variation:
|
|
||||||
name: common
|
|
||||||
border radius: 0.10
|
|
||||||
fill type: solid
|
|
||||||
fill color: rgb(0,0,0)
|
|
||||||
border color: rgb(255,255,255)
|
|
||||||
variation:
|
|
||||||
name: uncommon
|
|
||||||
border radius: 0.05
|
|
||||||
fill type: linear gradient
|
|
||||||
fill color 1: rgb(224,224,224)
|
|
||||||
fill color 2: rgb(84, 84, 84)
|
|
||||||
border color 1: rgb(0, 0, 0)
|
|
||||||
border color 2: rgb(0, 0, 0)
|
|
||||||
variation:
|
|
||||||
name: rare
|
|
||||||
border radius: 0.05
|
|
||||||
fill type: linear gradient
|
|
||||||
fill color 1: rgb(214,196,94)
|
|
||||||
fill color 2: rgb(95, 84, 40)
|
|
||||||
border color 1: rgb(0, 0, 0)
|
|
||||||
border color 2: rgb(0, 0, 0)
|
|
||||||
variation:
|
|
||||||
name: special
|
|
||||||
border radius: 0.10
|
|
||||||
fill type: linear gradient
|
|
||||||
fill color 1: rgb(224,170,247)
|
|
||||||
fill color 2: rgb(58,7,80)
|
|
||||||
border color 1: rgb(255,255,255)
|
|
||||||
border color 2: rgb(255,255,255)
|
|
||||||
automatic reminder text:
|
|
||||||
render style: both
|
|
||||||
choice images:
|
|
||||||
yes: script: buildin_image("bool_yes")
|
|
||||||
no: script: buildin_image("bool_no")
|
|
||||||
use gradient multicolor:
|
|
||||||
render style: both
|
|
||||||
choice images:
|
|
||||||
yes: script: buildin_image("bool_yes")
|
|
||||||
no: script: buildin_image("bool_no")
|
|
||||||
|
|
||||||
|
|
||||||
############################################################## Extra style
|
############################################################## Extra style
|
||||||
|
|
||||||
|
|||||||
@@ -273,6 +273,15 @@ set field:
|
|||||||
choice: only for custom keywords
|
choice: only for custom keywords
|
||||||
choice: no
|
choice: no
|
||||||
description: Should reminder text be added to keywords by default? Note: you can enable/disable reminder text by right clicking the keyword.
|
description: Should reminder text be added to keywords by default? Note: you can enable/disable reminder text by right clicking the keyword.
|
||||||
|
set field:
|
||||||
|
# TODO : RENAME
|
||||||
|
type: multiple choice
|
||||||
|
name: automatic reminder text2
|
||||||
|
choice: old keywords
|
||||||
|
choice: core set keywords
|
||||||
|
choice: expert level keywords
|
||||||
|
choice: custom keywords
|
||||||
|
description: Should reminder text be added to keywords by default? Note: you can enable/disable reminder text by right clicking the keyword.
|
||||||
set field:
|
set field:
|
||||||
type: boolean
|
type: boolean
|
||||||
name: automatic card numbers
|
name: automatic card numbers
|
||||||
@@ -290,6 +299,58 @@ set field:
|
|||||||
description: Use gradients on multicolor cards by default, you can always change it be clicking on the card border.
|
description: Use gradients on multicolor cards by default, you can always change it be clicking on the card border.
|
||||||
initial: no
|
initial: no
|
||||||
|
|
||||||
|
############################# Default style
|
||||||
|
|
||||||
|
default set style:
|
||||||
|
title:
|
||||||
|
padding left: 2
|
||||||
|
font:
|
||||||
|
size: 16
|
||||||
|
symbol:
|
||||||
|
variation:
|
||||||
|
name: common
|
||||||
|
border radius: 0.10
|
||||||
|
fill type: solid
|
||||||
|
fill color: rgb(0,0,0)
|
||||||
|
border color: rgb(255,255,255)
|
||||||
|
variation:
|
||||||
|
name: uncommon
|
||||||
|
border radius: 0.05
|
||||||
|
fill type: linear gradient
|
||||||
|
fill color 1: rgb(224,224,224)
|
||||||
|
fill color 2: rgb(84, 84, 84)
|
||||||
|
border color 1: rgb(0, 0, 0)
|
||||||
|
border color 2: rgb(0, 0, 0)
|
||||||
|
variation:
|
||||||
|
name: rare
|
||||||
|
border radius: 0.05
|
||||||
|
fill type: linear gradient
|
||||||
|
fill color 1: rgb(214,196,94)
|
||||||
|
fill color 2: rgb(95, 84, 40)
|
||||||
|
border color 1: rgb(0, 0, 0)
|
||||||
|
border color 2: rgb(0, 0, 0)
|
||||||
|
variation:
|
||||||
|
name: special
|
||||||
|
border radius: 0.10
|
||||||
|
fill type: linear gradient
|
||||||
|
fill color 1: rgb(224,170,247)
|
||||||
|
fill color 2: rgb(58,7,80)
|
||||||
|
border color 1: rgb(255,255,255)
|
||||||
|
border color 2: rgb(255,255,255)
|
||||||
|
automatic reminder text:
|
||||||
|
render style: both
|
||||||
|
choice images:
|
||||||
|
yes: script: buildin_image("bool_yes")
|
||||||
|
no: script: buildin_image("bool_no")
|
||||||
|
automatic reminder text2:
|
||||||
|
render style: checklist
|
||||||
|
direction: vertical
|
||||||
|
use gradient multicolor:
|
||||||
|
render style: both
|
||||||
|
choice images:
|
||||||
|
yes: script: buildin_image("bool_yes")
|
||||||
|
no: script: buildin_image("bool_no")
|
||||||
|
|
||||||
############################################################## Card fields
|
############################################################## Card fields
|
||||||
|
|
||||||
############################# Background stuff
|
############################# Background stuff
|
||||||
@@ -719,10 +780,6 @@ statistics dimension:
|
|||||||
numeric: true
|
numeric: true
|
||||||
icon: stats/casting_cost.png
|
icon: stats/casting_cost.png
|
||||||
|
|
||||||
statistics dimension:
|
|
||||||
name: rarity_twice
|
|
||||||
script: card.rarity + card.rarity
|
|
||||||
|
|
||||||
statistics category:
|
statistics category:
|
||||||
name: color / rarity
|
name: color / rarity
|
||||||
dimension: card_color
|
dimension: card_color
|
||||||
@@ -805,6 +862,19 @@ statistics category:
|
|||||||
|
|
||||||
has keywords: true
|
has keywords: true
|
||||||
|
|
||||||
|
keyword mode:
|
||||||
|
name: old
|
||||||
|
description: Old keywords (Banding, Phasing, etc.)
|
||||||
|
keyword mode:
|
||||||
|
name: core
|
||||||
|
description: Core set keywords (Flying, Haste, etc.)
|
||||||
|
keyword mode:
|
||||||
|
name: expert
|
||||||
|
description: Expert level keywords (Cycling, Vanishing, etc.)
|
||||||
|
keyword mode:
|
||||||
|
name: custom
|
||||||
|
description: Custom keywords
|
||||||
|
|
||||||
keyword parameter type:
|
keyword parameter type:
|
||||||
name: no parameter
|
name: no parameter
|
||||||
keyword parameter type:
|
keyword parameter type:
|
||||||
|
|||||||
+8
-1
@@ -92,6 +92,9 @@ class Style {
|
|||||||
inline RealSize getSize() const { return RealSize ( width, height); }
|
inline RealSize getSize() const { return RealSize ( width, height); }
|
||||||
inline RealRect getRect() const { return RealRect (left, top, width, height); }
|
inline RealRect getRect() const { return RealRect (left, top, width, height); }
|
||||||
|
|
||||||
|
/// Get a copy of this style
|
||||||
|
virtual StyleP clone() const = 0;
|
||||||
|
|
||||||
/// Make a viewer object for values using this style
|
/// Make a viewer object for values using this style
|
||||||
/** thisP is a smart pointer to this */
|
/** thisP is a smart pointer to this */
|
||||||
virtual ValueViewerP makeViewer(DataViewer& parent, const StyleP& thisP) = 0;
|
virtual ValueViewerP makeViewer(DataViewer& parent, const StyleP& thisP) = 0;
|
||||||
@@ -157,12 +160,16 @@ template <> ValueP read_new<Value>(Reader&);
|
|||||||
ValueP Type ## Field::newValue(const FieldP& thisP) const { \
|
ValueP Type ## Field::newValue(const FieldP& thisP) const { \
|
||||||
assert(thisP.get() == this); \
|
assert(thisP.get() == this); \
|
||||||
return new_shared1<Type ## Value>(static_pointer_cast<Type ## Field>(thisP)); \
|
return new_shared1<Type ## Value>(static_pointer_cast<Type ## Field>(thisP)); \
|
||||||
|
} \
|
||||||
|
StyleP Type ## Style::clone() const { \
|
||||||
|
return new_shared1<Type ## Style>(*this); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DECLARE_STYLE_TYPE(Type) \
|
#define DECLARE_STYLE_TYPE(Type) \
|
||||||
DECLARE_HAS_FIELD(Type) \
|
DECLARE_HAS_FIELD(Type) \
|
||||||
|
virtual StyleP clone() const; \
|
||||||
virtual ValueViewerP makeViewer(DataViewer& parent, const StyleP& thisP); \
|
virtual ValueViewerP makeViewer(DataViewer& parent, const StyleP& thisP); \
|
||||||
virtual ValueViewerP makeEditor(DataEditor& parent, const StyleP& thisP)
|
virtual ValueViewerP makeEditor(DataEditor& parent, const StyleP& thisP);
|
||||||
|
|
||||||
// implement field() which returns a field with the right (derived) type
|
// implement field() which returns a field with the right (derived) type
|
||||||
#define DECLARE_HAS_FIELD(Type) \
|
#define DECLARE_HAS_FIELD(Type) \
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class BooleanStyle : public ChoiceStyle {
|
|||||||
public:
|
public:
|
||||||
BooleanStyle(const ChoiceFieldP& field);
|
BooleanStyle(const ChoiceFieldP& field);
|
||||||
DECLARE_HAS_FIELD(Boolean); // not DECLARE_STYLE_TYPE, because we use a normal ChoiceValueViewer/Editor
|
DECLARE_HAS_FIELD(Boolean); // not DECLARE_STYLE_TYPE, because we use a normal ChoiceValueViewer/Editor
|
||||||
|
virtual StyleP clone() const;
|
||||||
|
|
||||||
// no extra data
|
// no extra data
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ IMPLEMENT_REFLECTION(Game) {
|
|||||||
REFLECT_BASE(Packaged);
|
REFLECT_BASE(Packaged);
|
||||||
REFLECT(init_script);
|
REFLECT(init_script);
|
||||||
REFLECT(set_fields);
|
REFLECT(set_fields);
|
||||||
|
REFLECT_IF_READING {
|
||||||
|
default_set_style.init(set_fields);
|
||||||
|
}
|
||||||
REFLECT(default_set_style);
|
REFLECT(default_set_style);
|
||||||
REFLECT(card_fields);
|
REFLECT(card_fields);
|
||||||
REFLECT(statistics_dimensions);
|
REFLECT(statistics_dimensions);
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ IMPLEMENT_REFLECTION(StyleSheet) {
|
|||||||
REFLECT(card_background);
|
REFLECT(card_background);
|
||||||
if (game) {
|
if (game) {
|
||||||
REFLECT_IF_READING {
|
REFLECT_IF_READING {
|
||||||
card_style .init(game->card_fields);
|
card_style.init(game->card_fields);
|
||||||
set_info_style.init(game->set_fields);
|
set_info_style.cloneFrom(game->default_set_style);
|
||||||
}
|
}
|
||||||
REFLECT(card_style);
|
REFLECT(card_style);
|
||||||
REFLECT(set_info_style);
|
REFLECT(set_info_style);
|
||||||
|
|||||||
@@ -53,6 +53,15 @@ class IndexMap : private vector<Value> {
|
|||||||
init_object(key, (*this)[key->index]);
|
init_object(key, (*this)[key->index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// Initialize this map with cloned values from another list
|
||||||
|
void cloneFrom(const IndexMap<Key,Value>& values) {
|
||||||
|
if (this->size() == values.size()) return;
|
||||||
|
this->reserve(values.size());
|
||||||
|
for(size_t index = size() ; index < values.size() ; ++index) {
|
||||||
|
const Value& value = values[index];
|
||||||
|
push_back(value ? value->clone() : value);
|
||||||
|
}
|
||||||
|
}
|
||||||
/// Change this map by adding an additional key and value
|
/// Change this map by adding an additional key and value
|
||||||
void add(const Key& key, const Value& value) {
|
void add(const Key& key, const Value& value) {
|
||||||
assert(get_key(value) == key);
|
assert(get_key(value) == key);
|
||||||
|
|||||||
Reference in New Issue
Block a user