forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'space-wizards:master' into master
- Loading branch information
Showing
829 changed files
with
10,100 additions
and
5,066 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
"Changes: Sprites": | ||
- '**/*.rsi/*.png' | ||
- changed-files: | ||
- any-glob-to-any-file: '**/*.rsi/*.png' | ||
|
||
"Changes: Map": | ||
- 'Resources/Maps/*.yml' | ||
- 'Resources/Prototypes/Maps/*.yml' | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- 'Resources/Maps/*.yml' | ||
- 'Resources/Prototypes/Maps/*.yml' | ||
|
||
"Changes: UI": | ||
- '**/*.xaml*' | ||
- changed-files: | ||
- any-glob-to-any-file: '**/*.xaml*' | ||
|
||
"No C#": | ||
- all: ["!**/*.cs"] | ||
- changed-files: | ||
# Equiv to any-glob-to-all as long as this has one matcher. If ALL changed files are not C# files, then apply label. | ||
- all-globs-to-all-files: "!**/*.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
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,17 @@ | ||
using System.Numerics; | ||
|
||
namespace Content.Client.Animations; | ||
|
||
/// <summary> | ||
/// Entities with this component tracks the user's world position every frame. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class TrackUserComponent : Component | ||
{ | ||
public EntityUid? User; | ||
|
||
/// <summary> | ||
/// Offset in the direction of the entity's rotation. | ||
/// </summary> | ||
public Vector2 Offset = Vector2.Zero; | ||
} |
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,31 @@ | ||
<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"> | ||
|
||
<!-- Main --> | ||
<ui:RadialContainer Name="Main" VerticalExpand="True" HorizontalExpand="True" Radius="64" ReserveSpaceForHiddenChildren="False"> | ||
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'emote-menu-category-general'}" TargetLayer="General" Visible="False"> | ||
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Clothing/Head/Soft/mimesoft.rsi/icon.png"/> | ||
</ui:RadialMenuTextureButton> | ||
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'emote-menu-category-vocal'}" TargetLayer="Vocal" Visible="False"> | ||
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Actions/scream.png"/> | ||
</ui:RadialMenuTextureButton> | ||
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'emote-menu-category-hands'}" TargetLayer="Hands" Visible="False"> | ||
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Clothing/Hands/Gloves/latex.rsi/icon.png"/> | ||
</ui:RadialMenuTextureButton> | ||
</ui:RadialContainer> | ||
|
||
<!-- General --> | ||
<ui:RadialContainer Name="General" VerticalExpand="True" HorizontalExpand="True" Radius="64"/> | ||
|
||
<!-- Vocal --> | ||
<ui:RadialContainer Name="Vocal" VerticalExpand="True" HorizontalExpand="True" Radius="64"/> | ||
|
||
<!-- Hands --> | ||
<ui:RadialContainer Name="Hands" VerticalExpand="True" HorizontalExpand="True" Radius="64"/> | ||
|
||
</ui:RadialMenu> |
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,112 @@ | ||
using System.Numerics; | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Shared.Chat.Prototypes; | ||
using Content.Shared.Speech; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Player; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.Chat.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class EmotesMenu : RadialMenu | ||
{ | ||
[Dependency] private readonly EntityManager _entManager = default!; | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!; | ||
|
||
private readonly SpriteSystem _spriteSystem; | ||
|
||
public event Action<ProtoId<EmotePrototype>>? OnPlayEmote; | ||
|
||
public EmotesMenu() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
RobustXamlLoader.Load(this); | ||
|
||
_spriteSystem = _entManager.System<SpriteSystem>(); | ||
|
||
var main = FindControl<RadialContainer>("Main"); | ||
|
||
var emotes = _prototypeManager.EnumeratePrototypes<EmotePrototype>(); | ||
foreach (var emote in emotes) | ||
{ | ||
var player = _playerManager.LocalSession?.AttachedEntity; | ||
if (emote.Category == EmoteCategory.Invalid || | ||
emote.ChatTriggers.Count == 0 || | ||
!(player.HasValue && (emote.Whitelist?.IsValid(player.Value, _entManager) ?? true)) || | ||
(emote.Blacklist?.IsValid(player.Value, _entManager) ?? false)) | ||
continue; | ||
|
||
if (!emote.Available && | ||
_entManager.TryGetComponent<SpeechComponent>(player.Value, out var speech) && | ||
!speech.AllowedEmotes.Contains(emote.ID)) | ||
continue; | ||
|
||
var parent = FindControl<RadialContainer>(emote.Category.ToString()); | ||
|
||
var button = new EmoteMenuButton | ||
{ | ||
StyleClasses = { "RadialMenuButton" }, | ||
SetSize = new Vector2(64f, 64f), | ||
ToolTip = Loc.GetString(emote.Name), | ||
ProtoId = emote.ID, | ||
}; | ||
|
||
var tex = new TextureRect | ||
{ | ||
VerticalAlignment = VAlignment.Center, | ||
HorizontalAlignment = HAlignment.Center, | ||
Texture = _spriteSystem.Frame0(emote.Icon), | ||
TextureScale = new Vector2(2f, 2f), | ||
}; | ||
|
||
button.AddChild(tex); | ||
parent.AddChild(button); | ||
foreach (var child in main.Children) | ||
{ | ||
if (child is not RadialMenuTextureButton castChild) | ||
continue; | ||
|
||
if (castChild.TargetLayer == emote.Category.ToString()) | ||
{ | ||
castChild.Visible = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
|
||
// Set up menu actions | ||
foreach (var child in Children) | ||
{ | ||
if (child is not RadialContainer container) | ||
continue; | ||
AddEmoteClickAction(container); | ||
} | ||
} | ||
|
||
private void AddEmoteClickAction(RadialContainer container) | ||
{ | ||
foreach (var child in container.Children) | ||
{ | ||
if (child is not EmoteMenuButton castChild) | ||
continue; | ||
|
||
castChild.OnButtonUp += _ => | ||
{ | ||
OnPlayEmote?.Invoke(castChild.ProtoId); | ||
Close(); | ||
}; | ||
} | ||
} | ||
} | ||
|
||
|
||
public sealed class EmoteMenuButton : RadialMenuTextureButton | ||
{ | ||
public ProtoId<EmotePrototype> ProtoId { get; set; } | ||
} |
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
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,48 @@ | ||
using Robust.Client.GameObjects; | ||
using Content.Shared.Fax.Components; | ||
using Content.Shared.Fax; | ||
using Robust.Client.Animations; | ||
|
||
namespace Content.Client.Fax.System; | ||
|
||
/// <summary> | ||
/// Visualizer for the fax machine which displays the correct sprite based on the inserted entity. | ||
/// </summary> | ||
public sealed class FaxVisualsSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly AnimationPlayerSystem _player = default!; | ||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<FaxMachineComponent, AppearanceChangeEvent>(OnAppearanceChanged); | ||
} | ||
|
||
private void OnAppearanceChanged(EntityUid uid, FaxMachineComponent component, ref AppearanceChangeEvent args) | ||
{ | ||
if (args.Sprite == null) | ||
return; | ||
|
||
if (_appearance.TryGetData(uid, FaxMachineVisuals.VisualState, out FaxMachineVisualState visuals) && visuals == FaxMachineVisualState.Inserting) | ||
{ | ||
_player.Play(uid, new Animation() | ||
{ | ||
Length = TimeSpan.FromSeconds(2.4), | ||
AnimationTracks = | ||
{ | ||
new AnimationTrackSpriteFlick() | ||
{ | ||
LayerKey = FaxMachineVisuals.VisualState, | ||
KeyFrames = | ||
{ | ||
new AnimationTrackSpriteFlick.KeyFrame(component.InsertingState, 0f), | ||
new AnimationTrackSpriteFlick.KeyFrame("icon", 2.4f), | ||
} | ||
} | ||
} | ||
}, "faxecute"); | ||
} | ||
} | ||
} |
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.