浏览代码

Merge pull request #992 from Azaezel/alpha41/methodSig

better callback filtering for getMethodSigs
Brian Roberts 2 年之前
父节点
当前提交
4489ebbf95
共有 1 个文件被更改,包括 11 次插入4 次删除
  1. 11 4
      Engine/source/console/simObject.cpp

+ 11 - 4
Engine/source/console/simObject.cpp

@@ -2662,7 +2662,7 @@ DefineEngineMethod( SimObject, dumpMethods, ArrayObject*, (),,
    return dictionary;
 }
 
-DefineEngineMethod(SimObject, getMethodSigs, ArrayObject*, (), ,
+DefineEngineMethod(SimObject, getMethodSigs, ArrayObject*, (bool commands), (false),
    "List the methods defined on this object.\n\n"
    "Each description is a newline-separated vector with the following elements:\n"
    "- method prototype string.\n"
@@ -2682,9 +2682,16 @@ DefineEngineMethod(SimObject, getMethodSigs, ArrayObject*, (), ,
    {
       Namespace::Entry* e = *j;
 
-      if (e->mType != Namespace::Entry::ScriptCallbackType)
-         continue;
-
+      if (commands)
+      {
+         if ((e->mType < Namespace::Entry::ConsoleFunctionType))
+            continue;
+      }
+      else
+      {
+         if ((e->mType > Namespace::Entry::ScriptCallbackType))
+            continue;
+      }
       StringBuilder str;
       str.append("function ");
       str.append(ns->getName());