-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Port-Morale-System
Signed-off-by: VMSolidus <[email protected]>
- Loading branch information
Showing
396 changed files
with
7,029 additions
and
1,120 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
Content.Client/Eye/PenLight/UI/PenLightBoundUserInterface.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,47 @@ | ||
using Content.Shared.Medical; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Eye.PenLight.UI | ||
{ | ||
[UsedImplicitly] | ||
public sealed class PenLightBoundUserInterface : BoundUserInterface | ||
{ | ||
[ViewVariables] | ||
private PenLightWindow? _window; | ||
|
||
public PenLightBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { } | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
_window = new PenLightWindow | ||
{ | ||
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName, | ||
}; | ||
_window.OnClose += Close; | ||
_window.OpenCentered(); | ||
} | ||
|
||
protected override void ReceiveMessage(BoundUserInterfaceMessage message) | ||
{ | ||
if (_window == null | ||
|| message is not PenLightUserMessage cast) | ||
return; | ||
|
||
_window.Diagnose(cast); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
|
||
if (_window != null) | ||
_window.OnClose -= Close; | ||
|
||
_window?.Dispose(); | ||
} | ||
} | ||
} |
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,11 @@ | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
Title="{Loc 'pen-light-exam-title'}" | ||
SetSize="0 -300"> | ||
<ScrollContainer VerticalExpand="True"> | ||
<BoxContainer Name="RootContainer" Orientation="Vertical" HorizontalExpand="True"> | ||
<Label Name="NoPatientDataText" Text="{Loc 'pen-light-window-no-patient-data-text'}" Visible="False"/> | ||
<Label Name="ExamDataLabel"/> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
</controls:FancyWindow> |
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,78 @@ | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Shared.Damage; | ||
using Content.Shared.IdentityManagement; | ||
using Content.Shared.Medical; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.XAML; | ||
using System.Text; | ||
|
||
|
||
namespace Content.Client.Eye.PenLight.UI | ||
{ | ||
[GenerateTypedNameReferences] | ||
public sealed partial class PenLightWindow : FancyWindow | ||
{ | ||
private readonly IEntityManager _entityManager; | ||
private const int LightHeight = 150; | ||
private const int LightWidth = 900; | ||
|
||
public PenLightWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
|
||
var dependencies = IoCManager.Instance!; | ||
_entityManager = dependencies.Resolve<IEntityManager>(); | ||
} | ||
public void Diagnose(PenLightUserMessage msg) | ||
{ | ||
var target = _entityManager.GetEntity(msg.TargetEntity); | ||
|
||
if (target == null || !_entityManager.TryGetComponent<DamageableComponent>(target, out var damageable)) | ||
{ | ||
NoPatientDataText.Visible = true; | ||
ExamDataLabel.Text = string.Empty; | ||
return; | ||
} | ||
|
||
NoPatientDataText.Visible = false; | ||
|
||
|
||
string entityName = Loc.GetString("pen-light-window-entity-unknown-text"); | ||
if (_entityManager.HasComponent<MetaDataComponent>(target.Value)) | ||
entityName = Identity.Name(target.Value, _entityManager); | ||
|
||
var sb = new StringBuilder(); | ||
sb.AppendLine(Loc.GetString("pen-light-window-entity-eyes-text", ("entityName", entityName))); | ||
|
||
// Check if Blind and return early if true | ||
if (msg.Blind == true) | ||
{ | ||
sb.AppendLine(Loc.GetString("pen-light-exam-blind-text")); | ||
ExamDataLabel.Text = sb.ToString(); | ||
SetHeight = LightHeight; | ||
SetWidth = LightWidth; | ||
return; | ||
} | ||
// EyeDamage | ||
if (msg.EyeDamage == true) | ||
sb.AppendLine(Loc.GetString("pen-light-exam-eyedamage-text")); | ||
|
||
// Drunk | ||
if (msg.Drunk == true) | ||
sb.AppendLine(Loc.GetString("pen-light-exam-drunk-text")); | ||
|
||
// Hallucinating | ||
if (msg.SeeingRainbows == true) | ||
sb.AppendLine(Loc.GetString("pen-light-exam-hallucinating-text")); | ||
|
||
// Healthy | ||
if (msg.Healthy == true) | ||
sb.AppendLine(Loc.GetString("pen-light-exam-healthy-text")); | ||
|
||
ExamDataLabel.Text = sb.ToString(); | ||
|
||
SetHeight = LightHeight; | ||
SetWidth = LightWidth; | ||
} | ||
} | ||
} |
72 changes: 0 additions & 72 deletions
72
Content.IntegrationTests/Tests/Nyanotrasen/Oracle/OracleTest.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.