made a start with script functions

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@62 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-31 12:17:36 +00:00
parent 0caaf01a78
commit 1ffaa5bd58
20 changed files with 372 additions and 29 deletions
+4 -1
View File
@@ -19,6 +19,9 @@ DECLARE_TYPEOF(Contexts);
DECLARE_TYPEOF_COLLECTION(FieldP);
DECLARE_TYPEOF_NO_REV(IndexMap_FieldP_StyleP);
// initialize functions, from functions.cpp
void init_script_functions(Context& ctx);
// ----------------------------------------------------------------------------- : ScriptManager : initialization
ScriptManager::ScriptManager(Set& set)
@@ -48,10 +51,10 @@ Context& ScriptManager::getContext(const StyleSheetP& stylesheet) {
// variables
// NOTE: do not use a smart pointer for the pointer to the set, because the set owns this
// which would lead to a reference cycle.
init_script_functions(*ctx);
ctx->setVariable(_("set"), new_intrusive1<ScriptObject<Set*> >(&set));
ctx->setVariable(_("game"), toScript(set.game));
ctx->setVariable(_("stylesheet"), toScript(stylesheet));
//ctx->style->object = style;
//ctx->setVariable(_("styling"), toScript(set->extraStyleData(style)));
try {
// perform init scripts