summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/main.lua
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2013-10-24 01:41:36 +0200
committerSamuel Barney <samjbarney@gmail.com>2013-10-24 01:41:36 +0200
commit4666c1bf3082a9b313336389ac25013429f2145f (patch)
tree10c4c7fb704267ed1ed5a2ae3b2e4b7f63ab9490 /MCServer/Plugins/APIDump/main.lua
parentRemoved my hackish Light functions (diff)
parentAPIDump: Added cChatColor constants. (diff)
downloadcuberite-4666c1bf3082a9b313336389ac25013429f2145f.tar
cuberite-4666c1bf3082a9b313336389ac25013429f2145f.tar.gz
cuberite-4666c1bf3082a9b313336389ac25013429f2145f.tar.bz2
cuberite-4666c1bf3082a9b313336389ac25013429f2145f.tar.lz
cuberite-4666c1bf3082a9b313336389ac25013429f2145f.tar.xz
cuberite-4666c1bf3082a9b313336389ac25013429f2145f.tar.zst
cuberite-4666c1bf3082a9b313336389ac25013429f2145f.zip
Diffstat (limited to 'MCServer/Plugins/APIDump/main.lua')
-rw-r--r--MCServer/Plugins/APIDump/main.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua
index b608ce256..2db8b4b1b 100644
--- a/MCServer/Plugins/APIDump/main.lua
+++ b/MCServer/Plugins/APIDump/main.lua
@@ -158,9 +158,16 @@ function CreateAPITables()
end
-- Member variables:
+ local SetField = a_ClassObj[".set"] or {};
if ((a_ClassObj[".get"] ~= nil) and (type(a_ClassObj[".get"]) == "table")) then
for k, v in pairs(a_ClassObj[".get"]) do
- table.insert(res.Variables, { Name = k });
+ if (SetField[k] == nil) then
+ -- It is a read-only variable, add it as a constant:
+ table.insert(res.Constants, {Name = k, Value = ""});
+ else
+ -- It is a read-write variable, add it as a variable:
+ table.insert(res.Variables, { Name = k });
+ end
end
end
return res;
@@ -818,12 +825,10 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI)
local HasConstants = (#a_ClassAPI.Constants > 0);
local HasFunctions = (#a_ClassAPI.Functions > 0);
local HasVariables = (#a_ClassAPI.Variables > 0);
- if (a_ClassAPI.Inherits ~= nil) then
- for idx, cls in ipairs(a_ClassAPI.Inherits) do
- HasConstants = HasConstants or (#cls.Constants > 0);
- HasFunctions = HasFunctions or (#cls.Functions > 0);
- HasVariables = HasVariables or (#cls.Variables > 0);
- end
+ for idx, cls in ipairs(InheritanceChain) do
+ HasConstants = HasConstants or (#cls.Constants > 0);
+ HasFunctions = HasFunctions or (#cls.Functions > 0);
+ HasVariables = HasVariables or (#cls.Variables > 0);
end
-- Write the table of contents: