merge remote master, upstream

This commit is contained in:
Dmitry
2025-10-26 22:31:58 +07:00
1466 changed files with 31780 additions and 19994 deletions

View File

@@ -13,7 +13,7 @@ from typing import List
SOLUTION_PATH = Path("..") / "SpaceStation14.sln"
# If this doesn't match the saved version we overwrite them all.
CURRENT_HOOKS_VERSION = "3"
CURRENT_HOOKS_VERSION = "4"
QUIET = len(sys.argv) == 2 and sys.argv[1] == "--quiet"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
gitroot=$(git rev-parse --show-toplevel)

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Just call post-checkout since it does the same thing.
gitroot=$(git rev-parse --git-path hooks)

View File

@@ -9,6 +9,7 @@ using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using System.Numerics;
using System.Linq;
using Content.Client.Stylesheets;
namespace Content.Client.Access.UI
{
@@ -49,12 +50,12 @@ namespace Content.Client.Access.UI
icons.Sort((x, y) => string.Compare(x.LocalizedJobName, y.LocalizedJobName, StringComparison.CurrentCulture));
foreach (var jobIcon in icons)
{
String styleBase = StyleBase.ButtonOpenBoth;
String styleBase = StyleClass.ButtonOpenBoth;
var modulo = i % JobIconColumnCount;
if (modulo == 0)
styleBase = StyleBase.ButtonOpenRight;
styleBase = StyleClass.ButtonOpenRight;
else if (modulo == JobIconColumnCount - 1)
styleBase = StyleBase.ButtonOpenLeft;
styleBase = StyleClass.ButtonOpenLeft;
// Generate buttons
var jobIconButton = new Button

View File

@@ -119,11 +119,11 @@ public sealed partial class GroupedAccessLevelChecklist : BoxContainer
if (_groupedAccessLevels.Count > 1)
{
if (AccessGroupList.ChildCount == 0)
accessGroupButton.AddStyleClass(StyleBase.ButtonOpenLeft);
accessGroupButton.AddStyleClass(StyleClass.ButtonOpenLeft);
else if (_groupedAccessLevels.Count > 1 && AccessGroupList.ChildCount == (_groupedAccessLevels.Count - 1))
accessGroupButton.AddStyleClass(StyleBase.ButtonOpenRight);
accessGroupButton.AddStyleClass(StyleClass.ButtonOpenRight);
else
accessGroupButton.AddStyleClass(StyleBase.ButtonOpenBoth);
accessGroupButton.AddStyleClass(StyleClass.ButtonOpenBoth);
}
accessGroupButton.Pressed = _accessGroupTabIndex == orderedAccessGroups.IndexOf(accessGroup);

View File

@@ -1,6 +1,7 @@
<DefaultWindow xmlns="https://spacestation14.io"
MinSize="650 290">
<BoxContainer Orientation="Vertical">
<!-- Privileged and target IDs, crew manifest button. -->
<GridContainer Columns="2">
<GridContainer Columns="3" HorizontalExpand="True">
<Label Text="{Loc 'id-card-console-window-privileged-id'}" />
@@ -16,6 +17,7 @@
</BoxContainer>
</GridContainer>
<Control MinSize="0 8" />
<!-- Full name and job title editing. -->
<GridContainer Columns="3" HSeparationOverride="4">
<Label Name="FullNameLabel" Text="{Loc 'id-card-console-window-full-name-label'}" />
<LineEdit Name="FullNameLineEdit" HorizontalExpand="True" />
@@ -26,10 +28,19 @@
<Button Name="JobTitleSaveButton" Text="{Loc 'id-card-console-window-save-button'}" Disabled="True" />
</GridContainer>
<Control MinSize="0 8" />
<GridContainer Columns="2">
<Label Text="{Loc 'id-card-console-window-job-selection-label'}" />
<OptionButton Name="JobPresetOptionButton" />
</GridContainer>
<!-- Job preset selection, grant/revoke all access buttons. -->
<BoxContainer Margin="0 8 0 4">
<BoxContainer>
<Label Text="{Loc 'id-card-console-window-job-selection-label'}" />
<OptionButton Name="JobPresetOptionButton" />
</BoxContainer>
<Control HorizontalExpand="True"/>
<BoxContainer>
<Button Name="SelectAllButton" Text="{Loc 'id-card-console-window-select-all-button'}" />
<Button Name="DeselectAllButton" Text="{Loc 'id-card-console-window-deselect-all-button'}" />
</BoxContainer>
</BoxContainer>
<!-- Individual access buttons -->
<Control Name="AccessLevelControlContainer" />
</BoxContainer>
</DefaultWindow>

View File

@@ -79,6 +79,18 @@ namespace Content.Client.Access.UI
JobPresetOptionButton.AddItem(Loc.GetString(job.Name), _jobPrototypeIds.Count - 1);
}
SelectAllButton.OnPressed += _ =>
{
SetAllAccess(true);
SubmitData();
};
DeselectAllButton.OnPressed += _ =>
{
SetAllAccess(false);
SubmitData();
};
JobPresetOptionButton.OnItemSelected += SelectJobPreset;
_accessButtons.Populate(accessLevels, prototypeManager);
AccessLevelControlContainer.AddChild(_accessButtons);
@@ -89,14 +101,13 @@ namespace Content.Client.Access.UI
}
}
private void ClearAllAccess()
/// <param name="enabled">If true, every individual access button will be pressed. If false, each will be depressed.</param>
private void SetAllAccess(bool enabled)
{
foreach (var button in _accessButtons.ButtonsList.Values)
{
if (button.Pressed)
{
button.Pressed = false;
}
if (!button.Disabled && button.Pressed != enabled)
button.Pressed = enabled;
}
}
@@ -110,7 +121,7 @@ namespace Content.Client.Access.UI
JobTitleLineEdit.Text = Loc.GetString(job.Name);
args.Button.SelectId(args.Id);
ClearAllAccess();
SetAllAccess(false);
// this is a sussy way to do this
foreach (var access in job.Access)

View File

@@ -23,9 +23,10 @@ namespace Content.Client.Actions.UI
public ActionAlertTooltip(FormattedMessage name, FormattedMessage? desc, string? requires = null)
{
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSystem;
_gameTiming = IoCManager.Resolve<IGameTiming>();
SetOnlyStyleClass(StyleNano.StyleClassTooltipPanel);
SetOnlyStyleClass(StyleClass.TooltipPanel);
BoxContainer vbox;
AddChild(vbox = new BoxContainer
@@ -36,7 +37,7 @@ namespace Content.Client.Actions.UI
var nameLabel = new RichTextLabel
{
MaxWidth = TooltipTextMaxWidth,
StyleClasses = {StyleNano.StyleClassTooltipActionTitle}
StyleClasses = { StyleClass.TooltipTitle }
};
nameLabel.SetMessage(name);
vbox.AddChild(nameLabel);
@@ -46,7 +47,7 @@ namespace Content.Client.Actions.UI
var description = new RichTextLabel
{
MaxWidth = TooltipTextMaxWidth,
StyleClasses = {StyleNano.StyleClassTooltipActionDescription}
StyleClasses = { StyleClass.TooltipDesc }
};
description.SetMessage(desc);
vbox.AddChild(description);
@@ -55,7 +56,7 @@ namespace Content.Client.Actions.UI
vbox.AddChild(_cooldownLabel = new RichTextLabel
{
MaxWidth = TooltipTextMaxWidth,
StyleClasses = {StyleNano.StyleClassTooltipActionCooldown},
StyleClasses = { StyleClass.TooltipDesc },
Visible = false
});
@@ -64,7 +65,7 @@ namespace Content.Client.Actions.UI
var requiresLabel = new RichTextLabel
{
MaxWidth = TooltipTextMaxWidth,
StyleClasses = {StyleNano.StyleClassTooltipActionRequirements}
StyleClasses = { StyleClass.TooltipDesc }
};
if (!FormattedMessage.TryFromMarkup("[color=#635c5c]" + requires + "[/color]", out var markup))

View File

@@ -7,7 +7,7 @@
</PanelContainer.PanelOverride>
<Control HorizontalAlignment="Center" VerticalAlignment="Center" MaxWidth="600">
<PanelContainer StyleClasses="AngleRect" />
<PanelContainer StyleClasses="BackgroundPanel" />
<BoxContainer Orientation="Vertical" Margin="4">
<RichTextLabel Name="Description" />

View File

@@ -12,17 +12,19 @@ namespace Content.Client.Administration.UI.AdminRemarks;
[GenerateTypedNameReferences]
public sealed partial class AdminMessagePopupWindow : Control
{
[Dependency] private readonly IStylesheetManager _styleMan = default!;
private float _timer = float.MaxValue;
public event Action? OnDismissPressed;
public event Action? OnAcceptPressed;
public AdminMessagePopupWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
Stylesheet = _styleMan.SheetSystem;
AcceptButton.OnPressed += OnAcceptButtonPressed;
DismissButton.OnPressed += OnDismissButtonPressed;
@@ -49,7 +51,8 @@ public sealed partial class AdminMessagePopupWindow : Control
MessageContainer.AddChild(new AdminMessagePopupMessage(message));
}
Description.SetMessage(FormattedMessage.FromMarkupOrThrow(Loc.GetString("admin-notes-message-desc", ("count", state.Messages.Length))));
Description.SetMessage(
FormattedMessage.FromMarkup(Loc.GetString("admin-notes-message-desc", ("count", state.Messages.Length))));
}
private void OnDismissButtonPressed(BaseButton.ButtonEventArgs obj)

View File

@@ -226,7 +226,7 @@ public sealed partial class BanPanel : DefaultWindow
var roleGroupCheckbox = new Button
{
Name = $"{groupName}GroupCheckbox",
Text = "Ban all",
Text = Loc.GetString("role-bans-ban-group"),
Margin = new Thickness(0, 0, 5, 0),
ToggleMode = true,
};
@@ -391,7 +391,7 @@ public sealed partial class BanPanel : DefaultWindow
TimeLine.Text = args.Text;
if (!double.TryParse(args.Text, out var result))
{
ExpiresLabel.Text = "err";
ExpiresLabel.Text = Loc.GetString("ban-panel-expiry-error");
ErrorLevel |= ErrorLevelEnum.Minutes;
TimeLine.ModulateSelfOverride = Color.Red;
UpdateSubmitEnabled();

View File

@@ -18,7 +18,7 @@
<Button Visible="True" Name="PopOut" Access="Public" Text="{Loc 'admin-logs-pop-out'}" StyleClasses="OpenBoth" HorizontalAlignment="Left" />
<Control HorizontalExpand="True" />
<Button Visible="False" Name="Bans" Text="{Loc 'admin-player-actions-bans'}" StyleClasses="OpenRight" />
<Button Visible="False" Name="Notes" Text="{Loc 'admin-player-actions-notes'}" StyleClasses="OpenBoth" />
<Button Visible="False" Access="Public" Name="Notes" Text="{Loc 'admin-player-actions-notes'}" StyleClasses="OpenBoth" />
<controls:ConfirmButton Visible="False" Name="Kick" Text="{Loc 'admin-player-actions-kick'}" ConfirmationText="{Loc 'admin-player-actions-confirm'}" StyleClasses="OpenBoth" />
<Button Visible="False" Name="Ban" Text="{Loc 'admin-player-actions-ban'}" StyleClasses="OpenBoth" />
<controls:ConfirmButton Visible="False" Name="Respawn" Text="{Loc 'admin-player-actions-respawn'}" ConfirmationText="{Loc 'admin-player-actions-confirm'}" StyleClasses="OpenBoth" />

View File

@@ -166,7 +166,7 @@ public sealed class AdminLogsEui : BaseEui
ClydeWindow = _clyde.CreateWindow(new WindowCreateParameters
{
Maximized = false,
Title = "Admin Logs",
Title = Loc.GetString("admin-logs-title"),
Monitor = monitor,
Width = 1100,
Height = 400

View File

@@ -5,7 +5,7 @@
<BoxContainer Orientation="Vertical" Name="Notes" Access="Public" VerticalExpand="True"/>
</ScrollContainer>
<Button Name="ShowMoreButton" Text="{Loc admin-notes-show-more}" Visible="False" HorizontalAlignment="Center" />
<Button Name="NewNoteButton" Text="{Loc admin-notes-new-note}" Disabled="True" />
<Button Name="NewNoteButton" Access="Public" Text="{Loc admin-notes-new-note}" Disabled="True" />
</BoxContainer>
</PanelContainer>
</Control>

View File

@@ -3,7 +3,7 @@
Title="Loading..."
MinSize="400 200">
<BoxContainer Orientation="Vertical" Margin="4">
<TextEdit Name="NoteTextEdit" HorizontalExpand="True" VerticalExpand="True" />
<TextEdit Name="NoteTextEdit" Access="Public" HorizontalExpand="True" VerticalExpand="True" />
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Name="ExpiryLabel" Text="{Loc admin-note-editor-expiry-label}" Visible="False" />
<HistoryLineEdit Name="ExpiryLineEdit" PlaceHolder="{Loc admin-note-editor-expiry-placeholder}"
@@ -17,7 +17,7 @@
ToolTip="{Loc admin-note-editor-secret-tooltip}" />
<CheckBox Name="PermanentCheckBox" Pressed="True" Text="{Loc admin-note-editor-expiry-checkbox}"
ToolTip="{Loc admin-note-editor-expiry-checkbox-tooltip}" />
<Button Name="SubmitButton" Text="{Loc admin-note-editor-submit}" HorizontalAlignment="Right" />
<Button Name="SubmitButton" Access="Public" Text="{Loc admin-note-editor-submit}" HorizontalAlignment="Right" />
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>

View File

@@ -133,7 +133,7 @@ public sealed partial class NoteEdit : FancyWindow
private bool IsSecret { get; set; }
private NoteType NoteType { get; set; }
private NoteSeverity? NoteSeverity
public NoteSeverity? NoteSeverity
{
get => _noteSeverity;
set

View File

@@ -27,7 +27,7 @@ namespace Content.Client.Administration.UI
[Dependency] private readonly IClientAdminManager _adminManager = default!;
private readonly Menu _menu;
private readonly List<DefaultWindow> _subWindows = new();
private readonly List<BaseWindow> _subWindows = new();
private Dictionary<int, PermissionsEuiState.AdminRankData> _ranks =
new();
@@ -216,7 +216,7 @@ namespace Content.Client.Administration.UI
var titleControl = new Label { Text = admin.Title ?? Loc.GetString("permissions-eui-edit-admin-title-control-text").ToLowerInvariant() };
if (admin.Title == null) // none
{
titleControl.StyleClasses.Add(StyleBase.StyleClassItalic);
titleControl.StyleClasses.Add(StyleClass.Italic);
}
al.AddChild(titleControl);
@@ -240,7 +240,7 @@ namespace Content.Client.Administration.UI
var rankControl = new Label { Text = rank };
if (italic)
{
rankControl.StyleClasses.Add(StyleBase.StyleClassItalic);
rankControl.StyleClasses.Add(StyleClass.Italic);
}
al.AddChild(rankControl);
@@ -340,10 +340,9 @@ namespace Content.Client.Administration.UI
tab.AddChild(adminVBox);
tab.AddChild(rankVBox);
Contents.AddChild(tab);
ContentsContainer.AddChild(tab);
ContentsContainer.MinSize = new(600, 400);
}
protected override Vector2 ContentsMinimumSize => new Vector2(600, 400);
}
private sealed class EditAdminWindow : DefaultWindow
@@ -419,21 +418,21 @@ namespace Content.Client.Administration.UI
var inherit = new Button
{
Text = "I",
StyleClasses = { StyleBase.ButtonOpenRight },
StyleClasses = { StyleClass.ButtonOpenRight },
Disabled = disable,
Group = group,
};
var sub = new Button
{
Text = "-",
StyleClasses = { StyleBase.ButtonOpenBoth },
StyleClasses = { StyleClass.ButtonOpenBoth },
Disabled = disable,
Group = group
};
var plus = new Button
{
Text = "+",
StyleClasses = { StyleBase.ButtonOpenLeft },
StyleClasses = { StyleClass.ButtonOpenLeft },
Disabled = disable,
Group = group
};
@@ -479,7 +478,7 @@ namespace Content.Client.Administration.UI
bottomButtons.AddChild(SaveButton);
Contents.AddChild(new BoxContainer
ContentsContainer.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
@@ -605,7 +604,7 @@ namespace Content.Client.Administration.UI
bottomButtons.AddChild(SaveButton);
Contents.AddChild(new BoxContainer
ContentsContainer.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =

View File

@@ -7,10 +7,8 @@
MinSize="50 50">
<BoxContainer Orientation="Vertical">
<GridContainer Columns="3">
<cc:UICommandButton Command="kick" Text="{Loc admin-player-actions-window-title}" WindowType="{x:Type at:PlayerActionsWindow}" />
<cc:CommandButton Command="banpanel" Text="{Loc admin-player-actions-window-ban}" />
<cc:CommandButton Command="aghost" Text="{Loc admin-player-actions-window-admin-ghost}" />
<cc:UICommandButton Command="tpto" Text="{Loc admin-player-actions-window-teleport}" WindowType="{x:Type at:TeleportWindow}" />
<cc:CommandButton Command="permissions" Text="{Loc admin-player-actions-window-permissions}" />
<cc:CommandButton Command="announceui" Text="{Loc admin-player-actions-window-announce}"/>
<cc:UICommandButton Command="callshuttle" Text="{Loc admin-player-actions-window-shuttle}" WindowType="{x:Type at:AdminShuttleWindow}"/>

View File

@@ -1,19 +0,0 @@
<DefaultWindow
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc admin-player-actions-window-title}" MinSize="425 272">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc admin-player-actions-reason}" MinWidth="100" />
<Control MinWidth="50" />
<LineEdit Name="ReasonLine" MinWidth="100" HorizontalExpand="True" />
</BoxContainer>
<cc:PlayerListControl Name="PlayerList" VerticalExpand="True" />
<BoxContainer Orientation="Horizontal">
<controls:ConfirmButton Name="SubmitKickButton" Text="{Loc admin-player-actions-kick}" ConfirmationText="{Loc 'admin-player-actions-confirm'}" Disabled="True"/>
<Button Name="SubmitAHelpButton" Text="{Loc admin-player-actions-ahelp}" Disabled="True"/>
<controls:ConfirmButton Name="SubmitRespawnButton" Text="{Loc admin-player-actions-respawn}" ConfirmationText="{Loc 'admin-player-actions-confirm'}" Disabled="True"/>
</BoxContainer>
</BoxContainer>
</DefaultWindow>

View File

@@ -1,64 +0,0 @@
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
namespace Content.Client.Administration.UI.Tabs.AdminTab
{
[GenerateTypedNameReferences]
[UsedImplicitly]
public sealed partial class PlayerActionsWindow : DefaultWindow
{
private PlayerInfo? _selectedPlayer;
public PlayerActionsWindow()
{
RobustXamlLoader.Load(this);
SubmitKickButton.OnPressed += SubmitKickButtonOnPressed;
SubmitAHelpButton.OnPressed += SubmitAhelpButtonOnPressed;
SubmitRespawnButton.OnPressed += SubmitRespawnButtonOnPressed;
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
}
private void OnListOnOnSelectionChanged(PlayerInfo? obj)
{
_selectedPlayer = obj;
var disableButtons = _selectedPlayer == null;
SubmitKickButton.Disabled = disableButtons;
SubmitAHelpButton.Disabled = disableButtons;
SubmitRespawnButton.Disabled = disableButtons;
}
private void SubmitKickButtonOnPressed(BaseButton.ButtonEventArgs obj)
{
if (_selectedPlayer == null)
return;
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
$"kick \"{_selectedPlayer.Username}\" \"{CommandParsing.Escape(ReasonLine.Text)}\"");
}
private void SubmitAhelpButtonOnPressed(BaseButton.ButtonEventArgs obj)
{
if (_selectedPlayer == null)
return;
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
$"openahelp \"{_selectedPlayer.SessionId}\"");
}
private void SubmitRespawnButtonOnPressed(BaseButton.ButtonEventArgs obj)
{
if (_selectedPlayer == null)
return;
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
$"respawn \"{_selectedPlayer.Username}\"");
}
}
}

View File

@@ -1,9 +0,0 @@
<DefaultWindow
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
Title="{Loc admin-ui-teleport}" MinSize="425 230">
<BoxContainer Orientation="Vertical">
<cc:PlayerListControl Name="PlayerList" />
<Button Name="SubmitButton" Text="{Loc admin-ui-teleport}" />
</BoxContainer>
</DefaultWindow>

View File

@@ -1,38 +0,0 @@
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.IoC;
namespace Content.Client.Administration.UI.Tabs.AdminTab
{
[GenerateTypedNameReferences]
[UsedImplicitly]
public sealed partial class TeleportWindow : DefaultWindow
{
private PlayerInfo? _selectedPlayer;
protected override void EnteredTree()
{
SubmitButton.OnPressed += SubmitButtonOnOnPressed;
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
}
private void OnListOnOnSelectionChanged(PlayerInfo? obj)
{
_selectedPlayer = obj;
SubmitButton.Disabled = _selectedPlayer == null;
}
private void SubmitButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
{
if (_selectedPlayer == null)
return;
// Execute command
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
$"tpto \"{_selectedPlayer.Username}\"");
}
}
}

View File

@@ -14,7 +14,7 @@
VerticalExpand="True"
Margin="0 0 0 0"
VerticalAlignment="Center">
<Label Text="{Loc 'anomaly-generator-fuel-display'}" StyleClasses="StatusFieldTitle" />
<Label Text="{Loc 'anomaly-generator-fuel-display'}" StyleClasses="highlight" />
<ProgressBar Name="FuelBar"
HorizontalExpand="True"
MaxValue="1"
@@ -27,8 +27,8 @@
Text="0 %" />
</ProgressBar>
</BoxContainer>
<RichTextLabel Name="CooldownLabel" StyleClasses="StatusFieldTitle" />
<RichTextLabel Name="ReadyLabel" StyleClasses="StatusFieldTitle" />
<RichTextLabel Name="CooldownLabel" StyleClasses="highlight" />
<RichTextLabel Name="ReadyLabel" StyleClasses="highlight" />
</BoxContainer>
<!--Sprite View-->
<PanelContainer Margin="12 0 0 0"

View File

@@ -338,7 +338,7 @@ namespace Content.Client.Arcade
menuInnerPanel.AddChild(menuContainer);
#endregion
Contents.AddChild(_mainPanel);
ContentsContainer.AddChild(_mainPanel);
CanKeyboardFocus = true;
}

View File

@@ -86,7 +86,7 @@ namespace Content.Client.Arcade
newGame.OnPressed += _ => OnPlayerAction?.Invoke(SharedSpaceVillainArcadeComponent.PlayerAction.NewGame);
grid.AddChild(newGame);
Contents.AddChild(grid);
ContentsContainer.AddChild(grid);
}
private void UpdateMetadata(SharedSpaceVillainArcadeComponent.SpaceVillainArcadeMetaDataUpdateMessage message)

View File

@@ -1,3 +1,4 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Content.Tests")]
[assembly: InternalsVisibleTo("Content.IntegrationTests")]

View File

@@ -1,6 +1,6 @@
using Content.Client.Atmos.Monitor.UI.Widgets;
using Content.Client.Message;
using Content.Client.Stylesheets;
using Content.Client.Stylesheets.Palette;
using Content.Client.UserInterface.Controls;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Monitor;
@@ -17,7 +17,7 @@ namespace Content.Client.Atmos.Monitor.UI;
public sealed partial class AirAlarmWindow : FancyWindow
{
public event Action<string, IAtmosDeviceData>? AtmosDeviceDataChanged;
public event Action<IAtmosDeviceData>? AtmosDeviceDataCopied;
public event Action<IAtmosDeviceData>? AtmosDeviceDataCopied;
public event Action<string, AtmosMonitorThresholdType, AtmosAlarmThreshold, Gas?>? AtmosAlarmThresholdChanged;
public event Action<AirAlarmMode>? AirAlarmModeChanged;
public event Action<bool>? AutoModeChanged;
@@ -131,7 +131,7 @@ public sealed partial class AirAlarmWindow : FancyWindow
case GasVentPumpData pump:
if (!_pumps.TryGetValue(addr, out var pumpControl))
{
var control= new PumpControl(pump, addr);
var control = new PumpControl(pump, addr);
control.PumpDataChanged += AtmosDeviceDataChanged;
control.PumpDataCopied += AtmosDeviceDataCopied;
_pumps.Add(addr, control);
@@ -186,11 +186,9 @@ public sealed partial class AirAlarmWindow : FancyWindow
{
return curAlarm switch
{
AtmosAlarmType.Danger => StyleNano.DangerousRedFore,
AtmosAlarmType.Warning => StyleNano.ConcerningOrangeFore,
_ => StyleNano.GoodGreenFore,
AtmosAlarmType.Danger => Palettes.Status.Critical,
AtmosAlarmType.Warning => Palettes.Status.Warning,
_ => Palettes.Status.Good,
};
}
}

View File

@@ -1,3 +1,4 @@
using Content.Client.Stylesheets;
using Content.Shared.Atmos.Monitor;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
@@ -42,11 +43,11 @@ public sealed partial class ThresholdBoundControl : BoxContainer
if (enabled)
{
CBoundLabel.RemoveStyleClass("Disabled");
CBoundLabel.RemoveStyleClass(StyleClass.LabelWeak);
}
else
{
CBoundLabel.SetOnlyStyleClass("Disabled");
CBoundLabel.SetOnlyStyleClass(StyleClass.LabelWeak);
}
}

View File

@@ -4,7 +4,7 @@
MinSize="480 400" Title="Canister">
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<Label Text="{Loc comp-gas-canister-ui-canister-status}" FontColorOverride="{x:Static s:StyleNano.NanoGold}" StyleClasses="LabelBig"/>
<Label Text="{Loc comp-gas-canister-ui-canister-status}" StyleClasses="LabelHeading"/>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc comp-gas-canister-ui-canister-pressure}"/>
<Label Name="CanisterPressureLabel" Align="Center" HorizontalExpand="True"/>
@@ -16,7 +16,7 @@
</BoxContainer>
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<Label Text="{Loc comp-gas-canister-ui-holding-tank-status}" FontColorOverride="{x:Static s:StyleNano.NanoGold}" StyleClasses="LabelBig"/>
<Label Text="{Loc comp-gas-canister-ui-holding-tank-status}" StyleClasses="LabelHeading"/>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc comp-gas-canister-ui-holding-tank-label}"/>
<Label Name="TankLabelLabel" Text="{Loc comp-gas-canister-ui-holding-tank-label-empty}" Align="Center" HorizontalExpand="True"/>
@@ -29,7 +29,7 @@
</BoxContainer>
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<Label Text="{Loc comp-gas-canister-ui-release-valve-status}" FontColorOverride="{x:Static s:StyleNano.NanoGold}" StyleClasses="LabelBig"/>
<Label Text="{Loc comp-gas-canister-ui-release-valve-status}" StyleClasses="LabelHeading"/>
<BoxContainer Orientation="Horizontal">
<BoxContainer Orientation="Vertical">
<Label Text="{Loc comp-gas-canister-ui-release-pressure}"/>

View File

@@ -7,10 +7,7 @@
Orientation="Vertical"
HorizontalExpand="True"
Margin="0 0 0 5">
<PanelContainer>
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="{xNamespace:Static style:StyleNano.ButtonColorDisabled}" />
</PanelContainer.PanelOverride>
<PanelContainer StyleClasses="PanelDark">
<Collapsible Name="Collapsible">
<CollapsibleHeading Name="Heading" MinHeight="35"/>
<CollapsibleBody Name="Body">

View File

@@ -14,10 +14,8 @@
<PanelContainer
VerticalExpand="True"
HorizontalExpand="True"
Margin="15">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="{xNamespace:Static style:StyleNano.PanelDark}" />
</PanelContainer.PanelOverride>
Margin="15"
StyleClasses="PanelDark">
<ScrollContainer VerticalExpand="True" HorizontalExpand="True">
<Control>
<Label Text="{Loc 'cryostorage-ui-label-no-bodies'}" Name="EmptyLabel" HorizontalAlignment="Center" VerticalAlignment="Center"/>

View File

@@ -1,7 +1,7 @@
<DefaultWindow
xmlns="https://spacestation14.io"
Title="{Loc 'ui-bql-results-title'}">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Vertical" MinSize="500 700">
<Label Name="StatusLabel" />
<ScrollContainer VerticalExpand="True">
<BoxContainer Orientation="Vertical" Name="ItemList" VerticalExpand="True" />

View File

@@ -21,8 +21,6 @@ internal sealed partial class ToolshedVisualizeWindow : DefaultWindow
RobustXamlLoader.Load(this);
}
protected override Vector2 ContentsMinimumSize => new(500, 700);
public void Update((string name, NetEntity entity)[] entities)
{
StatusLabel.Text = _loc.GetString("ui-bql-results-status", ("count", entities.Length));

View File

@@ -3,7 +3,7 @@
Margin="10 10 10 0"
HorizontalExpand="True"
Visible="True">
<PanelContainer StyleClasses="AngleRect" HorizontalExpand="True">
<PanelContainer StyleClasses="BackgroundPanel" HorizontalExpand="True">
<BoxContainer Orientation="Vertical"
HorizontalExpand="True">
<BoxContainer Orientation="Horizontal">

View File

@@ -1,4 +1,4 @@
using Content.Client.Stylesheets;
using Content.Client.Stylesheets.Palette;
using Content.Client.UserInterface.Controls;
using Content.Shared.Changeling.Components;
using Content.Shared.Changeling.Systems;
@@ -11,8 +11,8 @@ namespace Content.Client.Changeling.UI;
public sealed partial class ChangelingTransformBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey)
{
private SimpleRadialMenu? _menu;
private static readonly Color SelectedOptionBackground = StyleNano.ButtonColorGoodDefault.WithAlpha(128);
private static readonly Color SelectedOptionHoverBackground = StyleNano.ButtonColorGoodHovered.WithAlpha(128);
private static readonly Color SelectedOptionBackground = Palettes.Green.Element.WithAlpha(128);
private static readonly Color SelectedOptionHoverBackground = Palettes.Green.HoveredElement.WithAlpha(128);
protected override void Open()
{

View File

@@ -36,12 +36,12 @@ namespace Content.Client.Changelog
if (_changelogManager.NewChangelogEntries)
{
Text = Loc.GetString("changelog-button-new-entries");
StyleClasses.Add(StyleBase.ButtonCaution);
StyleClasses.Add(StyleClass.Negative);
}
else
{
Text = Loc.GetString("changelog-button");
StyleClasses.Remove(StyleBase.ButtonCaution);
StyleClasses.Remove(StyleClass.Negative);
}
}
}

View File

@@ -58,7 +58,7 @@ public sealed partial class ChangelogTab : Control
ChangelogBody.AddChild(new Label
{
Text = dayNice,
StyleClasses = { StyleBase.StyleClassLabelHeading },
StyleClasses = { StyleClass.LabelHeading },
Margin = new Thickness(4, 6, 0, 0)
});
@@ -117,7 +117,7 @@ public sealed partial class ChangelogTab : Control
};
readDivider.AddChild(hBox);
readDivider.AddChild(new PanelContainer { StyleClasses = { StyleBase.ClassLowDivider } });
readDivider.AddChild(new PanelContainer { StyleClasses = { StyleClass.LowDivider } });
ChangelogBody.AddChild(readDivider);
if (first)

View File

@@ -2,8 +2,9 @@
xmlns:ui="clr-namespace:Content.Client.Changelog"
Title="{Loc 'changelog-window-title'}"
MinSize="500 400"
SetSize="500 400">
<PanelContainer StyleClasses="AngleRect" />
SetSize="500 400"
Stylesheet="Interface">
<PanelContainer StyleClasses="BackgroundPanel" />
<BoxContainer Orientation="Vertical">
<TabContainer Name="Tabs" Access="Public" HorizontalExpand="True" VerticalExpand="True" />
<PanelContainer StyleClasses="LowDivider" />

View File

@@ -21,8 +21,7 @@ namespace Content.Client.Changelog
public ChangelogWindow()
{
RobustXamlLoader.Load(this);
WindowTitle.AddStyleClass(StyleBase.StyleClassLabelHeading);
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
WindowTitle.AddStyleClass(StyleClass.LabelHeading);
}
protected override void Opened()

View File

@@ -33,8 +33,8 @@
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-buffer-text'}" />
<Control HorizontalExpand="True" />
<Button MinSize="80 0" Margin="0 0 10 0" Name="BufferSortButton" Access="Public" Text="{Loc 'chem-master-window-sort-type-none'}" />
<Button MinSize="80 0" Name="BufferTransferButton" Access="Public" Text="{Loc 'chem-master-window-transfer-button'}" ToggleMode="True" StyleClasses="OpenRight" />
<Button MinSize="80 0" Name="BufferSortButton" Access="Public" Text="{Loc 'chem-master-window-sort-type-none'}" StyleClasses="OpenBoth" />
<Button MinSize="80 0" Name="BufferDiscardButton" Access="Public" Text="{Loc 'chem-master-window-discard-button'}" ToggleMode="True" StyleClasses="OpenLeft" />
</BoxContainer>
@@ -82,7 +82,7 @@
<Label Text="{Loc 'chem-master-window-packaging-text'}" />
<Control HorizontalExpand="True"/>
<Label Text="{Loc 'chem-master-window-buffer-label'}" />
<Label Name="BufferCurrentVolume" StyleClasses="LabelSecondaryColor" />
<Label Name="BufferCurrentVolume" StyleClasses="LabelWeak" />
</BoxContainer>
<!-- Wrap the packaging info-->
@@ -112,9 +112,9 @@
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-pills-label'}" />
<Control HorizontalExpand="True" MinSize="50 0" />
<Label Text="{Loc 'chem-master-window-pills-number-label'}" Margin="5 0 0 0" StyleClasses="LabelSecondaryColor" />
<Label Text="{Loc 'chem-master-window-pills-number-label'}" Margin="5 0 0 0" StyleClasses="LabelWeak" />
<SpinBox MinSize="100 0" Name="PillNumber" Access="Public" Value="0" />
<Label Text="{Loc 'chem-master-window-dose-label'}" Margin="5 0 0 0" StyleClasses="LabelSecondaryColor" />
<Label Text="{Loc 'chem-master-window-dose-label'}" Margin="5 0 0 0" StyleClasses="LabelWeak" />
<SpinBox MinSize="100 0" Name="PillDosage" Access="Public" Value="1" />
<Button MinSize="80 0" Name="CreatePillButton" Access="Public" Text="{Loc 'chem-master-window-create-button'}" />
</BoxContainer>
@@ -122,7 +122,7 @@
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-bottles-label'}" />
<Control HorizontalExpand="True" MinSize="50 0" />
<Label Text="{Loc 'chem-master-window-dose-label'}" Margin="5 0 0 0" StyleClasses="LabelSecondaryColor" />
<Label Text="{Loc 'chem-master-window-dose-label'}" Margin="5 0 0 0" StyleClasses="LabelWeak" />
<SpinBox MinSize="100 0" Name="BottleDosage" Access="Public" Value="0" />
<Button MinSize="80 0" Name="CreateBottleButton" Access="Public" Text="{Loc 'chem-master-window-create-button'}" />
</BoxContainer>

View File

@@ -53,14 +53,14 @@ namespace Content.Client.Chemistry.UI
{
// For every button decide which stylebase to have
// Every row has 10 buttons
String styleBase = StyleBase.ButtonOpenBoth;
String styleBase = StyleClass.ButtonOpenBoth;
uint modulo = i % 10;
if (i > 0 && modulo == 0)
styleBase = StyleBase.ButtonOpenRight;
styleBase = StyleClass.ButtonOpenRight;
else if (i > 0 && modulo == 9)
styleBase = StyleBase.ButtonOpenLeft;
styleBase = StyleClass.ButtonOpenLeft;
else if (i == 0)
styleBase = StyleBase.ButtonOpenRight;
styleBase = StyleClass.ButtonOpenRight;
// Generate buttons
PillTypeButtons[i] = new Button
@@ -113,16 +113,16 @@ namespace Content.Client.Chemistry.UI
var buttonConfigs = new (string text, ChemMasterReagentAmount amount, string styleClass)[]
{
("1", ChemMasterReagentAmount.U1, StyleBase.ButtonOpenBoth),
("5", ChemMasterReagentAmount.U5, StyleBase.ButtonOpenBoth),
("10", ChemMasterReagentAmount.U10, StyleBase.ButtonOpenBoth),
("15", ChemMasterReagentAmount.U15, StyleBase.ButtonOpenBoth),
("20", ChemMasterReagentAmount.U20, StyleBase.ButtonOpenBoth),
("25", ChemMasterReagentAmount.U25, StyleBase.ButtonOpenBoth),
("30", ChemMasterReagentAmount.U30, StyleBase.ButtonOpenBoth),
("50", ChemMasterReagentAmount.U50, StyleBase.ButtonOpenBoth),
("100", ChemMasterReagentAmount.U100, StyleBase.ButtonOpenBoth),
(Loc.GetString("chem-master-window-buffer-all-amount"), ChemMasterReagentAmount.All, StyleBase.ButtonOpenLeft),
("1", ChemMasterReagentAmount.U1, StyleClass.ButtonOpenBoth),
("5", ChemMasterReagentAmount.U5, StyleClass.ButtonOpenBoth),
("10", ChemMasterReagentAmount.U10, StyleClass.ButtonOpenBoth),
("15", ChemMasterReagentAmount.U15, StyleClass.ButtonOpenBoth),
("20", ChemMasterReagentAmount.U20, StyleClass.ButtonOpenBoth),
("25", ChemMasterReagentAmount.U25, StyleClass.ButtonOpenBoth),
("30", ChemMasterReagentAmount.U30, StyleClass.ButtonOpenBoth),
("50", ChemMasterReagentAmount.U50, StyleClass.ButtonOpenBoth),
("100", ChemMasterReagentAmount.U100, StyleClass.ButtonOpenBoth),
(Loc.GetString("chem-master-window-buffer-all-amount"), ChemMasterReagentAmount.All, StyleClass.ButtonOpenLeft),
};
var buttons = new List<ReagentButton>();
@@ -252,7 +252,7 @@ namespace Content.Client.Chemistry.UI
var bufferVol = new Label
{
Text = $"{state.BufferCurrentVolume}u",
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
StyleClasses = { StyleClass.LabelWeak }
};
bufferHBox.AddChild(bufferVol);
@@ -321,7 +321,7 @@ namespace Content.Client.Chemistry.UI
new Label
{
Text = $"{info.CurrentVolume}/{info.MaxVolume}",
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
StyleClasses = { StyleClass.LabelWeak }
}
}
});
@@ -376,7 +376,7 @@ namespace Content.Client.Chemistry.UI
new Label
{
Text = $"{quantity}u",
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
StyleClasses = { StyleClass.LabelWeak }
},
// Padding

View File

@@ -23,7 +23,7 @@ public sealed class HyposprayStatusControl : Control
{
_parent = parent;
_solutionContainers = solutionContainers;
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
_label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
AddChild(_label);
}

View File

@@ -24,7 +24,7 @@ public sealed class InjectorStatusControl : Control
{
_parent = parent;
_solutionContainers = solutionContainers;
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
_label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
AddChild(_label);
}

View File

@@ -107,7 +107,7 @@ namespace Content.Client.Chemistry.UI
var quantityLabel = new Label
{
Text = Loc.GetString("reagent-dispenser-window-quantity-label-text", ("quantity", quantity)),
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor },
StyleClasses = { StyleClass.LabelWeak },
};
ContainerInfo.Children.Add(new BoxContainer

View File

@@ -29,7 +29,7 @@ public sealed class SolutionStatusControl : PollingItemStatusControl<SolutionSta
_parent = parent;
_entityManager = entityManager;
_solutionContainers = solutionContainers;
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
_label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
AddChild(_label);
}

View File

@@ -17,7 +17,7 @@ namespace Content.Client.Cloning.UI
Title = Loc.GetString("accept-cloning-window-title");
Contents.AddChild(new BoxContainer
ContentsContainer.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =

View File

@@ -67,7 +67,7 @@ public sealed partial class ChameleonMenu : DefaultWindow
MinSize = new Vector2(48, 48),
HorizontalExpand = true,
Group = group,
StyleClasses = {StyleBase.ButtonSquare},
StyleClasses = {StyleClass.ButtonSquare},
ToggleMode = true,
Pressed = _selectedId == id,
ToolTip = proto.Name

View File

@@ -68,7 +68,7 @@ namespace Content.Client.Configurable.UI
outerColumn.AddChild(Column);
baseContainer.AddChild(outerColumn);
baseContainer.AddChild(confirmButton);
Contents.AddChild(baseContainer);
ContentsContainer.AddChild(baseContainer);
}
private void OnConfirm(ButtonEventArgs args)

View File

@@ -13,7 +13,8 @@
Name="IconLabel"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
StyleClasses="contextMenuIconLabel"
StyleClasses="LabelSubText"
Align="Right"
Visible="false"/>
</SpriteView>
<RichTextLabel

View File

@@ -16,7 +16,6 @@ namespace Content.Client.ContextMenu.UI
{
public const string StyleClassContextMenuButton = "contextMenuButton";
public const string StyleClassContextMenuExpansionTexture = "contextMenuExpansionTexture";
public const string StyleClassEntityMenuIconLabel = "contextMenuIconLabel";
public const float ElementMargin = 2;
public const float ElementHeight = 32;

View File

@@ -1,14 +0,0 @@
using Content.Shared.Crayon;
using Robust.Shared.GameObjects;
using Robust.Shared.ViewVariables;
namespace Content.Client.Crayon
{
[RegisterComponent]
public sealed partial class CrayonComponent : SharedCrayonComponent
{
[ViewVariables(VVAccess.ReadWrite)] public bool UIUpdateNeeded;
[ViewVariables] public int Charges { get; set; }
[ViewVariables] public int Capacity { get; set; }
}
}

View File

@@ -1,67 +1,52 @@
using Content.Client.Items;
using Content.Client.Message;
using Content.Client.Stylesheets;
using Content.Shared.Charges.Components;
using Content.Shared.Charges.Systems;
using Content.Shared.Crayon;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Localization;
using Robust.Shared.Timing;
namespace Content.Client.Crayon;
public sealed class CrayonSystem : SharedCrayonSystem
{
// Didn't do in shared because I don't think most of the server stuff can be predicted.
[Dependency] private readonly SharedChargesSystem _charges = default!;
[Dependency] private readonly EntityManager _entityManager = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CrayonComponent, ComponentHandleState>(OnCrayonHandleState);
Subs.ItemStatus<CrayonComponent>(ent => new StatusControl(ent));
}
private static void OnCrayonHandleState(EntityUid uid, CrayonComponent component, ref ComponentHandleState args)
{
if (args.Current is not CrayonComponentState state) return;
component.Color = state.Color;
component.SelectedState = state.State;
component.Charges = state.Charges;
component.Capacity = state.Capacity;
component.UIUpdateNeeded = true;
Subs.ItemStatus<CrayonComponent>(ent => new StatusControl(ent, _charges, _entityManager));
}
private sealed class StatusControl : Control
{
private readonly CrayonComponent _parent;
private readonly Entity<CrayonComponent> _crayon;
private readonly SharedChargesSystem _charges;
private readonly RichTextLabel _label;
private readonly int _capacity;
public StatusControl(CrayonComponent parent)
public StatusControl(Entity<CrayonComponent> crayon, SharedChargesSystem charges, EntityManager entityManage)
{
_parent = parent;
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
_crayon = crayon;
_charges = charges;
_capacity = entityManage.GetComponent<LimitedChargesComponent>(_crayon.Owner).MaxCharges;
_label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
AddChild(_label);
parent.UIUpdateNeeded = true;
}
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
if (!_parent.UIUpdateNeeded)
{
return;
}
_parent.UIUpdateNeeded = false;
_label.SetMarkup(Robust.Shared.Localization.Loc.GetString("crayon-drawing-label",
("color",_parent.Color),
("state",_parent.SelectedState),
("charges", _parent.Charges),
("capacity",_parent.Capacity)));
("color",_crayon.Comp.Color),
("state",_crayon.Comp.SelectedState),
("charges", _charges.GetCurrentCharges(_crayon.Owner)),
("capacity", _capacity)));
}
}
}

View File

@@ -137,7 +137,8 @@ namespace Content.Client.Crayon.UI
private void ButtonOnPressed(ButtonEventArgs obj)
{
if (obj.Button.Name == null) return;
if (obj.Button.Name == null)
return;
_selected = obj.Button.Name;
_autoSelected = null;

View File

@@ -100,11 +100,11 @@ public sealed partial class CreditsWindow : DefaultWindow
var container = new BoxContainer { Orientation = LayoutOrientation.Horizontal };
var previousPageButton = new Button { Text = "Previous Page" };
var previousPageButton = new Button { Text = Loc.GetString("credits-window-previous-page-button") };
previousPageButton.OnPressed +=
_ => PopulateAttributions(attributionsContainer, count - AttributionsSourcesPerPage);
var nextPageButton = new Button { Text = "Next Page" };
var nextPageButton = new Button { Text = Loc.GetString("credits-window-next-page-button") };
nextPageButton.OnPressed +=
_ => PopulateAttributions(attributionsContainer, count + AttributionsSourcesPerPage);
@@ -258,7 +258,7 @@ public sealed partial class CreditsWindow : DefaultWindow
foreach (var entry in CreditsManager.GetLicenses(_resourceManager).OrderBy(p => p.Name))
{
licensesContainer.AddChild(new Label
{ StyleClasses = { StyleBase.StyleClassLabelHeading }, Text = entry.Name });
{ StyleClasses = { StyleClass.LabelHeading }, Text = entry.Name });
// We split these line by line because otherwise
// the LGPL causes Clyde to go out of bounds in the rendering code.
@@ -299,7 +299,7 @@ public sealed partial class CreditsWindow : DefaultWindow
first = false;
patronsContainer.AddChild(new Label
{ StyleClasses = { StyleBase.StyleClassLabelHeading }, Text = $"{tier.Key}" });
{ StyleClasses = { StyleClass.LabelHeading }, Text = $"{tier.Key}" });
var msg = string.Join(", ", tier.OrderBy(p => p.Name).Select(p => p.Name));
@@ -347,7 +347,7 @@ public sealed partial class CreditsWindow : DefaultWindow
first = false;
ss14ContributorsContainer.AddChild(new Label
{ StyleClasses = { StyleBase.StyleClassLabelHeading }, Text = title });
{ StyleClasses = { StyleClass.LabelHeading }, Text = title });
var label = new RichTextLabel();
var text = _resourceManager.ContentFileReadAllText($"/Credits/{path}");

View File

@@ -58,7 +58,7 @@
StyleClasses="LabelBig" />
<BoxContainer Orientation="Horizontal"
Margin="0 0 0 5">
<Label Text="{Loc 'crew-monitoring-user-interface-job'}"
<Label Text="{Loc 'crew-monitoring-ui-job-label'}"
FontColorOverride="DarkGray" />
<TextureRect Name="PersonJobIcon"
TextureScale="2 2"

View File

@@ -276,7 +276,7 @@ public sealed partial class CriminalRecordsConsoleWindow : FancyWindow
private void SetStatus(SecurityStatus status)
{
if (status == SecurityStatus.Wanted || status == SecurityStatus.Suspected)
if (status == SecurityStatus.Wanted || status == SecurityStatus.Suspected || status == SecurityStatus.Hostile)
{
GetReason(status);
return;
@@ -322,6 +322,8 @@ public sealed partial class CriminalRecordsConsoleWindow : FancyWindow
SecurityStatus.Detained => "hud_incarcerated",
SecurityStatus.Discharged => "hud_discharged",
SecurityStatus.Suspected => "hud_suspected",
SecurityStatus.Hostile => "hud_hostile",
SecurityStatus.Eliminated => "hud_eliminated",
_ => "SecurityIconNone"
};
}

View File

@@ -0,0 +1,5 @@
using Content.Shared.Damage.Systems;
namespace Content.Client.Damage.Systems;
public sealed class DamageOtherOnHitSystem : SharedDamageOtherOnHitSystem;

View File

@@ -157,15 +157,12 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
{
var panelContainer = new PanelContainer
{
PanelOverride = new StyleBoxFlat
{
BackgroundColor = StyleNano.ButtonColorDefault
},
Children =
{
button
}
};
panelContainer.SetOnlyStyleClass(StyleClass.PanelLight);
Grid.AddChild(panelContainer);
}
else

View File

@@ -68,7 +68,7 @@ public sealed class DoorSystem : SharedDoorSystem
{
new AnimationTrackSpriteFlick
{
LayerKey = DoorVisualLayers.BaseUnlit,
LayerKey = DoorVisualLayers.BaseEmagging,
KeyFrames =
{
new AnimationTrackSpriteFlick.KeyFrame(comp.EmaggingSpriteState, 0f),
@@ -92,6 +92,10 @@ public sealed class DoorSystem : SharedDoorSystem
if (_animationSystem.HasRunningAnimation(entity, DoorComponent.AnimationKey))
_animationSystem.Stop(entity.Owner, DoorComponent.AnimationKey);
// We are checking beforehand since some doors may not have an emagging visual layer, and we don't want LayerSetVisible to throw an error.
if (_sprite.TryGetLayer(entity.Owner, DoorVisualLayers.BaseEmagging, out var _, false))
_sprite.LayerSetVisible(entity.Owner, DoorVisualLayers.BaseEmagging, state == DoorState.Emagging);
UpdateAppearanceForDoorState(entity, args.Sprite, state);
}
@@ -134,7 +138,9 @@ public sealed class DoorSystem : SharedDoorSystem
return;
case DoorState.Emagging:
_animationSystem.Play(entity, (Animation)entity.Comp.EmaggingAnimation, DoorComponent.AnimationKey);
// We are checking beforehand since some doors may not have an emagging visual layer.
if (_sprite.TryGetLayer(entity.Owner, DoorVisualLayers.BaseEmagging, out var _, false))
_animationSystem.Play(entity, (Animation)entity.Comp.EmaggingAnimation, DoorComponent.AnimationKey);
return;
}

View File

@@ -27,6 +27,15 @@ public sealed class DrunkOverlay : Overlay
private const float VisualThreshold = 10.0f;
private const float PowerDivisor = 250.0f;
/// <remarks>
/// This is a magic number based on my person preference of how quickly the bloodloss effect should kick in.
/// It is entirely arbitrary, and you should change it if it sucks.
/// Honestly should be refactored to be based on amount of blood lost but that's out of scope for what I'm doing atm.
/// Also caps all booze visual effects to a max intensity of 100 seconds or 100 booze power.
/// </remarks>
private const float MaxBoozePower = 100f;
private const float BoozePowerScale = 8f;
private float _visualScale = 0;
@@ -50,15 +59,9 @@ public sealed class DrunkOverlay : Overlay
var time = status.Item2;
var power = SharedDrunkSystem.MagicNumber;
var power = time == null ? MaxBoozePower : (float) Math.Min((time - _timing.CurTime).Value.TotalSeconds, MaxBoozePower);
if (time != null)
{
var curTime = _timing.CurTime;
power = (float) (time - curTime).Value.TotalSeconds;
}
CurrentBoozePower += 8f * (power * 0.5f - CurrentBoozePower) * args.DeltaSeconds / (power+1);
CurrentBoozePower += BoozePowerScale * (power - CurrentBoozePower) * args.DeltaSeconds / (power+1);
}
protected override bool BeforeDraw(in OverlayDrawArgs args)

View File

@@ -154,12 +154,6 @@ namespace Content.Client.Entry
_configManager.SetCVar("interface.resolutionAutoScaleMinimum", 0.5f);
}
public override void Shutdown()
{
base.Shutdown();
_titleWindowManager.Shutdown();
}
public override void PostInit()
{
base.PostInit();

View File

@@ -56,7 +56,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Scale="0.9 0.9"
StyleClasses="Refresh" />
StyleClasses="RefreshButton" />
</Button>
</BoxContainer>
</BoxContainer>

View File

@@ -21,7 +21,7 @@ public sealed class HandheldGpsStatusControl : Control
_parent = parent;
_entMan = IoCManager.Resolve<IEntityManager>();
_transform = _entMan.System<TransformSystem>();
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
_label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
AddChild(_label);
UpdateGpsDetails();
}

View File

@@ -15,48 +15,29 @@ public sealed class TitleWindowManager
public void Initialize()
{
_cfg.OnValueChanged(CVars.GameHostName, OnHostnameChange, true);
_cfg.OnValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange, true);
_cfg.OnValueChanged(CVars.GameHostName, _ => OnHostnameChange(), true);
_cfg.OnValueChanged(CCVars.GameHostnameInTitlebar, _ => OnHostnameChange(), true);
_client.RunLevelChanged += OnRunLevelChangedChange;
_client.RunLevelChanged += (_, _) => OnHostnameChange();
}
public void Shutdown()
{
_cfg.UnsubValueChanged(CVars.GameHostName, OnHostnameChange);
_cfg.UnsubValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange);
}
private void OnHostnameChange(string hostname)
private void OnHostnameChange()
{
var defaultWindowTitle = _gameController.GameTitle();
// Since the game assumes the server name is MyServer and that GameHostnameInTitlebar CCVar is true by default
// Lets just... not show anything. This also is used to revert back to just the game title on disconnect.
if (_client.RunLevel == ClientRunLevel.Initialize)
// When the client starts connecting, it will be using either the default hostname, or whatever hostname
// is set in its config file (aka the last server they connected to) until it receives the latest cvars.
// If they are not connected then we will not show anything other than the usual window title.
if (_client.RunLevel != ClientRunLevel.InGame)
{
_clyde.SetWindowTitle(defaultWindowTitle);
return;
}
if (_cfg.GetCVar(CCVars.GameHostnameInTitlebar))
// If you really dislike the dash I guess change it here
_clyde.SetWindowTitle(hostname + " - " + defaultWindowTitle);
else
_clyde.SetWindowTitle(defaultWindowTitle);
}
// Clients by default assume game.hostname_in_titlebar is true
// but we need to clear it as soon as we join and actually receive the servers preference on this.
// This will ensure we rerun OnHostnameChange and set the correct title bar name.
private void OnHostnameTitleChange(bool colonthree)
{
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName));
}
// This is just used we can rerun the hostname change function when we disconnect to revert back to just the games title.
private void OnRunLevelChangedChange(object? sender, RunLevelChangedEventArgs runLevelChangedEventArgs)
{
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName));
_clyde.SetWindowTitle(
_cfg.GetCVar(CCVars.GameHostnameInTitlebar)
? _cfg.GetCVar(CVars.GameHostName) + " - " + defaultWindowTitle
: defaultWindowTitle);
}
// You thought I would remove the :3 from this code? You were wrong.
}

View File

@@ -159,7 +159,7 @@ public sealed partial class GatewayWindow : FancyWindow,
if (Pressable())
{
openButton.AddStyleClass(StyleBase.ButtonCaution);
openButton.AddStyleClass(StyleClass.Negative);
}
var buttonContainer = new BoxContainer()

View File

@@ -15,7 +15,7 @@ public sealed class ReturnToBodyMenu : DefaultWindow
{
Title = Loc.GetString("ghost-return-to-body-title");
Contents.AddChild(new BoxContainer
ContentsContainer.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =

View File

@@ -0,0 +1,18 @@
<Control xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer HorizontalExpand="True" Margin="5 5 5 5">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BorderThickness="1" BorderColor="#777777"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" Name="LawsetContainer">
<PanelContainer Name="NameBackground">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#16168C"/>
</PanelContainer.PanelOverride>
<RichTextLabel Name="LawsetName" HorizontalAlignment="Center"/>
</PanelContainer>
<!--RichTextLabels containing the individual laws are inserted here-->
</BoxContainer>
</PanelContainer>
</Control>

View File

@@ -0,0 +1,96 @@
using System.Diagnostics.CodeAnalysis;
using Content.Client.Guidebook.Richtext;
using Content.Client.Message;
using Content.Client.UserInterface.ControlExtensions;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Content.Shared.Silicons.Laws;
using Robust.Shared.Utility;
namespace Content.Client.Guidebook.Controls;
/// <summary>
/// Control for embedding an AI Lawset in a guidebook
/// </summary>
[UsedImplicitly, GenerateTypedNameReferences]
public sealed partial class GuideLawsetEmbed : Control, IDocumentTag, ISearchableControl, IPrototypeRepresentationControl
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
private ISawmill _logging = default!;
public IPrototype? RepresentedPrototype { get; private set; }
public GuideLawsetEmbed()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
MouseFilter = MouseFilterMode.Stop;
}
public GuideLawsetEmbed(SiliconLawsetPrototype lawset) : this()
{
GenerateControl(lawset);
}
private void GenerateControl(SiliconLawsetPrototype lawset)
{
RepresentedPrototype = lawset;
var lawsetNameString = lawset.Name == null ? lawset.ID : Loc.GetString(lawset.Name);
LawsetName.SetMarkup($"[bold]{FormattedMessage.EscapeText(lawsetNameString)}[/bold]");
var i = 1;
foreach (var lawID in lawset.Laws)
{
var lawPrototype = _prototype.Index<SiliconLawPrototype>(lawID);
var locLawString = Loc.GetString(lawPrototype.LawString);
RichTextLabel lawN = new()
{
Margin = new(0, 5, 0, 1)
};
var locLawStatement = Loc.GetString("laws-number-wrapper", ("lawnumber", i), ("lawstring", locLawString));
lawN.SetMarkup(locLawStatement);
LawsetContainer.AddChild(lawN);
i++;
}
}
public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control)
{
control = null;
if (!args.TryGetValue("Lawset", out var id))
{
_logging.Error("Lawset embed tag is missing lawset prototype argument");
return false;
}
if (!_prototype.TryIndex<SiliconLawsetPrototype>(id, out var lawset))
{
_logging.Error($"Specified SiliconLawsetPrototype \"{id}\" is not a valid Lawset prototype");
return false;
}
GenerateControl(lawset);
control = this;
return true;
}
public bool CheckMatchesSearch(string query)
{
return this.ChildrenContainText(query);
}
public void SetHiddenState(bool state, string query)
{
Visible = CheckMatchesSearch(query) ? state : !state;
}
}

View File

@@ -0,0 +1,5 @@
<Control xmlns="https://spacestation14.io">
<BoxContainer Orientation="Vertical"
Name="GroupContainer">
</BoxContainer>
</Control>

View File

@@ -0,0 +1,40 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Client.Guidebook.Richtext;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Content.Shared.Silicons.Laws;
namespace Content.Client.Guidebook.Controls;
/// <summary>
/// Control for iterating and embedding every SiliconLawsetPrototype into the guidebook.
/// </summary>
[UsedImplicitly, GenerateTypedNameReferences]
public sealed partial class GuideLawsetListEmbed : Control, IDocumentTag
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
public GuideLawsetListEmbed()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
MouseFilter = MouseFilterMode.Stop;
}
public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control)
{
foreach (var lawset in _prototype.EnumeratePrototypes<SiliconLawsetPrototype>().OrderBy(x => x.ID))
{
GuideLawsetEmbed embed = new(lawset);
GroupContainer.AddChild(embed);
}
control = this;
return true;
}
}

View File

@@ -4,11 +4,11 @@
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<humanoid:MarkingPicker Name="MarkingPickerWidget" />
<BoxContainer>
<CheckBox Name="MarkingForced" Text="Force" Pressed="True" />
<CheckBox Name="MarkingIgnoreSpecies" Text="Ignore Species" Pressed="True" />
<CheckBox Name="MarkingForced" Text="{Loc humanoid-marking-modifier-force}" Pressed="True" />
<CheckBox Name="MarkingIgnoreSpecies" Text="{Loc humanoid-marking-modifier-ignore-species}" Pressed="True" />
</BoxContainer>
<Collapsible HorizontalExpand="True">
<CollapsibleHeading Title="Base layers" />
<CollapsibleHeading Title="{Loc humanoid-marking-modifier-base-layers}" />
<CollapsibleBody HorizontalExpand="True">
<BoxContainer Name="BaseLayersContainer" Orientation="Vertical" HorizontalExpand="True" />
</CollapsibleBody>

View File

@@ -118,7 +118,7 @@ public sealed partial class HumanoidMarkingModifierWindow : DefaultWindow
});
_enable = new CheckBox
{
Text = "Enable",
Text = Loc.GetString("humanoid-marking-modifier-enable"),
HorizontalAlignment = HAlignment.Right
};
@@ -134,8 +134,8 @@ public sealed partial class HumanoidMarkingModifierWindow : DefaultWindow
OnStateChanged!();
};
var lineEditBox = new BoxContainer();
lineEditBox.AddChild(new Label { Text = "Prototype id: "});
var lineEditBox = new BoxContainer { SeparationOverride = 4 };
lineEditBox.AddChild(new Label { Text = Loc.GetString("humanoid-marking-modifier-prototype-id") });
// TODO: This line edit should really be an options / dropdown selector, not text.
_lineEdit = new() { MinWidth = 200 };

View File

@@ -116,7 +116,7 @@ public sealed partial class ChameleonControllerMenu : FancyWindow
var button = new Button
{
HorizontalExpand = true,
StyleClasses = {StyleBase.ButtonSquare},
StyleClasses = {StyleClass.ButtonSquare},
ToolTip = Loc.GetString(name),
Text = Loc.GetString(name),
Margin = new Thickness(0, 0, 15, 0),

View File

@@ -19,7 +19,7 @@ public sealed class ImplanterStatusControl : Control
{
IoCManager.InjectDependencies(this);
_parent = parent;
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
_label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
_label.MaxWidth = 350;
AddChild(new ClipControl { Children = { _label } });

View File

@@ -36,7 +36,7 @@ namespace Content.Client.Info
PopulateTutorial(tutorialList);
Contents.AddChild(rootContainer);
ContentsContainer.AddChild(rootContainer);
SetSize = new Vector2(650, 650);
}

View File

@@ -16,7 +16,7 @@
Text="{Loc 'ui-rules-accept'}"
Disabled="True" />
<Button Name="QuitButton"
StyleClasses="Caution"
StyleClasses="negative"
Text="{Loc 'ui-escape-quit'}" />
</BoxContainer>
</BoxContainer>

View File

@@ -154,7 +154,7 @@ namespace Content.Client.Inventory
var button = new Button()
{
Text = Loc.GetString("strippable-bound-user-interface-stripping-menu-ensnare-button"),
StyleClasses = { StyleBase.ButtonOpenRight }
StyleClasses = { StyleClass.ButtonOpenRight }
};
button.OnPressed += (_) => SendPredictedMessage(new StrippingEnsnareButtonPressed());

View File

@@ -2,7 +2,6 @@
xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:style="clr-namespace:Content.Client.Stylesheets"
Title="{Loc 'microwave-menu-title'}"
MinWidth="512"
MinSize="512 256">
@@ -78,14 +77,14 @@
Name="StartButton"
Access="Public"
Text="{Loc 'microwave-menu-start-button'}"
StyleClasses="ButtonColorGreen"
StyleClasses="positive"
TextAlign="Center" />
<Button
Name="EjectButton"
Access="Public"
Text="{Loc 'microwave-menu-eject-all-text'}"
ToolTip="{Loc 'microwave-menu-eject-all-tooltip'}"
StyleClasses="ButtonColorRed"
StyleClasses="negative"
TextAlign="Center" />
</BoxContainer>
</BoxContainer>

View File

@@ -33,6 +33,7 @@ namespace Content.Client.Labels.UI
_window.OnLabelChanged += OnLabelChanged;
Reload();
_window.SetInitialLabelState(); // Must be after Reload() has set the label text
}
private void OnLabelChanged(string newLabel)

View File

@@ -1,8 +1,14 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Loc 'hand-labeler-ui-header'}">
<BoxContainer Orientation="Vertical" SeparationOverride="4" MinWidth="150">
Title="{Loc 'hand-labeler-ui-header'}"
SetWidth="400"
MinWidth="150">
<BoxContainer Orientation="Vertical" SeparationOverride="4">
<Label Name="CurrentTextLabel" Text="{Loc 'hand-labeler-current-text-label'}" />
<LineEdit Name="LabelLineEdit" />
<BoxContainer Orientation="Horizontal" Align="Center">
<Button Name="ResetLabelButton" Text="{Loc 'hand-labeler-ui-reset-label-text'}" StyleClasses="OpenRight" />
<Button Name="ClearLabelButton" Text="{Loc 'hand-labeler-ui-clear-label-text'}" StyleClasses="OpenLeft" />
</BoxContainer>
</BoxContainer>
</DefaultWindow>

View File

@@ -16,6 +16,7 @@ namespace Content.Client.Labels.UI
// TODO LineEdit Make this a bool on the LineEdit control
private string _label = string.Empty;
private string _initialLabel = string.Empty;
public HandLabelerWindow()
{
@@ -25,6 +26,7 @@ namespace Content.Client.Labels.UI
{
_label = e.Text;
OnLabelChanged?.Invoke(_label);
UpdateButtons();
};
LabelLineEdit.OnFocusEnter += _ => _focused = true;
@@ -33,12 +35,14 @@ namespace Content.Client.Labels.UI
_focused = false;
LabelLineEdit.Text = _label;
};
ResetLabelButton.OnPressed += _ => LabelLineEdit.SetText(_initialLabel, true);
ClearLabelButton.OnPressed += _ => LabelLineEdit.SetText("", true);
}
protected override void Opened()
{
base.Opened();
// Give the editor keyboard focus, since that's the only
// thing the user will want to be doing with this UI
LabelLineEdit.GrabKeyboardFocus();
@@ -51,7 +55,25 @@ namespace Content.Client.Labels.UI
_label = label;
if (!_focused)
{
LabelLineEdit.Text = label;
UpdateButtons();
}
}
public void SetInitialLabelState()
{
LabelLineEdit.Text = _label;
LabelLineEdit.CursorPosition = _label.Length;
LabelLineEdit.SelectionStart = 0;
_initialLabel = _label;
UpdateButtons();
}
public void UpdateButtons()
{
ResetLabelButton.Disabled = (LabelLineEdit.Text == _initialLabel);
ClearLabelButton.Disabled = (LabelLineEdit.Text == "");
}
public void SetMaxLabelLength(int maxLength)

View File

@@ -61,7 +61,7 @@ namespace Content.Client.LateJoin
VerticalExpand = true,
};
Contents.AddChild(_base);
ContentsContainer.AddChild(_base);
_jobRequirements.Updated += RebuildUI;
RebuildUI();

View File

@@ -5,7 +5,7 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls">
<parallax:ParallaxControl SpeedX="20"/>
<Control HorizontalAlignment="Center" VerticalAlignment="Center">
<PanelContainer StyleClasses="AngleRect" />
<PanelContainer StyleClasses="BackgroundPanel" />
<BoxContainer Orientation="Vertical" MinSize="300 200">
<BoxContainer Orientation="Horizontal">
<Label Margin="8 0 0 0" Text="{Loc 'connecting-title'}"
@@ -68,7 +68,7 @@
</BoxContainer>
</Control>
<!-- Bottom window for tips -->
<PanelContainer Name="LoginTips" StyleClasses="AngleRect" Margin="0 10" MaxWidth="600" VerticalExpand="True" VerticalAlignment="Bottom">
<PanelContainer Name="LoginTips" StyleClasses="BackgroundPanel" Margin="0 10" MaxWidth="600" VerticalExpand="True" VerticalAlignment="Bottom">
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<controls:StripeBack>
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Center">

View File

@@ -43,7 +43,7 @@ namespace Content.Client.Launcher
LayoutContainer.SetAnchorPreset(this, LayoutContainer.LayoutPreset.Wide);
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSystem;
ChangeLoginTip();
RetryButton.OnPressed += ReconnectButtonPressed;

View File

@@ -18,7 +18,7 @@
<Button Name="ConfirmDeleteButton"
Text="{Loc 'character-setup-gui-character-picker-button-confirm-delete-button'}"
Visible="False"
ModulateSelfOverride="{x:Static style:StyleNano.ButtonColorCautionDefault}"/>
StyleClasses="negative"/>
</BoxContainer>
</ContainerButton>

View File

@@ -34,19 +34,13 @@
Text="{Loc 'character-setup-gui-character-setup-close-button'}"
StyleClasses="ButtonBig"/>
</BoxContainer>
<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="{x:Static style:StyleNano.NanoGold}" ContentMarginTopOverride="2" />
</PanelContainer.PanelOverride>
<PanelContainer StyleClasses="highlight">
</PanelContainer>
<BoxContainer Orientation="Horizontal" VerticalExpand="True" SeparationOverride="0">
<ScrollContainer MinSize="325 0" Margin="5 5 0 0">
<BoxContainer Name="Characters" Orientation="Vertical" />
</ScrollContainer>
<PanelContainer MinSize="2 0">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="{x:Static style:StyleNano.NanoGold}" ContentMarginTopOverride="2" />
</PanelContainer.PanelOverride>
<PanelContainer MinSize="2 0" StyleClasses="highlight">
</PanelContainer>
<BoxContainer Name="CharEditor" HorizontalExpand="True" />
</BoxContainer>

View File

@@ -6,8 +6,8 @@ using Content.Client.Lobby.UI.Loadouts;
using Content.Client.Lobby.UI.Roles;
using Content.Client.Message;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.Sprite;
using Content.Client.Stylesheets;
using Content.Client.Sprite;
using Content.Client.UserInterface.Systems.Guidebook;
using Content.Shared.CCVar;
using Content.Shared.Clothing;
@@ -598,7 +598,7 @@ namespace Content.Client.Lobby.UI
{
Text = Loc.GetString(category.Name),
Margin = new Thickness(0, 10, 0, 0),
StyleClasses = { StyleBase.StyleClassLabelHeading },
StyleClasses = { StyleClass.LabelHeading },
});
}
@@ -666,6 +666,7 @@ namespace Content.Client.Lobby.UI
_species.Clear();
_species.AddRange(_prototypeManager.EnumeratePrototypes<SpeciesPrototype>().Where(o => o.RoundStart));
_species.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.CurrentCultureIgnoreCase));
var speciesIds = _species.Select(o => o.ID).ToList();
for (var i = 0; i < _species.Count; i++)
@@ -1420,7 +1421,7 @@ namespace Content.Client.Lobby.UI
return;
const string style = "SpeciesInfoDefault";
SpeciesInfoButton.StyleClasses.Add(style);
SpeciesInfoButton.StyleIdentifier = style;
}
private void UpdateMarkings()

View File

@@ -0,0 +1,28 @@
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using static Content.Client.Stylesheets.StylesheetHelpers;
namespace Content.Client.Lobby.UI;
[CommonSheetlet]
public sealed class HumanoidProfileEditorSheetlet : Sheetlet<PalettedStylesheet>
{
public override StyleRule[] GetRules(PalettedStylesheet sheet, object config)
{
return
[
E<TextureButton>()
.Identifier("SpeciesInfoDefault")
.Prop(TextureButton.StylePropertyTexture,
ResCache.GetTexture("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
// copied from `StyleNano`, but this is unused
// E<TextureButton>()
// .Identifier("SpeciesInfoWarning")
// .Prop(TextureButton.StylePropertyTexture,
// ResCache.GetTexture("/Textures/Interface/info.svg.192dpi.png"))
// .Prop(Control.StylePropertyModulateSelf, sheet.HighlightPalette[0]),
];
}
}

View File

@@ -1,7 +1,7 @@
<BoxContainer xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Orientation="Vertical">
<PanelContainer StyleClasses="AngleRect" HorizontalExpand="True" Margin="5">
<PanelContainer StyleClasses="BackgroundPanel" HorizontalExpand="True" Margin="5">
<BoxContainer Name="LoadoutsContainer" Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True"/>
</PanelContainer>
<!-- Buffer space so we have 10 margin between controls but also 10 to the borders -->

View File

@@ -20,7 +20,7 @@
<Control Name="DefaultState" VerticalExpand="True">
<BoxContainer Name="TopLeft" Orientation="Vertical">
<!-- Left Top Panel -->
<PanelContainer StyleClasses="AngleRect" HorizontalAlignment="Left" Name="LeftSideTop"
<PanelContainer StyleClasses="BackgroundPanel" HorizontalAlignment="Left" Name="LeftSideTop"
VerticalAlignment="Top">
<BoxContainer Orientation="Vertical" HorizontalAlignment="Center" MaxWidth="800">
<info:LinkBanner Name="LinkBanner" VerticalExpand="false" HorizontalAlignment="Center"
@@ -53,7 +53,7 @@
<!-- Left Bot Panel -->
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom">
<info:DevInfoBanner Name="DevInfoBanner" VerticalExpand="false" Margin="3 3 3 3" />
<PanelContainer StyleClasses="AngleRect">
<PanelContainer StyleClasses="BackgroundPanel">
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" />
</PanelContainer>
</BoxContainer>
@@ -63,7 +63,7 @@
<Control Access="Public" Visible="False" Name="CharacterSetupState" VerticalExpand="True" />
</BoxContainer>
<!-- Right Panel -->
<PanelContainer Name="RightSide" Access="Public" StyleClasses="AngleRect" HorizontalAlignment="Right" VerticalExpand="True"
<PanelContainer Name="RightSide" Access="Public" StyleClasses="BackgroundPanel" HorizontalAlignment="Right" VerticalExpand="True"
VerticalAlignment="Stretch">
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<!-- Top row -->
@@ -73,7 +73,7 @@
HorizontalExpand="True" HorizontalAlignment="Center" />
</BoxContainer>
<!-- Gold line -->
<controls:HLine Color="{x:Static style:StyleNano.NanoGold}" Thickness="2" />
<controls:HLine StyleClasses="highlight" Thickness="2" />
<controls:HSpacer Spacing="10" />
<!-- Voting & misc button bar -->
<BoxContainer Orientation="Horizontal" MinSize="0 40" HorizontalAlignment="Right">
@@ -97,7 +97,7 @@
<controls:HSpacer Spacing="5" />
<BoxContainer MinHeight="10" />
<!-- Gold line -->
<controls:HLine Color="{x:Static style:StyleNano.NanoGold}" Thickness="2" Access="Public" />
<controls:HLine StyleClasses="highlight" Thickness="2" Access="Public" />
<controls:HSpacer Spacing="10" />
<widgets:ChatBox Name="Chat" Access="Public" VerticalExpand="True" Margin="3 3 3 3" MinHeight="50" />
</BoxContainer>
@@ -111,7 +111,7 @@
</PanelContainer>
</SplitContainer>
<PanelContainer Name="ExpandPanel"
StyleClasses="AngleRect"
StyleClasses="BackgroundPanel"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0 2 2 0"

View File

@@ -7,7 +7,7 @@
<BoxContainer Orientation="Horizontal">
<Button Name="NevermindButton" Text="{Loc 'observe-nevermind'}" SizeFlagsStretchRatio="1"/>
<Control HorizontalExpand="True" SizeFlagsStretchRatio="2" />
<cc:CommandButton Command="observe" Name="ObserveButton" StyleClasses="Caution" Text="{Loc 'observe-confirm'}" SizeFlagsStretchRatio="1"/>
<cc:CommandButton Command="observe" Name="ObserveButton" StyleClasses="negative" Text="{Loc 'observe-confirm'}" SizeFlagsStretchRatio="1"/>
<cc:CommandButton Command="observe admin" Name="ObserveAsAdminButton" Text="{Loc 'observe-as-admin'}" SizeFlagsStretchRatio="1" Visible="False"/>
</BoxContainer>
</BoxContainer>

View File

@@ -31,9 +31,9 @@ public sealed partial class RequirementsSelector : BoxContainer
RobustXamlLoader.Load(this);
_options = new RadioOptions<int>(RadioOptionsLayout.Horizontal)
{
FirstButtonStyle = StyleBase.ButtonOpenRight,
ButtonStyle = StyleBase.ButtonOpenBoth,
LastButtonStyle = StyleBase.ButtonOpenLeft,
FirstButtonStyle = StyleClass.ButtonOpenRight,
ButtonStyle = StyleClass.ButtonOpenBoth,
LastButtonStyle = StyleClass.ButtonOpenLeft,
HorizontalExpand = true,
};
//Override default radio option button width
@@ -50,7 +50,7 @@ public sealed partial class RequirementsSelector : BoxContainer
Text = Loc.GetString("role-timer-locked"),
Visible = true,
HorizontalAlignment = HAlignment.Center,
StyleClasses = {StyleBase.StyleClassLabelSubText},
StyleClasses = {StyleClass.LabelSubText},
};
_lockStripe = new StripeBack()

View File

@@ -11,6 +11,9 @@ namespace Content.Client.MainMenu.UI;
[GenerateTypedNameReferences]
public sealed partial class MainMenuControl : Control
{
public const string StyleIdentifierMainMenu = "mainMenu";
public const string StyleIdentifierMainMenuVBox = "mainMenuVBox";
public MainMenuControl(IResourceCache resCache, IConfigurationManager configMan)
{
RobustXamlLoader.Load(this);

View File

@@ -0,0 +1,27 @@
using Content.Client.Stylesheets;
using Content.Client.Stylesheets.Fonts;
using Content.Client.Stylesheets.Stylesheets;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using static Content.Client.Stylesheets.StylesheetHelpers;
namespace Content.Client.MainMenu.UI;
[CommonSheetlet]
public sealed class MainMenuSheetlet : Sheetlet<NanotrasenStylesheet>
{
public override StyleRule[] GetRules(NanotrasenStylesheet sheet, object config)
{
return
[
// make those buttons bigger
E<Button>()
.Identifier(MainMenuControl.StyleIdentifierMainMenu)
.ParentOf(E<Label>())
.Font(sheet.BaseFont.GetFont(16, FontKind.Bold)),
E<BoxContainer>()
.Identifier(MainMenuControl.StyleIdentifierMainMenuVBox)
.Prop(BoxContainer.StylePropertySeparation, 2),
];
}
}

View File

@@ -1,7 +1,7 @@
<Control xmlns="https://spacestation14.io"
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
MouseFilter="Stop">
<PanelContainer StyleClasses="BackgroundOpenLeft"/>
<PanelContainer StyleClasses="BackgroundPanelOpenLeft"/>
<PanelContainer>
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BorderColor="#25252A" BorderThickness="0 0 0 3"/>
@@ -20,7 +20,7 @@
<Label Text="{Loc news-write-ui-article-name-label}" Margin="17 10 0 9" VerticalAlignment="Center"/>
<LineEdit Name="TitleField" Margin="6 10 0 9" MinWidth="260" MinHeight="23" Access="Public"/>
<Control HorizontalExpand="True" />
<Label Name="RichTextInfoLabel" Text="?" MouseFilter="Pass" Margin="14 0" StyleClasses="LabelSecondaryColor"/>
<Label Name="RichTextInfoLabel" Text="?" MouseFilter="Pass" Margin="14 0" StyleClasses="LabelWeak"/>
</BoxContainer>
<Control Name="TextEditPanel" VerticalExpand="True" Margin="11 0 11 0">
<PanelContainer>
@@ -43,7 +43,7 @@
<BoxContainer Orientation="Horizontal" Margin="12 5 12 8">
<Control>
<Button Name="ButtonCancel" SetHeight="32" SetWidth="85"
StyleClasses="ButtonColorRed" Text="{Loc news-write-ui-cancel-text}"/>
StyleClasses="negative" Text="{Loc news-write-ui-cancel-text}"/>
</Control>
<Control HorizontalExpand="True"/>
<BoxContainer Orientation="Horizontal">

View File

@@ -22,8 +22,8 @@ public sealed partial class ArticleEditorPanel : Control
{
RobustXamlLoader.Load(this);
ButtonPublish.StyleClasses.Add(StyleBase.ButtonOpenLeft);
ButtonPublish.StyleClasses.Add(StyleNano.StyleClassButtonColorGreen);
ButtonPublish.StyleClasses.Add(StyleClass.ButtonOpenLeft);
ButtonPublish.StyleClasses.Add(StyleClass.Positive);
ContentField.GetChild(0).Margin = new Thickness(9, 3);
// Customize scrollbar width and margin. This is not possible in xaml

View File

@@ -3,7 +3,7 @@
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Margin="0 0 0 8">
<PanelContainer StyleClasses="AngleRect" ModulateSelfOverride="#2b2b31"/>
<PanelContainer StyleClasses="BackgroundPanel" ModulateSelfOverride="#2b2b31"/>
<BoxContainer Orientation="Vertical" SetHeight="60">
<Control HorizontalExpand="True" SetHeight="27">
<PanelContainer>
@@ -21,7 +21,7 @@
HorizontalAlignment="Right" Margin="8 6 6 6" SetHeight="19" SetWidth="52" Access="Public">
<Button.StyleClasses>
<system:String>ButtonSmall</system:String>
<system:String>ButtonColorRed</system:String>
<system:String>negative</system:String>
</Button.StyleClasses>
</controls:ConfirmButton>
</BoxContainer>

View File

@@ -77,11 +77,11 @@ public sealed partial class MaterialDisplay : PanelContainer
{
var sheetsToEject = sheetsToEjectArray[i];
var styleClass = StyleBase.ButtonOpenBoth;
var styleClass = StyleClass.ButtonOpenBoth;
if (i == 0)
styleClass = StyleBase.ButtonOpenRight;
styleClass = StyleClass.ButtonOpenRight;
else if (i == sheetsToEjectArray.Length - 1)
styleClass = StyleBase.ButtonOpenLeft;
styleClass = StyleClass.ButtonOpenLeft;
var button = new Button
{

View File

@@ -62,7 +62,7 @@ public sealed partial class CrewMonitoringNavMapControl : NavMapControl
continue;
if (!LocalizedNames.TryGetValue(netEntity, out var name))
name = "Unknown";
name = Loc.GetString("navmap-unknown-entity");
var message = name + "\n" + Loc.GetString("navmap-location",
("x", MathF.Round(blip.Coordinates.X)),

View File

@@ -1,7 +1,7 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.Medical.CrewMonitoring"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'crew-monitoring-user-interface-title'}"
Title="{Loc crew-monitoring-ui-title}"
Resizable="False"
SetSize="1210 700"
MinSize="1210 700">
@@ -11,12 +11,12 @@
<BoxContainer Orientation="Vertical" Margin="0 0 10 0">
<controls:StripeBack>
<PanelContainer>
<Label Name="StationName" Text="Unknown station" Align="Center" Margin="0 5 0 3"/>
<Label Name="StationName" Text="{Loc crew-monitoring-ui-no-station-label}" Align="Center" Margin="0 5 0 3"/>
</PanelContainer>
</controls:StripeBack>
<LineEdit Name="SearchLineEdit" HorizontalExpand="True"
PlaceHolder="{Loc crew-monitor-filter-line-placeholder}" />
PlaceHolder="{Loc crew-monitoring-ui-filter-line-placeholder}" />
<ScrollContainer Name="SensorScroller"
VerticalExpand="True"
@@ -29,7 +29,7 @@
<!-- Table rows are filled by code -->
</BoxContainer>
<Label Name="NoServerLabel"
Text="{Loc 'crew-monitoring-user-interface-no-server'}"
Text="{Loc crew-monitoring-ui-no-server-label}"
StyleClasses="LabelHeading"
FontColorOverride="Red"
HorizontalAlignment="Center"
@@ -42,8 +42,8 @@
<BoxContainer Orientation="Vertical">
<PanelContainer StyleClasses="LowDivider" />
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom">
<Label Text="{Loc 'crew-monitoring-user-interface-flavor-left'}" StyleClasses="WindowFooterText" />
<Label Text="{Loc 'crew-monitoring-user-interface-flavor-right'}" StyleClasses="WindowFooterText"
<Label Text="{Loc crew-monitoring-ui-flavor-left-label}" StyleClasses="WindowFooterText" />
<Label Text="{Loc crew-monitoring-ui-flavor-right-label}" StyleClasses="WindowFooterText"
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" />
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered"
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>

Some files were not shown because too many files have changed in this diff Show More