mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
This is a gigantic kerfuffle because Chromium expects a very specific directory & app bundle layout. Have to change a bunch of resource loading code to account for content development being launched from an app bundle, and also had to make automatic MSBuild tooling & a python script to generate such an app bundle
38 lines
993 B
C#
38 lines
993 B
C#
using System.Numerics;
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
using Robust.Shared.Console;
|
|
|
|
namespace Robust.Client.WebView;
|
|
|
|
internal sealed class TestBrowseWindow : DefaultWindow
|
|
{
|
|
protected override Vector2 ContentsMinimumSize => new Vector2(640, 480);
|
|
|
|
public TestBrowseWindow(string url)
|
|
{
|
|
var wv = new WebViewControl();
|
|
wv.Url = url;
|
|
|
|
Contents.AddChild(wv);
|
|
}
|
|
}
|
|
|
|
internal sealed class TestBrowseWindowCommand : LocalizedCommands
|
|
{
|
|
public override string Command => "test_browse_window";
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
{
|
|
var url = args.Length > 0 ? args[0] : "https://spacestation14.com";
|
|
new TestBrowseWindow(url).Open();
|
|
}
|
|
|
|
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
|
{
|
|
if (args.Length == 1)
|
|
return CompletionResult.FromHint("<url>");
|
|
|
|
return CompletionResult.Empty;
|
|
}
|
|
}
|