mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
Lots of stuff. Also moved everything I could to the _Shitmed namespace
as I do in Goob. Will make future ports way faster
# Changelog
🆑 Mocho
- add: Added some fun organs and other thingies, check out the Goob PRs
if you want more details.
- fix: Fixed tons of issues with shitmed. Too many for the changelog in
fact.
(cherry picked from commit 3c9db94102cb25b28a83d51ac8d659fa31fe7d12)
59 lines
2.2 KiB
C#
59 lines
2.2 KiB
C#
using System.Linq;
|
|
using Content.Shared._Shitmed.Targeting;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client._Shitmed.UserInterface.Systems.Targeting.Widgets;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class TargetingControl : UIWidget
|
|
{
|
|
private readonly TargetingUIController _controller;
|
|
private readonly Dictionary<TargetBodyPart, TextureButton> _bodyPartControls;
|
|
|
|
public TargetingControl()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
_controller = UserInterfaceManager.GetUIController<TargetingUIController>();
|
|
|
|
_bodyPartControls = new Dictionary<TargetBodyPart, TextureButton>
|
|
{
|
|
// TODO: ADD EYE AND MOUTH TARGETING
|
|
{ TargetBodyPart.Head, HeadButton },
|
|
{ TargetBodyPart.Torso, ChestButton },
|
|
{ TargetBodyPart.Groin, GroinButton },
|
|
{ TargetBodyPart.LeftArm, LeftArmButton },
|
|
{ TargetBodyPart.LeftHand, LeftHandButton },
|
|
{ TargetBodyPart.RightArm, RightArmButton },
|
|
{ TargetBodyPart.RightHand, RightHandButton },
|
|
{ TargetBodyPart.LeftLeg, LeftLegButton },
|
|
{ TargetBodyPart.LeftFoot, LeftFootButton },
|
|
{ TargetBodyPart.RightLeg, RightLegButton },
|
|
{ TargetBodyPart.RightFoot, RightFootButton },
|
|
};
|
|
|
|
foreach (var bodyPartButton in _bodyPartControls)
|
|
{
|
|
bodyPartButton.Value.MouseFilter = MouseFilterMode.Stop;
|
|
bodyPartButton.Value.OnPressed += _ => SetActiveBodyPart(bodyPartButton.Key);
|
|
|
|
TargetDoll.Texture = Theme.ResolveTexture("target_doll");
|
|
}
|
|
}
|
|
|
|
private void SetActiveBodyPart(TargetBodyPart bodyPart) => _controller.CycleTarget(bodyPart);
|
|
|
|
public void SetBodyPartsVisible(TargetBodyPart bodyPart)
|
|
{
|
|
foreach (var bodyPartButton in _bodyPartControls)
|
|
bodyPartButton.Value.Children.First().Visible = bodyPartButton.Key == bodyPart;
|
|
}
|
|
|
|
protected override void OnThemeUpdated() => TargetDoll.Texture = Theme.ResolveTexture("target_doll");
|
|
|
|
public void SetTargetDollVisible(bool visible) => Visible = visible;
|
|
|
|
}
|