Closed b0mbie closed 4 weeks ago
Heya, thanks for reporting.
If I understand you correctly, then this can be fixed by editting the wiki.
I looked up an example that also allows multiple types for a parameter and found concommand.Add which is typed correctly for its flags
parameter: https://github.com/luttje/glua-api-snippets/blob/d4940ffbc406630b84588608f218c8aa27db5266/library/concommand.lua#L35
You can see on the wiki edit page that this is achieved with an argument documented like this:
<arg name="flags" type="number" alttype="table" default="0">Console command modifier flags. Either a bitflag, or a table of enums. See <page>Enums/FCVAR</page>.</arg>
If this answers your question, then it'd be great if you could edit the wiki to document this alttype
. Let me know if this is the case and I'll close this issue.
Next month when the scraper updates I'll update the extension in LLS-Addons
PS: Maybe @robotboy655 would be okay with setting the alttype="false"
for this specific argument in SetTooltip, even though false
obviously isn't a datatype. In that situation we could add a type page to the wiki for https://wiki.facepunch.com/gmod/false (and true) that would point to https://wiki.facepunch.com/gmod/boolean
I think the wiki has it misdocumented, its not false
to disable it (it works, but as a coincidence), it's omitting the argument that is intended, or nil
. I have updated the wiki page.
Oh! That certainly makes more sense. I think it'll be ok to close this now, then.
The page for
Panel:SetTooltip
says thatstr
can actually be either astring
orfalse
for no tooltip:Then, the page for
Panel:GetTooltip
also says that the return value is the tooltip text, if it was set:The tooltip type can possibly defined to be
string|false
for thePanel:SetTooltip
parameter type, though I'm not sure about the return type forPanel:GetTooltip
.This change would fix the diagnostics for the example presented on the page for
Panel:SetTooltip
: