Фикс панели эмоутов и роадмапа (#3530)

This commit is contained in:
iertis 2025-12-28 21:09:11 +05:00 committed by GitHub
parent fad22424ea
commit 0736327c08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 61 additions and 38 deletions

View file

@ -55,7 +55,7 @@ namespace Content.Client.Info
var roadmapButton = new Button
{
Text = Loc.GetString("server-info-roadmap-button"),
StyleClasses = { StyleClass.ButtonSquare },
StyleClasses = { StyleClass.Negative },
};
roadmapButton.OnPressed += _ => UserInterfaceManager.GetUIController<RoadmapUIController>().ToggleRoadmap();
buttons.AddChild(roadmapButton);

View file

@ -8,7 +8,7 @@
<BoxContainer Orientation="Vertical" SeparationOverride="4" MinWidth="150">
<ui:VoteCallMenuButton />
<!-- Sunrise-Start -->
<Button Access="Public" Name="RoadmapButton" Text="{Loc 'ui-roadmap'}" StyleClasses="Caution" />
<Button Access="Public" Name="RoadmapButton" Text="{Loc 'ui-roadmap'}" />
<Button Access="Public" Name="DonateButton" Text="{Loc 'ui-escape-donate'}" />
<Button Access="Public" Name="ReplaysButton" Text="{Loc 'ui-escape-replays'}" />
<!-- Sunrise-End -->

View file

@ -169,8 +169,6 @@ namespace Content.Client.Stylesheets
public const string StyleClassCrossButtonRed = "CrossButtonRed";
public const string StyleClassButtonColorRed = "ButtonColorRed";
public const string StyleClassButtonColorGreen = "ButtonColorGreen";
public const string StyleClassNoStyle = "NoStyle"; // Sunrise-Edit
public static readonly Color ChatBackgroundColor = Color.FromHex("#25252ADD");
// i'm not sure what the missing symbols were referencing, and this is getting obseleted anyway so:
@ -1687,18 +1685,6 @@ namespace Content.Client.Stylesheets
.Pseudo(ContainerButton.StylePseudoClassHover)
.Prop(Control.StylePropertyModulateSelf, new Color(20, 156, 224)),
// Sunrise-Start
Element<Button>().Class(StyleClassNoStyle)
.Prop(Button.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = Color.Transparent,
ContentMarginLeftOverride = 15,
ContentMarginRightOverride = 15,
ContentMarginTopOverride = 12,
ContentMarginBottomOverride = 12
}),
// Sunrise-End
// Silicon law edit ui
Element<Label>().Class(SiliconLawContainer.StyleClassSiliconLawPositionLabel)
.Prop(Label.StylePropertyFontColor, NanoGold),

View file

@ -0,0 +1,31 @@
using System.Numerics;
using Content.Client._Sunrise.Stylesheets;
using Content.Client.Stylesheets;
using Content.Client.Stylesheets.Palette;
using Content.Client.Stylesheets.SheetletConfigs;
using Content.Client.Stylesheets.Stylesheets;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using static Content.Client.Stylesheets.StylesheetHelpers;
namespace Content.Client._Sunrise.Sheetlets;
[CommonSheetlet]
public sealed class SunriseButtonSheetlet<T> : Sheetlet<T> where T : PalettedStylesheet, IButtonConfig, IIconConfig
{
public override StyleRule[] GetRules(T sheet, object config)
{
return [
E<Button>().Class(SunriseStyleClass.StyleClassNoStyle)
.Box(new StyleBoxFlat
{
BackgroundColor = Color.Transparent,
ContentMarginLeftOverride = 15,
ContentMarginRightOverride = 15,
ContentMarginTopOverride = 12,
ContentMarginBottomOverride = 12
}),
];
}
}

View file

@ -0,0 +1,16 @@
namespace Content.Client._Sunrise.Stylesheets;
///
/// <summary>
/// A collection of public reusable style classes. These should be general purpose (Not specific to only one element
/// or Ui).
/// </summary>
/// <remarks>
/// It is named `StyleClass` as opposed to `StyleClasses` because `StyleClasses` is a field on `Control` so it made
/// it a pain to reference this class from a `Control`. (Weird name is worth typing `StyleClass.OpenBoth` vs.
/// `Stylesheets.Styleclasses.OpenBoth`)
/// </remarks>
public static class SunriseStyleClass
{
public const string StyleClassNoStyle = "NoStyle"; // Sunrise-Edit
}

View file

@ -154,8 +154,10 @@ public sealed partial class EmotesTabControl : BaseTabControl
if (emote.Category == EmoteCategory.Invalid || emote.Category == EmoteCategory.Verb || emote.ChatTriggers.Count == 0)
return false;
if (!whitelistSystem.IsWhitelistPassOrNull(emote.Whitelist, player) ||
whitelistSystem.IsWhitelistFail(emote.Blacklist, player))
if (whitelistSystem.IsWhitelistPass(emote.Blacklist, player))
return false;
if (whitelistSystem.IsWhitelistFail(emote.Whitelist, player))
return false;
if (!emote.Available &&

View file

@ -155,8 +155,10 @@ public sealed partial class VerbsTabControl : BaseTabControl
if (emote.Category == EmoteCategory.Invalid || emote.Category != EmoteCategory.Verb)
return false;
if (!whitelistSystem.IsWhitelistPassOrNull(emote.Whitelist, player) ||
whitelistSystem.IsWhitelistFail(emote.Blacklist, player))
if (whitelistSystem.IsWhitelistPass(emote.Blacklist, player))
return false;
if (whitelistSystem.IsWhitelistFail(emote.Whitelist, player))
return false;
if (!emote.Available &&

View file

@ -1,4 +1,5 @@
using Content.Server.Chat.Systems;
using System.Reflection.Metadata;
using Content.Server.Chat.Systems;
using Content.Shared._Sunrise.Animations;
using Content.Shared._Sunrise.Flip;
using Content.Shared._Sunrise.Jump;
@ -31,26 +32,11 @@ public sealed class EmoteAnimationSystem : EntitySystem
{
SubscribeLocalEvent<EmoteAnimationComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<EmoteAnimationComponent, EmoteEvent>(OnEmote);
SubscribeAllEvent<PlayEmoteMessage>(OnPlayEmote);
}
private void OnPlayEmote(PlayEmoteMessage msg, EntitySessionEventArgs args)
private void OnGetState(Entity<EmoteAnimationComponent> ent, ref ComponentGetState args)
{
if (args.SenderSession.AttachedEntity is not {} uid)
return;
if (!HasComp<EmoteAnimationComponent>(uid))
return;
if (!_prototypeManager.TryIndex(msg.ProtoId, out var proto))
return;
_chat.TryEmoteWithChat(uid, proto.ID);
}
private void OnGetState(EntityUid uid, EmoteAnimationComponent component, ref ComponentGetState args)
{
args.State = new EmoteAnimationComponent.EmoteAnimationComponentState(component.AnimationId);
args.State = new EmoteAnimationComponent.EmoteAnimationComponentState(ent.Comp.AnimationId);
}
private void OnEmote(EntityUid uid, EmoteAnimationComponent component, ref EmoteEvent args)