Lua:Environments: Difference between revisions
→Environments: some source links |
|||
| Line 2: | Line 2: | ||
Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded. | Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded. | ||
=== LuaMenu === | === LuaMenu === | ||
Source: {{sourcelink|file=Lua/LuaMenu.cpp}} | |||
Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload. | Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload. | ||
=== LuaParser === | === LuaParser === | ||
Source: {{sourcelink|file=Lua/LuaParser.cpp}} | |||
Minimal environment used to parse and load definition files. | Minimal environment used to parse and load definition files. | ||
=== LuaIntro === | === LuaIntro === | ||
Source: {{sourcelink|file=Lua/LuaIntro.cpp}} | |||
Introduced in 95.0, to allow visual customisation of the loading process. | Introduced in 95.0, to allow visual customisation of the loading process. | ||
=== LuaRules (synced) === | === LuaRules (synced) === | ||
Source: {{sourcelink|file=Lua/LuaHandle.cpp}} | |||
Source: {{sourcelink|file=Lua/LuaHandleSynced.cpp}} | |||
The main environment for synced game-controlling mechanics ("gadgets"). | The main environment for synced game-controlling mechanics ("gadgets"). | ||
=== LuaRules (unsynced) === | === LuaRules (unsynced) === | ||
Source: {{sourcelink|file=Lua/LuaHandle.cpp}} | |||
The main environment for unsynced game effects, rendering, UI etc. ("gadgets") | The main environment for unsynced game effects, rendering, UI etc. ("gadgets") | ||
=== LuaGaia (synced) === | === LuaGaia (synced) === | ||
Source: {{sourcelink|file=Lua/LuaGaia.cpp}} | |||
As LuaRules (synced) but for maps. | As LuaRules (synced) but for maps. | ||
=== LuaGaia (unsynced) === | === LuaGaia (unsynced) === | ||
Source: {{sourcelink|file=Lua/LuaGaia.cpp}} | |||
As LuaRules (unsynced) but for maps. | As LuaRules (unsynced) but for maps. | ||
=== LuaUI === | === LuaUI === | ||
Revision as of 23:46, 25 December 2017
Environments
Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded.
LuaMenu
Source: Lua/LuaMenu.cpp
Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload.
LuaParser
Source: Lua/LuaParser.cpp
Minimal environment used to parse and load definition files.
LuaIntro
Source: Lua/LuaIntro.cpp
Introduced in 95.0, to allow visual customisation of the loading process.
LuaRules (synced)
Source: Lua/LuaHandle.cpp
Source: Lua/LuaHandleSynced.cpp
The main environment for synced game-controlling mechanics ("gadgets").
LuaRules (unsynced)
Source: Lua/LuaHandle.cpp
The main environment for unsynced game effects, rendering, UI etc. ("gadgets")
LuaGaia (synced)
Source: Lua/LuaGaia.cpp
As LuaRules (synced) but for maps.
LuaGaia (unsynced)
Source: Lua/LuaGaia.cpp
As LuaRules (unsynced) but for maps.
LuaUI
The main environment for toggleable UI elements and controls ("widgets").
Interfaces
The following table demonstrates which interfaces are available to each environment.
| LuaMenu | LuaIntro | LuaParser | LuaRules/Gaia (synced) |
LuaRules/Gaia (unsynced) |
LuaUI | |
|---|---|---|---|---|---|---|
| Lua_ConstGame | - | + | - | + | + | + |
| Lua_ConstEngine | + | + | + | + | + | + |
| Lua_ConstPlatform | + | + | - | - | + | + |
| Lua_UnitDefs | - | - | - | + | + | + |
| Lua_WeaponDefs | - | - | - | + | + | + |
| Lua_FeatureDefs | - | - | - | + | + | + |
| Lua_ConstCOB | - | - | - | + | - | - |
| Lua_CMDs | - | + | - | + | + | + |
| Lua_UnsyncedRead | +*** | +*** | - | - | + | + |
| Lua_UnsyncedCtrl | +*** | +*** | - | + | + | + |
| Lua_SyncedRead | - | +*** | - | + | + | +** |
| Lua_SyncedCtrl | - | - | - | + | - | - |
| Lua_MoveCtrl | - | - | - | + | - | - |
| Lua_PathFinder | - | - | - | + | + | + |
| Lua_OpenGL_Api | +*** | +*** | - | - | + | + |
| Lua_GLSL_Api | +*** | +*** | - | - | + | + |
| Lua_FBO_and_RBO | + | + | - | - | + | + |
| Lua_UnitRendering | - | - | - | - | + | - |
| Lua_Fonts | + | + | - | - | + | + |
| Lua_ConstGL | + | + | - | - | + | + |
| Lua_VFS | + | + | + | +* | + | + |
| Lua_Scream | + | + | - | - | + | + |
| Lua_BitOps | - | - | - | + | + | + |
| Lua_MathExtra | - | - | - | + | + | + |
| Lua_Socket | + | - | - | - | - | + |
| * | only VFS.ZIP_ONLY |
| ** | with special LOS handling and decoy unit handling |
| *** | stripped down environment with certain functions removed |