-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1621 from space-syndicate/upstream-sync
Upstream sync
- Loading branch information
Showing
124 changed files
with
3,968 additions
and
2,720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,29 @@ jobs: | |
# TODO | ||
#- name: Get this week's Patreons | ||
# run: Tools/script2dumppatreons > Resources/Credits/Patrons.yml | ||
|
||
# MAKE SURE YOU ENABLED "Allow GitHub Actions to create and approve pull requests" IN YOUR ACTIONS, OTHERWISE IT WILL MOST LIKELY FAIL | ||
|
||
|
||
# For this you can use a pat token of an account with direct push access to the repo if you have protected branches. | ||
# Uncomment this and comment the other line if you do this. | ||
# https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches | ||
|
||
#- name: Commit new credit files | ||
# uses: stefanzweifel/git-auto-commit-action@v4 | ||
# with: | ||
# commit_message: Update Credits | ||
# commit_author: PJBot <[email protected]> | ||
|
||
# This will make a PR | ||
- name: Set current date as env variable | ||
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV | ||
|
||
- name: Commit new credit files | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit_message: Update Credits | ||
commit_author: PJBot <[email protected]> | ||
commit-message: Update Credits | ||
title: Update Credits | ||
body: This is an automated Pull Request. This PR updates the github contributors in the credits section. | ||
author: PJBot <[email protected]> | ||
branch: automated/credits-${{env.NOW}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 37 additions & 34 deletions
71
Content.Client/Medical/CrewMonitoring/CrewMonitoringBoundUserInterface.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,56 @@ | ||
using Content.Shared.Medical.CrewMonitoring; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Medical.CrewMonitoring | ||
namespace Content.Client.Medical.CrewMonitoring; | ||
|
||
public sealed class CrewMonitoringBoundUserInterface : BoundUserInterface | ||
{ | ||
public sealed class CrewMonitoringBoundUserInterface : BoundUserInterface | ||
[ViewVariables] | ||
private CrewMonitoringWindow? _menu; | ||
|
||
public CrewMonitoringBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
[ViewVariables] | ||
private CrewMonitoringWindow? _menu; | ||
} | ||
|
||
public CrewMonitoringBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
} | ||
protected override void Open() | ||
{ | ||
EntityUid? gridUid = null; | ||
string stationName = string.Empty; | ||
|
||
protected override void Open() | ||
if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform)) | ||
{ | ||
EntityUid? gridUid = null; | ||
gridUid = xform.GridUid; | ||
|
||
if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform)) | ||
if (EntMan.TryGetComponent<MetaDataComponent>(gridUid, out var metaData)) | ||
{ | ||
gridUid = xform.GridUid; | ||
stationName = metaData.EntityName; | ||
} | ||
|
||
_menu = new CrewMonitoringWindow(gridUid); | ||
|
||
_menu.OpenCentered(); | ||
_menu.OnClose += Close; | ||
} | ||
|
||
protected override void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
base.UpdateState(state); | ||
_menu = new CrewMonitoringWindow(stationName, gridUid); | ||
|
||
switch (state) | ||
{ | ||
case CrewMonitoringState st: | ||
EntMan.TryGetComponent<TransformComponent>(Owner, out var xform); | ||
_menu.OpenCentered(); | ||
_menu.OnClose += Close; | ||
} | ||
|
||
_menu?.ShowSensors(st.Sensors, xform?.Coordinates, st.Snap, st.Precision); | ||
break; | ||
} | ||
} | ||
protected override void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
base.UpdateState(state); | ||
|
||
protected override void Dispose(bool disposing) | ||
switch (state) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
|
||
_menu?.Dispose(); | ||
case CrewMonitoringState st: | ||
EntMan.TryGetComponent<TransformComponent>(Owner, out var xform); | ||
_menu?.ShowSensors(st.Sensors, Owner, xform?.Coordinates); | ||
break; | ||
} | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
|
||
_menu?.Dispose(); | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
Content.Client/Medical/CrewMonitoring/CrewMonitoringNavMapControl.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Content.Client.Pinpointer.UI; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.UserInterface.Controls; | ||
|
||
namespace Content.Client.Medical.CrewMonitoring; | ||
|
||
public sealed partial class CrewMonitoringNavMapControl : NavMapControl | ||
{ | ||
public NetEntity? Focus; | ||
public Dictionary<NetEntity, string> LocalizedNames = new(); | ||
|
||
private Color _backgroundColor; | ||
private Label _trackedEntityLabel; | ||
private PanelContainer _trackedEntityPanel; | ||
|
||
public CrewMonitoringNavMapControl() : base() | ||
{ | ||
WallColor = new Color(250, 146, 255); | ||
TileColor = new(71, 42, 72); | ||
|
||
_backgroundColor = Color.FromSrgb(TileColor.WithAlpha(0.8f)); | ||
|
||
_trackedEntityLabel = new Label | ||
{ | ||
Margin = new Thickness(10f, 8f), | ||
HorizontalAlignment = HAlignment.Center, | ||
VerticalAlignment = VAlignment.Center, | ||
Modulate = Color.White, | ||
}; | ||
|
||
_trackedEntityPanel = new PanelContainer | ||
{ | ||
PanelOverride = new StyleBoxFlat | ||
{ | ||
BackgroundColor = _backgroundColor, | ||
}, | ||
|
||
Margin = new Thickness(5f, 10f), | ||
HorizontalAlignment = HAlignment.Left, | ||
VerticalAlignment = VAlignment.Bottom, | ||
Visible = false, | ||
}; | ||
|
||
_trackedEntityPanel.AddChild(_trackedEntityLabel); | ||
this.AddChild(_trackedEntityPanel); | ||
} | ||
|
||
protected override void Draw(DrawingHandleScreen handle) | ||
{ | ||
base.Draw(handle); | ||
|
||
if (Focus == null) | ||
{ | ||
_trackedEntityLabel.Text = string.Empty; | ||
_trackedEntityPanel.Visible = false; | ||
|
||
return; | ||
} | ||
|
||
foreach ((var netEntity, var blip) in TrackedEntities) | ||
{ | ||
if (netEntity != Focus) | ||
continue; | ||
|
||
if (!LocalizedNames.TryGetValue(netEntity, out var name)) | ||
name = "Unknown"; | ||
|
||
var message = name + "\nLocation: [x = " + MathF.Round(blip.Coordinates.X) + ", y = " + MathF.Round(blip.Coordinates.Y) + "]"; | ||
|
||
_trackedEntityLabel.Text = message; | ||
_trackedEntityPanel.Visible = true; | ||
|
||
return; | ||
} | ||
|
||
_trackedEntityLabel.Text = string.Empty; | ||
_trackedEntityPanel.Visible = false; | ||
} | ||
} |
76 changes: 43 additions & 33 deletions
76
Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,49 @@ | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:ui="clr-namespace:Content.Client.Pinpointer.UI" | ||
xmlns:ui="clr-namespace:Content.Client.Medical.CrewMonitoring" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
Title="{Loc 'crew-monitoring-user-interface-title'}" | ||
SetSize="1130 700" | ||
MinSize="1130 700"> | ||
<BoxContainer Orientation="Horizontal"> | ||
<ScrollContainer HorizontalExpand="True" | ||
VerticalExpand="True" | ||
Margin="8, 8, 8, 8"> | ||
<GridContainer Name="SensorsTable" | ||
HorizontalExpand="True" | ||
VerticalExpand="True" | ||
HSeparationOverride="5" | ||
VSeparationOverride="20" | ||
Columns="4"> | ||
<!-- Table header --> | ||
<Label Text="{Loc 'crew-monitoring-user-interface-name'}" | ||
StyleClasses="LabelHeading"/> | ||
<Label Text="{Loc 'crew-monitoring-user-interface-job'}" | ||
StyleClasses="LabelHeading"/> | ||
<Label Text="{Loc 'crew-monitoring-user-interface-status'}" | ||
StyleClasses="LabelHeading"/> | ||
<Label Text="{Loc 'crew-monitoring-user-interface-location'}" | ||
StyleClasses="LabelHeading"/> | ||
SetSize="1200 700" | ||
MinSize="1200 700"> | ||
<BoxContainer Orientation="Vertical"> | ||
<BoxContainer Orientation="Horizontal" VerticalExpand="True" HorizontalExpand="True"> | ||
<ui:CrewMonitoringNavMapControl Name="NavMap" HorizontalExpand="True" VerticalExpand="True" Margin="5 20"/> | ||
<BoxContainer Orientation="Vertical"> | ||
<controls:StripeBack> | ||
<PanelContainer> | ||
<Label Name="StationName" Text="Unknown station" Align="Center" /> | ||
</PanelContainer> | ||
</controls:StripeBack> | ||
|
||
<ScrollContainer Name="SensorScroller" | ||
VerticalExpand="True" | ||
SetWidth="520" | ||
Margin="8, 8, 8, 8"> | ||
<BoxContainer Name="SensorsTable" | ||
Orientation="Vertical" | ||
HorizontalExpand="True" | ||
Margin="0 0 10 0"> | ||
<!-- Table rows are filled by code --> | ||
</BoxContainer> | ||
<Label Name="NoServerLabel" | ||
Text="{Loc 'crew-monitoring-user-interface-no-server'}" | ||
StyleClasses="LabelHeading" | ||
FontColorOverride="Red" | ||
HorizontalAlignment="Center" | ||
Visible="false"/> | ||
</ScrollContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
|
||
<!-- Table rows are filled by code --> | ||
</GridContainer> | ||
<Label Name="NoServerLabel" | ||
Text="{Loc 'crew-monitoring-user-interface-no-server'}" | ||
StyleClasses="LabelHeading" | ||
FontColorOverride="Red" | ||
HorizontalAlignment="Center" | ||
Visible="false"/> | ||
</ScrollContainer> | ||
<ui:NavMapControl Name="NavMap" | ||
Margin="5 5"/> | ||
<!-- Footer --> | ||
<BoxContainer Orientation="Vertical"> | ||
<PanelContainer StyleClasses="LowDivider" /> | ||
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom"> | ||
<Label Text="{Loc 'crew-monitoring-user-interface-flavor-left'}" StyleClasses="WindowFooterText" /> | ||
<Label Text="{Loc 'crew-monitoring-user-interface-flavor-right'}" StyleClasses="WindowFooterText" | ||
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" /> | ||
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered" | ||
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</controls:FancyWindow> |
Oops, something went wrong.