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

Upstream Merge 2024-10-13 #260

Closed
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c87928e
Replace Shittle With Pathfinder (#1027)
VMSolidus Oct 9, 2024
ac72909
Automatic Changelog Update (#1027)
SimpleStation14 Oct 9, 2024
457e618
Re-Add Crusher Weapons (#1026)
VMSolidus Oct 9, 2024
2e97c44
Automatic Changelog Update (#1026)
SimpleStation14 Oct 9, 2024
b0262f3
Port Gax From Estação Pirata (#1019)
Ichaie Oct 9, 2024
0410b9a
Automatic Changelog Update (#1019)
SimpleStation14 Oct 9, 2024
41f1172
Security Loadouts Expansion 2 (#1025)
VMSolidus Oct 9, 2024
df747c4
Fix Librarian Access (#1023)
VMSolidus Oct 9, 2024
6ab7965
Psionic Potential Trait Fixes (#1022)
VMSolidus Oct 9, 2024
b179f27
Automatic Changelog Update (#1025)
SimpleStation14 Oct 9, 2024
7237d66
Automatic Changelog Update (#1022)
SimpleStation14 Oct 9, 2024
db88b1b
Update Languages.ftl (#1020)
VMSolidus Oct 9, 2024
811b91d
Automatic Changelog Update (#1020)
SimpleStation14 Oct 9, 2024
14d2280
Random Bark Revamp (#1003)
Mnemotechnician Oct 9, 2024
8c5faf3
Language Refactor 3 (#937)
Mnemotechnician Oct 9, 2024
f0636f7
Automatic Changelog Update (#1003)
SimpleStation14 Oct 9, 2024
87cc149
Station Only Glimmer Mites (#976)
VMSolidus Oct 9, 2024
39ddc33
Custom Specie Name (#994)
FoxxoTrystan Oct 9, 2024
da39971
Automatic Changelog Update (#976)
SimpleStation14 Oct 9, 2024
dde6130
Automatic Changelog Update (#994)
SimpleStation14 Oct 9, 2024
fb54f66
Cargo Hardsuit Market (#1024)
VMSolidus Oct 9, 2024
683b8b6
Automatic Changelog Update (#1024)
SimpleStation14 Oct 9, 2024
00d83ef
Resprites Service Uniforms & Adds Rolled Sleeve Variants (#1021)
DangerRevolution Oct 10, 2024
0efe026
Automatic Changelog Update (#1021)
SimpleStation14 Oct 10, 2024
480b273
Head of Security Equipment (#1031)
VMSolidus Oct 11, 2024
c22e80a
Automatic Changelog Update (#1031)
SimpleStation14 Oct 11, 2024
7d07958
Port a New Map: RadStation (#1034)
Ichaie Oct 11, 2024
ad53e7c
Automatic Changelog Update (#1034)
SimpleStation14 Oct 11, 2024
87d4a8a
Feat: Sleeping and Muzzle Block Vocal Emotes (#1037)
Mnemotechnician Oct 11, 2024
6227db4
Automatic Changelog Update (#1037)
SimpleStation14 Oct 11, 2024
d6a2db2
Bluespace And Normality Ores (#1042)
VMSolidus Oct 12, 2024
f5521e4
Automatic Changelog Update (#1042)
SimpleStation14 Oct 12, 2024
aa85a33
Merge remote-tracking branch 'real-ee/master' into feat/floof-upstrea…
Mnemotechnician Oct 13, 2024
676d013
Early merge of Simple-Station/Einstein-Engines#1036
Mnemotechnician Oct 10, 2024
5835445
Ugh.
Mnemotechnician Oct 13, 2024
4eaa4ea
Early merge Simple-Station/Einstein-Engines#1032
Mnemotechnician Oct 13, 2024
6e91632
Fix bluespace recipe?
Mnemotechnician Oct 13, 2024
60dd693
Fix Arrivals Shuttle (#1040)
Fansana Oct 13, 2024
f29a5bf
Automatic Changelog Update (#1040)
SimpleStation14 Oct 13, 2024
124af12
Custom Name Fixes (#1032)
FoxxoTrystan Oct 13, 2024
d84a728
Cherry Pick "Fix Latejoin Antag Preferences Not Being Respected" (#1038)
Remuchi Oct 13, 2024
f1dd679
Add ArachneWeb to Spiderweb. (#1033)
FoxxoTrystan Oct 13, 2024
74fa664
Automatic Changelog Update (#1033)
SimpleStation14 Oct 13, 2024
aa799f5
Feat: Togglable Under-Table Crawling (#1036)
Mnemotechnician Oct 13, 2024
d3e4d14
Automatic Changelog Update (#1036)
SimpleStation14 Oct 13, 2024
fcada74
Improve "Show Clothing" Button Labels (#1030)
DEATHB4DEFEAT Oct 13, 2024
053d42b
Automatic Changelog Update (#1030)
SimpleStation14 Oct 13, 2024
8fec666
Update Credits (#1043)
github-actions[bot] Oct 13, 2024
c377ee5
Make Brains Not Food (#1044)
VMSolidus Oct 13, 2024
705a5f3
Automatic Changelog Update (#1044)
SimpleStation14 Oct 13, 2024
20c1ccc
Transhumanism Physical Traits (#1035)
VMSolidus Oct 13, 2024
782f590
Automatic Changelog Update (#1035)
SimpleStation14 Oct 13, 2024
977fccf
Service Contractor Loadouts (#1041)
VMSolidus Oct 13, 2024
120f73d
Automatic Changelog Update (#1041)
SimpleStation14 Oct 13, 2024
6a815ba
Feat: Port All Delta-V Mail Improvements (#1011)
Mnemotechnician Oct 13, 2024
1bb7f1b
Automatic Changelog Update (#1011)
SimpleStation14 Oct 13, 2024
69a12e2
Merge remote-tracking branch 'real-ee/master' into feat/floof-upstrea…
Mnemotechnician Oct 14, 2024
d2c6612
Apparently secwatch was silently reverted???
Mnemotechnician Oct 14, 2024
d2aaf88
Update hardsuits.yml
Mnemotechnician Oct 20, 2024
a4d6ea3
Update cargo_hardsuits.yml
Mnemotechnician Oct 20, 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
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions Content.Client/CartridgeLoader/Cartridges/MailMetricUi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader.Cartridges;
using Robust.Client.UserInterface;

namespace Content.Client.CartridgeLoader.Cartridges;

public sealed partial class MailMetricUi : UIFragment
{
private MailMetricUiFragment? _fragment;

public override Control GetUIFragmentRoot()
{
return _fragment!;
}

public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner)
{
_fragment = new MailMetricUiFragment();
}

public override void UpdateState(BoundUserInterfaceState state)
{
if (state is MailMetricUiState cast)
{
_fragment?.UpdateState(cast);
}
}
}
183 changes: 183 additions & 0 deletions Content.Client/CartridgeLoader/Cartridges/MailMetricUiFragment.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<cartridges:MailMetricUiFragment
xmlns:cartridges="clr-namespace:Content.Client.CartridgeLoader.Cartridges"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns="https://spacestation14.io"
Margin="5"
VerticalExpand="True"
Orientation="Vertical">
<PanelContainer StyleClasses="BackgroundDark"></PanelContainer>
<controls:StripeBack Name="MailMetricHeaderContainer">
<PanelContainer>
<Label Name="MailMetricHeader"
Align="Center"
Text="{Loc 'mail-metrics-header'}" />
</PanelContainer>
</controls:StripeBack>
<BoxContainer
Orientation="Vertical"
HorizontalExpand="True"
Margin="20 0">
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="2">
<Label Name="TitleEmpty1"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True" />
<Label Name="MailCountLabel"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
ClipText="True"
StyleClasses="monospace"
Align="Center"
Text="{Loc 'mail-metrics-count-header'}" />
<Label Name="SpesosLabel"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
ClipText="True"
Align="Center"
StyleClasses="monospace"
Text="{Loc 'mail-metrics-money-header'}" />
</BoxContainer>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="2">
<Label Name="OpenedLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc 'mail-metrics-opened'}" />
<Label Name="OpenedMailCount"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
<Label Name="OpenedMailSpesos"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="2">
<Label Name="ExpiredLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc 'mail-metrics-expired'}" />
<Label Name="ExpiredMailCount"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
<Label Name="ExpiredMailSpesos"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="2">
<Label Name="TamperedLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc 'mail-metrics-tampered'}" />
<Label Name="TamperedMailCount"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
<Label Name="TamperedMailSpesos"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="2">
<Label Name="DamagedLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc 'mail-metrics-damaged'}" />
<Label Name="DamagedMailCount"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
<Label Name="DamagedMailSpesos"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
StyleClasses="monospace"
Align="Right"
ClipText="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="2">
<Label Name="UnopenedLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc 'mail-metrics-unopened'}" />
<Label Name="UnopenedMailCount"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
StyleClasses="monospace"
Align="Right"
ClipText="True" />
<Label Name="UnopenedMailSpesos"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="2">
<Label Name="TotalMailLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc 'mail-metrics-total'}" />
<Label Name="TotalMailCount"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
<Label Name="TotalMailSpesos"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
Align="Right"
StyleClasses="monospace"
ClipText="True" />
</BoxContainer>
</BoxContainer>
<BoxContainer
Orientation="Vertical"
HorizontalExpand="True"
Margin="10">
<Label
Name="SuccessRateCounts"
Align="Center"
StyleClasses="LabelBig" />
<Label
Name="SuccessRatePercent"
Align="Center"
StyleClasses="LabelBig" />
</BoxContainer>
</cartridges:MailMetricUiFragment>
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using Content.Shared.CartridgeLoader.Cartridges;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class MailMetricUiFragment : BoxContainer
{

private OpenedMailPercentGrade? _successGrade;

public MailMetricUiFragment()
{
RobustXamlLoader.Load(this);

// This my way of adding multiple classes to a XAML control.
// Haha Batman I'm going to blow up Gotham City
OpenedMailCount.StyleClasses.Add("Good");
OpenedMailSpesos.StyleClasses.Add("Good");
TamperedMailCount.StyleClasses.Add("Danger");
TamperedMailSpesos.StyleClasses.Add("Danger");
ExpiredMailCount.StyleClasses.Add("Danger");
ExpiredMailSpesos.StyleClasses.Add("Danger");
DamagedMailCount.StyleClasses.Add("Danger");
DamagedMailSpesos.StyleClasses.Add("Danger");
UnopenedMailCount.StyleClasses.Add("Caution");
}

public void UpdateState(MailMetricUiState state)
{
UpdateTextLabels(state);
UpdateSuccessGrade(state);
}

public void UpdateTextLabels(MailMetricUiState state)
{
var stats = state.Metrics;

OpenedMailCount.Text = stats.OpenedCount.ToString();
OpenedMailSpesos.Text = stats.Earnings.ToString();
TamperedMailCount.Text = stats.TamperedCount.ToString();
TamperedMailSpesos.Text = stats.TamperedLosses.ToString();
ExpiredMailCount.Text = stats.ExpiredCount.ToString();
ExpiredMailSpesos.Text = stats.ExpiredLosses.ToString();
DamagedMailCount.Text = stats.DamagedCount.ToString();
DamagedMailSpesos.Text = stats.DamagedLosses.ToString();
UnopenedMailCount.Text = state.UnopenedMailCount.ToString();
TotalMailCount.Text = state.TotalMail.ToString();
TotalMailSpesos.Text = stats.TotalIncome.ToString();
SuccessRateCounts.Text = Loc.GetString("mail-metrics-progress",
("opened", stats.OpenedCount),
("total", state.TotalMail));
SuccessRatePercent.Text = Loc.GetString("mail-metrics-progress-percent",
("successRate", state.SuccessRate));
}

public void UpdateSuccessGrade(MailMetricUiState state)
{
var previousGrade = _successGrade;
_successGrade = GetSuccessRateGrade(state.SuccessRate);

// No need to update if they're the same
if (previousGrade == _successGrade)
return;

var previousGradeClass = GetClassForGrade(previousGrade);
if (previousGradeClass != string.Empty)
{
SuccessRatePercent.StyleClasses.Remove(previousGradeClass);
}

SuccessRatePercent.StyleClasses.Add(GetClassForGrade(_successGrade));
}

private static OpenedMailPercentGrade GetSuccessRateGrade(double successRate)
{
return successRate switch
{
> 75 => OpenedMailPercentGrade.Good,
> 50 => OpenedMailPercentGrade.Average,
_ => OpenedMailPercentGrade.Bad,
};
}

private string GetClassForGrade(OpenedMailPercentGrade? grade)
{
return grade switch
{
OpenedMailPercentGrade.Good => "Good",
OpenedMailPercentGrade.Average => "Caution",
OpenedMailPercentGrade.Bad => "Danger",
_ => string.Empty,
};
}
}

enum OpenedMailPercentGrade
{
Good,
Average,
Bad
}
1 change: 1 addition & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.OpenBelt);
human.AddFunction(ContentKeyFunctions.OfferItem);
human.AddFunction(ContentKeyFunctions.ToggleStanding);
human.AddFunction(ContentKeyFunctions.ToggleCrawlingUnder);
human.AddFunction(ContentKeyFunctions.MouseMiddle);
human.AddFunction(ContentKeyFunctions.ArcadeUp);
human.AddFunction(ContentKeyFunctions.ArcadeDown);
Expand Down
Loading
Loading