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:
twanvl
2007-06-22 23:12:41 +00:00
parent 97e0e8d6d6
commit e46cbe66b2
33 changed files with 384 additions and 138 deletions
+5
View File
@@ -57,6 +57,7 @@ Context& SetScriptContext::getContext(const StyleSheetP& stylesheet) {
ctx->setVariable(_("set"), new_intrusive1<ScriptObject<Set*> >(&set));
ctx->setVariable(_("game"), to_script(set.game));
ctx->setVariable(_("stylesheet"), to_script(stylesheet));
ctx->setVariable(_("card style"), to_script(&stylesheet->card_style));
ctx->setVariable(_("card"), set.cards.empty() ? script_nil : to_script(set.cards.front())); // dummy value
ctx->setVariable(_("styling"), to_script(&set.stylingDataFor(*stylesheet)));
try {
@@ -130,6 +131,10 @@ void SetScriptManager::initDependencies(Context& ctx, StyleSheet& stylesheet) {
// find dependencies of choice images and other style stuff
FOR_EACH(s, stylesheet.card_style) {
s->initDependencies(ctx, Dependency(DEP_STYLE, s->fieldP->index, &stylesheet));
// are there dependencies of this style on other style properties?
Dependency test(DEP_DUMMY, false);
s->checkContentDependencies(ctx, test);
if (test.index) s->content_dependent = true;
}
}