namespace Sandbox.Modals; public interface IModalSystem { internal static IModalSystem Current { get; set; } public bool HasModalsOpen(); public void CloseAll( bool immediate = false ); public void Game( string packageIdent ); public void Map( string packageIdent ); public void Package( string packageIdent, string page ); public void Organization( Package.Organization org ); public void Review( Package package ); public void PackageSelect( string query, Action onPackageSelected, Action onFilterChanged = null ); public void FriendsList( in FriendsListModalOptions options ); public void ServerList( in ServerListConfig config ); public void Settings( string page = "" ); public void CreateGame( in CreateGameOptions options ); public void Player( SteamId steamid, string page = "" ); public void News( Sandbox.Services.News newsitem ); public void PlayerList(); public void WorkshopPublish( in WorkshopPublishOptions options ); /// /// The menu that is shown when escape is pressed while playing. /// public void PauseMenu(); public bool IsModalOpen { get; } public bool IsPauseMenuOpen { get; } } public struct FriendsListModalOptions { public FriendsListModalOptions() { } /// /// Show offline members /// public bool ShowOfflineMembers { get; set; } = true; /// /// Show online (but not in-game) members /// public bool ShowOnlineMembers { get; set; } = true; } public struct ServerListConfig { public ServerListConfig( string game = null, string map = null ) { GamePackageFilter = game; MapPackageFilter = map; } public string GamePackageFilter { get; set; } public string MapPackageFilter { get; set; } } /// /// Passed to IModalSystem.CreateGame /// public struct CreateGameOptions { public CreateGameOptions( Package package, Action onComplete = null ) { Package = package; OnComplete = onComplete; } public Package Package { get; set; } public Action OnComplete { get; set; } } public struct CreateGameResults { public CreateGameResults() { } public Dictionary GameSettings { get; set; } = new(); public string MapIdent { get; set; } public int MaxPlayers { get; set; } public string ServerName { get; set; } public Sandbox.Network.LobbyPrivacy Privacy { get; set; } } /// /// Passed to IModalSystem.WorkshopPublish /// public struct WorkshopPublishOptions { public WorkshopPublishOptions() { } /// /// The default title of this item. The user will be able to change it. /// public string Title { get; set; } /// /// The description of this item. The user will be able to change it. /// public string Description { get; set; } /// /// 512x512 thumbnail image, no transparency /// public Bitmap Thumbnail { get; set; } /// /// The filesystem containing the files to publish /// public Storage.Entry StorageEntry { get; set; } /// /// Keyvalues to store on the item. You can search and filter by these later. /// public Dictionary KeyValues { get; set; } /// /// Tags to set on the item. You can search and filter by these later. /// public HashSet Tags { get; set; } /// /// You can store metadata on the item, which is just a string. This can be read when querying items before /// downloading them - so it can be useful for storing extra info you want to store. /// public string Metadata { get; set; } /// /// The visibility of the item /// public Storage.Visibility Visibility { get; set; } = Storage.Visibility.Public; /// /// Can the client select the visibility for this item /// public bool CanSelectVisibility { get; set; } = true; /// /// Called when done. The ulong is the published item id. You can access it via url /// https://steamcommunity.com/sharedfiles/filedetails/?id=###### /// public Action OnComplete { get; set; } }