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

Хирургия (попытка 2) #65

Merged
merged 42 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fdbf09f
The ShitMed
gluesniffler Oct 5, 2024
67d262b
Fixes
Roudenn Oct 29, 2024
5a6c44a
Delete redudant systems
Roudenn Oct 29, 2024
10fe206
fix components
Roudenn Oct 29, 2024
7c2ab82
fix error, update system
Rxup Oct 29, 2024
73213f0
Update BodyPartComponent.cs
Roudenn Oct 29, 2024
74734f3
fix max health, fix test legs
Rxup Oct 29, 2024
1a43876
fix test
Rxup Oct 29, 2024
39b21a0
Port fixes from EE (#875)
Roudenn Oct 30, 2024
635ca12
[Fix] Healing Fixes (#874)
Roudenn Oct 30, 2024
8cc9756
[Port] Surgery fixes: Part 2 (#876)
TokenStyle Nov 3, 2024
458da37
remove backmen ccvar
TokenStyle Nov 3, 2024
b0b0e11
Body doll in the Health Analyzer menu (#877)
Roudenn Nov 1, 2024
018ed00
fixes and fix guidebook paths (#887)
Rxup Nov 2, 2024
de95d85
Added some experimental lag fixes to surgery. Might have crashes
gluesniffler Nov 2, 2024
440ceb1
russian locale
TokenStyle Nov 3, 2024
3539651
Merge branch 'master' into shitmedd
TokenStyle Nov 3, 2024
cbca315
Merge branch 'master' into shitmedd
TokenStyle Nov 17, 2024
222aa74
Revert "Added some experimental lag fixes to surgery. Might have cras…
TokenStyle Nov 17, 2024
16e860c
[Port] Surgery fixes: Part 3 (#892)
Roudenn Nov 3, 2024
43744df
[Tweak] Rework BodyPartComponent to use DamageSpecifier (#890)
Roudenn Nov 6, 2024
b58d2a0
[Port] Surgery fixes: Part 4 (#909)
TokenStyle Nov 17, 2024
d87ea8a
[Fix] surgery emergency fix
TokenStyle Nov 17, 2024
99c53ac
[Balance] Surgery healing tweaks (#911)
Roudenn Nov 10, 2024
3e977be
[Port] Surgery Update V: The Phantom Gib (#919)
Roudenn Nov 17, 2024
8201474
let me pass tests
TokenStyle Nov 20, 2024
4c7530b
let me pass test pls
TokenStyle Nov 20, 2024
eba82b2
let me pass test pls
TokenStyle Nov 20, 2024
ed0713c
let me pass tests
TokenStyle Nov 20, 2024
01b6fde
chief medical officer pass tests
TokenStyle Nov 20, 2024
072441f
no felinid ears no fun pass tests
TokenStyle Nov 20, 2024
f7be7fc
[Port] Surgery Fixes: Popup Walker (#923)
Roudenn Nov 19, 2024
2cd2490
[PORT]Health Analyzer update (#925)
trest100 Nov 21, 2024
13934f5
let me pass tests
TokenStyle Nov 21, 2024
ac36313
remove shadowkin let tests pass
TokenStyle Nov 21, 2024
e66b04b
first commit
AwareFoxy Nov 22, 2024
4c1a903
Merge branch 'master' into shitmedd
AwareFoxy Nov 22, 2024
3dc3dfa
Revert "first commit" formatting changes
TokenStyle Nov 22, 2024
3319583
add corvax next comments for changes for easier upstreams
TokenStyle Nov 22, 2024
221ee3e
namespaces changes for everythin
TokenStyle Nov 22, 2024
438b01b
Revert "namespaces changes for everythin"
TokenStyle Nov 22, 2024
02d7f5e
[Fix] Surgery Hotfix: Head and Limbs dissapears
TokenStyle Nov 22, 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
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions Content.Client/Body/Systems/BodySystem.cs

This file was deleted.

35 changes: 34 additions & 1 deletion Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Client.Examine;
using Content.Client.Strip;
using Content.Client.Verbs.UI;
using Content.Shared.Body.Part;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
Expand Down Expand Up @@ -40,7 +41,6 @@ public sealed class HandsSystem : SharedHandsSystem
public event Action<string, EntityUid>? OnPlayerItemRemoved;
public event Action<string>? OnPlayerHandBlocked;
public event Action<string>? OnPlayerHandUnblocked;

public override void Initialize()
{
base.Initialize();
Expand All @@ -51,6 +51,8 @@ public override void Initialize()
SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
SubscribeLocalEvent<HandsComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved);
SubscribeLocalEvent<HandsComponent, BodyPartDisabledEvent>(HandleBodyPartDisabled);

OnHandSetActive += OnHandActivated;
}
Expand Down Expand Up @@ -238,8 +240,38 @@ public void UIHandAltActivateItem(string handName)
RaisePredictiveEvent(new RequestHandAltInteractEvent(handName));
}

#region pulling

#endregion

#region visuals

private void HideLayers(EntityUid uid, HandsComponent component, Entity<BodyPartComponent> part, SpriteComponent? sprite = null)
{
if (part.Comp.PartType != BodyPartType.Hand || !Resolve(uid, ref sprite, logMissing: false))
return;

var location = part.Comp.Symmetry switch
{
BodyPartSymmetry.None => HandLocation.Middle,
BodyPartSymmetry.Left => HandLocation.Left,
BodyPartSymmetry.Right => HandLocation.Right,
_ => throw new ArgumentOutOfRangeException(nameof(part.Comp.Symmetry))
};

if (component.RevealedLayers.TryGetValue(location, out var revealedLayers))
{
foreach (var key in revealedLayers)
sprite.RemoveLayer(key);

revealedLayers.Clear();
}
}

private void HandleBodyPartRemoved(EntityUid uid, HandsComponent component, ref BodyPartRemovedEvent args) => HideLayers(uid, component, args.Part);

private void HandleBodyPartDisabled(EntityUid uid, HandsComponent component, ref BodyPartDisabledEvent args) => HideLayers(uid, component, args.Part);

protected override void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args)
{
base.HandleEntityInserted(uid, hands, args);
Expand All @@ -264,6 +296,7 @@ protected override void HandleEntityRemoved(EntityUid uid, HandsComponent hands,

if (!hands.Hands.TryGetValue(args.Container.ID, out var hand))
return;

UpdateHandVisuals(uid, args.Entity, hand);
_stripSys.UpdateUi(uid);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Shared.MedicalScanner;
using Content.Shared._CorvaxNext.Targeting;
using JetBrains.Annotations;
using Robust.Client.UserInterface;
using Robust.Client.GameObjects;

namespace Content.Client.HealthAnalyzer.UI
{
Expand All @@ -17,10 +18,13 @@ public HealthAnalyzerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owne
protected override void Open()
{
base.Open();

_window = this.CreateWindow<HealthAnalyzerWindow>();

_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
_window = new HealthAnalyzerWindow
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
};
_window.OnClose += Close;
_window.OnBodyPartSelected += SendBodyPartMessage;
_window.OpenCentered();
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
Expand All @@ -33,5 +37,22 @@ protected override void ReceiveMessage(BoundUserInterfaceMessage message)

_window.Populate(cast);
}

private void SendBodyPartMessage(TargetBodyPart? part, EntityUid target) => SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), part ?? null));

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

if (_window != null)
{
_window.OnClose -= Close;
_window.OnBodyPartSelected -= SendBodyPartMessage;
}

_window?.Dispose();
}
}
}
222 changes: 196 additions & 26 deletions Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<controls:FancyWindow
<controls:FancyWindow
xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
MaxHeight="525"
MinWidth="300">
MinWidth="350">
<ScrollContainer
Margin="5 5 5 5"
ReturnMeasure="True"
Expand All @@ -13,45 +13,215 @@
Orientation="Vertical">
<Label
Name="NoPatientDataText"
Text="{Loc health-analyzer-window-no-patient-data-text}" />

Text="{Loc health-analyzer-window-no-patient-data-text}"/>
<Button Name="ReturnButton"
Text="{Loc 'health-analyzer-window-return-button-text'}"
Margin="0 0 0 10"
HorizontalExpand="False"/>
<BoxContainer
Name="PatientDataContainer"
Margin="0 0 0 5"
Orientation="Vertical">
<BoxContainer Orientation="Horizontal" Margin="0 0 0 5">
<SpriteView OverrideDirection="South" Scale="2 2" Name="SpriteView" Access="Public" SetSize="64 64" />
<TextureRect Name="NoDataTex" Access="Public" SetSize="64 64" Visible="false" Stretch="KeepAspectCentered" TexturePath="/Textures/Interface/Misc/health_analyzer_out_of_range.png"/>
<BoxContainer Margin="5 0 0 0" Orientation="Vertical" VerticalAlignment="Top">
<RichTextLabel Name="NameLabel" SetWidth="150" />
<Label Name="SpeciesLabel" VerticalAlignment="Top" StyleClasses="LabelSubText" />
<BoxContainer Orientation="Horizontal"
Margin="0 0 0 5">
<PanelContainer>
<SpriteView OverrideDirection="South"
Scale="2.5 2.5"
Name="SpriteView"
Access="Public"
SetSize="96 96"/>
<PanelContainer
Name="PartView"
SetSize="57 96"
Margin="18 0 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Left">
<PanelContainer
SetSize="15 33"
Margin="4 0 0 0"
HorizontalAlignment="Left">
<TextureButton
Name="RightArmButton"
MinSize="15 25"
StyleClasses="TargetDollButtonRightArm"
VerticalAlignment="Top">
</TextureButton>
<TextureButton
Name="RightHandButton"
MinSize="15 15"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonRightHand">
</TextureButton>
</PanelContainer>
<PanelContainer
SetSize="43 75"
Margin="0 0 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<TextureButton
Name="HeadButton"
MinSize="28 23"
VerticalAlignment="Top"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonHead">
<!--<PanelContainer
SetSize="15 15"
Margin="0 9 0 0"
HorizontalAlignment="Center">
<TextureButton
Name="EyesButton"
MinSize="15 9"
VerticalAlignment="Top"
StyleClasses="TargetDollButtonEyes">
<TextureRect
TexturePath="/Textures/Interface/Targeting/Doll/eyes.png"
Stretch="KeepAspectCentered"
SetSize="15 9"/>
</TextureButton>
<TextureButton
Name="MouthButton"
SetSize="9 6"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonMouth">
<TextureRect
TexturePath="/Textures/Interface/Targeting/Doll/mouth.png"
Stretch="KeepAspectCentered"
SetSize="9 6"/>
</TextureButton>
</PanelContainer>-->
</TextureButton>
<TextureButton
Name="ChestButton"
SetSize="28 30"
Margin="0 18 0 0"
VerticalAlignment="Top"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonChest">
</TextureButton>
<PanelContainer
MinSize="38 35"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<TextureButton
Name="GroinButton"
MinSize="28 15"
VerticalAlignment="Top"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonGroin">
</TextureButton>
<PanelContainer
MinSize="20 30"
VerticalAlignment="Bottom"
HorizontalAlignment="Right">
<TextureButton
Name="LeftLegButton"
MinSize="15 28"
VerticalAlignment="Top"
HorizontalAlignment="Left"
StyleClasses="TargetDollButtonLeftLeg">
</TextureButton>
<TextureButton
Name="LeftFootButton"
MinSize="20 10"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonLeftFoot">
</TextureButton>
</PanelContainer>
<PanelContainer
MinSize="20 30"
VerticalAlignment="Bottom"
HorizontalAlignment="Left">
<TextureButton
Name="RightLegButton"
MinSize="15 28"
VerticalAlignment="Top"
HorizontalAlignment="Right"
StyleClasses="TargetDollButtonRightLeg">
</TextureButton>
<TextureButton
Name="RightFootButton"
MinSize="20 10"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
StyleClasses="TargetDollButtonRightFoot">
</TextureButton>
</PanelContainer>
</PanelContainer>
</PanelContainer>
<PanelContainer
SetSize="15 33"
Margin="0 0 4 0"
HorizontalAlignment="Right">
<TextureButton
Name="LeftArmButton"
MinSize="15 25"
StyleClasses="TargetDollButtonLeftArm"
VerticalAlignment="Top">
</TextureButton>
<TextureButton
Name="LeftHandButton"
MinSize="15 15"
VerticalAlignment="Bottom"
StyleClasses="TargetDollButtonLeftHand">
</TextureButton>
</PanelContainer>
</PanelContainer>
</PanelContainer>
<TextureRect Name="NoDataTex"
Access="Public"
SetSize="64 64"
Visible="false"
Stretch="KeepAspectCentered"
TexturePath="/Textures/Interface/Misc/health_analyzer_out_of_range.png"/>
<BoxContainer Margin="5 0 0 0"
Orientation="Vertical"
VerticalAlignment="Top">
<RichTextLabel Name="NameLabel"
SetWidth="150"/>
<Label Name="SpeciesLabel"
VerticalAlignment="Top"
StyleClasses="LabelSubText"/>
<Label Name="PartNameLabel"
VerticalAlignment="Bottom"
StyleClasses="LabelSubText"/>
</BoxContainer>
<Label Margin="0 0 5 0" HorizontalExpand="True" HorizontalAlignment="Right" VerticalExpand="True"
VerticalAlignment="Top" Name="ScanModeLabel"
Text="{Loc 'health-analyzer-window-entity-unknown-text'}" />
<Label Margin="0 0 5 0"
HorizontalExpand="True"
HorizontalAlignment="Right"
VerticalExpand="True"
VerticalAlignment="Top"
Name="ScanModeLabel"
Text="{Loc 'health-analyzer-window-entity-unknown-text'}"/>
</BoxContainer>

<PanelContainer StyleClasses="LowDivider" />
<PanelContainer StyleClasses="LowDivider"/>

<GridContainer Margin="0 5 0 0" Columns="2">
<Label Text="{Loc 'health-analyzer-window-entity-status-text'}" />
<Label Name="StatusLabel" />
<Label Text="{Loc 'health-analyzer-window-entity-temperature-text'}" />
<Label Name="TemperatureLabel" />
<Label Text="{Loc 'health-analyzer-window-entity-blood-level-text'}" />
<Label Name="BloodLabel" />
<Label Text="{Loc 'health-analyzer-window-entity-damage-total-text'}" />
<Label Name="DamageLabel" />
<GridContainer Margin="0 5 0 0"
Columns="2">
<Label Text="{Loc 'health-analyzer-window-entity-status-text'}"/>
<Label Name="StatusLabel"/>
<Label Text="{Loc 'health-analyzer-window-entity-temperature-text'}"/>
<Label Name="TemperatureLabel"/>
<Label Text="{Loc 'health-analyzer-window-entity-blood-level-text'}"/>
<Label Name="BloodLabel"/>
<Label Text="{Loc 'health-analyzer-window-entity-damage-total-text'}"/>
<Label Name="DamageLabel"/>
</GridContainer>
</BoxContainer>

<PanelContainer Name="AlertsDivider" Visible="False" StyleClasses="LowDivider" />
<PanelContainer Name="AlertsDivider"
Visible="False"
StyleClasses="LowDivider"/>

<BoxContainer Name="AlertsContainer" Visible="False" Margin="0 5" Orientation="Vertical" HorizontalAlignment="Center">
<BoxContainer Name="AlertsContainer"
Visible="False"
Margin="0 5"
Orientation="Vertical"
HorizontalAlignment="Center">

</BoxContainer>

<PanelContainer StyleClasses="LowDivider" />
<PanelContainer StyleClasses="LowDivider"/>

<BoxContainer
Name="GroupsContainer"
Expand Down
Loading
Loading