diff -r a8b137d12ad7 src/script/api/script_controller.hpp --- a/src/script/api/script_controller.hpp Fri Jul 19 19:51:21 2013 +0200 +++ b/src/script/api/script_controller.hpp Sat Jul 20 11:58:25 2013 +0200 @@ -120,21 +120,22 @@ * When Squirrel triggers a print, this function is called. * Squirrel calls this when 'print' is used, or when the script made an error. * @param error_msg If true, it is a Squirrel error message. * @param message The message Squirrel logged. * @note Use ScriptLog.Info/Warning/Error instead of 'print'. */ static void Print(bool error_msg, const char *message); /** * 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. * @note This command can be called from the global space, and does not need an instance. */ static HSQOBJECT Import(const char *library, const char *class_name, int version); private: typedef std::map LoadedLibraryList; ///< The type for loaded libraries. diff -r a8b137d12ad7 src/script/api/script_info_docs.hpp --- a/src/script/api/script_info_docs.hpp Fri Jul 19 19:51:21 2013 +0200 +++ b/src/script/api/script_info_docs.hpp Sat Jul 20 11:58:25 2013 +0200 @@ -11,23 +11,24 @@ /* This file exists purely for doxygen purposes. */ /** * 'Abstract' class of the Scripts use to register themselves. * * @note This class is not part of the API. It is purely to document what * 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 */ class ScriptInfo { public: /** * Gets the author name to be shown in the 'Available Scripts' window. * * @return The author name of the Script. * @note This function is required. @@ -36,20 +37,22 @@ /** * Gets the Scripts name. This is shown in the 'Available Scripts' window * and at all other places where the Script is mentioned, like the debug * window or OpenTTD's help message. The name is used to uniquely * identify an Script within OpenTTD and this name is used in savegames * and the configuration file. * * @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(); /** * Gets a 4 ASCII character short name of the Script to uniquely * identify it from other Scripts. The short name is primarily * used as unique identifier for the content system. * The content system uses besides the short name also the * MD5 checksum of all the source files to uniquely identify * a specific version of the Script. @@ -137,21 +140,22 @@ * * @return True if the Script can be selected from the GUI as non-developer. * @note This function is optional. Default is false. * * @api -ai */ bool IsDeveloperOnly(); /** * 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. */ string CreateInstance(); /** * Gets the API version this Script is written for. If this function * does not exist API compatibility with version 0.7 is assumed. * If the function returns something OpenTTD does not understand,