diff --git a/Content.Client/FlavorText/FlavorText.xaml b/Content.Client/FlavorText/FlavorText.xaml index 37d4b5fda05..36363f9f439 100644 --- a/Content.Client/FlavorText/FlavorText.xaml +++ b/Content.Client/FlavorText/FlavorText.xaml @@ -1,5 +1,10 @@  + diff --git a/Content.Client/FlavorText/FlavorText.xaml.cs b/Content.Client/FlavorText/FlavorText.xaml.cs index 91b59046a47..f6afe3a1424 100644 --- a/Content.Client/FlavorText/FlavorText.xaml.cs +++ b/Content.Client/FlavorText/FlavorText.xaml.cs @@ -1,4 +1,5 @@ -using Robust.Client.AutoGenerated; +using Content.Sunrise.Interfaces.Shared; +using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; using Robust.Shared.Utility; @@ -10,14 +11,40 @@ public sealed partial class FlavorText : Control { public Action? OnFlavorTextChanged; - public FlavorText() + private ISharedSponsorsManager? _sponsorsMgr; // Sunrise-Sponsors + + public FlavorText(ISharedSponsorsManager? sponsorsMgr, bool sponsorOnly) // Sunrise-Edit { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); + _sponsorsMgr = sponsorsMgr; + var loc = IoCManager.Resolve(); CFlavorTextInput.Placeholder = new Rope.Leaf(loc.GetString("flavor-text-placeholder")); CFlavorTextInput.OnTextChanged += _ => FlavorTextChanged(); + // Sunrise-Start + if (sponsorOnly) + { + SponsorOnlyNotify.Visible = true; + CFlavorTextInput.Visible = false; + LimitBox.Visible = false; + } + if (_sponsorsMgr != null && _sponsorsMgr.ClientAllowedFlavor()) + { + var maxDescLength = _sponsorsMgr.ClientGetSizeFlavor(); + LimitLabel.Text = $"{maxDescLength}"; + SponsorOnlyNotify.Visible = false; + CFlavorTextInput.Visible = true; + LimitBox.Visible = true; + } + else + { + SponsorOnlyNotify.Visible = true; + CFlavorTextInput.Visible = false; + LimitBox.Visible = false; + } + // Sunrise-End } public void FlavorTextChanged() diff --git a/Content.Client/Holiday/HolidayClothingSwapComponent.cs b/Content.Client/Holiday/HolidayClothingSwapComponent.cs new file mode 100644 index 00000000000..b6e0d6655e1 --- /dev/null +++ b/Content.Client/Holiday/HolidayClothingSwapComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Client.Holiday; + +[RegisterComponent] +public sealed partial class HolidayClothingSwapComponent : Component +{ + [DataField] + public Dictionary Sprite = new(); +} diff --git a/Content.Client/Holiday/HolidaySystem.cs b/Content.Client/Holiday/HolidaySystem.cs index 07ae98f4490..ecadf113937 100644 --- a/Content.Client/Holiday/HolidaySystem.cs +++ b/Content.Client/Holiday/HolidaySystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Clothing.EntitySystems; using Content.Shared.Holiday; using Content.Shared.Item; using Robust.Client.GameObjects; @@ -11,11 +12,13 @@ public sealed class HolidaySystem : EntitySystem { [Dependency] private readonly IResourceCache _rescache = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly ClothingSystem _clothing = default!; /// public override void Initialize() { SubscribeLocalEvent(OnAppearanceChange); + SubscribeLocalEvent(OnAppearanceChange); } private void OnAppearanceChange(Entity ent, ref AppearanceChangeEvent args) @@ -31,4 +34,18 @@ private void OnAppearanceChange(Entity ent, ref Appeara if (_rescache.TryGetResource(path, out RSIResource? rsi)) args.Sprite.BaseRSI = rsi.RSI; } + + // Sunrise-Start + private void OnAppearanceChange(Entity ent, ref AppearanceChangeEvent args) + { + if (!_appearance.TryGetData(ent, HolidayVisuals.Holiday, out var data, args.Component)) + return; + + var comp = ent.Comp; + if (!comp.Sprite.TryGetValue(data, out var rsistring) || args.Sprite == null) + return; + + _clothing.SetVisuals(ent, rsistring); + } + // Sunrise-End } diff --git a/Content.Client/Holopad/HolopadWindow.xaml b/Content.Client/Holopad/HolopadWindow.xaml index 9c3dfab1ea6..5a7ad05bea8 100644 --- a/Content.Client/Holopad/HolopadWindow.xaml +++ b/Content.Client/Holopad/HolopadWindow.xaml @@ -27,7 +27,11 @@ @@ -68,18 +72,25 @@ - + - + + + + - - - + - - - + + + + + + + + diff --git a/Content.Client/Holopad/HolopadWindow.xaml.cs b/Content.Client/Holopad/HolopadWindow.xaml.cs index bcab0d43df1..25982b901c2 100644 --- a/Content.Client/Holopad/HolopadWindow.xaml.cs +++ b/Content.Client/Holopad/HolopadWindow.xaml.cs @@ -171,8 +171,10 @@ public void UpdateState(Dictionary holopads) // Caller ID text var callerId = _telephoneSystem.GetFormattedCallerIdForEntity(telephone.LastCallerId.Item1, telephone.LastCallerId.Item2, Color.LightGray, "Default", 11); + var holoapdId = _telephoneSystem.GetFormattedDeviceIdForEntity(telephone.LastCallerId.Item3, Color.LightGray, "Default", 11); CallerIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(callerId)); + HolopadIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(holoapdId)); LockOutIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(callerId)); // Sort holopads alphabetically @@ -236,10 +238,13 @@ private void UpdateAppearance() // Make / update required children foreach (var child in ContactsList.Children) { - if (child is not HolopadContactButton) + if (child is not HolopadContactButton contactButton) continue; - var contactButton = (HolopadContactButton)child; + var passesFilter = string.IsNullOrEmpty(SearchLineEdit.Text) || + contactButton.Text?.Contains(SearchLineEdit.Text, StringComparison.CurrentCultureIgnoreCase) == true; + + contactButton.Visible = passesFilter; contactButton.Disabled = (_currentState != TelephoneState.Idle || lockButtons); } @@ -290,7 +295,7 @@ private void UpdateAppearance() FetchingAvailableHolopadsContainer.Visible = (ContactsList.ChildCount == 0); ActiveCallControlsContainer.Visible = (_currentState != TelephoneState.Idle || _currentUiKey == HolopadUiKey.AiRequestWindow); CallPlacementControlsContainer.Visible = !ActiveCallControlsContainer.Visible; - CallerIdText.Visible = (_currentState == TelephoneState.Ringing); + CallerIdContainer.Visible = (_currentState == TelephoneState.Ringing); AnswerCallButton.Visible = (_currentState == TelephoneState.Ringing); } @@ -316,6 +321,7 @@ public HolopadContactButton() HorizontalExpand = true; SetHeight = 32; Margin = new Thickness(0f, 1f, 0f, 1f); + ReservesSpace = false; } public void UpdateValues(NetEntity netEntity, string label) diff --git a/Content.Client/Lobby/LobbyUIController.cs b/Content.Client/Lobby/LobbyUIController.cs index 03e67988976..91ea85ea253 100644 --- a/Content.Client/Lobby/LobbyUIController.cs +++ b/Content.Client/Lobby/LobbyUIController.cs @@ -5,6 +5,7 @@ using Content.Client.Lobby.UI; using Content.Client.Players.PlayTimeTracking; using Content.Client.Station; +using Content.Shared._Sunrise.SunriseCCVars; using Content.Shared.CCVar; using Content.Shared.Clothing; using Content.Shared.GameTicking; @@ -75,6 +76,12 @@ public override void Initialize() { _profileEditor?.RefreshFlavorText(); }); + // Sunrise-Start + _configurationManager.OnValueChanged(SunriseCCVars.FlavorTextSponsorOnly, args => + { + _profileEditor?.RefreshFlavorText(); + }); + // Sunrise-End _configurationManager.OnValueChanged(CCVars.GameRoleTimers, _ => RefreshProfileEditor()); diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index c4eee784d73..d3a320a29f6 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -470,7 +470,10 @@ public void RefreshFlavorText() if (_flavorText != null) return; - _flavorText = new FlavorText.FlavorText(); + // Sunrise-Start + var sponsorOnly = _cfgManager.GetCVar(SunriseCCVars.FlavorTextSponsorOnly); + _flavorText = new FlavorText.FlavorText(_sponsorsMgr, sponsorOnly); + // Sunrise-End TabContainer.AddChild(_flavorText); TabContainer.SetTabTitle(TabContainer.ChildCount - 1, Loc.GetString("humanoid-profile-editor-flavortext-tab")); _flavorTextEdit = _flavorText.CFlavorTextInput; diff --git a/Content.Client/Options/UI/OptionsMenu.xaml b/Content.Client/Options/UI/OptionsMenu.xaml index 2077625c232..1bcd857c0f4 100644 --- a/Content.Client/Options/UI/OptionsMenu.xaml +++ b/Content.Client/Options/UI/OptionsMenu.xaml @@ -3,11 +3,11 @@ Title="{Loc 'ui-options-title'}" MinSize="800 450"> + - diff --git a/Content.Client/Options/UI/OptionsMenu.xaml.cs b/Content.Client/Options/UI/OptionsMenu.xaml.cs index 1da25fedaf4..b5afd6f7f0d 100644 --- a/Content.Client/Options/UI/OptionsMenu.xaml.cs +++ b/Content.Client/Options/UI/OptionsMenu.xaml.cs @@ -13,12 +13,14 @@ public OptionsMenu() RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); - Tabs.SetTabTitle(0, Loc.GetString("ui-options-tab-misc")); - Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-graphics")); - Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-controls")); - Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-audio")); - Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-accessibility")); - Tabs.SetTabTitle(5, Loc.GetString("ui-options-tab-sunrise")); + // Sunrise-Start + Tabs.SetTabTitle(0, Loc.GetString("ui-options-tab-extra")); + Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-misc")); + Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-graphics")); + Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-controls")); + Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-audio")); + Tabs.SetTabTitle(5, Loc.GetString("ui-options-tab-accessibility")); + // Sunrise-End UpdateTabs(); } diff --git a/Content.Client/Options/UI/Tabs/SunriseTab.xaml b/Content.Client/Options/UI/Tabs/ExtraTab.xaml similarity index 97% rename from Content.Client/Options/UI/Tabs/SunriseTab.xaml rename to Content.Client/Options/UI/Tabs/ExtraTab.xaml index c2541cb318a..eab6293d02e 100644 --- a/Content.Client/Options/UI/Tabs/SunriseTab.xaml +++ b/Content.Client/Options/UI/Tabs/ExtraTab.xaml @@ -1,4 +1,4 @@ - @@ -36,4 +36,4 @@ - + diff --git a/Content.Client/Options/UI/Tabs/SunriseTab.xaml.cs b/Content.Client/Options/UI/Tabs/ExtraTab.xaml.cs similarity index 98% rename from Content.Client/Options/UI/Tabs/SunriseTab.xaml.cs rename to Content.Client/Options/UI/Tabs/ExtraTab.xaml.cs index 5524198193f..6a0fc23cf89 100644 --- a/Content.Client/Options/UI/Tabs/SunriseTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/ExtraTab.xaml.cs @@ -13,12 +13,12 @@ namespace Content.Client.Options.UI.Tabs; [GenerateTypedNameReferences] -public sealed partial class SunriseTab : Control +public sealed partial class ExtraTab : Control { [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - public SunriseTab() + public ExtraTab() { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); diff --git a/Content.Client/Physics/Controllers/MoverController.cs b/Content.Client/Physics/Controllers/MoverController.cs index f6631f41cef..d2ac0cdefdc 100644 --- a/Content.Client/Physics/Controllers/MoverController.cs +++ b/Content.Client/Physics/Controllers/MoverController.cs @@ -146,6 +146,9 @@ public override void SetSprinting(Entity entity, ushort sub // Logger.Info($"[{_gameTiming.CurTick}/{subTick}] Sprint: {enabled}"); base.SetSprinting(entity, subTick, walking); - + if (walking && _cfg.GetCVar(CCVars.ToggleWalk)) + _alerts.ShowAlert(entity, WalkingAlert, showCooldown: false, autoRemove: false); + else + _alerts.ClearAlert(entity, WalkingAlert); } } diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs index d8042897036..3ddfd10fae0 100644 --- a/Content.Client/Stylesheets/StyleNano.cs +++ b/Content.Client/Stylesheets/StyleNano.cs @@ -163,6 +163,7 @@ public sealed class StyleNano : StyleBase 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"); @@ -1722,7 +1723,19 @@ public StyleNano(IResourceCache resCache) : base(resCache) new[] { new StyleProperty(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Bwoink/un_pinned.png")) - }) + }), + // Sunrise-Edit + + Element +