forked from Simple-Station/Einstein-Engines
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changelings playtest (Simple-Station#381)
- Loading branch information
Showing
143 changed files
with
3,635 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Content.Client.Alerts; | ||
using Content.Client.UserInterface.Systems.Alerts.Controls; | ||
using Content.Shared.Changeling; | ||
using Content.Shared.StatusIcon.Components; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.Changeling; | ||
|
||
public sealed partial class ChangelingSystem : EntitySystem | ||
{ | ||
|
||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ChangelingComponent, UpdateAlertSpriteEvent>(OnUpdateAlert); | ||
SubscribeLocalEvent<ChangelingComponent, GetStatusIconsEvent>(GetChanglingIcon); | ||
} | ||
|
||
private void OnUpdateAlert(EntityUid uid, ChangelingComponent comp, ref UpdateAlertSpriteEvent args) | ||
{ | ||
if (args.Alert.AlertKey.AlertType != "Chemicals") | ||
return; | ||
|
||
var chemicalsNormalised = (int) (comp.Chemicals / comp.MaxChemicals * 16); // hardcoded because uhh umm | ||
var sprite = args.SpriteViewEnt.Comp; | ||
sprite.LayerSetState(AlertVisualLayers.Base, $"{chemicalsNormalised}"); | ||
} | ||
|
||
private void GetChanglingIcon(Entity<ChangelingComponent> ent, ref GetStatusIconsEvent args) | ||
{ | ||
if (HasComp<HivemindComponent>(ent) && _prototype.TryIndex(ent.Comp.StatusIcon, out var iconPrototype)) | ||
args.StatusIcons.Add(iconPrototype); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Content.Client/Goobstation/Changeling/UI/TransformMenu.xaml
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 @@ | ||
<ui:RadialMenu xmlns="https://spacestation14.io" | ||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls" | ||
BackButtonStyleClass="RadialMenuBackButton" | ||
CloseButtonStyleClass="RadialMenuCloseButton" | ||
VerticalExpand="True" | ||
HorizontalExpand="True" | ||
MinSize="450 450"> | ||
|
||
<ui:RadialContainer Name="Main" VerticalExpand="True" HorizontalExpand="True" Radius="64"/> | ||
|
||
</ui:RadialMenu> |
26 changes: 26 additions & 0 deletions
26
Content.Client/Goobstation/Changeling/UI/TransformMenu.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Content.Client.UserInterface.Controls; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client.Changeling.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class TransformMenu : RadialMenu | ||
{ | ||
[Dependency] private readonly EntityManager _entity = default!; | ||
|
||
private readonly SpriteSystem _sprite = default!; | ||
|
||
public TransformMenu() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
RobustXamlLoader.Load(this); | ||
|
||
_sprite = _entity.System<SpriteSystem>(); | ||
|
||
var main = FindControl<RadialContainer>("Main"); | ||
|
||
// TODO: transform radial menu | ||
} | ||
} |
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
Oops, something went wrong.