forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Upstream sync (space-wizards#264)" (space-wizards#265)
This reverts commit bbf7dea.
- Loading branch information
Showing
515 changed files
with
3,549 additions
and
7,739 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
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
24 changes: 5 additions & 19 deletions
24
Content.Client/Ghost/Roles/UI/GhostRoleRulesWindow.xaml.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
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,109 @@ | ||
using System.Collections.Generic; | ||
using Content.Shared.MobState; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.GameObjects; | ||
using Robust.Shared.IoC; | ||
using Robust.Shared.Serialization; | ||
using Robust.Shared.Serialization.Manager.Attributes; | ||
using DrawDepth = Content.Shared.DrawDepth.DrawDepth; | ||
|
||
namespace Content.Client.MobState | ||
{ | ||
[UsedImplicitly] | ||
public sealed class DamageStateVisualizer : AppearanceVisualizer, ISerializationHooks | ||
{ | ||
private DamageState _data = DamageState.Alive; | ||
private Dictionary<DamageState, string> _stateMap = new(); | ||
private int? _originalDrawDepth; | ||
|
||
[DataField("normal")] | ||
private string? _normal; | ||
|
||
[DataField("crit")] | ||
private string? _crit; | ||
|
||
[DataField("dead")] | ||
private string? _dead; | ||
|
||
/// <summary> | ||
/// Should noRot be turned off when crit / dead. | ||
/// </summary> | ||
[DataField("rotate")] | ||
private bool _rotate; | ||
|
||
void ISerializationHooks.BeforeSerialization() | ||
{ | ||
_stateMap.TryGetValue(DamageState.Alive, out _normal); | ||
_stateMap.TryGetValue(DamageState.Critical, out _crit); | ||
_stateMap.TryGetValue(DamageState.Dead, out _dead); | ||
} | ||
|
||
void ISerializationHooks.AfterDeserialization() | ||
{ | ||
if (_normal != null) | ||
{ | ||
_stateMap.Add(DamageState.Alive, _normal); | ||
} | ||
|
||
if (_crit != null) | ||
{ | ||
_stateMap.Add(DamageState.Critical, _crit); | ||
} | ||
|
||
if (_dead != null) | ||
{ | ||
_stateMap.Add(DamageState.Dead, _dead); | ||
} | ||
} | ||
|
||
public override void OnChangeData(AppearanceComponent component) | ||
{ | ||
base.OnChangeData(component); | ||
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(component.Owner); | ||
if (!component.TryGetData(DamageStateVisuals.State, out DamageState data)) | ||
{ | ||
return; | ||
} | ||
|
||
if (_data == data) | ||
{ | ||
return; | ||
} | ||
|
||
_data = data; | ||
|
||
if (_rotate) | ||
{ | ||
sprite.NoRotation = data switch | ||
{ | ||
DamageState.Critical => false, | ||
DamageState.Dead => false, | ||
_ => true | ||
}; | ||
} | ||
|
||
if (_stateMap.TryGetValue(_data, out var state)) | ||
{ | ||
sprite.LayerSetState(DamageStateVisualLayers.Base, state); | ||
} | ||
|
||
// So they don't draw over mobs anymore | ||
if (_data == DamageState.Dead && sprite.DrawDepth > (int) DrawDepth.Items) | ||
{ | ||
_originalDrawDepth = sprite.DrawDepth; | ||
sprite.DrawDepth = (int) DrawDepth.Items; | ||
} | ||
else if (_originalDrawDepth != null) | ||
{ | ||
sprite.DrawDepth = _originalDrawDepth.Value; | ||
_originalDrawDepth = null; | ||
} | ||
} | ||
} | ||
|
||
public enum DamageStateVisualLayers : byte | ||
{ | ||
Base | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,38 +1,7 @@ | ||
using Content.Shared.PowerCell; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.PowerCell; | ||
|
||
[UsedImplicitly] | ||
public sealed class PowerCellSystem : SharedPowerCellSystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<PowerCellVisualsComponent, AppearanceChangeEvent>(OnPowerCellVisualsChange); | ||
} | ||
|
||
private void OnPowerCellVisualsChange(EntityUid uid, PowerCellVisualsComponent component, ref AppearanceChangeEvent args) | ||
{ | ||
if (args.Sprite == null) return; | ||
|
||
if (args.Component.TryGetData(PowerCellVisuals.ChargeLevel, out byte level)) | ||
{ | ||
if (level == 0) | ||
{ | ||
args.Sprite.LayerSetVisible(PowerCellVisualLayers.Unshaded, false); | ||
return; | ||
} | ||
|
||
args.Sprite.LayerSetVisible(PowerCellVisualLayers.Unshaded, true); | ||
args.Sprite.LayerSetState(PowerCellVisualLayers.Unshaded, $"o{level}"); | ||
} | ||
} | ||
|
||
private enum PowerCellVisualLayers : byte | ||
{ | ||
Base, | ||
Unshaded, | ||
} | ||
} | ||
public sealed class PowerCellSystem : SharedPowerCellSystem { } |
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,46 @@ | ||
using Content.Shared.PowerCell; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.GameObjects; | ||
using Robust.Shared.IoC; | ||
using Robust.Shared.Serialization.Manager.Attributes; | ||
|
||
namespace Content.Client.PowerCell | ||
{ | ||
[UsedImplicitly] | ||
public sealed class PowerCellVisualizer : AppearanceVisualizer | ||
{ | ||
[DataField("prefix")] | ||
private string? _prefix; | ||
|
||
public override void InitializeEntity(EntityUid entity) | ||
{ | ||
base.InitializeEntity(entity); | ||
|
||
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(entity); | ||
|
||
if (_prefix != null) | ||
{ | ||
sprite.LayerMapSet(Layers.Charge, sprite.AddLayerState($"{_prefix}_100")); | ||
sprite.LayerSetShader(Layers.Charge, "unshaded"); | ||
} | ||
} | ||
|
||
public override void OnChangeData(AppearanceComponent component) | ||
{ | ||
base.OnChangeData(component); | ||
|
||
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(component.Owner); | ||
if (component.TryGetData(PowerCellVisuals.ChargeLevel, out byte level)) | ||
{ | ||
var adjustedLevel = level * 25; | ||
sprite.LayerSetState(Layers.Charge, $"{_prefix}_{adjustedLevel}"); | ||
} | ||
} | ||
|
||
private enum Layers : byte | ||
{ | ||
Charge | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
<DefaultWindow xmlns="https://spacestation14.io" | ||
xmlns:radar="clr-namespace:Content.Client.Radar" | ||
Title="{Loc 'radar-window-title'}" | ||
Resizable="False"> | ||
<BoxContainer Orientation="Horizontal"> | ||
<radar:RadarControl Name="Radar"/> | ||
</BoxContainer> | ||
</DefaultWindow> |
Oops, something went wrong.