Garry's Mod Wiki

Revision Difference

Global.RunGameUICommand#511298

<function name="RunGameUICommand" parent="Global" type="libraryfunc">⤶ <description>Runs a menu command. Equivalent to <page>Global.RunConsoleCommand</page>( "gamemenucommand", command ) unless the command starts with the "engine" keyword in which case it is equivalent to <page>Global.RunConsoleCommand</page>( command ).</description>⤶ <realm>Menu</realm>⤶ <args>⤶ <arg name="command" type="string">The menu command to run&#xA;&#xA;Should be one of the following:&#xA;* Disconnect - Disconnects from the current server.&#xA;* OpenBenchmarkDialog - Opens the &quot;Video Hardware Stress Test&quot; dialog.&#xA;* OpenChangeGameDialog - Does not work in GMod.&#xA;* OpenCreateMultiplayerGameDialog - Opens the Source dialog for creating a listen server.&#xA;* OpenCustomMapsDialog - Does nothing.&#xA;* OpenFriendsDialog - Does nothing.&#xA;* OpenGameMenu - Does not work in GMod.&#xA;* OpenLoadCommentaryDialog - Opens the &quot;Developer Commentary&quot; selection dialog. Useless in GMod.&#xA;* OpenLoadDemoDialog - Does nothing.&#xA;* OpenLoadGameDialog - Opens the Source &quot;Load Game&quot; dialog.&#xA;* OpenNewGameDialog - Opens the &quot;New Game&quot; dialog. Useless in GMod.&#xA;* OpenOptionsDialog - Opens the options dialog.&#xA;* OpenPlayerListDialog - Opens the &quot;Mute Players&quot; dialog that shows all players connected to the server and allows to mute them.&#xA;* OpenSaveGameDialog - Opens the Source &quot;Save Game&quot; dialog.&#xA;* OpenServerBrowser - Opens the legacy server browser.&#xA;* Quit - Quits the game `without` confirmation (unlike other Source games).&#xA;* QuitNoConfirm - Quits the game without confirmation (like other Source games).&#xA;* ResumeGame - Closes the menu and returns to the game.&#xA;* engine &amp;amp;lt;concommand&amp;amp;gt; - Runs a console command. Equivalent to &lt;page&gt;Global.RunConsoleCommand&lt;/page&gt;( &amp;amp;lt;concommand&amp;amp;gt; ).</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Opens the options dialog.</description>⤶ <code>RunGameUICommand( "OpenOptionsDialog" )</code>⤶ ⤶ </example>⤶ ⤶ ⤶ <example>⤶ <description>Hides the game UI (menu). Equivalent to <page>Global.RunConsoleCommand</page>( "gameui_hide" )</description>⤶ <code>RunGameUICommand( "engine gameui_hide" )</code>⤶ ⤶ </example>