From a31947423cdeab8b0e0846971fef9b5d2c0f1e63 Mon Sep 17 00:00:00 2001 From: Cinka Date: Mon, 26 Feb 2024 21:43:11 +0300 Subject: [PATCH] - add: more interaction shit --- .../Animation/SharebleAnimationSystem.cs | 7 +- .../InteractionPanel/InteractionPanelEui.cs | 1 + .../UI/InteractionPanelButton.xaml.cs | 13 +- .../UI/InteractionPanelWindow.xaml | 12 +- .../UI/InteractionPanelWindow.xaml.cs | 44 ++- .../InteractionPanel/InteractionPanelEui.cs | 21 +- .../InteractionPanelSystem.cs | 105 +++++- .../_Amour/InteractionPanel/Interactions.cs | 38 +-- .../InteractionPanel/Actions/Animations.cs | 102 ++++++ .../Actions/IInteractionAction.cs | 7 + .../Checks/IInteractionCheck.cs | 7 + .../InteractionPanel/Checks/Interaction.cs | 18 ++ .../InteractionPanel/IInteractionCheck.cs | 18 -- .../InteractionPanel/InteractionDoAfter.cs | 15 + .../InteractionGroupPrototype.cs | 11 + .../InteractionPanelComponent.cs | 1 + .../InteractionPanelMessages.cs | 20 +- .../InteractionPanelSystem.cs | 11 - .../InteractionPanel/InteractionPrototype.cs | 13 + Resources/Locale/ru-RU/_amour/anus.ftl | 6 - Resources/Locale/ru-RU/_amour/interaction.ftl | 6 - .../ru-RU/_amour/interactions/interaction.ftl | 28 ++ .../Locale/ru-RU/_amour/interactions/ui.ftl | 2 + .../Prototypes/Entities/Mobs/Species/base.yml | 3 +- .../_Amour/Interactions/interaction.yml | 298 ++++++++++++++++++ .../_Amour/Interactions/interactionGroups.yml | 19 ++ .../_Amour/Interactions/interactionList.yml | 23 ++ 27 files changed, 752 insertions(+), 97 deletions(-) create mode 100644 Content.Shared/_Amour/InteractionPanel/Actions/Animations.cs create mode 100644 Content.Shared/_Amour/InteractionPanel/Actions/IInteractionAction.cs create mode 100644 Content.Shared/_Amour/InteractionPanel/Checks/IInteractionCheck.cs delete mode 100644 Content.Shared/_Amour/InteractionPanel/IInteractionCheck.cs create mode 100644 Content.Shared/_Amour/InteractionPanel/InteractionDoAfter.cs create mode 100644 Content.Shared/_Amour/InteractionPanel/InteractionGroupPrototype.cs delete mode 100644 Content.Shared/_Amour/InteractionPanel/InteractionPanelSystem.cs delete mode 100644 Resources/Locale/ru-RU/_amour/anus.ftl delete mode 100644 Resources/Locale/ru-RU/_amour/interaction.ftl create mode 100644 Resources/Locale/ru-RU/_amour/interactions/interaction.ftl create mode 100644 Resources/Locale/ru-RU/_amour/interactions/ui.ftl create mode 100644 Resources/Prototypes/_Amour/Interactions/interactionGroups.yml create mode 100644 Resources/Prototypes/_Amour/Interactions/interactionList.yml diff --git a/Content.Client/_Amour/Animation/SharebleAnimationSystem.cs b/Content.Client/_Amour/Animation/SharebleAnimationSystem.cs index 8c896bbed0..9430dfa85c 100644 --- a/Content.Client/_Amour/Animation/SharebleAnimationSystem.cs +++ b/Content.Client/_Amour/Animation/SharebleAnimationSystem.cs @@ -46,8 +46,11 @@ public sealed class SharebleAnimationSystem : SharedAnimationSystem public override void Play(EntityUid uid,AnimationData data, string animationId = "funny") { - if(_animation.HasRunningAnimation(uid,animationId)) - return; + if (_animation.HasRunningAnimation(uid, animationId)) + { + Logger.Error($"Entity {ToPrettyString(uid)} has running animation {animationId}"); + _animation.Stop(uid,animationId); + } var animation = ParseAnimation(data); _animation.Play(uid,animation,animationId); diff --git a/Content.Client/_Amour/InteractionPanel/InteractionPanelEui.cs b/Content.Client/_Amour/InteractionPanel/InteractionPanelEui.cs index e5fcefe426..ba18999c3e 100644 --- a/Content.Client/_Amour/InteractionPanel/InteractionPanelEui.cs +++ b/Content.Client/_Amour/InteractionPanel/InteractionPanelEui.cs @@ -19,6 +19,7 @@ public sealed class InteractionPanelEui : BaseEui _interactionPanelWindow = new UI.InteractionPanelWindow(); _interactionPanelWindow.OnClose += () => SendMessage(new CloseEuiMessage()); _interactionPanelWindow.OnInteraction += InteractionPanelWindowOnInteraction; + _interactionPanelWindow.OnUpdateRequired += () => SendMessage(new InteractionUpdateMessage()); } private void InteractionPanelWindowOnInteraction(string id) diff --git a/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelButton.xaml.cs b/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelButton.xaml.cs index afe738a8ce..243c8601ce 100644 --- a/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelButton.xaml.cs +++ b/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelButton.xaml.cs @@ -6,10 +6,21 @@ using Robust.Client.UserInterface.XAML; namespace Content.Client._Amour.InteractionPanel.UI; [GenerateTypedNameReferences] -public sealed partial class InteractionPanelButton : ContainerButton +public sealed partial class InteractionPanelButton : Button { public event Action? OnInteraction; + private Color _color = Color.White; + public Color Color + { + get => _color; + set + { + _color = value; + ModulateSelfOverride = value; + } + } + private string _interactionId = "Interaction"; public string InteractionId { diff --git a/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelWindow.xaml b/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelWindow.xaml index e96c2e42ab..5810675815 100644 --- a/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelWindow.xaml +++ b/Content.Client/_Amour/InteractionPanel/UI/InteractionPanelWindow.xaml @@ -3,7 +3,7 @@ xmlns:controls1="clr-namespace:Content.Client.UserInterface.Controls" xmlns:ui="clr-namespace:Content.Client._Amour.InteractionPanel.UI" Title="{Loc 'interaction-panel-title'}" - MinSize="400 500"> + MinSize="500 500"> @@ -35,8 +35,16 @@ - + + + +