diff options
author | madmaxoft <github@xoft.cz> | 2013-09-14 08:38:39 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-09-14 08:38:39 +0200 |
commit | badacdb7c6ccc4200d67b4d0ef4c69f9087422ff (patch) | |
tree | 75c4760e057061569e2db86e0f6363c441abda51 | |
parent | APIDump: Added more globally-ignored functions. (diff) | |
download | cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.gz cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.bz2 cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.lz cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.xz cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.zst cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/APIDump/APIDesc.lua | 1 | ||||
-rw-r--r-- | MCServer/Plugins/APIDump/main.lua | 26 |
2 files changed, 22 insertions, 5 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index faa24c07c..1578e01ed 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -1251,6 +1251,7 @@ A list of items regarding plugins that have been documented ]], Functions = { + operator_plus = {Params = "{{Vector3d}}", Return = "{{Vector3d}}", Notes = "Returns the sum of this vector with the specified vector" }, }, Constants = { diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index 2a4a83be9..446763905 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -247,6 +247,26 @@ function ReadDescriptions(a_API) local UnexportedDocumented = {}; -- List of API objects that are documented but not exported, simply a list of names for i, cls in ipairs(a_API) do + -- Rename special functions: + for j, fn in ipairs(cls.Functions) do + if (fn.Name == ".call") then + fn.DocID = "constructor"; + fn.Name = "() <i>(constructor)</i>"; + elseif (fn.Name == ".add") then + fn.DocID = "operator_plus"; + fn.Name = "<i>operator +</i>"; + elseif (fn.Name == ".div") then + fn.DocID = "operator_div"; + fn.Name = "<i>operator /</i>"; + elseif (fn.Name == ".mul") then + fn.DocID = "operator_mul"; + fn.Name = "<i>operator *</i>"; + elseif (fn.Name == ".sub") then + fn.DocID = "operator_sub"; + fn.Name = "<i>operator -</i>"; + end + end + local APIDesc = g_APIDesc.Classes[cls.Name]; if (APIDesc ~= nil) then cls.Desc = APIDesc.Desc; @@ -264,11 +284,7 @@ function ReadDescriptions(a_API) if (APIDesc.Functions ~= nil) then -- Assign function descriptions: for j, func in ipairs(cls.Functions) do - local FnName = func.Name; - if (FnName == ".call") then - FnName = "constructor"; - func.Name = "() <i>(constructor)</i>"; - end + local FnName = func.DocID or func.Name; local FnDesc = APIDesc.Functions[FnName]; if (FnDesc ~= nil) then func.Params = FnDesc.Params; |