Фикс панели эмоутов и роадмапа (#3530)
This commit is contained in:
parent
fad22424ea
commit
0736327c08
8 changed files with 61 additions and 38 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 -->
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
31
Content.Client/_Sunrise/Sheetlets/SunriseButtonSheetlets.cs
Normal file
31
Content.Client/_Sunrise/Sheetlets/SunriseButtonSheetlets.cs
Normal 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
|
||||
}),
|
||||
];
|
||||
}
|
||||
}
|
||||
16
Content.Client/_Sunrise/Sheetlets/SunriseStyleClass.cs
Normal file
16
Content.Client/_Sunrise/Sheetlets/SunriseStyleClass.cs
Normal 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
|
||||
}
|
||||
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue