Overlayclass

Provides static methods for displaying various modal overlays in the game UI. The `Sandbox.Game.Overlay` class allows you to open modals for packages, maps, news, organizations, reviews, friends lists, server lists, settings, input bindings, and player profiles. It serves as a central point for invoking user interface overlays that interact with core game and community features.

objectOverlay
Namespace
global
Assembly
Sandbox.Engine
Declaration
public class Sandbox.Game.Overlay

Constructors1

Showing 1 constructors

Methods23

Showing 23 methods

public static void Close()PUBLICSTATIC

Closes the top overlay if one exists

Returns:void

public static void CloseAll(bool immediate = False)PUBLICSTATIC

Close all open overlays

ParameterTypeDescription
immediate = FalseboolIf , will skip any outros
Returns:void

public static void CreateGame(Sandbox.Modals.CreateGameOptions options)PUBLICSTATIC

Opens a modal to create a game with a bunch of settings. We use this in the menu when you click "Create Game" and the game has options.

ParameterTypeDescription
optionsCreateGameOptions
Returns:void

public static void ShowBinds()PUBLICSTATIC

Opens a modal that lets you view and rebind game input actions.

Returns:void

public static void ShowGameModal(string packageIdent)PUBLICSTATIC

Opens a modal for the specified game package

ParameterTypeDescription
packageIdentstring
Returns:void

public static void ShowMapModal(string packageIdent)PUBLICSTATIC

Opens a modal for the specified map package

ParameterTypeDescription
packageIdentstring
Returns:void

public static void ShowMapSelector(System.Action`1<string> onSelect, string selected = null)PUBLICSTATIC

ParameterTypeDescription
onSelectAction<string>
selected = nullstring
Returns:void

public static void ShowNewsModal(Sandbox.Services.News newsitem)PUBLICSTATIC

Opens a modal for the news item

ParameterTypeDescription
newsitemNews
Returns:void

public static void ShowOrganizationModal(Sandbox.Package.Organization org)PUBLICSTATIC

Opens a modal for the specified organization. This is most likely called from a Package - so get the organization from there.

ParameterTypeDescription
orgOrganization
Returns:void

public static void ShowPackageSelector(string query, System.Action`1<Sandbox.Package> onSelect, System.Action`1<string> onFilterChanged = null)PUBLICSTATIC

ParameterTypeDescription
querystring
onSelectAction<Package>
onFilterChanged = nullAction<string>
Returns:void

public static void ShowPauseMenu()PUBLICSTATIC

Opens the pause menu overlay. This is the same menu that appears when pressing ESC.

Returns:void

public static void ShowPlayer(Sandbox.SteamId steamid, string page)PUBLICSTATIC

View a selected user's profile

ParameterTypeDescription
steamidSteamId
pagestring
Returns:void

public static void ShowPlayerList()PUBLICSTATIC

Open a modal that shows a list of players currently in the game

Returns:void

public static void ShowReportModal(string packageIdent)PUBLICSTATIC

Opens a modal to report the specified package

ParameterTypeDescription
packageIdentstring
Returns:void

public static void ShowReviewModal(Sandbox.Package package)PUBLICSTATIC

Opens a modal to review the specified package

ParameterTypeDescription
packagePackage
Returns:void

public static void ShowServerList(Sandbox.Modals.ServerListConfig config)PUBLICSTATIC

Opens a modal that shows a list of active servers

ParameterTypeDescription
configServerListConfig
Returns:void

public static void ShowServiceConnector()PUBLICSTATIC

Shows modal to edit the streaming settings

Returns:void

public static void ShowSettingsModal(string page)PUBLICSTATIC

Opens a modal that lets you modify your settings Optionally, you can specify a page to open directly to: "keybinds", "video", "input", "audio", "game", "storage", "developer"

ParameterTypeDescription
pagestring
Returns:void

public static void WorkshopPublish(Sandbox.Modals.WorkshopPublishOptions options)PUBLICSTATIC

Open a modal that prompts the user to publish content to the workshop

ParameterTypeDescription
optionsWorkshopPublishOptions
Returns:void

Properties2

Showing 2 properties

public bool Sandbox.Game.Overlay.IsOpen { get; set; }PUBLICGETSET

Returns true if any overlay is open

Returns:bool

public bool Sandbox.Game.Overlay.IsPauseMenuOpen { get; set; }PUBLICGETSET

Returns true if the pause menu overlay is open

Returns:bool

On this page

Constructorspublic Overlay()Methodspublic static System.Void Close()public static System.Void CloseAll(System.Boolean immediate = False)public static System.Void CreateGame(Sandbox.Modals.CreateGameOptions options)public static System.Void ShowBinds()public static System.Void ShowFriendsList()public static System.Void ShowFriendsList(Sandbox.Modals.FriendsListModalOptions options)public static System.Void ShowGameModal(System.String packageIdent)public static System.Void ShowMapModal(System.String packageIdent)public static System.Void ShowMapSelector(System.Action`1<System.String> onSelect, System.String selected = null)public static System.Void ShowNewsModal(Sandbox.Services.News newsitem)public static System.Void ShowOrganizationModal(Sandbox.Package.Organization org)public static System.Void ShowPackageModal(System.String ident, System.String page)public static System.Void ShowPackageModal(System.String ident)public static System.Void ShowPackageSelector(System.String query, System.Action`1<Sandbox.Package> onSelect, System.Action`1<System.String> onFilterChanged = null)public static System.Void ShowPauseMenu()public static System.Void ShowPlayer(Sandbox.SteamId steamid, System.String page)public static System.Void ShowPlayerList()public static System.Void ShowReportModal(System.String packageIdent)public static System.Void ShowReviewModal(Sandbox.Package package)public static System.Void ShowServerList(Sandbox.Modals.ServerListConfig config)public static System.Void ShowServiceConnector()public static System.Void ShowSettingsModal(System.String page)public static System.Void WorkshopPublish(Sandbox.Modals.WorkshopPublishOptions options)Propertiespublic System.Boolean Sandbox.Game.Overlay.IsOpen { get; set; }public System.Boolean Sandbox.Game.Overlay.IsPauseMenuOpen { get; set; }Metadata