mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
more script functions and text editor improvements
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@100 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -329,7 +329,12 @@ inline ScriptValueP toScript(const shared_ptr<T>& v) { return new_intrusive1<Scr
|
||||
* Throws an error if the parameter is not found.
|
||||
*/
|
||||
#define SCRIPT_PARAM(Type, name) \
|
||||
Type name = *ctx.getVariable(_(#name))
|
||||
Type name = getParam<Type>(ctx.getVariable(_(#name)))
|
||||
|
||||
template <typename T>
|
||||
inline T getParam (const ScriptValueP& value) { return *value; }
|
||||
template <>
|
||||
inline ScriptValueP getParam<ScriptValueP>(const ScriptValueP& value) { return value; }
|
||||
|
||||
/// Retrieve an optional parameter
|
||||
/** Usage:
|
||||
|
||||
Reference in New Issue
Block a user