improved handling of aliasses and warnings

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@51 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-26 23:33:33 +00:00
parent 1459cd6d76
commit 10f52c80ac
5 changed files with 42 additions and 11 deletions
+5 -2
View File
@@ -55,10 +55,12 @@ class OptionalScript {
}
return false;
}
private:
ScriptP script; ///< The script, may be null if there is no script
String unparsed; ///< Unparsed script, for writing back to a file
// parse the unparsed string, while reading
void parse(Reader&);
DECLARE_REFLECTION();
template <typename T> friend class Scriptable;
};
@@ -95,7 +97,8 @@ template <typename T>
void Reader::handle(Scriptable<T>& s) {
handle(s.script.unparsed);
if (starts_with(s.script.unparsed, _("script:"))) {
s.script.script = parse(s.script.unparsed);
s.script.unparsed = s.script.unparsed.substr(7);
s.script.parse(*this);
} else {
handle(value);
}