diff options
author | zuu <zuu@openttd.org> | 2013-11-16 12:33:45 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-11-16 12:33:45 +0000 |
commit | 41b07b571d3a55acda841cfbede1d5b03b38b757 (patch) | |
tree | a32567b1184100929cdee97743a18f5d44538824 /src | |
parent | 3b9f92e14cab0cb08697646d917af81f47144854 (diff) | |
download | openttd-41b07b571d3a55acda841cfbede1d5b03b38b757.tar.xz |
(svn r26010) -Document [FS#5662]: The AI/GS library name to use in Import, is not the name given by GetName but GetInstanceName
Diffstat (limited to 'src')
-rw-r--r-- | src/script/api/script_controller.hpp | 3 | ||||
-rw-r--r-- | src/script/api/script_info_docs.hpp | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/script/api/script_controller.hpp b/src/script/api/script_controller.hpp index 20a849fc8..10fd48dcd 100644 --- a/src/script/api/script_controller.hpp +++ b/src/script/api/script_controller.hpp @@ -127,7 +127,8 @@ public: /** * Import a library. - * @param library The name of the library to import. + * @param library The name of the library to import. The name should be composed as ScriptInfo::GetCategory() + "." + + * ScriptInfo::CreateInstance(). * @param class_name Under which name you want it to be available (or "" if you just want the returning object). * @param version Which version you want specifically. * @return The loaded library object. If class_name is set, it is also available (under the scope of the import) under that name. diff --git a/src/script/api/script_info_docs.hpp b/src/script/api/script_info_docs.hpp index 1ae38750c..e9e83881a 100644 --- a/src/script/api/script_info_docs.hpp +++ b/src/script/api/script_info_docs.hpp @@ -18,9 +18,10 @@ * Scripts must or can implemented to provide information to OpenTTD to * base configuring/starting/loading the Script on. * - * @note The required functions are also needed for Script Libraries. As such - * the information here can be used for libraries, but the information - * will not be shown in the GUI except for error/debug messages. + * @note The required functions are also needed for Script Libraries, but in + * that case you extend ScriptLibrary. As such the information here can + * be used for libraries, but the information will not be shown in the + * GUI except for error/debug messages. * * @api ai game */ @@ -43,6 +44,8 @@ public: * * @return The name of the Script. * @note This function is required. + * @note This name is not used as library name by ScriptController::Import, + * instead the name returned by #CreateInstance is used. */ string GetName(); @@ -144,7 +147,8 @@ public: /** * Gets the name of main class of the Script so OpenTTD knows - * what class to instantiate. + * what class to instantiate. For libraries, this name is also + * used when other scripts import it using @ScriptController::Import. * * @return The class name of the Script. * @note This function is required. |