Merge branch 'master' into offmed-staging

This commit is contained in:
Janet Blackquill
2025-11-05 16:52:49 -05:00
1731 changed files with 38109 additions and 46754 deletions

1
.github/CODEOWNERS vendored
View File

@@ -28,6 +28,7 @@
/Content.*/Stunnable/ @Princess-Cheeseballs /Content.*/Stunnable/ @Princess-Cheeseballs
/Content.*/Nutrition/ @Princess-Cheeseballs /Content.*/Nutrition/ @Princess-Cheeseballs
/Content.*/EntityEffects @Princess-Cheeseballs @sowelipililimute
# SKREEEE # SKREEEE
/Content.*.Database/ @PJB3005 @DrSmugleaf /Content.*.Database/ @PJB3005 @DrSmugleaf

View File

@@ -13,7 +13,7 @@ from typing import List
SOLUTION_PATH = Path("..") / "SpaceStation14.sln" SOLUTION_PATH = Path("..") / "SpaceStation14.sln"
# If this doesn't match the saved version we overwrite them all. # 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" 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) 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. # Just call post-checkout since it does the same thing.
gitroot=$(git rev-parse --git-path hooks) gitroot=$(git rev-parse --git-path hooks)

View File

@@ -8,7 +8,7 @@ This isnt an exhaustive list of things that you cant do. Rather, take it i
This code of conduct applies specifically to the Github repositories and its spaces managed by the Space Station 14 project or Space Wizards Federation. Some spaces, such as the Space Station 14 Discord or the official Wizard's Den game servers, have their own rules but are in spirit equal to what may be found in here. This code of conduct applies specifically to the Github repositories and its spaces managed by the Space Station 14 project or Space Wizards Federation. Some spaces, such as the Space Station 14 Discord or the official Wizard's Den game servers, have their own rules but are in spirit equal to what may be found in here.
If you believe someone is violating the code of conduct, we ask that you report it by contacting a Maintainer, Project Manager or Wizard staff member through [Discord](https://discord.ss14.io/), [the forums](https://forum.spacestation14.com/), or emailing [telecommunications@spacestation14.com](mailto:telecommunications@spacestation14.com). If you believe someone is violating the code of conduct, we ask that you report it by contacting a Maintainer, Project Manager or Wizard staff member through [Discord](https://discord.ss14.io/), [the forums](https://forum.spacestation14.com/), or emailing [support@spacestation14.com](mailto:support@spacestation14.com).
- **Be friendly and patient.** - **Be friendly and patient.**
- **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability. - **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.

View File

@@ -0,0 +1,160 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Content.IntegrationTests;
using Content.IntegrationTests.Pair;
using Content.Server.Destructible;
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Damage.Systems;
using Content.Shared.FixedPoint;
using Content.Shared.Maps;
using Robust.Shared;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Benchmarks;
[Virtual]
[GcServer(true)]
[MemoryDiagnoser]
public class DestructibleBenchmark
{
/// <summary>
/// Number of destructible entities per prototype to spawn with a <see cref="DestructibleComponent"/>.
/// </summary>
[Params(1, 10, 100, 1000, 5000)]
public int EntityCount;
/// <summary>
/// Amount of blunt damage we do to each entity.
/// </summary>
[Params(10000)]
public FixedPoint2 DamageAmount;
[Params("Blunt")]
public ProtoId<DamageTypePrototype> DamageType;
private static readonly EntProtoId WindowProtoId = "Window";
private static readonly EntProtoId WallProtoId = "WallReinforced";
private static readonly EntProtoId HumanProtoId = "MobHuman";
private static readonly ProtoId<ContentTileDefinition> TileRef = "Plating";
private readonly EntProtoId[] _prototypes = [WindowProtoId, WallProtoId, HumanProtoId];
private readonly List<Entity<DamageableComponent>> _damageables = new();
private readonly List<Entity<DamageableComponent, DestructibleComponent>> _destructbiles = new();
private DamageSpecifier _damage;
private TestPair _pair = default!;
private IEntityManager _entMan = default!;
private IPrototypeManager _protoMan = default!;
private IRobustRandom _random = default!;
private ITileDefinitionManager _tileDefMan = default!;
private DamageableSystem _damageable = default!;
private DestructibleSystem _destructible = default!;
private SharedMapSystem _map = default!;
[GlobalSetup]
public async Task SetupAsync()
{
ProgramShared.PathOffset = "../../../../";
PoolManager.Startup();
_pair = await PoolManager.GetServerClient();
var server = _pair.Server;
var mapdata = await _pair.CreateTestMap();
_entMan = server.ResolveDependency<IEntityManager>();
_protoMan = server.ResolveDependency<IPrototypeManager>();
_random = server.ResolveDependency<IRobustRandom>();
_tileDefMan = server.ResolveDependency<ITileDefinitionManager>();
_damageable = _entMan.System<DamageableSystem>();
_destructible = _entMan.System<DestructibleSystem>();
_map = _entMan.System<SharedMapSystem>();
if (!_protoMan.Resolve(DamageType, out var type))
return;
_damage = new DamageSpecifier(type, DamageAmount);
_random.SetSeed(69420); // Randomness needs to be deterministic for benchmarking.
var plating = _tileDefMan[TileRef].TileId;
// We make a rectangular grid of destructible entities, and then damage them all simultaneously to stress test the system.
// Needed for managing the performance of destructive effects and damage application.
await server.WaitPost(() =>
{
// Set up a thin line of tiles to place our objects on. They should be anchored for a "realistic" scenario...
for (var x = 0; x < EntityCount; x++)
{
for (var y = 0; y < _prototypes.Length; y++)
{
_map.SetTile(mapdata.Grid, mapdata.Grid, new Vector2i(x, y), new Tile(plating));
}
}
for (var x = 0; x < EntityCount; x++)
{
var y = 0;
foreach (var protoId in _prototypes)
{
var coords = new EntityCoordinates(mapdata.Grid, x + 0.5f, y + 0.5f);
_entMan.SpawnEntity(protoId, coords);
y++;
}
}
var query = _entMan.EntityQueryEnumerator<DamageableComponent, DestructibleComponent>();
while (query.MoveNext(out var uid, out var damageable, out var destructible))
{
_damageables.Add((uid, damageable));
_destructbiles.Add((uid, damageable, destructible));
}
});
}
[Benchmark]
public async Task PerformDealDamage()
{
await _pair.Server.WaitPost(() =>
{
_damageable.ApplyDamageToAllEntities(_damageables, _damage);
});
}
[Benchmark]
public async Task PerformTestTriggers()
{
await _pair.Server.WaitPost(() =>
{
_destructible.TestAllTriggers(_destructbiles);
});
}
[Benchmark]
public async Task PerformTestBehaviors()
{
await _pair.Server.WaitPost(() =>
{
_destructible.TestAllBehaviors(_destructbiles);
});
}
[GlobalCleanup]
public async Task CleanupAsync()
{
await _pair.DisposeAsync();
PoolManager.Shutdown();
}
}

View File

@@ -0,0 +1,253 @@
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Content.IntegrationTests;
using Content.IntegrationTests.Pair;
using Content.Server.Atmos;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Reactions;
using Content.Shared.Atmos;
using Robust.Shared;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
namespace Content.Benchmarks;
/// <summary>
/// Benchmarks the performance of different gas reactions.
/// Tests each reaction type with realistic gas mixtures to measure computational cost.
/// </summary>
[Virtual]
[GcServer(true)]
[MemoryDiagnoser]
public class GasReactionBenchmark
{
private const int Iterations = 1000;
private TestPair _pair = default!;
private AtmosphereSystem _atmosphereSystem = default!;
// Grid and tile for reactions that need a holder
private EntityUid _testGrid = default!;
private TileAtmosphere _testTile = default!;
// Reaction instances
private PlasmaFireReaction _plasmaFireReaction = default!;
private TritiumFireReaction _tritiumFireReaction = default!;
private FrezonProductionReaction _frezonProductionReaction = default!;
private FrezonCoolantReaction _frezonCoolantReaction = default!;
private AmmoniaOxygenReaction _ammoniaOxygenReaction = default!;
private N2ODecompositionReaction _n2oDecompositionReaction = default!;
private WaterVaporReaction _waterVaporReaction = default!;
// Gas mixtures for each reaction type
private GasMixture _plasmaFireMixture = default!;
private GasMixture _tritiumFireMixture = default!;
private GasMixture _frezonProductionMixture = default!;
private GasMixture _frezonCoolantMixture = default!;
private GasMixture _ammoniaOxygenMixture = default!;
private GasMixture _n2oDecompositionMixture = default!;
private GasMixture _waterVaporMixture = default!;
[GlobalSetup]
public async Task SetupAsync()
{
ProgramShared.PathOffset = "../../../../";
PoolManager.Startup();
_pair = await PoolManager.GetServerClient();
var server = _pair.Server;
// Create test map and grid
var mapData = await _pair.CreateTestMap();
_testGrid = mapData.Grid;
await server.WaitPost(() =>
{
var entMan = server.ResolveDependency<IEntityManager>();
_atmosphereSystem = entMan.System<AtmosphereSystem>();
_plasmaFireReaction = new PlasmaFireReaction();
_tritiumFireReaction = new TritiumFireReaction();
_frezonProductionReaction = new FrezonProductionReaction();
_frezonCoolantReaction = new FrezonCoolantReaction();
_ammoniaOxygenReaction = new AmmoniaOxygenReaction();
_n2oDecompositionReaction = new N2ODecompositionReaction();
_waterVaporReaction = new WaterVaporReaction();
SetupGasMixtures();
SetupTile();
});
}
private void SetupGasMixtures()
{
// Plasma Fire: Plasma + Oxygen at high temperature
// Temperature must be > PlasmaMinimumBurnTemperature for reaction to occur
_plasmaFireMixture = new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.PlasmaMinimumBurnTemperature + 100f // ~673K
};
_plasmaFireMixture.AdjustMoles(Gas.Plasma, 20f);
_plasmaFireMixture.AdjustMoles(Gas.Oxygen, 100f);
// Tritium Fire: Tritium + Oxygen at high temperature
// Temperature must be > FireMinimumTemperatureToExist for reaction to occur
_tritiumFireMixture = new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.FireMinimumTemperatureToExist + 100f // ~473K
};
_tritiumFireMixture.AdjustMoles(Gas.Tritium, 20f);
_tritiumFireMixture.AdjustMoles(Gas.Oxygen, 100f);
// Frezon Production: Oxygen + Tritium + Nitrogen catalyst
// Optimal temperature for efficiency (80% of max efficiency temp)
_frezonProductionMixture = new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.FrezonProductionMaxEfficiencyTemperature * 0.8f // ~48K
};
_frezonProductionMixture.AdjustMoles(Gas.Oxygen, 50f);
_frezonProductionMixture.AdjustMoles(Gas.Tritium, 50f);
_frezonProductionMixture.AdjustMoles(Gas.Nitrogen, 10f);
// Frezon Coolant: Frezon + Nitrogen
// Temperature must be > FrezonCoolLowerTemperature (23.15K) for reaction to occur
_frezonCoolantMixture = new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.T20C + 50f // ~343K
};
_frezonCoolantMixture.AdjustMoles(Gas.Frezon, 30f);
_frezonCoolantMixture.AdjustMoles(Gas.Nitrogen, 100f);
// Ammonia + Oxygen reaction (concentration-dependent, no temp requirement)
_ammoniaOxygenMixture = new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.T20C + 100f // ~393K
};
_ammoniaOxygenMixture.AdjustMoles(Gas.Ammonia, 40f);
_ammoniaOxygenMixture.AdjustMoles(Gas.Oxygen, 40f);
// N2O Decomposition (no temperature requirement, just needs N2O moles)
_n2oDecompositionMixture = new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.T20C + 100f // ~393K
};
_n2oDecompositionMixture.AdjustMoles(Gas.NitrousOxide, 100f);
// Water Vapor - needs water vapor to condense
_waterVaporMixture = new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.T20C
};
_waterVaporMixture.AdjustMoles(Gas.WaterVapor, 50f);
}
private void SetupTile()
{
// Create a tile atmosphere to use as holder for all reactions
var testIndices = new Vector2i(0, 0);
_testTile = new TileAtmosphere(_testGrid, testIndices, new GasMixture(Atmospherics.CellVolume)
{
Temperature = Atmospherics.T20C
});
}
private static GasMixture CloneMixture(GasMixture original)
{
return new GasMixture(original);
}
[Benchmark]
public async Task PlasmaFireReaction()
{
await _pair.Server.WaitPost(() =>
{
for (var i = 0; i < Iterations; i++)
{
var mixture = CloneMixture(_plasmaFireMixture);
_plasmaFireReaction.React(mixture, _testTile, _atmosphereSystem, 1f);
}
});
}
[Benchmark]
public async Task TritiumFireReaction()
{
await _pair.Server.WaitPost(() =>
{
for (var i = 0; i < Iterations; i++)
{
var mixture = CloneMixture(_tritiumFireMixture);
_tritiumFireReaction.React(mixture, _testTile, _atmosphereSystem, 1f);
}
});
}
[Benchmark]
public async Task FrezonProductionReaction()
{
await _pair.Server.WaitPost(() =>
{
for (var i = 0; i < Iterations; i++)
{
var mixture = CloneMixture(_frezonProductionMixture);
_frezonProductionReaction.React(mixture, _testTile, _atmosphereSystem, 1f);
}
});
}
[Benchmark]
public async Task FrezonCoolantReaction()
{
await _pair.Server.WaitPost(() =>
{
for (var i = 0; i < Iterations; i++)
{
var mixture = CloneMixture(_frezonCoolantMixture);
_frezonCoolantReaction.React(mixture, _testTile, _atmosphereSystem, 1f);
}
});
}
[Benchmark]
public async Task AmmoniaOxygenReaction()
{
await _pair.Server.WaitPost(() =>
{
for (var i = 0; i < Iterations; i++)
{
var mixture = CloneMixture(_ammoniaOxygenMixture);
_ammoniaOxygenReaction.React(mixture, _testTile, _atmosphereSystem, 1f);
}
});
}
[Benchmark]
public async Task N2ODecompositionReaction()
{
await _pair.Server.WaitPost(() =>
{
for (var i = 0; i < Iterations; i++)
{
var mixture = CloneMixture(_n2oDecompositionMixture);
_n2oDecompositionReaction.React(mixture, _testTile, _atmosphereSystem, 1f);
}
});
}
[Benchmark]
public async Task WaterVaporReaction()
{
await _pair.Server.WaitPost(() =>
{
for (var i = 0; i < Iterations; i++)
{
var mixture = CloneMixture(_waterVaporMixture);
_waterVaporReaction.React(mixture, _testTile, _atmosphereSystem, 1f);
}
});
}
[GlobalCleanup]
public async Task CleanupAsync()
{
await _pair.DisposeAsync();
PoolManager.Shutdown();
}
}

View File

@@ -49,12 +49,12 @@ namespace Content.Client.Access.UI
icons.Sort((x, y) => string.Compare(x.LocalizedJobName, y.LocalizedJobName, StringComparison.CurrentCulture)); icons.Sort((x, y) => string.Compare(x.LocalizedJobName, y.LocalizedJobName, StringComparison.CurrentCulture));
foreach (var jobIcon in icons) foreach (var jobIcon in icons)
{ {
String styleBase = StyleBase.ButtonOpenBoth; String styleBase = StyleClass.ButtonOpenBoth;
var modulo = i % JobIconColumnCount; var modulo = i % JobIconColumnCount;
if (modulo == 0) if (modulo == 0)
styleBase = StyleBase.ButtonOpenRight; styleBase = StyleClass.ButtonOpenRight;
else if (modulo == JobIconColumnCount - 1) else if (modulo == JobIconColumnCount - 1)
styleBase = StyleBase.ButtonOpenLeft; styleBase = StyleClass.ButtonOpenLeft;
// Generate buttons // Generate buttons
var jobIconButton = new Button var jobIconButton = new Button

View File

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

View File

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

View File

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

View File

@@ -12,17 +12,19 @@ namespace Content.Client.Administration.UI.AdminRemarks;
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public sealed partial class AdminMessagePopupWindow : Control public sealed partial class AdminMessagePopupWindow : Control
{ {
[Dependency] private readonly IStylesheetManager _styleMan = default!;
private float _timer = float.MaxValue; private float _timer = float.MaxValue;
public event Action? OnDismissPressed; public event Action? OnDismissPressed;
public event Action? OnAcceptPressed; public event Action? OnAcceptPressed;
public AdminMessagePopupWindow() public AdminMessagePopupWindow()
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace; Stylesheet = _styleMan.SheetSystem;
AcceptButton.OnPressed += OnAcceptButtonPressed; AcceptButton.OnPressed += OnAcceptButtonPressed;
DismissButton.OnPressed += OnDismissButtonPressed; DismissButton.OnPressed += OnDismissButtonPressed;
@@ -49,7 +51,8 @@ public sealed partial class AdminMessagePopupWindow : Control
MessageContainer.AddChild(new AdminMessagePopupMessage(message)); 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) private void OnDismissButtonPressed(BaseButton.ButtonEventArgs obj)

View File

@@ -294,19 +294,19 @@ public sealed partial class BanPanel : DefaultWindow
} }
/// <summary> /// <summary>
/// Adds a check button specifically for one "role" in a "group" /// Adds a toggle button specifically for one "role" in a "group"
/// E.g. it would add the Chief Medical Officer "role" into the "Medical" group. /// E.g. it would add the Chief Medical Officer "role" into the "Medical" group.
/// </summary> /// </summary>
private void AddRoleCheckbox(string group, string role, GridContainer roleGroupInnerContainer, Button roleGroupCheckbox) private void AddRoleCheckbox(string group, string role, GridContainer roleGroupInnerContainer, Button roleGroupCheckbox)
{ {
var roleCheckboxContainer = new BoxContainer(); var roleCheckboxContainer = new BoxContainer();
var roleCheckButton = new Button var roleToggleButton = new Button
{ {
Name = role, Name = role,
Text = role, Text = role,
ToggleMode = true, ToggleMode = true,
}; };
roleCheckButton.OnToggled += args => roleToggleButton.OnToggled += args =>
{ {
// Checks the role group checkbox if all the children are pressed // Checks the role group checkbox if all the children are pressed
if (args.Pressed && _roleCheckboxes[group].All(e => e.Item1.Pressed)) if (args.Pressed && _roleCheckboxes[group].All(e => e.Item1.Pressed))
@@ -343,12 +343,12 @@ public sealed partial class BanPanel : DefaultWindow
roleCheckboxContainer.AddChild(jobIconTexture); roleCheckboxContainer.AddChild(jobIconTexture);
} }
roleCheckboxContainer.AddChild(roleCheckButton); roleCheckboxContainer.AddChild(roleToggleButton);
roleGroupInnerContainer.AddChild(roleCheckboxContainer); roleGroupInnerContainer.AddChild(roleCheckboxContainer);
_roleCheckboxes.TryAdd(group, []); _roleCheckboxes.TryAdd(group, []);
_roleCheckboxes[group].Add((roleCheckButton, rolePrototype)); _roleCheckboxes[group].Add((roleToggleButton, rolePrototype));
} }
public void UpdateBanFlag(bool newFlag) public void UpdateBanFlag(bool newFlag)

View File

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

View File

@@ -11,6 +11,9 @@ namespace Content.Client.Administration.UI.CustomControls;
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public sealed partial class PlayerListEntry : BoxContainer public sealed partial class PlayerListEntry : BoxContainer
{ {
private readonly ResPath _pinnedResPath = new("/Textures/Interface/Bwoink/pinned.png");
private readonly ResPath _unPinnedResPath = new("/Textures/Interface/Bwoink/un_pinned.png");
public PlayerListEntry() public PlayerListEntry()
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
@@ -44,15 +47,6 @@ public sealed partial class PlayerListEntry : BoxContainer
private void UpdatePinButtonTexture(bool isPinned) private void UpdatePinButtonTexture(bool isPinned)
{ {
if (isPinned) PlayerEntryPinButton.TexturePath = isPinned ? _pinnedResPath.CanonPath : _unPinnedResPath.CanonPath;
{
PlayerEntryPinButton?.RemoveStyleClass(StyleNano.StyleClassPinButtonUnpinned);
PlayerEntryPinButton?.AddStyleClass(StyleNano.StyleClassPinButtonPinned);
}
else
{
PlayerEntryPinButton?.RemoveStyleClass(StyleNano.StyleClassPinButtonPinned);
PlayerEntryPinButton?.AddStyleClass(StyleNano.StyleClassPinButtonUnpinned);
}
} }
} }

View File

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

View File

@@ -14,9 +14,6 @@ namespace Content.Client.Administration.UI.Notes;
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public sealed partial class AdminNotesLine : BoxContainer public sealed partial class AdminNotesLine : BoxContainer
{ {
[Dependency] private readonly ILogManager _logManager = default!;
private readonly ISawmill _sawmill = default!;
private readonly SpriteSystem _sprites; private readonly SpriteSystem _sprites;
private const string AdminNotesTextureBase = "/Textures/Interface/AdminNotes/"; private const string AdminNotesTextureBase = "/Textures/Interface/AdminNotes/";
@@ -36,8 +33,6 @@ public sealed partial class AdminNotesLine : BoxContainer
public AdminNotesLine(SpriteSystem sprites, SharedAdminNote note) public AdminNotesLine(SpriteSystem sprites, SharedAdminNote note)
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
_sawmill = _logManager.GetSawmill("admin.notes");
_sprites = sprites; _sprites = sprites;
Note = note; Note = note;
@@ -66,7 +61,7 @@ public sealed partial class AdminNotesLine : BoxContainer
if (iconPath is null) if (iconPath is null)
{ {
SeverityRect.Visible = false; SeverityRect.Visible = false;
_sawmill.Warning($"Could not find an icon for note ID {Note.Id}"); Logger.WarningS("admin.notes", $"Could not find an icon for note ID {Note.Id}");
} }
else else
{ {

View File

@@ -3,7 +3,7 @@
Title="Loading..." Title="Loading..."
MinSize="400 200"> MinSize="400 200">
<BoxContainer Orientation="Vertical" Margin="4"> <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"> <BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Name="ExpiryLabel" Text="{Loc admin-note-editor-expiry-label}" Visible="False" /> <Label Name="ExpiryLabel" Text="{Loc admin-note-editor-expiry-label}" Visible="False" />
<HistoryLineEdit Name="ExpiryLineEdit" PlaceHolder="{Loc admin-note-editor-expiry-placeholder}" <HistoryLineEdit Name="ExpiryLineEdit" PlaceHolder="{Loc admin-note-editor-expiry-placeholder}"
@@ -17,7 +17,7 @@
ToolTip="{Loc admin-note-editor-secret-tooltip}" /> ToolTip="{Loc admin-note-editor-secret-tooltip}" />
<CheckBox Name="PermanentCheckBox" Pressed="True" Text="{Loc admin-note-editor-expiry-checkbox}" <CheckBox Name="PermanentCheckBox" Pressed="True" Text="{Loc admin-note-editor-expiry-checkbox}"
ToolTip="{Loc admin-note-editor-expiry-checkbox-tooltip}" /> 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>
</BoxContainer> </BoxContainer>
</controls:FancyWindow> </controls:FancyWindow>

View File

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

View File

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

View File

@@ -7,10 +7,8 @@
MinSize="50 50"> MinSize="50 50">
<BoxContainer Orientation="Vertical"> <BoxContainer Orientation="Vertical">
<GridContainer Columns="3"> <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="banpanel" Text="{Loc admin-player-actions-window-ban}" />
<cc:CommandButton Command="aghost" Text="{Loc admin-player-actions-window-admin-ghost}" /> <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="permissions" Text="{Loc admin-player-actions-window-permissions}" />
<cc:CommandButton Command="announceui" Text="{Loc admin-player-actions-window-announce}"/> <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}"/> <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" VerticalExpand="True"
Margin="0 0 0 0" Margin="0 0 0 0"
VerticalAlignment="Center"> VerticalAlignment="Center">
<Label Text="{Loc 'anomaly-generator-fuel-display'}" StyleClasses="StatusFieldTitle" /> <Label Text="{Loc 'anomaly-generator-fuel-display'}" StyleClasses="highlight" />
<ProgressBar Name="FuelBar" <ProgressBar Name="FuelBar"
HorizontalExpand="True" HorizontalExpand="True"
MaxValue="1" MaxValue="1"
@@ -27,8 +27,8 @@
Text="0 %" /> Text="0 %" />
</ProgressBar> </ProgressBar>
</BoxContainer> </BoxContainer>
<RichTextLabel Name="CooldownLabel" StyleClasses="StatusFieldTitle" /> <RichTextLabel Name="CooldownLabel" StyleClasses="highlight" />
<RichTextLabel Name="ReadyLabel" StyleClasses="StatusFieldTitle" /> <RichTextLabel Name="ReadyLabel" StyleClasses="highlight" />
</BoxContainer> </BoxContainer>
<!--Sprite View--> <!--Sprite View-->
<PanelContainer Margin="12 0 0 0" <PanelContainer Margin="12 0 0 0"

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,5 @@
using Content.Shared.Atmos.EntitySystems;
namespace Content.Client.Atmos.EntitySystems;
public sealed class DeltaPressureSystem : SharedDeltaPressureSystem;

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
MinSize="480 400" Title="Canister"> MinSize="480 400" Title="Canister">
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10"> <BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Vertical" VerticalExpand="True"> <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"> <BoxContainer Orientation="Horizontal">
<Label Text="{Loc comp-gas-canister-ui-canister-pressure}"/> <Label Text="{Loc comp-gas-canister-ui-canister-pressure}"/>
<Label Name="CanisterPressureLabel" Align="Center" HorizontalExpand="True"/> <Label Name="CanisterPressureLabel" Align="Center" HorizontalExpand="True"/>
@@ -16,7 +16,7 @@
</BoxContainer> </BoxContainer>
<BoxContainer Orientation="Vertical" VerticalExpand="True"> <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"> <BoxContainer Orientation="Horizontal">
<Label Text="{Loc comp-gas-canister-ui-holding-tank-label}"/> <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"/> <Label Name="TankLabelLabel" Text="{Loc comp-gas-canister-ui-holding-tank-label-empty}" Align="Center" HorizontalExpand="True"/>
@@ -29,7 +29,7 @@
</BoxContainer> </BoxContainer>
<BoxContainer Orientation="Vertical" VerticalExpand="True"> <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="Horizontal">
<BoxContainer Orientation="Vertical"> <BoxContainer Orientation="Vertical">
<Label Text="{Loc comp-gas-canister-ui-release-pressure}"/> <Label Text="{Loc comp-gas-canister-ui-release-pressure}"/>

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,7 +3,7 @@
Margin="10 10 10 0" Margin="10 10 10 0"
HorizontalExpand="True" HorizontalExpand="True"
Visible="True"> Visible="True">
<PanelContainer StyleClasses="AngleRect" HorizontalExpand="True"> <PanelContainer StyleClasses="BackgroundPanel" HorizontalExpand="True">
<BoxContainer Orientation="Vertical" <BoxContainer Orientation="Vertical"
HorizontalExpand="True"> HorizontalExpand="True">
<BoxContainer Orientation="Horizontal"> <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.Client.UserInterface.Controls;
using Content.Shared.Changeling.Components; using Content.Shared.Changeling.Components;
using Content.Shared.Changeling.Systems; 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) public sealed partial class ChangelingTransformBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey)
{ {
private SimpleRadialMenu? _menu; private SimpleRadialMenu? _menu;
private static readonly Color SelectedOptionBackground = StyleNano.ButtonColorGoodDefault.WithAlpha(128); private static readonly Color SelectedOptionBackground = Palettes.Green.Element.WithAlpha(128);
private static readonly Color SelectedOptionHoverBackground = StyleNano.ButtonColorGoodHovered.WithAlpha(128); private static readonly Color SelectedOptionHoverBackground = Palettes.Green.HoveredElement.WithAlpha(128);
protected override void Open() protected override void Open()
{ {

View File

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

View File

@@ -52,6 +52,7 @@ namespace Content.Client.Changelog
// Open changelog purely to compare to the last viewed date. // Open changelog purely to compare to the last viewed date.
var changelogs = await LoadChangelog(); var changelogs = await LoadChangelog();
UpdateChangelogs(changelogs); UpdateChangelogs(changelogs);
_configManager.OnValueChanged(CCVars.ServerId, OnServerIdCVarChanged);
} }
private void UpdateChangelogs(List<Changelog> changelogs) private void UpdateChangelogs(List<Changelog> changelogs)
@@ -81,6 +82,11 @@ namespace Content.Client.Changelog
MaxId = changelog.Entries.Max(c => c.Id); MaxId = changelog.Entries.Max(c => c.Id);
CheckLastSeenEntry();
}
private void CheckLastSeenEntry()
{
var path = new ResPath($"/changelog_last_seen_{_configManager.GetCVar(CCVars.ServerId)}"); var path = new ResPath($"/changelog_last_seen_{_configManager.GetCVar(CCVars.ServerId)}");
if (_resource.UserData.TryReadAllText(path, out var lastReadIdText)) if (_resource.UserData.TryReadAllText(path, out var lastReadIdText))
{ {
@@ -92,6 +98,11 @@ namespace Content.Client.Changelog
NewChangelogEntriesChanged?.Invoke(); NewChangelogEntriesChanged?.Invoke();
} }
private void OnServerIdCVarChanged(string newValue)
{
CheckLastSeenEntry();
}
public Task<List<Changelog>> LoadChangelog() public Task<List<Changelog>> LoadChangelog()
{ {
return Task.Run(() => return Task.Run(() =>

View File

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

View File

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

View File

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

View File

@@ -31,6 +31,11 @@ internal sealed class ChatManager : IChatManager
// See server-side manager. This just exists for shared code. // See server-side manager. This just exists for shared code.
} }
public void SendAdminAlertNoFormatOrEscape(string message)
{
// See server-side manager. This just exists for shared code.
}
public void SendMessage(string text, ChatSelectChannel channel) public void SendMessage(string text, ChatSelectChannel channel)
{ {
var str = text.ToString(); var str = text.ToString();

View File

@@ -33,8 +33,8 @@
<BoxContainer Orientation="Horizontal"> <BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-buffer-text'}" /> <Label Text="{Loc 'chem-master-window-buffer-text'}" />
<Control HorizontalExpand="True" /> <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="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" /> <Button MinSize="80 0" Name="BufferDiscardButton" Access="Public" Text="{Loc 'chem-master-window-discard-button'}" ToggleMode="True" StyleClasses="OpenLeft" />
</BoxContainer> </BoxContainer>
@@ -82,7 +82,7 @@
<Label Text="{Loc 'chem-master-window-packaging-text'}" /> <Label Text="{Loc 'chem-master-window-packaging-text'}" />
<Control HorizontalExpand="True"/> <Control HorizontalExpand="True"/>
<Label Text="{Loc 'chem-master-window-buffer-label'}" /> <Label Text="{Loc 'chem-master-window-buffer-label'}" />
<Label Name="BufferCurrentVolume" StyleClasses="LabelSecondaryColor" /> <Label Name="BufferCurrentVolume" StyleClasses="LabelWeak" />
</BoxContainer> </BoxContainer>
<!-- Wrap the packaging info--> <!-- Wrap the packaging info-->
@@ -112,9 +112,9 @@
<BoxContainer Orientation="Horizontal"> <BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-pills-label'}" /> <Label Text="{Loc 'chem-master-window-pills-label'}" />
<Control HorizontalExpand="True" MinSize="50 0" /> <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" /> <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" /> <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'}" /> <Button MinSize="80 0" Name="CreatePillButton" Access="Public" Text="{Loc 'chem-master-window-create-button'}" />
</BoxContainer> </BoxContainer>
@@ -122,7 +122,7 @@
<BoxContainer Orientation="Horizontal"> <BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-bottles-label'}" /> <Label Text="{Loc 'chem-master-window-bottles-label'}" />
<Control HorizontalExpand="True" MinSize="50 0" /> <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" /> <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'}" /> <Button MinSize="80 0" Name="CreateBottleButton" Access="Public" Text="{Loc 'chem-master-window-create-button'}" />
</BoxContainer> </BoxContainer>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -30,10 +30,8 @@ namespace Content.Client.Construction.UI
[Dependency] private readonly IUserInterfaceManager _uiManager = default!; [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!; [Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private readonly ISawmill _sawmill = default!;
private readonly SpriteSystem _spriteSystem; private readonly SpriteSystem _spriteSystem;
private readonly IConstructionMenuView _constructionView; private readonly IConstructionMenuView _constructionView;
private readonly EntityWhitelistSystem _whitelistSystem; private readonly EntityWhitelistSystem _whitelistSystem;
@@ -89,8 +87,6 @@ namespace Content.Client.Construction.UI
{ {
// This is a lot easier than a factory // This is a lot easier than a factory
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_sawmill = _logManager.GetSawmill("construction.menu");
_constructionView = new ConstructionMenu(); _constructionView = new ConstructionMenu();
_whitelistSystem = _entManager.System<EntityWhitelistSystem>(); _whitelistSystem = _entManager.System<EntityWhitelistSystem>();
_spriteSystem = _entManager.System<SpriteSystem>(); _spriteSystem = _entManager.System<SpriteSystem>();
@@ -288,7 +284,7 @@ namespace Content.Client.Construction.UI
if (!_constructionSystem!.TryGetRecipePrototype(recipe.ID, out var targetProtoId)) if (!_constructionSystem!.TryGetRecipePrototype(recipe.ID, out var targetProtoId))
{ {
_sawmill.Error("Cannot find the target prototype in the recipe cache with the id \"{0}\" of {1}.", Logger.Error("Cannot find the target prototype in the recipe cache with the id \"{0}\" of {1}.",
recipe.ID, recipe.ID,
nameof(ConstructionPrototype)); nameof(ConstructionPrototype));
continue; continue;

View File

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

View File

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

View File

@@ -34,7 +34,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
_crayon = crayon; _crayon = crayon;
_charges = charges; _charges = charges;
_capacity = entityManage.GetComponent<LimitedChargesComponent>(_crayon.Owner).MaxCharges; _capacity = entityManage.GetComponent<LimitedChargesComponent>(_crayon.Owner).MaxCharges;
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } }; _label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
AddChild(_label); AddChild(_label);
} }

View File

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

View File

@@ -258,7 +258,7 @@ public sealed partial class CreditsWindow : DefaultWindow
foreach (var entry in CreditsManager.GetLicenses(_resourceManager).OrderBy(p => p.Name)) foreach (var entry in CreditsManager.GetLicenses(_resourceManager).OrderBy(p => p.Name))
{ {
licensesContainer.AddChild(new Label licensesContainer.AddChild(new Label
{ StyleClasses = { StyleBase.StyleClassLabelHeading }, Text = entry.Name }); { StyleClasses = { StyleClass.LabelHeading }, Text = entry.Name });
// We split these line by line because otherwise // We split these line by line because otherwise
// the LGPL causes Clyde to go out of bounds in the rendering code. // 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; first = false;
patronsContainer.AddChild(new Label 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)); 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; first = false;
ss14ContributorsContainer.AddChild(new Label ss14ContributorsContainer.AddChild(new Label
{ StyleClasses = { StyleBase.StyleClassLabelHeading }, Text = title }); { StyleClasses = { StyleClass.LabelHeading }, Text = title });
var label = new RichTextLabel(); var label = new RichTextLabel();
var text = _resourceManager.ContentFileReadAllText($"/Credits/{path}"); var text = _resourceManager.ContentFileReadAllText($"/Credits/{path}");

View File

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

View File

@@ -1,5 +1,6 @@
using System.Linq; using System.Linq;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;

View File

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

View File

@@ -47,7 +47,7 @@
Access="Public" Access="Public"
Text="{Loc 'ui-disposal-unit-button-eject'}" Text="{Loc 'ui-disposal-unit-button-eject'}"
StyleClasses="OpenBoth" /> StyleClasses="OpenBoth" />
<CheckButton Name="Power" <Button Name="Power"
Access="Public" Access="Public"
Text="{Loc 'ui-disposal-unit-button-power'}" Text="{Loc 'ui-disposal-unit-button-power'}"
StyleClasses="OpenLeft" /> StyleClasses="OpenLeft" />

View File

@@ -34,7 +34,7 @@
Access="Public" Access="Public"
Text="{Loc 'ui-disposal-unit-button-eject'}" Text="{Loc 'ui-disposal-unit-button-eject'}"
StyleClasses="OpenBoth" /> StyleClasses="OpenBoth" />
<CheckButton Name="Power" <Button Name="Power"
Access="Public" Access="Public"
Text="{Loc 'ui-disposal-unit-button-power'}" Text="{Loc 'ui-disposal-unit-button-power'}"
StyleClasses="OpenLeft" /> StyleClasses="OpenLeft" />

View File

@@ -68,7 +68,7 @@ public sealed class DoorSystem : SharedDoorSystem
{ {
new AnimationTrackSpriteFlick new AnimationTrackSpriteFlick
{ {
LayerKey = DoorVisualLayers.BaseUnlit, LayerKey = DoorVisualLayers.BaseEmagging,
KeyFrames = KeyFrames =
{ {
new AnimationTrackSpriteFlick.KeyFrame(comp.EmaggingSpriteState, 0f), new AnimationTrackSpriteFlick.KeyFrame(comp.EmaggingSpriteState, 0f),
@@ -92,6 +92,10 @@ public sealed class DoorSystem : SharedDoorSystem
if (_animationSystem.HasRunningAnimation(entity, DoorComponent.AnimationKey)) if (_animationSystem.HasRunningAnimation(entity, DoorComponent.AnimationKey))
_animationSystem.Stop(entity.Owner, 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); UpdateAppearanceForDoorState(entity, args.Sprite, state);
} }
@@ -134,7 +138,9 @@ public sealed class DoorSystem : SharedDoorSystem
return; return;
case DoorState.Emagging: 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; return;
} }

View File

@@ -27,6 +27,15 @@ public sealed class DrunkOverlay : Overlay
private const float VisualThreshold = 10.0f; private const float VisualThreshold = 10.0f;
private const float PowerDivisor = 250.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; private float _visualScale = 0;
@@ -50,15 +59,9 @@ public sealed class DrunkOverlay : Overlay
var time = status.Item2; 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) CurrentBoozePower += BoozePowerScale * (power - CurrentBoozePower) * args.DeltaSeconds / (power+1);
{
var curTime = _timing.CurTime;
power = (float) (time - curTime).Value.TotalSeconds;
}
CurrentBoozePower += 8f * (power * 0.5f - CurrentBoozePower) * args.DeltaSeconds / (power+1);
} }
protected override bool BeforeDraw(in OverlayDrawArgs args) protected override bool BeforeDraw(in OverlayDrawArgs args)

View File

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

View File

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

View File

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

View File

@@ -15,48 +15,29 @@ public sealed class TitleWindowManager
public void Initialize() public void Initialize()
{ {
_cfg.OnValueChanged(CVars.GameHostName, OnHostnameChange, true); _cfg.OnValueChanged(CVars.GameHostName, _ => OnHostnameChange(), true);
_cfg.OnValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange, true); _cfg.OnValueChanged(CCVars.GameHostnameInTitlebar, _ => OnHostnameChange(), true);
_client.RunLevelChanged += OnRunLevelChangedChange; _client.RunLevelChanged += (_, _) => OnHostnameChange();
} }
public void Shutdown() private void OnHostnameChange()
{
_cfg.UnsubValueChanged(CVars.GameHostName, OnHostnameChange);
_cfg.UnsubValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange);
}
private void OnHostnameChange(string hostname)
{ {
var defaultWindowTitle = _gameController.GameTitle(); var defaultWindowTitle = _gameController.GameTitle();
// Since the game assumes the server name is MyServer and that GameHostnameInTitlebar CCVar is true by default // When the client starts connecting, it will be using either the default hostname, or whatever hostname
// Lets just... not show anything. This also is used to revert back to just the game title on disconnect. // is set in its config file (aka the last server they connected to) until it receives the latest cvars.
if (_client.RunLevel == ClientRunLevel.Initialize) // 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); _clyde.SetWindowTitle(defaultWindowTitle);
return; return;
} }
if (_cfg.GetCVar(CCVars.GameHostnameInTitlebar)) _clyde.SetWindowTitle(
// If you really dislike the dash I guess change it here _cfg.GetCVar(CCVars.GameHostnameInTitlebar)
_clyde.SetWindowTitle(hostname + " - " + defaultWindowTitle); ? _cfg.GetCVar(CVars.GameHostName) + " - " + defaultWindowTitle
else : defaultWindowTitle);
_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));
} }
// 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()) if (Pressable())
{ {
openButton.AddStyleClass(StyleBase.ButtonCaution); openButton.AddStyleClass(StyleClass.Negative);
} }
var buttonContainer = new BoxContainer() var buttonContainer = new BoxContainer()

View File

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

@@ -7,6 +7,7 @@ using Robust.Client.UserInterface;
using Robust.Shared.ContentPack; using Robust.Shared.ContentPack;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Reflection; using Robust.Shared.Reflection;
using Robust.Shared.Sandboxing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using static Pidgin.Parser; using static Pidgin.Parser;
@@ -20,7 +21,7 @@ public sealed partial class DocumentParsingManager
[Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IReflectionManager _reflectionManager = default!; [Dependency] private readonly IReflectionManager _reflectionManager = default!;
[Dependency] private readonly IResourceManager _resourceManager = default!; [Dependency] private readonly IResourceManager _resourceManager = default!;
[Dependency] private readonly IDynamicTypeFactory _dynamicTypeFactory = default!; [Dependency] private readonly ISandboxHelper _sandboxHelper = default!;
private readonly Dictionary<string, Parser<char, Control>> _tagControlParsers = new(); private readonly Dictionary<string, Parser<char, Control>> _tagControlParsers = new();
private Parser<char, Control> _controlParser = default!; private Parser<char, Control> _controlParser = default!;
@@ -42,7 +43,7 @@ public sealed partial class DocumentParsingManager
foreach (var typ in _reflectionManager.GetAllChildren<IDocumentTag>()) foreach (var typ in _reflectionManager.GetAllChildren<IDocumentTag>())
{ {
_tagControlParsers.Add(typ.Name, CreateTagControlParser(typ.Name, typ, _dynamicTypeFactory)); _tagControlParsers.Add(typ.Name, CreateTagControlParser(typ.Name, typ, _sandboxHelper));
} }
ControlParser = whitespaceAndCommentParser.Then(_controlParser.Many()); ControlParser = whitespaceAndCommentParser.Then(_controlParser.Many());
@@ -86,14 +87,14 @@ public sealed partial class DocumentParsingManager
return true; return true;
} }
private Parser<char, Control> CreateTagControlParser(string tagId, Type tagType, IDynamicTypeFactory typeFactory) private Parser<char, Control> CreateTagControlParser(string tagId, Type tagType, ISandboxHelper sandbox)
{ {
return Map( return Map(
(args, controls) => (args, controls) =>
{ {
try try
{ {
var tag = (IDocumentTag) typeFactory.CreateInstance(tagType); var tag = (IDocumentTag) sandbox.CreateInstance(tagType);
if (!tag.TryParseTag(args, out var control)) if (!tag.TryParseTag(args, out var control))
{ {
_sawmill.Error($"Failed to parse {tagId} args"); _sawmill.Error($"Failed to parse {tagId} args");

View File

@@ -8,11 +8,6 @@ namespace Content.Client.Guidebook.Richtext;
[UsedImplicitly] [UsedImplicitly]
public sealed class Table : TableContainer, IDocumentTag public sealed class Table : TableContainer, IDocumentTag
{ {
[Dependency] private readonly ILogManager _logManager = default!;
private ISawmill Sawmill => _sawmill ??= _logManager.GetSawmill("table");
private ISawmill? _sawmill;
public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control) public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control)
{ {
HorizontalExpand = true; HorizontalExpand = true;
@@ -20,7 +15,7 @@ public sealed class Table : TableContainer, IDocumentTag
if (!args.TryGetValue("Columns", out var columns) || !int.TryParse(columns, out var columnsCount)) if (!args.TryGetValue("Columns", out var columns) || !int.TryParse(columns, out var columnsCount))
{ {
Sawmill.Error("Guidebook tag \"Table\" does not specify required property \"Columns.\""); Logger.Error("Guidebook tag \"Table\" does not specify required property \"Columns.\"");
control = null; control = null;
return false; return false;
} }

View File

@@ -1,4 +1,4 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
@@ -12,11 +12,6 @@ namespace Content.Client.Guidebook.RichText;
[UsedImplicitly] [UsedImplicitly]
public sealed class TextLinkTag : IMarkupTagHandler public sealed class TextLinkTag : IMarkupTagHandler
{ {
[Dependency] private readonly ILogManager _logManager = default!;
private ISawmill Sawmill => _sawmill ??= _logManager.GetSawmill(Name);
private ISawmill? _sawmill;
public static Color LinkColor => Color.CornflowerBlue; public static Color LinkColor => Color.CornflowerBlue;
public string Name => "textlink"; public string Name => "textlink";
@@ -58,7 +53,7 @@ public sealed class TextLinkTag : IMarkupTagHandler
if (control.TryGetParentHandler<ILinkClickHandler>(out var handler)) if (control.TryGetParentHandler<ILinkClickHandler>(out var handler))
handler.HandleClick(link); handler.HandleClick(link);
else else
Sawmill.Warning("Warning! No valid ILinkClickHandler found."); Logger.Warning("Warning! No valid ILinkClickHandler found.");
} }
} }

View File

@@ -1,29 +1,23 @@
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using Content.Client.Message;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Content.Shared._Offbrand.Wounds; // Offbrand using Content.Shared._Offbrand.Wounds; // Offbrand
using Content.Shared.Alert; using Content.Shared.Damage.Components;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Content.Shared.Humanoid; using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Prototypes; using Content.Shared.Humanoid.Prototypes;
using Content.Shared.IdentityManagement; using Content.Shared.IdentityManagement;
using Content.Shared.Inventory;
using Content.Shared.MedicalScanner; using Content.Shared.MedicalScanner;
using Content.Shared.Mobs; using Content.Shared.Mobs;
using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Nutrition.Components;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.ResourceManagement; using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Utility; using Robust.Shared.Utility;

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
<Button Name="AllButton" Text="{Loc 'instruments-component-channels-all-button'}" HorizontalExpand="true" VerticalExpand="true" SizeFlagsStretchRatio="1"/> <Button Name="AllButton" Text="{Loc 'instruments-component-channels-all-button'}" HorizontalExpand="true" VerticalExpand="true" SizeFlagsStretchRatio="1"/>
<Button Name="ClearButton" Text="{Loc 'instruments-component-channels-clear-button'}" HorizontalExpand="true" VerticalExpand="true" SizeFlagsStretchRatio="1"/> <Button Name="ClearButton" Text="{Loc 'instruments-component-channels-clear-button'}" HorizontalExpand="true" VerticalExpand="true" SizeFlagsStretchRatio="1"/>
</BoxContainer> </BoxContainer>
<CheckButton Name="DisplayTrackNames" <Button Name="DisplayTrackNames"
Text="{Loc 'instruments-component-channels-track-names-toggle'}" /> Text="{Loc 'instruments-component-channels-track-names-toggle'}" />
</BoxContainer> </BoxContainer>
</DefaultWindow> </DefaultWindow>

View File

@@ -154,7 +154,7 @@ namespace Content.Client.Inventory
var button = new Button() var button = new Button()
{ {
Text = Loc.GetString("strippable-bound-user-interface-stripping-menu-ensnare-button"), Text = Loc.GetString("strippable-bound-user-interface-stripping-menu-ensnare-button"),
StyleClasses = { StyleBase.ButtonOpenRight } StyleClasses = { StyleClass.ButtonOpenRight }
}; };
button.OnPressed += (_) => SendPredictedMessage(new StrippingEnsnareButtonPressed()); button.OnPressed += (_) => SendPredictedMessage(new StrippingEnsnareButtonPressed());
@@ -190,7 +190,7 @@ namespace Content.Client.Inventory
if (EntMan.TryGetComponent<VirtualItemComponent>(heldEntity, out var virt)) if (EntMan.TryGetComponent<VirtualItemComponent>(heldEntity, out var virt))
{ {
button.Blocked = true; button.Blocked = true;
if (EntMan.TryGetComponent<CuffableComponent>(Owner, out var cuff) && _cuffable.GetAllCuffs(cuff).Contains(virt.BlockingEntity)) if (_cuffable.TryGetAllCuffs(Owner, out var cuffs) && cuffs.Contains(virt.BlockingEntity))
button.BlockedRect.MouseFilter = MouseFilterMode.Ignore; button.BlockedRect.MouseFilter = MouseFilterMode.Ignore;
} }

View File

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

View File

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

View File

@@ -1,8 +1,14 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Loc 'hand-labeler-ui-header'}"> Title="{Loc 'hand-labeler-ui-header'}"
<BoxContainer Orientation="Vertical" SeparationOverride="4" MinWidth="150"> SetWidth="400"
MinWidth="150">
<BoxContainer Orientation="Vertical" SeparationOverride="4">
<Label Name="CurrentTextLabel" Text="{Loc 'hand-labeler-current-text-label'}" /> <Label Name="CurrentTextLabel" Text="{Loc 'hand-labeler-current-text-label'}" />
<LineEdit Name="LabelLineEdit" /> <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> </BoxContainer>
</DefaultWindow> </DefaultWindow>

View File

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

View File

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

View File

@@ -20,9 +20,7 @@ namespace Content.Client.Launcher
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IClipboardManager _clipboard = default!; [Dependency] private readonly IClipboardManager _clipboard = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private ISawmill _sawmill = default!;
private LauncherConnectingGui? _control; private LauncherConnectingGui? _control;
private Page _currentPage; private Page _currentPage;
@@ -61,8 +59,6 @@ namespace Content.Client.Launcher
protected override void Startup() protected override void Startup()
{ {
_sawmill = _logManager.GetSawmill("launcher-ui");
_control = new LauncherConnectingGui(this, _random, _prototypeManager, _cfg, _clipboard); _control = new LauncherConnectingGui(this, _random, _prototypeManager, _cfg, _clipboard);
_userInterfaceManager.StateRoot.AddChild(_control); _userInterfaceManager.StateRoot.AddChild(_control);
@@ -119,12 +115,12 @@ namespace Content.Client.Launcher
} }
else else
{ {
_sawmill.Info($"Redial not possible, no Ss14Address"); Logger.InfoS("launcher-ui", $"Redial not possible, no Ss14Address");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
_sawmill.Error($"Redial exception: {ex}"); Logger.ErrorS("launcher-ui", $"Redial exception: {ex}");
} }
return false; return false;
} }

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,8 +6,8 @@ using Content.Client.Lobby.UI.Loadouts;
using Content.Client.Lobby.UI.Roles; using Content.Client.Lobby.UI.Roles;
using Content.Client.Message; using Content.Client.Message;
using Content.Client.Players.PlayTimeTracking; using Content.Client.Players.PlayTimeTracking;
using Content.Client.Sprite;
using Content.Client.Stylesheets; using Content.Client.Stylesheets;
using Content.Client.Sprite;
using Content.Client.UserInterface.Systems.Guidebook; using Content.Client.UserInterface.Systems.Guidebook;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Clothing; using Content.Shared.Clothing;
@@ -539,7 +539,7 @@ namespace Content.Client.Lobby.UI
{ {
Text = Loc.GetString(category.Name), Text = Loc.GetString(category.Name),
Margin = new Thickness(0, 10, 0, 0), Margin = new Thickness(0, 10, 0, 0),
StyleClasses = { StyleBase.StyleClassLabelHeading }, StyleClasses = { StyleClass.LabelHeading },
}); });
} }
@@ -607,6 +607,7 @@ namespace Content.Client.Lobby.UI
_species.Clear(); _species.Clear();
_species.AddRange(_prototypeManager.EnumeratePrototypes<SpeciesPrototype>().Where(o => o.RoundStart)); _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(); var speciesIds = _species.Select(o => o.ID).ToList();
for (var i = 0; i < _species.Count; i++) for (var i = 0; i < _species.Count; i++)
@@ -1347,7 +1348,7 @@ namespace Content.Client.Lobby.UI
return; return;
const string style = "SpeciesInfoDefault"; const string style = "SpeciesInfoDefault";
SpeciesInfoButton.StyleClasses.Add(style); SpeciesInfoButton.StyleIdentifier = style;
} }
private void UpdateMarkings() 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" <BoxContainer xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Orientation="Vertical"> 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"/> <BoxContainer Name="LoadoutsContainer" Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True"/>
</PanelContainer> </PanelContainer>
<!-- Buffer space so we have 10 margin between controls but also 10 to the borders --> <!-- Buffer space so we have 10 margin between controls but also 10 to the borders -->

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