mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Make some values scriptable
color radius color left width color right width color top width color bottom width font shadow displacement x font shadow displacement y font shadow blur
This commit is contained in:
+15
-7
@@ -21,7 +21,8 @@ Font::Font()
|
||||
, scale_down_to(100000)
|
||||
, max_stretch(1.0)
|
||||
, color(Color(0,0,0))
|
||||
, shadow_displacement(0,0)
|
||||
, shadow_displacement_x(0)
|
||||
, shadow_displacement_y(0)
|
||||
, shadow_blur(0)
|
||||
, separator_color(Color(0,0,0,128))
|
||||
, flags(FONT_NORMAL)
|
||||
@@ -89,7 +90,10 @@ bool Font::update(Context& ctx) {
|
||||
changes |= style .update(ctx);
|
||||
changes |= underline .update(ctx);
|
||||
changes |= color .update(ctx);
|
||||
changes |= shadow_color.update(ctx);
|
||||
changes |= shadow_color .update(ctx);
|
||||
changes |= shadow_displacement_x.update(ctx);
|
||||
changes |= shadow_displacement_y.update(ctx);
|
||||
changes |= shadow_blur .update(ctx);
|
||||
flags = (flags & ~FONT_BOLD & ~FONT_ITALIC)
|
||||
| (weight() == _("bold") ? FONT_BOLD : FONT_NORMAL)
|
||||
| (style() == _("italic") ? FONT_ITALIC : FONT_NORMAL);
|
||||
@@ -103,7 +107,10 @@ void Font::initDependencies(Context& ctx, const Dependency& dep) const {
|
||||
style .initDependencies(ctx, dep);
|
||||
underline .initDependencies(ctx, dep);
|
||||
color .initDependencies(ctx, dep);
|
||||
shadow_color.initDependencies(ctx, dep);
|
||||
shadow_color .initDependencies(ctx, dep);
|
||||
shadow_displacement_x.initDependencies(ctx, dep);
|
||||
shadow_displacement_y.initDependencies(ctx, dep);
|
||||
shadow_blur .initDependencies(ctx, dep);
|
||||
}
|
||||
|
||||
FontP Font::make(int add_flags, bool add_underline, String const* other_family, Color const* other_color, double const* other_size) const {
|
||||
@@ -121,8 +128,9 @@ FontP Font::make(int add_flags, bool add_underline, String const* other_family,
|
||||
}
|
||||
if (add_flags & FONT_SOFT) {
|
||||
f->color = f->separator_color;
|
||||
f->shadow_displacement = RealSize(0,0); // no shadow
|
||||
}
|
||||
f->shadow_displacement_x = 0; // no shadow
|
||||
f->shadow_displacement_y = 0; // no shadow
|
||||
}
|
||||
if (add_underline) {
|
||||
f->underline = true;
|
||||
}
|
||||
@@ -185,8 +193,8 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(Font) {
|
||||
REFLECT(color);
|
||||
REFLECT(scale_down_to);
|
||||
REFLECT(max_stretch);
|
||||
REFLECT_N("shadow_displacement_x", shadow_displacement.width);
|
||||
REFLECT_N("shadow_displacement_y", shadow_displacement.height);
|
||||
REFLECT(shadow_displacement_x);
|
||||
REFLECT(shadow_displacement_y);
|
||||
REFLECT(shadow_color);
|
||||
REFLECT(shadow_blur);
|
||||
REFLECT(separator_color);
|
||||
|
||||
Reference in New Issue
Block a user