Garry's Mod Wiki

Revision Difference

Global.RunGameUICommand#517806

<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>⤶ <arg name="command" type="string">The menu command to run⤶ ⤶ Should be one of the following:⤶ * Disconnect - Disconnects from the current server.⤶ * OpenBenchmarkDialog - Opens the "Video Hardware Stress Test" dialog.⤶ * OpenChangeGameDialog - Does not work in GMod.⤶ * OpenCreateMultiplayerGameDialog - Opens the Source dialog for creating a listen server.⤶ * OpenCustomMapsDialog - Does nothing.⤶ * OpenFriendsDialog - Does nothing.⤶ * OpenGameMenu - Does not work in GMod.⤶ * OpenLoadCommentaryDialog - Opens the "Developer Commentary" selection dialog. Useless in GMod.⤶ * OpenLoadDemoDialog - Does nothing.⤶ * OpenLoadGameDialog - Opens the Source "Load Game" dialog.⤶ * OpenNewGameDialog - Opens the "New Game" dialog. Useless in GMod.⤶ * OpenOptionsDialog - Opens the options dialog.⤶ * OpenPlayerListDialog - Opens the "Mute Players" dialog that shows all players connected to the server and allows to mute them.⤶ * OpenSaveGameDialog - Opens the Source "Save Game" dialog.⤶ * OpenServerBrowser - Opens the legacy server browser.⤶ * Quit - Quits the game `without` confirmation (unlike other Source games).⤶ * QuitNoConfirm - Quits the game without confirmation (like other Source games).⤶ * ResumeGame - Closes the menu and returns to the game.⤶ * engine &amp;lt;concommand&amp;gt; - Runs a console command. Equivalent to <page>Global.RunConsoleCommand</page>( &amp;lt;concommand&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>