Page 1 of 1

[1.1.107] runtime-api.json set_quick_bar_slot incorrect parameter

Posted: Fri Apr 19, 2024 12:37 pm
by Gweneph
The description of the filter parameter of set_quick_bar_slot says it can accept nil (and indeed I believe that's how you clear it). However, it's not marked optional and nil isn't in the type union:

Code: Select all

    {
      "name": "filter",
      "order": 1,
      "description": "The filter or `nil`.",
      "type": {
        "complex_type": "union",
        "options": [
          "string",
          "LuaItemPrototype",
          "LuaItemStack"
        ],
        "full_format": false
      },
      "optional": false
    }

Re: [1.1.107] runtime-api.json set_quick_bar_slot incorrect parameter

Posted: Fri Apr 19, 2024 12:41 pm
by Rseding91
That is correct. Optional means you can exclude the parameter and it’s fine. This is not optional and you must give it a value or nil.

Re: [1.1.107] runtime-api.json set_quick_bar_slot incorrect parameter

Posted: Fri Apr 19, 2024 1:07 pm
by Bilka
But nil should indeed be in the type union, moved to doc requests.

Re: [1.1.107] runtime-api.json set_quick_bar_slot incorrect parameter

Posted: Sat May 04, 2024 4:49 pm
by Bilka
Bilka wrote:
Fri Apr 19, 2024 1:07 pm
But nil should indeed be in the type union, moved to doc requests.
And docs fixed for the next doc release.