@using System; @using Sandbox.UI; @using Sandbox; @using Sandbox.Modals; @using Menu; @using Sandbox.Menu;
{ _showdebug = !_showdebug; } )>Overlay Debug
@if ( _showdebug ) {

MenuOverlay

{ MenuOverlay.Message( "Message Title" ); } )>Message
{ MenuOverlay.Question( "Want some crisps?", "people", () => {}, () => {} ); } )>Question

ModalSystem

{ ModalSystem.Instance.Game( "facepunch.sandbox" ); } )>Game Modal
{ ModalSystem.Instance.Map( "facepunch.flatgrass" ); } )>Map Modal
{ ModalSystem.Instance.Package( "facepunch.flatgrass" ); } )>Package Modal
{ ModalSystem.Instance.Settings(); } )>Settings
{ ModalSystem.Instance.PauseMenu(); } )>Pause Menu
{ ModalSystem.Instance.PackageSelect( "type:model", p => {}, f => {} ); } )>Package Select
{ ModalSystem.Instance.WorkshopPublish( MockWorkshopItem() ); } )>Workshop Publish
}
@code { bool _showdebug; WorkshopPublishOptions MockWorkshopItem() { var o = new WorkshopPublishOptions(); o.Title = "My Test File"; o.StorageEntry = Storage.CreateEntry( "tests" ); o.StorageEntry.Files.WriteAllText( "/banana/orange/test.txt", "This is a test file!" ); o.StorageEntry.Files.WriteAllText( "/banana/shouldnotcopy.txt", "This is a test file!" ); o.StorageEntry.Files.WriteAllText( "/banana/orange/models/files/somethingelse.txt", "This is a test file!" ); o.StorageEntry.Files.WriteAllText( "/banana/orange/models/files/buttes.txt", "This is a test file!" ); var thumb = new Bitmap( 512, 512 ); thumb.Clear( Color.Random ); for ( int i=0; i< 100; i++ ) { thumb.SetFill( Color.Random ); thumb.DrawCircle( Vector2.Random * 512, Random.Shared.Float( 5, 10 ) ); } o.Thumbnail = thumb; o.KeyValues ??= new(); o.KeyValues["type"] = "test"; o.Tags = [ "test", "menu", "placeholder" ]; o.Metadata = "This is a string. It could be Json. It could be anything"; return o; } }