mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Cleaned up Set::Styling/Card::Styling by spliting that functionality into a 'DelayedIndexMaps' class;
Added 'right' and 'bottom' properties to style as an alternative way of specifying width/height; Added content_width, content_height and content_lines properties that give feedback on text rendering; Always show warnings when showing errors and vice-versa, this prevents script errors from appearing before the reader/parse error that caused them; Finally some preliminairy work on export templates git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@428 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -68,6 +68,18 @@ void TextStyle::initDependencies(Context& ctx, const Dependency& dep) const {
|
||||
// font .initDependencies(ctx, dep);
|
||||
// symbol_font.initDependencies(ctx, dep);
|
||||
}
|
||||
void TextStyle::checkContentDependencies(Context& ctx, const Dependency& dep) const {
|
||||
Style ::checkContentDependencies(ctx, dep);
|
||||
alignment.initDependencies(ctx, dep);
|
||||
}
|
||||
void TextStyle::markDependencyMember(const String& name, const Dependency& dep) const {
|
||||
Style::markDependencyMember(name, dep);
|
||||
// mark dependencies on content
|
||||
if (dep.type == DEP_DUMMY && dep.index == false &&
|
||||
(name == _("content width") || name == _("content height") || name == _("content lines"))) {
|
||||
const_cast<Dependency&>(dep).index = true;
|
||||
}
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(TextBackground) {
|
||||
REFLECT(image);
|
||||
@@ -75,6 +87,13 @@ IMPLEMENT_REFLECTION(TextBackground) {
|
||||
REFLECT_N("displacement_y", displacement.height);
|
||||
}
|
||||
|
||||
template <typename T> void reflect_content(T& tag, const TextStyle& ts) {}
|
||||
template <> void reflect_content(GetMember& tag, const TextStyle& ts) {
|
||||
REFLECT_N("content_width", ts.content_width);
|
||||
REFLECT_N("content_height", ts.content_height);
|
||||
REFLECT_N("content_lines", ts.content_lines);
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(TextStyle) {
|
||||
REFLECT_BASE(Style);
|
||||
REFLECT(font);
|
||||
@@ -99,6 +118,7 @@ IMPLEMENT_REFLECTION(TextStyle) {
|
||||
REFLECT(text_background);
|
||||
REFLECT(text_background_left);
|
||||
REFLECT(text_background_right);
|
||||
reflect_content(tag, *this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : TextValue
|
||||
|
||||
Reference in New Issue
Block a user