-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
3mo xeno archeology (first phase) #33370
base: master
Are you sure you want to change the base?
Changes from 52 commits
eba8da7
152d8d5
c7e209a
d2e8d72
5aa453b
2befbd0
33c5775
ad6e686
d6d9965
1371613
5dae996
e3cea19
e833ba9
95de7f5
99b97c0
0dce0b0
dd52fbe
3c01fdb
34a703c
c42a2b2
2392c51
05e7918
dbc3f70
e22daae
c908214
13fd4fb
cd297d0
2a97270
b0bc961
5ad649d
4c7c6fd
7c0ba34
51d9c4c
c315765
6960349
c390f61
49dc97a
4066b1d
34b6c4e
f9fca67
e44dac6
6b39a61
0784cb4
0842483
4ea9d3b
32ce0f1
41be02b
38b318e
ff8fc26
1f14968
e2ac3db
01134bb
5cbfff3
e8f3a39
45b0e1c
d5aed90
6c19b74
cbb88a7
5087745
c358542
922ef41
9b4ad1c
c1deec1
47284c7
f0a80de
74f447d
692037a
0b818e2
5114279
5f6b3bf
cd3a798
058c0e6
4b4b276
2f83500
e551dc9
ca6891f
f509ed2
65727ad
ec338d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using Content.Shared.Xenoarchaeology.Artifact; | ||
|
||
namespace Content.Client.Xenoarchaeology.Artifact; | ||
|
||
/// <inheritdoc/> | ||
public sealed class XenoArtifactSystem : SharedXenoArtifactSystem; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Content.Client.Xenoarchaeology.Ui; | ||
using Content.Shared.Xenoarchaeology.Equipment; | ||
using Content.Shared.Xenoarchaeology.Equipment.Components; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Xenoarchaeology.Equipment; | ||
|
||
/// <summary> | ||
/// This handles... | ||
/// </summary> | ||
public sealed class ArtifactAnalyzerSystem : SharedArtifactAnalyzerSystem | ||
{ | ||
[Dependency] private readonly UserInterfaceSystem _ui = default!; | ||
|
||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<AnalysisConsoleComponent, AfterAutoHandleStateEvent>(OnAnalysisConsoleAfterAutoHandleState); | ||
SubscribeLocalEvent<ArtifactAnalyzerComponent, AfterAutoHandleStateEvent>(OnAnalyzerAfterAutoHandleState); | ||
} | ||
|
||
private void OnAnalysisConsoleAfterAutoHandleState(Entity<AnalysisConsoleComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
if (_ui.TryGetOpenUi<AnalysisConsoleBoundUserInterface>(ent.Owner, ArtifactAnalyzerUiKey.Key, out var bui)) | ||
bui.Update(ent); | ||
} | ||
|
||
private void OnAnalyzerAfterAutoHandleState(Entity<ArtifactAnalyzerComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
if (!TryGetAnalysisConsole(ent, out var analysisConsole)) | ||
return; | ||
|
||
if (_ui.TryGetOpenUi<AnalysisConsoleBoundUserInterface>(analysisConsole.Value.Owner, ArtifactAnalyzerUiKey.Key, out var bui)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DRY, this is the same work as lines 26-27 using a different entity so make a method. |
||
bui.Update(analysisConsole.Value); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,4 @@ | |
namespace Content.Client.Xenoarchaeology.Equipment; | ||
|
||
/// <inheritdoc/> | ||
public sealed class ArtifactCrusherSystem : SharedArtifactCrusherSystem | ||
{ | ||
|
||
} | ||
public sealed class ArtifactCrusherSystem : SharedArtifactCrusherSystem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid unneccesary file changes in an already chonky PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sign fine... but please do notice that it took me 20 minutes to enforce remove on last line to perfectly revert changes due to (i think) editor config defaults... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Content.Client.Xenoarchaeology.Ui; | ||
using Content.Shared.Xenoarchaeology.Equipment; | ||
using Content.Shared.Xenoarchaeology.Equipment.Components; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Xenoarchaeology.Equipment; | ||
|
||
public sealed class NodeScannerSystem : SharedNodeScannerSystem | ||
{ | ||
[Dependency] private readonly UserInterfaceSystem _ui = default!; | ||
|
||
/// <inheritdoc /> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<NodeScannerComponent, AfterAutoHandleStateEvent>(OnAnalysisConsoleAfterAutoHandleState); | ||
} | ||
|
||
protected override void TryOpenUi(Entity<NodeScannerComponent> device, EntityUid actor) | ||
{ | ||
_ui.TryOpenUi(device.Owner, NodeScannerUiKey.Key, actor, true); | ||
} | ||
|
||
private void OnAnalysisConsoleAfterAutoHandleState(Entity<NodeScannerComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
if (_ui.TryGetOpenUi<NodeScannerBoundUserInterface>(ent.Owner, NodeScannerUiKey.Key, out var bui)) | ||
bui.Update(ent); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,37 @@ | ||
using Content.Shared.Xenoarchaeology.Equipment; | ||
using Content.Shared.Research.Components; | ||
using Content.Shared.Xenoarchaeology.Equipment.Components; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.UserInterface; | ||
|
||
namespace Content.Client.Xenoarchaeology.Ui; | ||
|
||
[UsedImplicitly] | ||
public sealed class AnalysisConsoleBoundUserInterface : BoundUserInterface | ||
public sealed class AnalysisConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) | ||
{ | ||
[ViewVariables] | ||
private AnalysisConsoleMenu? _consoleMenu; | ||
|
||
public AnalysisConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
|
||
_consoleMenu = this.CreateWindow<AnalysisConsoleMenu>(); | ||
_consoleMenu = new AnalysisConsoleMenu(Owner); | ||
|
||
_consoleMenu.OnClose += Close; | ||
_consoleMenu.OpenCentered(); | ||
|
||
_consoleMenu.OnServerSelectionButtonPressed += () => | ||
{ | ||
SendMessage(new AnalysisConsoleServerSelectionMessage()); | ||
}; | ||
_consoleMenu.OnScanButtonPressed += () => | ||
{ | ||
SendMessage(new AnalysisConsoleScanButtonPressedMessage()); | ||
}; | ||
_consoleMenu.OnPrintButtonPressed += () => | ||
{ | ||
SendMessage(new AnalysisConsolePrintButtonPressedMessage()); | ||
SendMessage(new ConsoleServerSelectionMessage()); | ||
}; | ||
_consoleMenu.OnExtractButtonPressed += () => | ||
{ | ||
SendMessage(new AnalysisConsoleExtractButtonPressedMessage()); | ||
}; | ||
_consoleMenu.OnUpBiasButtonPressed += () => | ||
{ | ||
SendMessage(new AnalysisConsoleBiasButtonPressedMessage(false)); | ||
}; | ||
_consoleMenu.OnDownBiasButtonPressed += () => | ||
{ | ||
SendMessage(new AnalysisConsoleBiasButtonPressedMessage(true)); | ||
}; | ||
} | ||
|
||
protected override void UpdateState(BoundUserInterfaceState state) | ||
public void Update(Entity<AnalysisConsoleComponent> ent) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Public methods need docstring. |
||
base.UpdateState(state); | ||
|
||
switch (state) | ||
{ | ||
case AnalysisConsoleUpdateState msg: | ||
_consoleMenu?.SetButtonsDisabled(msg); | ||
_consoleMenu?.UpdateInformationDisplay(msg); | ||
_consoleMenu?.UpdateProgressBar(msg); | ||
break; | ||
} | ||
_consoleMenu?.Update(ent); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,91 @@ | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls" | ||
xmlns:ui="clr-namespace:Content.Client.Xenoarchaeology.Ui" | ||
Title="{Loc 'analysis-console-menu-title'}" | ||
MinSize="620 280" | ||
SetSize="620 280"> | ||
MinSize="700 350" | ||
SetSize="980 550"> | ||
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True"> | ||
<BoxContainer Margin="10 10 10 10" MinWidth="150" Orientation="Vertical" | ||
VerticalExpand="True" SizeFlagsStretchRatio="1"> | ||
<BoxContainer Orientation="Vertical" VerticalExpand="True"> | ||
<Button Name="ServerSelectionButton" | ||
Text="{Loc 'analysis-console-server-list-button'}"></Button> | ||
<BoxContainer MinHeight="5"></BoxContainer> | ||
<Button Name="ScanButton" | ||
Text="{Loc 'analysis-console-scan-button'}" | ||
ToolTip="{Loc 'analysis-console-scan-tooltip-info'}"> | ||
</Button> | ||
<BoxContainer MinHeight="5"></BoxContainer> | ||
<Button Name="PrintButton" | ||
Text="{Loc 'analysis-console-print-button'}" | ||
ToolTip="{Loc 'analysis-console-print-tooltip-info'}"> | ||
</Button> | ||
<BoxContainer MinHeight="5"></BoxContainer> | ||
<BoxContainer Orientation="Horizontal"> | ||
<Button Name="UpBiasButton" | ||
Text="{Loc 'analysis-console-bias-up'}" | ||
ToolTip="{Loc 'analysis-console-bias-button-info-up'}" | ||
HorizontalExpand="True" | ||
StyleClasses="OpenRight"> | ||
</Button> | ||
<Button Name="DownBiasButton" | ||
Text="{Loc 'analysis-console-bias-down'}" | ||
ToolTip="{Loc 'analysis-console-bias-button-info-down'}" | ||
HorizontalExpand="True" | ||
StyleClasses="OpenLeft"> | ||
</Button> | ||
<BoxContainer Margin="10 10 10 10" MaxWidth="220" SetWidth="220" Orientation="Vertical" HorizontalExpand="False" VerticalExpand="True"> | ||
<PanelContainer Name="BackPanel" HorizontalAlignment="Center"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxTexture Modulate="#1B1B1E" PatchMarginBottom="10" PatchMarginLeft="10" PatchMarginRight="10" PatchMarginTop="10"/> | ||
</PanelContainer.PanelOverride> | ||
<BoxContainer HorizontalExpand="True" VerticalExpand="True" MinSize="128 128"> | ||
<SpriteView Name="ArtifactView" Scale="4 4" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalExpand="True" VerticalExpand="True"/> | ||
</BoxContainer> | ||
<BoxContainer MinHeight="15"></BoxContainer> | ||
<Button Name="ExtractButton" | ||
Text="{Loc 'analysis-console-extract-button'}" | ||
ToolTip="{Loc 'analysis-console-extract-button-info'}"> | ||
</Button> | ||
</PanelContainer> | ||
<customControls:HSeparator StyleClasses="HighDivider" Margin="0 15 0 10"/> | ||
<BoxContainer Name="ExtractContainer" Orientation="Vertical" VerticalExpand="True" Visible="False"> | ||
<PanelContainer HorizontalExpand="True" VerticalExpand="True" RectClipContent="True"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#000000FF" /> | ||
</PanelContainer.PanelOverride> | ||
<BoxContainer Margin="10 10 10 5" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True"> | ||
<ScrollContainer HScrollEnabled="False" HorizontalExpand="True" VerticalExpand="True"> | ||
<BoxContainer HorizontalExpand="True" VerticalExpand="True"> | ||
<RichTextLabel Name="ExtractionResearchLabel" VerticalAlignment="Top" HorizontalAlignment="Left"/> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
<Control MinHeight="5"/> | ||
<RichTextLabel Name="ExtractionSumLabel" VerticalAlignment="Bottom" HorizontalAlignment="Left"/> | ||
</BoxContainer> | ||
</PanelContainer> | ||
</BoxContainer> | ||
<BoxContainer Orientation="Vertical"> | ||
<Label Name="ProgressLabel"></Label> | ||
<ProgressBar | ||
Name="ProgressBar" | ||
MinValue="0" | ||
MaxValue="1" | ||
SetHeight="20"> | ||
</ProgressBar> | ||
<BoxContainer Name="NodeViewContainer" Orientation="Vertical" VerticalExpand="True"> | ||
<ScrollContainer HScrollEnabled="False" HorizontalExpand="True" VerticalExpand="True"> | ||
<BoxContainer Orientation="Vertical" HorizontalExpand="False" VerticalExpand="True"> | ||
<Label Name="NoneSelectedLabel" Text="{Loc 'analysis-console-no-node'}" HorizontalAlignment="Center" VerticalAlignment="Center" VerticalExpand="True" Visible="False"/> | ||
<BoxContainer Name="InfoContainer" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True"> | ||
<BoxContainer HorizontalExpand="True"> | ||
<RichTextLabel Name="IDLabel" HorizontalExpand="True"/> | ||
<RichTextLabel Name="IDValueLabel" HorizontalAlignment="Right"/> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="True"> | ||
<RichTextLabel Name="ClassLabel" HorizontalExpand="True"/> | ||
<RichTextLabel Name="ClassValueLabel" HorizontalAlignment="Right"/> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="True"> | ||
<RichTextLabel Name="LockedLabel" HorizontalExpand="True"/> | ||
<RichTextLabel Name="LockedValueLabel" HorizontalAlignment="Right"/> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="True"> | ||
<RichTextLabel Name="DurabilityLabel" HorizontalExpand="True"/> | ||
<RichTextLabel Name="DurabilityValueLabel" HorizontalAlignment="Right"/> | ||
</BoxContainer> | ||
<Control MinHeight="20"/> | ||
<RichTextLabel Name="EffectLabel"/> | ||
<RichTextLabel Name="EffectValueLabel" HorizontalExpand="True"/> | ||
<RichTextLabel Name="TriggerLabel"/> | ||
<RichTextLabel Name="TriggerValueLabel" HorizontalExpand="True"/> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
<Control MinHeight="5"/> | ||
<BoxContainer Orientation="Horizontal" HorizontalExpand="True"> | ||
<Button Name="ServerButton" Text="{Loc 'analysis-console-server-list-button'}" StyleClasses="OpenRight" HorizontalExpand="True" MinHeight="35"/> | ||
<Button Name="ExtractButton" Text="{Loc 'analysis-console-extract-button'}" StyleClasses="OpenLeft" HorizontalExpand="True" MinHeight="35"/> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
<customControls:VSeparator StyleClasses="LowDivider" /> | ||
<PanelContainer Margin="10 10 10 10" HorizontalExpand="True" SizeFlagsStretchRatio="3"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#000000FF" /> | ||
</PanelContainer.PanelOverride> | ||
<BoxContainer Margin="10 10 10 10" Orientation="Horizontal"> | ||
<BoxContainer Orientation="Vertical" HorizontalExpand="True"> | ||
<BoxContainer VerticalExpand="True"> | ||
<RichTextLabel Name="Information"> </RichTextLabel> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="True" VerticalExpand="True"> | ||
<PanelContainer Margin="10 10 10 10" HorizontalExpand="True" RectClipContent="True"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#000000FF" /> | ||
</PanelContainer.PanelOverride> | ||
<BoxContainer Margin="10 10 10 10" Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True"> | ||
<ui:XenoArtifactGraphControl Name="GraphControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> | ||
<Label Name="NoArtiLabel" | ||
Text="{Loc 'analysis-console-info-no-artifact'}" | ||
HorizontalExpand="True" | ||
VerticalExpand="True" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center"/> | ||
</ui:XenoArtifactGraphControl> | ||
</BoxContainer> | ||
<BoxContainer VerticalExpand="False" Orientation="Vertical" MaxSize="64 64"> | ||
<SpriteView | ||
Name="ArtifactDisplay" | ||
OverrideDirection="South" | ||
VerticalExpand="False" | ||
SetSize="64 64" | ||
MaxSize="64 64" | ||
Scale="2 2"> | ||
</SpriteView> | ||
</BoxContainer> | ||
<BoxContainer VerticalExpand="True"></BoxContainer> | ||
</BoxContainer> | ||
</PanelContainer> | ||
</PanelContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</controls:FancyWindow> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove redundant docstring (or explain what this class does)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed it, sry :3