summaryrefslogtreecommitdiff
path: root/src/script/script_info.hpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-11-29 23:26:35 +0000
committertruebrain <truebrain@openttd.org>2011-11-29 23:26:35 +0000
commit34d7f01cccfbb4dcd09f0b68ded513f495fa69ed (patch)
treef7d152f88f52d5c883538a5218138fa3a256dc1e /src/script/script_info.hpp
parentc38c16773ca0bc5c928486b18318eb5b147f8ff0 (diff)
downloadopenttd-34d7f01cccfbb4dcd09f0b68ded513f495fa69ed.tar.xz
(svn r23364) -Codechange: refactor AIConfig, moving it mostly to Scriptconfig
Diffstat (limited to 'src/script/script_info.hpp')
-rw-r--r--src/script/script_info.hpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/script/script_info.hpp b/src/script/script_info.hpp
index 1e118f164..b686d53f4 100644
--- a/src/script/script_info.hpp
+++ b/src/script/script_info.hpp
@@ -15,6 +15,8 @@
#include <squirrel.h>
#include "../misc/countedptr.hpp"
+#include "script_config.hpp"
+
class ScriptInfo : public SimpleCountedObject {
public:
ScriptInfo() :
@@ -98,9 +100,41 @@ public:
*/
virtual class ScriptScanner *GetScanner() { return this->scanner; }
+ /**
+ * Get the settings of the Script.
+ */
+ bool GetSettings();
+
+ /**
+ * Get the config list for this Script.
+ */
+ const ScriptConfigItemList *GetConfigList() const;
+
+ /**
+ * Get the description of a certain Script config option.
+ */
+ const ScriptConfigItem *GetConfigItem(const char *name) const;
+
+ /**
+ * Set a setting.
+ */
+ SQInteger AddSetting(HSQUIRRELVM vm);
+
+ /**
+ * Add labels for a setting.
+ */
+ SQInteger AddLabels(HSQUIRRELVM vm);
+
+ /**
+ * Get the default value for a setting.
+ */
+ int GetSettingDefaultValue(const char *name) const;
+
+
protected:
- class Squirrel *engine; ///< Engine used to register for Squirrel.
- HSQOBJECT *SQ_instance; ///< The Squirrel instance created for this info.
+ class Squirrel *engine; ///< Engine used to register for Squirrel.
+ HSQOBJECT *SQ_instance; ///< The Squirrel instance created for this info.
+ ScriptConfigItemList config_list; ///< List of settings from this Script.
private:
char *main_script; ///< The full path of the script.