mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-01 19:08:19 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
62 lines
1.4 KiB
C#
62 lines
1.4 KiB
C#
using Sandbox.Menu;
|
|
|
|
namespace Sandbox.Internal;
|
|
|
|
/// <summary>
|
|
/// This is how the engine communicates with the menu system
|
|
/// </summary>
|
|
public interface IMenuSystem
|
|
{
|
|
internal static IMenuSystem Current { get; set; }
|
|
|
|
/// <summary>
|
|
/// Called to initialize the menu system
|
|
/// </summary>
|
|
public void Init();
|
|
|
|
/// <summary>
|
|
/// Close down the menu, delete everything
|
|
/// </summary>
|
|
public void Shutdown();
|
|
|
|
/// <summary>
|
|
/// Called every frame, to let the menu think
|
|
/// </summary>
|
|
public void Tick();
|
|
|
|
/// <summary>
|
|
/// Show a popup
|
|
/// </summary>
|
|
public void Popup( string type, string title, string subtitle );
|
|
|
|
/// <summary>
|
|
/// Show a question
|
|
/// </summary>
|
|
public void Question( string message, string icon, Action yes, Action no );
|
|
|
|
/// <summary>
|
|
/// Package closed. Add a toast asking if it was cool or not
|
|
/// </summary>
|
|
public void OnPackageClosed( Package package );
|
|
|
|
|
|
internal static void ShowServerError( string title, string subtitle )
|
|
{
|
|
Current?.Popup( "error", title, subtitle );
|
|
}
|
|
|
|
/// <summary>
|
|
/// True if we want to force the cursor to be visible and swallow input.
|
|
/// This is used for the developer console and loading screens.
|
|
/// </summary>
|
|
public bool ForceCursorVisible { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Used to talk to the menu's loading screen.
|
|
/// </summary>
|
|
internal interface ILoadingInterface : IDisposable
|
|
{
|
|
public void LoadingProgress( LoadingProgress progress );
|
|
}
|