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

Up180824 #22

Merged
merged 61 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1aec1e0
PTS 2.0: complete remake (#1832)
arimah Aug 12, 2024
7d4a9e8
Automatic Changelog (#1832)
FrontierATC Aug 12, 2024
3efa444
Add NeedAllJobRequirement to job proto (#1841)
dvir001 Aug 12, 2024
4557e8a
Mob/Turret Laser Reflect Chance (#1844)
ErhardSteinhauer Aug 12, 2024
5b74a8c
Automatic Changelog (#1844)
FrontierATC Aug 12, 2024
8102c6b
Add hovertaxibot (#1852)
whatston3 Aug 12, 2024
2cc2c3e
Crescent (Update) (#1796)
dvir001 Aug 12, 2024
cb7a54d
Automatic Changelog (#1852)
FrontierATC Aug 12, 2024
424f724
Automatic Changelog (#1796)
FrontierATC Aug 12, 2024
7663266
Departmental EVA Suits (#1836)
ErhardSteinhauer Aug 12, 2024
cb60f83
Automatic Changelog (#1836)
FrontierATC Aug 12, 2024
b237403
KC Anchor (Update) (#1685)
ThatOneGoblin25 Aug 13, 2024
449c8e5
Automatic Changelog (#1685)
FrontierATC Aug 13, 2024
8922210
Remove superfluous keys from shuttle telecom server (#1857)
arimah Aug 13, 2024
41c0882
LVHI Broom Shuttle (New) (#1806)
ErhardSteinhauer Aug 13, 2024
646f39b
Automatic Changelog (#1806)
FrontierATC Aug 13, 2024
2bdd7ea
Shotgun spread refactor CherryPick
VividPups Aug 14, 2024
14d1fb1
Create shotgun spread ents, inheritance fixes
whatston3 Aug 14, 2024
c7e56aa
Remove preferences for sleeper agent (whoops) (#1863)
whatston3 Aug 15, 2024
be0e257
Automatic Changelog (#1863)
FrontierATC Aug 15, 2024
2952598
DungeonJob.PostGenWallMount: better error handling (#1858)
whatston3 Aug 15, 2024
304de1e
Automatic Changelog (#1858)
FrontierATC Aug 15, 2024
ec03b96
Add RockWall to Mineshaft walls config (#1861)
whatston3 Aug 15, 2024
de0045d
Expedition Loots Balance Pass (Again) (#1821)
ErhardSteinhauer Aug 15, 2024
99a6628
Automatic Changelog (#1821)
FrontierATC Aug 15, 2024
bbe7b6e
Fix Frontier Outpost's medical cross (#1865)
arimah Aug 15, 2024
0c8b0c6
CMO Turtleneck Added to Loadout (#1867)
KyuPolaris Aug 16, 2024
ddb94c3
Automatic Changelog (#1867)
FrontierATC Aug 16, 2024
b48a2f3
Mercenary tech fab (#1854)
ErhardSteinhauer Aug 17, 2024
d509fe4
Automatic Changelog (#1854)
FrontierATC Aug 17, 2024
df5581c
Pacified Zone: filter immune users by playtime (#1855)
whatston3 Aug 17, 2024
240bbe2
Automatic Changelog (#1855)
FrontierATC Aug 17, 2024
3cb53cc
More Infinite Supply Vendors (#1866)
whatston3 Aug 17, 2024
bf0c181
Automatic Changelog (#1866)
FrontierATC Aug 17, 2024
ee50e12
Medidrobe change (#1870)
SabatonShip Aug 17, 2024
32bc8f5
Expedition FTL: avoid collisions on returning. (#1862)
whatston3 Aug 17, 2024
82e0cd5
Automatic Changelog (#1862)
FrontierATC Aug 17, 2024
0d5ef5a
Derelict McCargo (McHobo): (New) Alternative POI to Grifty's (#1859)
Tych0theSynth Aug 17, 2024
8908839
Automatic Changelog (#1859)
FrontierATC Aug 17, 2024
5f8b58f
Dragonfly bridgefix (#1875)
ThatOneGoblin25 Aug 17, 2024
42f6e3e
Automatic Changelog (#1875)
FrontierATC Aug 17, 2024
47520f6
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Aug 17, 2024
45ca9f5
Shuttle Communication Intercom (#1871)
dvir001 Aug 17, 2024
793188c
Automatic Changelog (#1871)
FrontierATC Aug 17, 2024
1254c02
MobFleshClampExpedition shoots one dart, no spread
whatston3 Aug 17, 2024
fea3fce
Merge pull request #1860 from VividPups/shotgun-refactor-
whatston3 Aug 17, 2024
7085ee2
Change Frontier and NFSD offset (#1880)
arimah Aug 18, 2024
43d8abf
Automatic Changelog (#1880)
FrontierATC Aug 18, 2024
905f334
Mail Tracking (DeltaV) (#1877)
dvir001 Aug 18, 2024
e025d74
Automatic Changelog (#1877)
FrontierATC Aug 18, 2024
5234904
Fix Merge
Vonsant Aug 18, 2024
3df6476
Localisation
Vonsant Aug 18, 2024
589af80
Fixes
Vonsant Aug 18, 2024
8fc7eed
Handheld Radio Frequencies (#1833)
whatston3 Aug 18, 2024
d5791cb
Automatic Changelog (#1833)
FrontierATC Aug 18, 2024
ba48e7d
Fixes
Vonsant Aug 18, 2024
78c0da8
Fixes
Vonsant Aug 18, 2024
ff12a54
FixesLinter
Vonsant Aug 18, 2024
7234747
OutpostFixes
Vonsant Aug 18, 2024
680cda5
Merge remote-tracking branch 'upstream/master' into up180824
Vonsant Aug 18, 2024
71297b9
Localisation
Vonsant Aug 18, 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/DeltaV/CartridgeLoader/Cartridges/MailMetricUi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Robust.Client.UserInterface;
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader.Cartridges;

namespace Content.Client.DeltaV.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);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<cartridges:MailMetricUiFragment
xmlns:cartridges="clr-namespace:Content.Client.DeltaV.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,105 @@
using System.Runtime.CompilerServices;
using Content.Shared.CartridgeLoader.Cartridges;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.DeltaV.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
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,31 @@ public bool IsAllowed(JobPrototype job, [NotNullWhen(false)] out FormattedMessag
public bool CheckRoleTime(JobPrototype job, [NotNullWhen(false)] out FormattedMessage? reason)
{
var reqs = _entManager.System<SharedRoleSystem>().GetJobRequirement(job);
return CheckRoleTime(reqs, out reason);

//return CheckRoleTime(reqs, out reason); // Frontier: old implementation

// Frontier: alternate role time checks
if (CheckRoleTime(reqs, out reason))
return true;

var altReqs = _entManager.System<SharedRoleSystem>().GetAlternateJobRequirements(job);
if (altReqs != null)
{
foreach (var alternateSet in altReqs.Values)
{
// Suppress reasons on alternate requirement sets
if (CheckRoleTime(alternateSet, out var altReason))
{
return true;
}
reason.PushNewline();
reason.AddMarkupPermissive(Loc.GetString("role-requirement-alternative"));
reason.PushNewline();
reason.AddMarkupPermissive(altReason.ToMarkup());
}
}
return false;
// End Frontier: alternate role time checks
}

public bool CheckRoleTime(HashSet<JobRequirement>? requirements, [NotNullWhen(false)] out FormattedMessage? reason)
Expand Down
Loading
Loading