diff options
author | Yexo <yexo@openttd.org> | 2009-02-06 00:25:37 +0000 |
---|---|---|
committer | Yexo <yexo@openttd.org> | 2009-02-06 00:25:37 +0000 |
commit | cb3784d8b1a8aa20eab38cf28ee7a2649039ed4f (patch) | |
tree | bc4a66f71ecd553a2fcef1f5e1937be2943df355 /src/ai/ai_info.hpp | |
parent | 8f270af1242fc9e1746bfa3f4a7e8a70fdf6340f (diff) | |
download | openttd-cb3784d8b1a8aa20eab38cf28ee7a2649039ed4f.tar.xz |
(svn r15366) -Add [NoAI]: Add AddLabels() where you can define labels for the values of the settings in info.nut
Diffstat (limited to 'src/ai/ai_info.hpp')
-rw-r--r-- | src/ai/ai_info.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ai/ai_info.hpp b/src/ai/ai_info.hpp index fc04d6180..57317d3f0 100644 --- a/src/ai/ai_info.hpp +++ b/src/ai/ai_info.hpp @@ -6,6 +6,7 @@ #define AI_INFO #include <list> +#include "../core/smallmap_type.hpp" #include "api/ai_object.hpp" enum AIConfigFlags { @@ -14,6 +15,8 @@ enum AIConfigFlags { AICONFIG_BOOLEAN = 0x2, //!< This value is a boolean (either 0 (false) or 1 (true) ). }; +typedef SmallMap<int, char *> LabelMapping; + struct AIConfigItem { const char *name; //!< The name of the configuration setting. const char *description; //!< The description of the configuration setting. @@ -26,6 +29,7 @@ struct AIConfigItem { int random_deviation; //!< The maximum random deviation from the default value. int step_size; //!< The step size in the gui. AIConfigFlags flags; //!< Flags for the configuration setting. + LabelMapping *labels; //!< Text labels for the integer values. }; extern AIConfigItem _start_date_config; @@ -141,6 +145,11 @@ public: 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); |