Jelajahi Sumber

Reflect the global variable implementation in the documentations and angelscript api

Blue, The Magnificent 9 tahun lalu
induk
melakukan
d62b51289e
4 mengubah file dengan 7 tambahan dan 3 penghapusan
  1. 2 1
      Docs/AngelScriptAPI.h
  2. 2 0
      Docs/LuaScriptAPI.dox
  3. 1 1
      Docs/Reference.dox
  4. 2 1
      Docs/ScriptAPI.dox

+ 2 - 1
Docs/AngelScriptAPI.h

@@ -14117,6 +14117,7 @@ String GetFileSizeString(uint64);
 uint GetFloat16Format();
 uint GetFloat32Format();
 uint GetFormat(const String&);
+Variant GetGlobalVariable(const String&);
 String GetInternalPath(const String&);
 uint GetLinearDepthFormat();
 uint GetLuminanceAlphaFormat();
@@ -14178,6 +14179,7 @@ String RemoveTrailingSlash(const String&);
 String ReplaceExtension(const String&, const String&);
 uint SDBMHash(uint, uint8);
 void SendEvent(const String&, VariantMap& = VariantMap ( ));
+void SetGlobalVariable(const String&, Variant&);
 void SetMiniDumpDir(const String&);
 void SetRandomSeed(uint);
 float Sign(float);
@@ -14713,4 +14715,3 @@ uint VO_LOW_MATERIAL_QUALITY;
 uint VO_NONE;
 Color WHITE;
 Color YELLOW;
-VariantMap globalVars;

+ 2 - 0
Docs/LuaScriptAPI.dox

@@ -7812,6 +7812,7 @@ Properties:
 - String GetFileSizeString(long memorySize)
 - FileSystem* GetFileSystem()
 - Graphics* GetGraphics()
+- Variant GetGlobalVariable(const String key)
 - Input* GetInput()
 - String GetInternalPath(const String pathName)
 - Localization* GetLocalization()
@@ -7856,6 +7857,7 @@ Properties:
 - unsigned SDBMHash(unsigned hash, char c)
 - void SendEvent(const String eventName, VariantMap& eventData)
 - void SetExecuteConsoleCommands(bool enable)
+- void SetGlobalVariable(const String key, Variant value)
 - void SetMiniDumpDir(const String pathName)
 - void SetRandomSeed(unsigned seed)
 - float Sign(float value)

+ 1 - 1
Docs/Reference.dox

@@ -643,7 +643,7 @@ There are some complexities of the scripting system one has to watch out for:
 
 - If a ScriptFile resource is reloaded, all the script objects created from it will be destroyed, then recreated. They will lose any stored state as their constructors and Start() methods will be run again. This is rarely useful when running an actual game, but may be helpful during development.
 
-A global VariantMap, globalVars, can be accessed by all scripts to store shared data or to preserve data through script file reloads.
+Two global functions, GetGlobalVariable() and SetGlobalVariable(), can be accessed by all scripts to store shared data or to preserve data through script file reloads.
 
 \section Scripting_Modifications AngelScript modifications
 

+ 2 - 1
Docs/ScriptAPI.dox

@@ -14967,6 +14967,7 @@ Properties:
 - uint GetFloat16Format()
 - uint GetFloat32Format()
 - uint GetFormat(const String&)
+- Variant GetGlobalVariable(const String&)
 - String GetInternalPath(const String&)
 - uint GetLinearDepthFormat()
 - uint GetLuminanceAlphaFormat()
@@ -15028,6 +15029,7 @@ Properties:
 - String ReplaceExtension(const String&, const String&)
 - uint SDBMHash(uint, uint8)
 - void SendEvent(const String&, VariantMap& = VariantMap ( ))
+- void SetGlobalVariable(const String&, Variant&)
 - void SetMiniDumpDir(const String&)
 - void SetRandomSeed(uint)
 - float Sign(float)
@@ -15561,7 +15563,6 @@ Properties:
 - uint VO_NONE
 - Color WHITE
 - Color YELLOW
-- VariantMap globalVars
 */
 
 }