Merge remote-tracking branch 'upstream/staging' into ed-22-12-2024-upstream
# Conflicts: # Content.IntegrationTests/Tests/PostMapInitTest.cs # Content.IntegrationTests/Tests/ResearchTest.cs # Resources/Prototypes/Entities/Objects/Decoration/flora.yml # Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml # Resources/Prototypes/Maps/Pools/default.yml
This commit is contained in:
34
Content.Client/UserInterface/RichText/MonoTag.cs
Normal file
34
Content.Client/UserInterface/RichText/MonoTag.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Linq;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface.RichText;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.UserInterface.RichText;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the font to a monospaced variant
|
||||
/// </summary>
|
||||
public sealed class MonoTag : IMarkupTag
|
||||
{
|
||||
[ValidatePrototypeId<FontPrototype>] public const string MonoFont = "Monospace";
|
||||
|
||||
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
public string Name => "mono";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void PushDrawContext(MarkupNode node, MarkupDrawingContext context)
|
||||
{
|
||||
var font = FontTag.CreateFont(context.Font, node, _resourceCache, _prototypeManager, MonoFont);
|
||||
context.Font.Push(font);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void PopDrawContext(MarkupNode node, MarkupDrawingContext context)
|
||||
{
|
||||
context.Font.Pop();
|
||||
}
|
||||
}
|
||||
@@ -572,6 +572,10 @@ public sealed class UserAHelpUIHandler : IAHelpUIHandler
|
||||
_window.OnClose += () => { OnClose?.Invoke(); };
|
||||
_window.OnOpen += () => { OnOpen?.Invoke(); };
|
||||
_window.Contents.AddChild(_chatPanel);
|
||||
|
||||
var introText = Loc.GetString("bwoink-system-introductory-message");
|
||||
var introMessage = new SharedBwoinkSystem.BwoinkTextMessage( _ownerId, SharedBwoinkSystem.SystemUserId, introText);
|
||||
Receive(introMessage);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Client.Administration.Managers;
|
||||
using System.Numerics;
|
||||
using Content.Client.Administration.Managers;
|
||||
using Content.Client.Gameplay;
|
||||
using Content.Client.Markers;
|
||||
using Content.Client.Sandbox;
|
||||
@@ -7,9 +8,7 @@ using Content.Client.UserInterface.Controls;
|
||||
using Content.Client.UserInterface.Systems.DecalPlacer;
|
||||
using Content.Client.UserInterface.Systems.Sandbox.Windows;
|
||||
using Content.Shared.Input;
|
||||
using Content.Shared.Silicons.StationAi;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.Debugging;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
@@ -109,9 +108,13 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
|
||||
|
||||
private void EnsureWindow()
|
||||
{
|
||||
if(_window is { Disposed: false })
|
||||
if (_window is { Disposed: false })
|
||||
return;
|
||||
_window = UIManager.CreateWindow<SandboxWindow>();
|
||||
// Pre-center the window without forcing it to the center every time.
|
||||
_window.OpenCentered();
|
||||
_window.Close();
|
||||
|
||||
_window.OnOpen += () => { SandboxButton!.Pressed = true; };
|
||||
_window.OnClose += () => { SandboxButton!.Pressed = false; };
|
||||
_window.ToggleLightButton.Pressed = !_light.Enabled;
|
||||
@@ -149,7 +152,6 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
|
||||
_window.ToggleSubfloorButton.OnPressed += _ => _sandbox.ToggleSubFloor();
|
||||
_window.ShowMarkersButton.OnPressed += _ => _sandbox.ShowMarkers();
|
||||
_window.ShowBbButton.OnPressed += _ => _sandbox.ShowBb();
|
||||
_window.MachineLinkingButton.OnPressed += _ => _sandbox.MachineLinking();
|
||||
}
|
||||
|
||||
private void CheckSandboxVisibility()
|
||||
@@ -164,7 +166,7 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
|
||||
{
|
||||
if (_window != null)
|
||||
{
|
||||
_window.Dispose();
|
||||
_window.Close();
|
||||
_window = null;
|
||||
}
|
||||
|
||||
@@ -209,7 +211,7 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
|
||||
if (_sandbox.SandboxAllowed && _window.IsOpen != true)
|
||||
{
|
||||
UIManager.ClickSound();
|
||||
_window.OpenCentered();
|
||||
_window.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4,20 +4,24 @@
|
||||
Title="{Loc sandbox-window-title}"
|
||||
Resizable="False">
|
||||
<BoxContainer Orientation="Vertical" SeparationOverride="4">
|
||||
<Button Name="AiOverlayButton" Access="Public" Text="{Loc sandbox-window-ai-overlay-button}" ToggleMode="True"/>
|
||||
<Button Name="RespawnButton" Access="Public" Text="{Loc sandbox-window-respawn-button}"/>
|
||||
<Button Name="SpawnEntitiesButton" Access="Public" Text="{Loc sandbox-window-spawn-entities-button}"/>
|
||||
<Label Text="{Loc sandbox-window-map-editing-label}"/>
|
||||
<Button Name="SpawnTilesButton" Access="Public" Text="{Loc sandbox-window-spawn-tiles-button}"/>
|
||||
<Button Name="SpawnEntitiesButton" Access="Public" Text="{Loc sandbox-window-spawn-entities-button}"/>
|
||||
<Button Name="SpawnDecalsButton" Access="Public" Text="{Loc sandbox-window-spawn-decals-button}"/>
|
||||
<Button Name="GiveFullAccessButton" Access="Public" Text="{Loc sandbox-window-grant-full-access-button}"/>
|
||||
<Button Name="GiveAghostButton" Access="Public" Text="{Loc sandbox-window-ghost-button}"/>
|
||||
|
||||
<Label Text="{Loc sandbox-window-visibility-label}"/>
|
||||
<Button Name="ToggleLightButton" Access="Public" Text="{Loc sandbox-window-toggle-lights-button}" ToggleMode="True"/>
|
||||
<Button Name="ToggleFovButton" Access="Public" Text="{Loc sandbox-window-toggle-fov-button}" ToggleMode="True"/>
|
||||
<Button Name="ToggleShadowsButton" Access="Public" Text="{Loc sandbox-window-toggle-shadows-button}" ToggleMode="True"/>
|
||||
<Button Name="ToggleSubfloorButton" Access="Public" Text="{Loc sandbox-window-toggle-subfloor-button}" ToggleMode="True"/>
|
||||
<Button Name="SuicideButton" Access="Public" Text="{Loc sandbox-window-toggle-suicide-button}" ToggleMode="True"/>
|
||||
<Button Name="AiOverlayButton" Access="Public" Text="{Loc sandbox-window-ai-overlay-button}" ToggleMode="True"/>
|
||||
<Button Name="ShowMarkersButton" Access="Public" Text="{Loc sandbox-window-show-spawns-button}" ToggleMode="True"/>
|
||||
<Button Name="ShowBbButton" Access="Public" Text="{Loc sandbox-window-show-bb-button}" ToggleMode="True"/>
|
||||
<Button Name="MachineLinkingButton" Access="Public" Text="{Loc sandbox-window-link-machines-button}" ToggleMode="True"/>
|
||||
|
||||
<Label Text="{Loc sandbox-window-your-character-label}"/>
|
||||
<Button Name="GiveAghostButton" Access="Public" Text="{Loc sandbox-window-ghost-button}"/>
|
||||
<Button Name="GiveFullAccessButton" Access="Public" Text="{Loc sandbox-window-grant-full-access-button}"/>
|
||||
<Button Name="SuicideButton" Access="Public" Text="{Loc sandbox-window-toggle-suicide-button}"/>
|
||||
<Button Name="RespawnButton" Access="Public" Text="{Loc sandbox-window-respawn-button}"/>
|
||||
</BoxContainer>
|
||||
</windows:SandboxWindow>
|
||||
|
||||
Reference in New Issue
Block a user