Garry's Mod Wiki

Revision Difference

search.AddProvider#516961

<function name="AddProvider" parent="search" type="libraryfunc"> <description>Adds a search result provider. For examples, see gamemodes/sandbox/gamemode/cl_search_models.lua</description> <realm>Client</realm> <args>⤶ <arg name="provider" type="function">Provider function. It has one argument: {{FuncArg|string|searchQuery</arg>⤶ <arg name="id" type="string" default="nil">If provided, ensures that only one provider exists with the given ID at a time.</arg>⤶ </args>⤶ </function> ⤶ <arg⤶ |type=function⤶ |name=provider⤶ |desc=provider function. it has one argument: {{funcarg|string|searchquery}}⤶ you must return a list of tables structured like this:⤶ * <page>string</page> text - text to "copy to clipboard"⤶ * <page>function</page> func - function to use/spawn the item⤶ * <page>panel</page> icon - a panel to add to spawnmenu⤶ * <page>table</page> words - a table of words?⤶ }}⤶ {{arg>⤶ <type>string</type>⤶ <name>id</name>⤶ <desc>If provided, ensures that only one provider exists with the given ID at a time.</desc>⤶ <default>nil</default>⤶ ⤶ </arg⤶ |type=function⤶ |name=provider⤶ |desc=provider function. it has one argument: {{funcarg|string|searchquery}}⤶ you must return a list of tables structured like this:⤶ * <page>string</page> text - text to "copy to clipboard"⤶ * <page>function</page> func - function to use/spawn the item⤶ * <page>panel</page> icon - a panel to add to spawnmenu⤶ * <page>table</page> words - a table of words?⤶ }}⤶ {{arg>⤶ You must return a list of tables structured like this:⤶ * <page>string</page> text - Text to "Copy to clipboard"⤶ * <page>function</page> func - Function to use/spawn the item⤶ * <page>Panel</page> icon - A panel to add to spawnmenu⤶ * <page>table</page> words - A table of words?⤶ }}