浏览代码

Add more default values for options tables;

bjorn 3 周之前
父节点
当前提交
cb4b89a83f

+ 27 - 10
api/init.lua

@@ -1748,6 +1748,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Optional options.",
+                  default = "nil",
                   table = {
                     {
                       name = "decode",
@@ -1795,6 +1796,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Optional options.",
+                  default = "nil",
                   table = {
                     {
                       name = "decode",
@@ -1842,6 +1844,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Optional options.",
+                  default = "nil",
                   table = {
                     {
                       name = "decode",
@@ -12553,7 +12556,8 @@ return {
                 {
                   name = "options",
                   type = "table",
-                  description = "Model options.",
+                  description = "An optional table of Model options.",
+                  default = "nil",
                   table = {
                     {
                       name = "mipmaps",
@@ -12588,7 +12592,8 @@ return {
                 {
                   name = "options",
                   type = "table",
-                  description = "Model options.",
+                  description = "An optional table of Model options.",
+                  default = "nil",
                   table = {
                     {
                       name = "mipmaps",
@@ -12623,7 +12628,8 @@ return {
                 {
                   name = "options",
                   type = "table",
-                  description = "Model options.",
+                  description = "An optional table of Model options.",
+                  default = "nil",
                   table = {
                     {
                       name = "mipmaps",
@@ -12860,7 +12866,8 @@ return {
                 {
                   name = "options",
                   type = "table",
-                  description = "Shader options.",
+                  description = "An optional table of Shader options.",
+                  default = "nil",
                   table = {
                     {
                       name = "flags",
@@ -12899,7 +12906,8 @@ return {
                 {
                   name = "options",
                   type = "table",
-                  description = "Shader options.",
+                  description = "An optional table of Shader options.",
+                  default = "nil",
                   table = {
                     {
                       name = "flags",
@@ -12938,7 +12946,8 @@ return {
                 {
                   name = "options",
                   type = "table",
-                  description = "Shader options.",
+                  description = "An optional table of Shader options.",
+                  default = "nil",
                   table = {
                     {
                       name = "flags",
@@ -12991,6 +13000,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Texture options.",
+                  default = "nil",
                   table = {
                     {
                       name = "type",
@@ -13058,6 +13068,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Texture options.",
+                  default = "nil",
                   table = {
                     {
                       name = "type",
@@ -13130,6 +13141,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Texture options.",
+                  default = "nil",
                   table = {
                     {
                       name = "type",
@@ -13192,6 +13204,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Texture options.",
+                  default = "nil",
                   table = {
                     {
                       name = "type",
@@ -13254,6 +13267,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Texture options.",
+                  default = "nil",
                   table = {
                     {
                       name = "type",
@@ -13316,6 +13330,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Texture options.",
+                  default = "nil",
                   table = {
                     {
                       name = "type",
@@ -13391,6 +13406,7 @@ return {
                   name = "options",
                   type = "table",
                   description = "Options for the texture view.",
+                  default = "nil",
                   table = {
                     {
                       name = "type",
@@ -19513,8 +19529,8 @@ return {
                       description = "The z coordinate of the next point."
                     },
                     {
-                      name = "...",
-                      type = "*",
+                      name = "...numbers",
+                      type = "number",
                       description = "More points to add to the line."
                     }
                   },
@@ -19543,8 +19559,8 @@ return {
                       description = "A vector containing the position of the next point on the line."
                     },
                     {
-                      name = "...",
-                      type = "*",
+                      name = "...vectors",
+                      type = "number",
                       description = "More points to add to the line."
                     }
                   },
@@ -34459,6 +34475,7 @@ return {
                   name = "settings",
                   type = "table",
                   description = "An optional table with settings for the physics simulation.",
+                  default = "nil",
                   table = {
                     {
                       name = "tags",

+ 1 - 0
api/lovr/audio/newSource.lua

@@ -17,6 +17,7 @@ return {
     },
     options = {
       type = 'table',
+      default = 'nil',
       description = 'Optional options.',
       table = {
         {

+ 8 - 4
api/lovr/graphics/Pass/line.lua

@@ -44,15 +44,19 @@ return {
       type = 'Vec3',
       description = 'A vector containing the position of the next point on the line.'
     },
-    ['...'] = {
-      type = '*',
+    ['...numbers'] = {
+      type = 'number',
+      description = 'More points to add to the line.'
+    },
+    ['...vectors'] = {
+      type = 'number',
       description = 'More points to add to the line.'
     }
   },
   returns = {},
   variants = {
     {
-      arguments = { 'x1', 'y1', 'z1', 'x2', 'y2', 'z2', '...' },
+      arguments = { 'x1', 'y1', 'z1', 'x2', 'y2', 'z2', '...numbers' },
       returns = {}
     },
     {
@@ -60,7 +64,7 @@ return {
       returns = {}
     },
     {
-      arguments = { 'v1', 'v2', '...' },
+      arguments = { 'v1', 'v2', '...vectors' },
       returns = {}
     }
   },

+ 2 - 1
api/lovr/graphics/newModel.lua

@@ -19,7 +19,8 @@ return {
     },
     options = {
       type = 'table',
-      description = 'Model options.',
+      default = 'nil',
+      description = 'An optional table of Model options.',
       table = {
         {
           name = 'mipmaps',

+ 2 - 1
api/lovr/graphics/newShader.lua

@@ -39,7 +39,8 @@ return {
     },
     options = {
       type = 'table',
-      description = 'Shader options.',
+      default = 'nil',
+      description = 'An optional table of Shader options.',
       table = {
         {
           name = 'flags',

+ 1 - 0
api/lovr/graphics/newTexture.lua

@@ -37,6 +37,7 @@ return {
     },
     options = {
       type = 'table',
+      default = 'nil',
       description = 'Texture options.',
       table = {
         {

+ 1 - 0
api/lovr/graphics/newTextureView.lua

@@ -21,6 +21,7 @@ return {
     },
     options = {
       type = 'table',
+      default = 'nil',
       description = 'Options for the texture view.',
       table = {
         {

+ 1 - 0
api/lovr/headset/newLayer.lua

@@ -13,6 +13,7 @@ return {
     },
     options = {
       type = 'table',
+      default = 'nil',
       description = 'Optional options for the Layer.',
       table = {
         {

+ 1 - 0
api/lovr/physics/newWorld.lua

@@ -4,6 +4,7 @@ return {
   arguments = {
     settings = {
       type = 'table',
+      default = 'nil',
       description = 'An optional table with settings for the physics simulation.',
       table = {
         {