Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 9/21/2024 #69

Merged
merged 149 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
6ecc1f8
Automatic Changelog Update (#879)
SimpleStation14 Sep 7, 2024
5fd26be
Automatic Changelog Update (#875)
SimpleStation14 Sep 7, 2024
93e3ba6
Update discord-changelog.yml (#881)
DEATHB4DEFEAT Sep 7, 2024
ee3274b
[Feature] Shortcut Construction System (#861)
Remuchi Sep 7, 2024
9aa0038
Automatic Changelog Update (#861)
SimpleStation14 Sep 7, 2024
266aef8
Update gloves.yml (#860)
Evgencheg Sep 7, 2024
bc17a0d
Update Credits (#887)
github-actions[bot] Sep 8, 2024
0ab7da1
Default TOML File (#818)
VMSolidus Sep 8, 2024
9dd569d
Make Height Sliders Affect Your Bloodstream Volume (#858)
Mnemotechnician Sep 8, 2024
5c48a1e
Disable Quick Swap for Item Slots by Default (#856)
Mnemotechnician Sep 8, 2024
1580c4e
Automatic Changelog Update (#858)
SimpleStation14 Sep 8, 2024
d7b6c82
Fixed some Comment Syntax (#851)
SleepyScarecrow Sep 8, 2024
da02682
Add New Nuke Music (#850)
BasedUser Sep 8, 2024
d3eeaba
Change Slime Scream (#849)
BasedUser Sep 8, 2024
a5ee726
Automatic Changelog Update (#856)
SimpleStation14 Sep 8, 2024
50f3f79
Make Hugging/Petting Interactions Affect Mood (#823)
Mnemotechnician Sep 8, 2024
23f1b4e
Display Language Fonts/Colors in Chat Bubbles (#812)
Mnemotechnician Sep 8, 2024
4ba3984
Automatic Changelog Update (#849)
SimpleStation14 Sep 8, 2024
e14b140
Oscillating Event Scheduler (#796)
Mnemotechnician Sep 8, 2024
8f0d160
TraitSystem Component Removals (Anomalous Positronics Trait) (#885)
VMSolidus Sep 8, 2024
08be023
Cherry-Pick "Shrimp Mob for Metempsychosis (#862)" (#882)
Mnemotechnician Sep 8, 2024
a33f392
Automatic Changelog Update (#812)
SimpleStation14 Sep 8, 2024
be2907f
Automatic Changelog Update (#882)
SimpleStation14 Sep 8, 2024
0442fa3
Fix Translators Not Working Correctly Under Certain Conditions (#834)
Mnemotechnician Sep 8, 2024
32b0166
Automatic Changelog Update (#834)
SimpleStation14 Sep 8, 2024
7a592e9
Re-Enable Recycler Gibbing (#822)
VMSolidus Sep 8, 2024
7fc3c07
Adds a Toy Which Makes Bwoink Sound (#759)
BlueHNT Sep 8, 2024
7d0cbc6
Automatic Changelog Update (#822)
SimpleStation14 Sep 8, 2024
272ae47
AddPsionicPower Command (#807)
VMSolidus Sep 8, 2024
7235684
Automatic Changelog Update (#759)
SimpleStation14 Sep 8, 2024
01c94a1
Automatic Changelog Update (#807)
SimpleStation14 Sep 8, 2024
f8027b5
Fix Maps Missing Assistants (#838)
VMSolidus Sep 9, 2024
06771ea
Nerf Default Power Attack (#866)
VMSolidus Sep 9, 2024
d82aa20
Automatic Changelog Update (#838)
SimpleStation14 Sep 9, 2024
874f4f7
Update Clothing Assignments of Suit/Skirt (#857)
Tirochora Sep 9, 2024
d37c7ee
Re-Enable Arrivals (#871)
VMSolidus Sep 9, 2024
aec137a
Automatic Changelog Update (#866)
SimpleStation14 Sep 9, 2024
058650e
Americanize Contests System (#814)
VMSolidus Sep 9, 2024
d0c5110
Step Trigger Minor Refactor (#884)
VMSolidus Sep 9, 2024
7bdec1c
Automatic Changelog Update (#871)
SimpleStation14 Sep 9, 2024
ff1dc64
Automatic Changelog Update (#884)
SimpleStation14 Sep 9, 2024
cd3c598
Fix Logic Requirements Not Checking Inversion (#891)
DEATHB4DEFEAT Sep 9, 2024
a0c225d
Split Arm And Leg Markings (#870)
VMSolidus Sep 9, 2024
bb8df4d
Automatic Changelog Update (#870)
SimpleStation14 Sep 9, 2024
182f9a3
Revert Revert Antag Refactor With Fixes (#794)
VMSolidus Sep 9, 2024
eeaf639
Automatic Changelog Update (#794)
SimpleStation14 Sep 9, 2024
88451f1
Hotfix Linter (#894)
VMSolidus Sep 9, 2024
1dcb1c2
Food Recipe Guidebook (#783)
Mnemotechnician Sep 11, 2024
2384e9c
Automatic Changelog Update (#783)
SimpleStation14 Sep 11, 2024
c83c55e
Uncomment Rat King (#903)
VMSolidus Sep 11, 2024
2e80ed4
Jetpack Server Configuration (#901)
VMSolidus Sep 11, 2024
6a40446
Automatic Changelog Update (#903)
SimpleStation14 Sep 11, 2024
ea88caf
Medical Loadout Groups (#902)
VMSolidus Sep 11, 2024
fdd00e7
Automatic Changelog Update (#901)
SimpleStation14 Sep 11, 2024
4d82754
Penlight-Fixes (#900)
SleepyScarecrow Sep 11, 2024
0fa1fbf
Automatic Changelog Update (#902)
SimpleStation14 Sep 11, 2024
2a59ad3
Fix Languages Again (#893)
Mnemotechnician Sep 11, 2024
9fe62d8
Automatic Changelog Update (#900)
SimpleStation14 Sep 11, 2024
6143cc2
Automatic Changelog Update (#893)
SimpleStation14 Sep 11, 2024
601073c
Cargo Loadout Groups (#909)
gluesniffler Sep 11, 2024
fb6b08a
Automatic Changelog Update (#909)
SimpleStation14 Sep 11, 2024
349d9b7
Security Loadout Groups (#908)
gluesniffler Sep 11, 2024
3334564
Automatic Changelog Update (#908)
SimpleStation14 Sep 11, 2024
069c187
Service & Instrument Loadout Groups (#906)
gluesniffler Sep 11, 2024
82997f9
Automatic Changelog Update (#906)
SimpleStation14 Sep 11, 2024
cda8a79
Engineering Loadout Groups (#907)
gluesniffler Sep 11, 2024
8b3534a
Automatic Changelog Update (#907)
SimpleStation14 Sep 11, 2024
d14ec7b
Reverse Engineering Update Pr Port/ Board Cost Balance (#910)
Squishy77 Sep 12, 2024
871d723
Automatic Changelog Update (#910)
SimpleStation14 Sep 12, 2024
2ba9c9c
Alcohol Ethanol Content Fix (#911)
SleepyScarecrow Sep 12, 2024
ebb4b2e
Automatic Changelog Update (#911)
SimpleStation14 Sep 12, 2024
67a17ae
Port Delta-V Jukebox Additions (#912)
Mnemotechnician Sep 12, 2024
093ab48
Make Blood Deficiency Bloodloss Consistent (#895)
angelofallars Sep 12, 2024
1482e54
Automatic Changelog Update (#912)
SimpleStation14 Sep 12, 2024
61bb6ea
Automatic Changelog Update (#895)
SimpleStation14 Sep 12, 2024
97e7f1e
Add Access Wire to Airlocks (#916)
stellar-novas Sep 14, 2024
ea22022
Automatic Changelog Update (#916)
SimpleStation14 Sep 14, 2024
5e4e4b1
Science Loadout Groups + Command Cost Adjustments (#914)
gluesniffler Sep 14, 2024
4f601f5
Automatic Changelog Update (#914)
SimpleStation14 Sep 14, 2024
b35e63b
Bartender Loadout Groups (Also Item Group Localizations) (#915)
VMSolidus Sep 14, 2024
ca4ea41
Automatic Changelog Update (#915)
SimpleStation14 Sep 14, 2024
8b93cec
Cherry-Pick #28077 (#898)
VMSolidus Sep 14, 2024
9b7d531
Slight Starting Gear Changes. (#897)
CilliePaint Sep 14, 2024
c0ca58b
Automatic Changelog Update (#897)
SimpleStation14 Sep 14, 2024
c49ce78
User-Friendly Sprinting (#889)
Mnemotechnician Sep 14, 2024
53fdceb
Automatic Changelog Update (#889)
SimpleStation14 Sep 14, 2024
5f7475d
Chemical Moodlets (And Drug Addictions!) (#896)
VMSolidus Sep 14, 2024
8824b51
Automatic Changelog Update (#896)
SimpleStation14 Sep 14, 2024
63ec69b
Fix #864 and Rehydratable System Doing Client-Side Spawn (#888)
Mnemotechnician Sep 14, 2024
8adc3b9
Automatic Changelog Update (#888)
SimpleStation14 Sep 14, 2024
fbc4698
Hotfix Shortconstructionmenu Radius Becoming Infinite (#890)
Mnemotechnician Sep 14, 2024
4419aaa
Nerf Uncloneable (#868)
VMSolidus Sep 14, 2024
956b334
Automatic Changelog Update (#868)
SimpleStation14 Sep 14, 2024
41a8b1b
Weather Block Marker, Rad Markers and Invisible Walls (#862)
Peptide90 Sep 14, 2024
82deba4
Harpy Flight System (#919)
gluesniffler Sep 16, 2024
2f5e697
Automatic Changelog Update (#919)
SimpleStation14 Sep 16, 2024
5004cf8
Physical Pulling (#883)
Mnemotechnician Sep 17, 2024
b65a5d8
Core Fullsize (Underfueled) AME (#927)
VMSolidus Sep 17, 2024
3dc28cf
Automatic Changelog Update (#883)
SimpleStation14 Sep 17, 2024
0079259
Automatic Changelog Update (#927)
SimpleStation14 Sep 17, 2024
2f8d9e8
Fixes to Bench and Barber Chair Rotation (#925)
Flybik Sep 17, 2024
34d9e0d
Re-Adds Fireaxe Prying (#921)
zelezniciar1 Sep 17, 2024
ff618e9
Automatic Changelog Update (#925)
SimpleStation14 Sep 17, 2024
f5275e2
9 More Traits (#918)
VMSolidus Sep 17, 2024
3dd57ca
Open Market Tacsuits (#845)
VMSolidus Sep 17, 2024
9e293ea
Psionic Power Rolling Rework (#830)
VMSolidus Sep 17, 2024
a553909
IPC Refactor (#771)
VMSolidus Sep 17, 2024
ca88477
Automatic Changelog Update (#921)
SimpleStation14 Sep 17, 2024
46cbafa
Filespace ContestsSystem.cs (#931)
VMSolidus Sep 18, 2024
364b237
Fix Uncloneable Feedback Message (#926)
VMSolidus Sep 18, 2024
4d4afb6
Automatic Changelog Update (#926)
SimpleStation14 Sep 18, 2024
d5f0c55
Better Lying Down System (From White Dream) (#815)
VMSolidus Sep 19, 2024
a8e435c
Automatic Changelog Update (#815)
SimpleStation14 Sep 19, 2024
2bfbc72
Remove DeltaV Options (#928)
FoxxoTrystan Sep 19, 2024
0cf7803
Automatic Changelog Update (#928)
SimpleStation14 Sep 19, 2024
d6dd2ea
Fix SpawnAndDeleteAllEntities (#932)
VMSolidus Sep 19, 2024
dee5a40
[Port] StepTriggerGroup From WhiteDream (#929)
VMSolidus Sep 19, 2024
6d1aae9
Automatic Changelog Update (#929)
SimpleStation14 Sep 19, 2024
0aa49c1
Fix Laying Down Bugs (#933)
VMSolidus Sep 19, 2024
7bce1e9
Automatic Changelog Update (#933)
SimpleStation14 Sep 19, 2024
8b5dcd6
Non-Destructive Universal Language (#899)
VMSolidus Sep 20, 2024
80daa94
Automatic Changelog Update (#899)
SimpleStation14 Sep 20, 2024
7119dd0
NyanoCombat Part 4: MeleeSystem Refactor Part 2, Electric Boogaloo (#…
VMSolidus Sep 20, 2024
c1aef1b
Automatic Changelog Update (#934)
SimpleStation14 Sep 20, 2024
b01ae70
Allow Crawling Entities To Go Under Tables (#939)
gluesniffler Sep 20, 2024
7ff002a
Automatic Changelog Update (#939)
SimpleStation14 Sep 20, 2024
14d8f81
Melee Part 5: Less Exhaustion (#938)
OldDanceJacket Sep 20, 2024
6a653c5
Automatic Changelog Update (#938)
SimpleStation14 Sep 20, 2024
104ee3e
Variable NPC Juke Aggression (#935)
VMSolidus Sep 20, 2024
68772a8
Automatic Changelog Update (#935)
SimpleStation14 Sep 20, 2024
981c4f6
Update SetOutfitCommand.cs (#941)
VMSolidus Sep 20, 2024
81bbf6b
Longarms Require Wielding (#913)
VMSolidus Sep 20, 2024
82f4971
Automatic Changelog Update (#913)
SimpleStation14 Sep 20, 2024
328d71a
Ports Atmospheric Alerts Computer (#922)
zelezniciar1 Sep 20, 2024
def63b6
Basic Language Menu (#936)
VMSolidus Sep 20, 2024
20158ff
Automatic Changelog Update (#922)
SimpleStation14 Sep 20, 2024
5247c97
Remove Become Psionic Objective (#940)
VMSolidus Sep 20, 2024
cce7e3f
Automatic Changelog Update (#936)
SimpleStation14 Sep 20, 2024
75c39d5
Automatic Changelog Update (#940)
SimpleStation14 Sep 20, 2024
0e187aa
Update Credits (#923)
github-actions[bot] Sep 21, 2024
49d128c
Reimplement Part Upgrading (#917)
VMSolidus Sep 21, 2024
f126bb4
[Port] Uplink Discounts From White Dream (#930)
VMSolidus Sep 21, 2024
331d68d
Automatic Changelog Update (#917)
SimpleStation14 Sep 21, 2024
1b43123
Automatic Changelog Update (#930)
SimpleStation14 Sep 21, 2024
61e1c8c
Psionic "Heal Other" Powers (#942)
VMSolidus Sep 21, 2024
272b4ec
Automatic Changelog Update (#942)
SimpleStation14 Sep 21, 2024
5bf5d57
More Objects Hit By Projectiles (#943)
VMSolidus Sep 21, 2024
900630c
Automatic Changelog Update (#943)
SimpleStation14 Sep 21, 2024
2e20bb9
Merge remote-tracking branch 'EE-Master/master' into Update-9/21/2024
VMSolidus Sep 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/discord-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ jobs:
env:
CHANGELOG_DIR: ${{ vars.CHANGELOG_DIR }}
CHANGELOG_WEBHOOK: ${{ secrets.CHANGELOG_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
continue-on-error: true
2 changes: 1 addition & 1 deletion Content.Benchmarks/SpawnEquipDeleteBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ await _pair.Server.WaitPost(() =>
for (var i = 0; i < N; i++)
{
_entity = server.EntMan.SpawnAttachedTo(Mob, _coords);
_spawnSys.EquipStartingGear(_entity, _gear, null);
_spawnSys.EquipStartingGear(_entity, _gear);
server.EntMan.DeleteEntity(_entity);
}
});
Expand Down
81 changes: 81 additions & 0 deletions Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<BoxContainer xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Content.Client.Stylesheets"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Orientation="Vertical" HorizontalExpand ="True" Margin="0 0 0 3">

<!-- Device selection button -->
<Button Name="FocusButton" HorizontalExpand="True" SetHeight="32" Margin="12 0 0 0" StyleClasses="OpenBoth" Access="Public">
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Horizontal">

<!-- Alarm state -->
<TextureRect Stretch="Keep" HorizontalAlignment="Left" Margin="-20 -2 0 0" ModulateSelfOverride="#25252a" TexturePath="/Textures/Interface/AtmosMonitoring/status_bg.png">
<BoxContainer VerticalExpand="True" HorizontalExpand="True" Orientation="Horizontal" Margin="8 0">
<TextureRect Name="ArrowTexture" VerticalAlignment="Center" SetSize="12 12" Stretch="KeepAspectCentered" Margin="3 0" TexturePath="/Textures/Interface/Nano/triangle_right.png"></TextureRect>
<Label Name="AlarmStateLabel" HorizontalExpand="True" HorizontalAlignment="Center" FontColorOverride="#5A5A5A" Text="{Loc 'atmos-alerts-window-invalid-state'}"></Label>
</BoxContainer>
</TextureRect>

<!-- Alarm name -->
<Label Name="AlarmNameLabel" Text="???" HorizontalExpand="True" HorizontalAlignment="Center" Margin="5 0"></Label>
</BoxContainer>
</Button>

<!-- Panel that appears on selecting the device -->
<PanelContainer Name="FocusContainer" HorizontalExpand="True" Margin="1 -1 1 0" ReservesSpace="False" Visible="False" Access="Public">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#25252a"/>
</PanelContainer.PanelOverride>
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Vertical">

<!-- Atmosphere status -->
<Control>

<!-- Main container for displaying atmospheric data -->
<BoxContainer Name="MainDataContainer" HorizontalExpand="True" VerticalExpand="True" Orientation="Vertical" ReservesSpace="False" Visible="False">
<BoxContainer HorizontalExpand="True" Orientation="Horizontal">
<Label Name="TemperatureHeaderLabel" Text="{Loc 'atmos-alerts-window-temperature-label'}" HorizontalAlignment="Center" HorizontalExpand="True" FontColorOverride="#a9a9a9" Margin="0 2 0 0" SetHeight="24"></Label>
<Label Name="PressureHeaderLabel" Text="{Loc 'atmos-alerts-window-pressure-label'}" HorizontalAlignment="Center" HorizontalExpand="True" FontColorOverride="#a9a9a9" Margin="0 2 0 0" SetHeight="24"></Label>
<Label Name="OxygenationHeaderLabel" Text="{Loc 'atmos-alerts-window-oxygenation-label'}" HorizontalAlignment="Center" HorizontalExpand="True" FontColorOverride="#a9a9a9" Margin="0 2 0 0" SetHeight="24"></Label>
</BoxContainer>
<PanelContainer HorizontalExpand="True">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#202023"/>
</PanelContainer.PanelOverride>
<BoxContainer HorizontalExpand="True" Orientation="Horizontal">
<Label Name="TemperatureLabel" Text="???" HorizontalAlignment="Center" HorizontalExpand="True" FontColorOverride="#5A5A5A" Margin="0 2 0 0" SetHeight="24"></Label>
<Label Name="PressureLabel" Text="???" HorizontalAlignment="Center" HorizontalExpand="True" FontColorOverride="#5A5A5A" Margin="0 2 0 0" SetHeight="24"></Label>
<Label Name="OxygenationLabel" Text="???" HorizontalAlignment="Center" HorizontalExpand="True" FontColorOverride="#5A5A5A" Margin="0 2 0 0" SetHeight="24"></Label>
</BoxContainer>
</PanelContainer>
<BoxContainer HorizontalExpand="True" Orientation="Horizontal">
<Label Name="GasesHeaderLabel" Text="{Loc 'atmos-alerts-window-other-gases-label'}" HorizontalAlignment="Center" HorizontalExpand="True" FontColorOverride="#a9a9a9" Margin="0 4 0 0" SetHeight="24"></Label>
</BoxContainer>
<PanelContainer HorizontalExpand="True">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#202023"/>
</PanelContainer.PanelOverride>

<!-- Gas entries added via C# code -->
<GridContainer Name="GasGridContainer" HorizontalExpand="True" Columns = "4"></GridContainer>
</PanelContainer>
</BoxContainer>

<!-- If the alarm is inactive, this is label is diplayed instead -->
<Label Name="NoDataLabel" Text="{Loc 'atmos-alerts-window-no-data-available'}" HorizontalAlignment="Center" Margin="0 15" FontColorOverride="#a9a9a9" ReservesSpace="False" Visible="False"></Label>

<!-- Silencing progress bar -->
<controls:StripeBack Name="SilenceAlarmProgressBar" ReservesSpace="False" Visible="False" Access="Public">
<PanelContainer>
<Label Text="{Loc 'atmos-alerts-window-alerts-being-silenced'}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5 5 5 5"/>
</PanelContainer>
</controls:StripeBack>
</Control>

<!-- Check box for silencing this alarm -->
<CheckBox Name="SilenceCheckBox" Text="{Loc 'atmos-alerts-window-silence-alerts'}" HorizontalAlignment="Left" Margin="5 5 5 5" Access="Public"></CheckBox>
</BoxContainer>
</PanelContainer>

</BoxContainer>
215 changes: 215 additions & 0 deletions Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
using Content.Client.Stylesheets;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Atmos.Monitor;
using Content.Shared.FixedPoint;
using Content.Shared.Temperature;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Map;
using System.Linq;

namespace Content.Client.Atmos.Consoles;

[GenerateTypedNameReferences]
public sealed partial class AtmosAlarmEntryContainer : BoxContainer
{
public NetEntity NetEntity;
public EntityCoordinates? Coordinates;

private readonly IEntityManager _entManager;
private readonly IResourceCache _cache;

private Dictionary<AtmosAlarmType, string> _alarmStrings = new Dictionary<AtmosAlarmType, string>()
{
[AtmosAlarmType.Invalid] = "atmos-alerts-window-invalid-state",
[AtmosAlarmType.Normal] = "atmos-alerts-window-normal-state",
[AtmosAlarmType.Warning] = "atmos-alerts-window-warning-state",
[AtmosAlarmType.Danger] = "atmos-alerts-window-danger-state",
};

private Dictionary<Gas, string> _gasShorthands = new Dictionary<Gas, string>()
{
[Gas.Ammonia] = "NH₃",
[Gas.CarbonDioxide] = "CO₂",
[Gas.Frezon] = "F",
[Gas.Nitrogen] = "N₂",
[Gas.NitrousOxide] = "N₂O",
[Gas.Oxygen] = "O₂",
[Gas.Plasma] = "P",
[Gas.Tritium] = "T",
[Gas.WaterVapor] = "H₂O",
};

public AtmosAlarmEntryContainer(NetEntity uid, EntityCoordinates? coordinates)
{
RobustXamlLoader.Load(this);

_entManager = IoCManager.Resolve<IEntityManager>();
_cache = IoCManager.Resolve<IResourceCache>();

NetEntity = uid;
Coordinates = coordinates;

// Load fonts
var headerFont = new VectorFont(_cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Bold.ttf"), 11);
var normalFont = new VectorFont(_cache.GetResource<FontResource>("/Fonts/NotoSansDisplay/NotoSansDisplay-Regular.ttf"), 11);
var smallFont = new VectorFont(_cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10);

// Set fonts
TemperatureHeaderLabel.FontOverride = headerFont;
PressureHeaderLabel.FontOverride = headerFont;
OxygenationHeaderLabel.FontOverride = headerFont;
GasesHeaderLabel.FontOverride = headerFont;

TemperatureLabel.FontOverride = normalFont;
PressureLabel.FontOverride = normalFont;
OxygenationLabel.FontOverride = normalFont;

NoDataLabel.FontOverride = headerFont;

SilenceCheckBox.Label.FontOverride = smallFont;
SilenceCheckBox.Label.FontColorOverride = Color.DarkGray;
}

public void UpdateEntry(AtmosAlertsComputerEntry entry, bool isFocus, AtmosAlertsFocusDeviceData? focusData = null)
{
NetEntity = entry.NetEntity;
Coordinates = _entManager.GetCoordinates(entry.Coordinates);

// Load fonts
var normalFont = new VectorFont(_cache.GetResource<FontResource>("/Fonts/NotoSansDisplay/NotoSansDisplay-Regular.ttf"), 11);

// Update alarm state
if (!_alarmStrings.TryGetValue(entry.AlarmState, out var alarmString))
alarmString = "atmos-alerts-window-invalid-state";

AlarmStateLabel.Text = Loc.GetString(alarmString);
AlarmStateLabel.FontColorOverride = GetAlarmStateColor(entry.AlarmState);

// Update alarm name
AlarmNameLabel.Text = Loc.GetString("atmos-alerts-window-alarm-label", ("name", entry.EntityName), ("address", entry.Address));

// Focus updates
FocusContainer.Visible = isFocus;

if (isFocus)
SetAsFocus();
else
RemoveAsFocus();

if (isFocus && entry.Group == AtmosAlertsComputerGroup.AirAlarm)
{
MainDataContainer.Visible = (entry.AlarmState != AtmosAlarmType.Invalid);
NoDataLabel.Visible = (entry.AlarmState == AtmosAlarmType.Invalid);

if (focusData != null)
{
// Update temperature
var tempK = (FixedPoint2)focusData.Value.TemperatureData.Item1;
var tempC = (FixedPoint2)TemperatureHelpers.KelvinToCelsius(tempK.Float());

TemperatureLabel.Text = Loc.GetString("atmos-alerts-window-temperature-value", ("valueInC", tempC), ("valueInK", tempK));
TemperatureLabel.FontColorOverride = GetAlarmStateColor(focusData.Value.TemperatureData.Item2);

// Update pressure
PressureLabel.Text = Loc.GetString("atmos-alerts-window-pressure-value", ("value", (FixedPoint2)focusData.Value.PressureData.Item1));
PressureLabel.FontColorOverride = GetAlarmStateColor(focusData.Value.PressureData.Item2);

// Update oxygenation
var oxygenPercent = (FixedPoint2)0f;
var oxygenAlert = AtmosAlarmType.Invalid;

if (focusData.Value.GasData.TryGetValue(Gas.Oxygen, out var oxygenData))
{
oxygenPercent = oxygenData.Item2 * 100f;
oxygenAlert = oxygenData.Item3;
}

OxygenationLabel.Text = Loc.GetString("atmos-alerts-window-oxygenation-value", ("value", oxygenPercent));
OxygenationLabel.FontColorOverride = GetAlarmStateColor(oxygenAlert);

// Update other present gases
GasGridContainer.RemoveAllChildren();

var gasData = focusData.Value.GasData.Where(g => g.Key != Gas.Oxygen);

if (gasData.Count() == 0)
{
// No other gases
var gasLabel = new Label()
{
Text = Loc.GetString("atmos-alerts-window-other-gases-value-nil"),
FontOverride = normalFont,
FontColorOverride = StyleNano.DisabledFore,
HorizontalAlignment = HAlignment.Center,
VerticalAlignment = VAlignment.Center,
HorizontalExpand = true,
Margin = new Thickness(0, 2, 0, 0),
SetHeight = 24f,
};

GasGridContainer.AddChild(gasLabel);
}

else
{
// Add an entry for each gas
foreach ((var gas, (var mol, var percent, var alert)) in gasData)
{
var gasPercent = (FixedPoint2)0f;
gasPercent = percent * 100f;

if (!_gasShorthands.TryGetValue(gas, out var gasShorthand))
gasShorthand = "X";

var gasLabel = new Label()
{
Text = Loc.GetString("atmos-alerts-window-other-gases-value", ("shorthand", gasShorthand), ("value", gasPercent)),
FontOverride = normalFont,
FontColorOverride = GetAlarmStateColor(alert),
HorizontalAlignment = HAlignment.Center,
VerticalAlignment = VAlignment.Center,
HorizontalExpand = true,
Margin = new Thickness(0, 2, 0, 0),
SetHeight = 24f,
};

GasGridContainer.AddChild(gasLabel);
}
}
}
}
}

public void SetAsFocus()
{
FocusButton.AddStyleClass(StyleNano.StyleClassButtonColorGreen);
ArrowTexture.TexturePath = "/Textures/Interface/Nano/inverted_triangle.svg.png";
}

public void RemoveAsFocus()
{
FocusButton.RemoveStyleClass(StyleNano.StyleClassButtonColorGreen);
ArrowTexture.TexturePath = "/Textures/Interface/Nano/triangle_right.png";
FocusContainer.Visible = false;
}

private Color GetAlarmStateColor(AtmosAlarmType alarmType)
{
switch (alarmType)
{
case AtmosAlarmType.Normal:
return StyleNano.GoodGreenFore;
case AtmosAlarmType.Warning:
return StyleNano.ConcerningOrangeFore;
case AtmosAlarmType.Danger:
return StyleNano.DangerousRedFore;
}

return StyleNano.DisabledFore;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using Content.Shared.Atmos.Components;

namespace Content.Client.Atmos.Consoles;

public sealed class AtmosAlertsComputerBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private AtmosAlertsComputerWindow? _menu;

public AtmosAlertsComputerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }

protected override void Open()
{
_menu = new AtmosAlertsComputerWindow(this, Owner);
_menu.OpenCentered();
_menu.OnClose += Close;

EntMan.TryGetComponent<TransformComponent>(Owner, out var xform);
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

var castState = (AtmosAlertsComputerBoundInterfaceState) state;

if (castState == null)
return;

EntMan.TryGetComponent<TransformComponent>(Owner, out var xform);
_menu?.UpdateUI(xform?.Coordinates, castState.AirAlarms, castState.FireAlarms, castState.FocusData);
}

public void SendFocusChangeMessage(NetEntity? netEntity)
{
SendMessage(new AtmosAlertsComputerFocusChangeMessage(netEntity));
}

public void SendDeviceSilencedMessage(NetEntity netEntity, bool silenceDevice)
{
SendMessage(new AtmosAlertsComputerDeviceSilencedMessage(netEntity, silenceDevice));
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

_menu?.Dispose();
}
}
Loading
Loading