Skip to content

Commit

Permalink
Merge branch 'space-wizards:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Acensti committed Apr 20, 2023
2 parents 3c00227 + 9567e37 commit 2ab39d1
Show file tree
Hide file tree
Showing 114 changed files with 3,316 additions and 1,196 deletions.
2 changes: 1 addition & 1 deletion Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void UpdateUI()
_viewBox.AddChild(viewWest);
_viewBox.AddChild(viewEast);
_summaryLabel.Text = selectedCharacter.Summary;
EntitySystem.Get<HumanoidAppearanceSystem>().LoadProfile(_previewDummy.Value, selectedCharacter);
_entityManager.System<HumanoidAppearanceSystem>().LoadProfile(_previewDummy.Value, selectedCharacter);
GiveDummyJobClothes(_previewDummy.Value, selectedCharacter);
}
}
Expand Down
66 changes: 1 addition & 65 deletions Content.Client/Power/APC/ApcVisualizer.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using Content.Shared.APC;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.State;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;

namespace Content.Client.Power.APC
{
Expand All @@ -15,69 +10,15 @@ public sealed class ApcVisualizer : AppearanceVisualizer
public static readonly Color FullColor = Color.FromHex("#3db83b");
public static readonly Color EmagColor = Color.FromHex("#1f48d6");

[UsedImplicitly]
[Obsolete("Subscribe to your component being initialised instead.")]
public override void InitializeEntity(EntityUid entity)
{
base.InitializeEntity(entity);

var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(entity);

sprite.LayerMapSet(Layers.Panel, sprite.AddLayerState("apc0"));

sprite.LayerMapSet(Layers.ChargeState, sprite.AddLayerState("apco3-0"));
sprite.LayerSetShader(Layers.ChargeState, "unshaded");

sprite.LayerMapSet(Layers.Lock, sprite.AddLayerState("apcox-0"));
sprite.LayerSetShader(Layers.Lock, "unshaded");

sprite.LayerMapSet(Layers.Equipment, sprite.AddLayerState("apco0-3"));
sprite.LayerSetShader(Layers.Equipment, "unshaded");

sprite.LayerMapSet(Layers.Lighting, sprite.AddLayerState("apco1-3"));
sprite.LayerSetShader(Layers.Lighting, "unshaded");

sprite.LayerMapSet(Layers.Environment, sprite.AddLayerState("apco2-3"));
sprite.LayerSetShader(Layers.Environment, "unshaded");
}

[Obsolete("Subscribe to AppearanceChangeEvent instead.")]
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);

var ent = IoCManager.Resolve<IEntityManager>();
var sprite = ent.GetComponent<SpriteComponent>(component.Owner);
if (component.TryGetData<ApcPanelState>(ApcVisuals.PanelState, out var panelState))
{
switch (panelState)
{
case ApcPanelState.Closed:
sprite.LayerSetState(Layers.Panel, "apc0");
break;
case ApcPanelState.Open:
sprite.LayerSetState(Layers.Panel, "apcframe");
break;
}
}
if (component.TryGetData<ApcChargeState>(ApcVisuals.ChargeState, out var chargeState))
{
switch (chargeState)
{
case ApcChargeState.Lack:
sprite.LayerSetState(Layers.ChargeState, "apco3-0");
break;
case ApcChargeState.Charging:
sprite.LayerSetState(Layers.ChargeState, "apco3-1");
break;
case ApcChargeState.Full:
sprite.LayerSetState(Layers.ChargeState, "apco3-2");
break;
case ApcChargeState.Emag:
sprite.LayerSetState(Layers.ChargeState, "emag-unlit");
break;
}

if (ent.TryGetComponent(component.Owner, out SharedPointLightComponent? light))
{
light.Color = chargeState switch
Expand All @@ -90,20 +31,15 @@ public override void OnChangeData(AppearanceComponent component)
};
}
}
else
{
sprite.LayerSetState(Layers.ChargeState, "apco3-0");
}
}

enum Layers : byte
enum ApcVisualLayers : byte
{
ChargeState,
Lock,
Equipment,
Lighting,
Environment,
Panel,
}
}
}
4 changes: 2 additions & 2 deletions Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'Salvage expeditions'}"
Title="{Loc 'salvage-expedition-window-title'}"
MinSize="800 360">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Name="NextOfferLabel"
Text="Next offer:"
Text="{Loc 'salvage-expedition-window-next'}"
Margin="5"></Label>
<ProgressBar Name="NextOfferBar"
HorizontalExpand="True"
Expand Down
Loading

0 comments on commit 2ab39d1

Please sign in to comment.