Skip to content

Commit

Permalink
Merge branch 'newyear_2025' of https://github.com/DragonDidlo/space-s…
Browse files Browse the repository at this point in the history
…tation-14_sunrise_dev into newyear_2025
  • Loading branch information
DragonDidlo committed Dec 30, 2024
2 parents f865d41 + 6e6891d commit 36257a3
Show file tree
Hide file tree
Showing 382 changed files with 174,460 additions and 68,569 deletions.
5 changes: 5 additions & 0 deletions Content.Client/FlavorText/FlavorText.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<Control Name="CFlavorText" xmlns="https://spacestation14.io">
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<Label Name="SponsorOnlyNotify" Text="{Loc 'humanoid-profile-editor-flavor-text-sponsor-only'}" StyleClasses="LabelKeyText" Visible="False" />
<BoxContainer Name="LimitBox" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 5 0 0">
<Label Name="LimitTitle" Text="{Loc 'humanoid-profile-editor-flavor-text-limit'}" StyleClasses="LabelKeyText" Margin="0 0 5 0" />
<Label Name="LimitLabel"/>
</BoxContainer>
<TextEdit Name="CFlavorTextInput" Access="Public" MinSize="220 100" Margin="10" HorizontalExpand="True" VerticalExpand="True" />
</BoxContainer>
</Control>
31 changes: 29 additions & 2 deletions Content.Client/FlavorText/FlavorText.xaml.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -10,14 +11,40 @@ public sealed partial class FlavorText : Control
{
public Action<string>? 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<ILocalizationManager>();
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()
Expand Down
8 changes: 8 additions & 0 deletions Content.Client/Holiday/HolidayClothingSwapComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Content.Client.Holiday;

[RegisterComponent]
public sealed partial class HolidayClothingSwapComponent : Component
{
[DataField]
public Dictionary<string, string> Sprite = new();
}
17 changes: 17 additions & 0 deletions Content.Client/Holiday/HolidaySystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Holiday;
using Content.Shared.Item;
using Robust.Client.GameObjects;
Expand All @@ -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!;

/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<HolidayRsiSwapComponent, AppearanceChangeEvent>(OnAppearanceChange);
SubscribeLocalEvent<HolidayClothingSwapComponent, AppearanceChangeEvent>(OnAppearanceChange);
}

private void OnAppearanceChange(Entity<HolidayRsiSwapComponent> ent, ref AppearanceChangeEvent args)
Expand All @@ -31,4 +34,18 @@ private void OnAppearanceChange(Entity<HolidayRsiSwapComponent> ent, ref Appeara
if (_rescache.TryGetResource(path, out RSIResource? rsi))
args.Sprite.BaseRSI = rsi.RSI;
}

// Sunrise-Start
private void OnAppearanceChange(Entity<HolidayClothingSwapComponent> ent, ref AppearanceChangeEvent args)
{
if (!_appearance.TryGetData<string>(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
}
31 changes: 21 additions & 10 deletions Content.Client/Holopad/HolopadWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
<!-- Header text -->
<BoxContainer MinHeight="60" Orientation="Vertical" VerticalAlignment="Center">
<Label Name="CallStatusText" Margin="10 5 10 0" ReservesSpace="False"/>
<RichTextLabel Name="CallerIdText" HorizontalAlignment="Center" Margin="0 0 0 0" ReservesSpace="False"/>
<BoxContainer Name="CallerIdContainer" Orientation="Vertical" ReservesSpace="False">
<RichTextLabel Name="CallerIdText" HorizontalAlignment="Center" Margin="0 0 0 0"/>
<Label Text="{Loc 'holopad-window-relay-label'}" Margin="10 5 10 0" ReservesSpace="False"/>
<RichTextLabel Name="HolopadIdText" HorizontalAlignment="Center" Margin="0 0 0 10"/>
</BoxContainer>
</BoxContainer>

<!-- Controls (the answer call button is absent when the phone is not ringing) -->
Expand Down Expand Up @@ -68,18 +72,25 @@
<PanelContainer Name="HolopadContactListHeaderPanel">
<Label Text="{Loc 'holopad-window-select-contact-from-list'}" HorizontalAlignment="Center" Margin="0 3 0 3"/>
</PanelContainer>

<PanelContainer Name="HolopadContactListPanel">
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" Margin="8, 8, 8, 8" MinHeight="256">
<BoxContainer Orientation="Vertical">

<!-- Contact filter -->
<LineEdit Name="SearchLineEdit" HorizontalExpand="True" Margin="4, 4, 4, 0"
PlaceHolder="{Loc holopad-window-filter-line-placeholder}" />

<!-- If there is no data yet, this will be displayed -->
<BoxContainer Name="FetchingAvailableHolopadsContainer" HorizontalAlignment="Center" HorizontalExpand="True" VerticalExpand="True" ReservesSpace="False">
<Label Text="{Loc 'holopad-window-fetching-contacts-list'}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</BoxContainer>
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" Margin="8, 8, 8, 8" MinHeight="256">

<!-- Container for the contacts -->
<BoxContainer Name="ContactsList" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="10 0 10 0"/>
</ScrollContainer>
<!-- If there is no data yet, this will be displayed -->
<BoxContainer Name="FetchingAvailableHolopadsContainer" HorizontalAlignment="Center" HorizontalExpand="True" VerticalExpand="True" ReservesSpace="False">
<Label Text="{Loc 'holopad-window-fetching-contacts-list'}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</BoxContainer>

<!-- Container for the contacts -->
<BoxContainer Name="ContactsList" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="10 0 10 0"/>
</ScrollContainer>
</BoxContainer>
</PanelContainer>
</BoxContainer>

Expand Down
12 changes: 9 additions & 3 deletions Content.Client/Holopad/HolopadWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ public void UpdateState(Dictionary<NetEntity, string> 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
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand All @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Options/UI/OptionsMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Title="{Loc 'ui-options-title'}"
MinSize="800 450">
<TabContainer Name="Tabs" Access="Public">
<tabs:ExtraTab Name="ExtraTab" />
<tabs:MiscTab Name="MiscTab" />
<tabs:GraphicsTab Name="GraphicsTab" />
<tabs:KeyRebindTab Name="KeyRebindTab" />
<tabs:AudioTab Name="AudioTab" />
<tabs:AccessibilityTab Name="AccessibilityTab" />
<tabs:SunriseTab Name="SunriseTab" />
</TabContainer>
</DefaultWindow>
14 changes: 8 additions & 6 deletions Content.Client/Options/UI/OptionsMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tabs:SunriseTab xmlns="https://spacestation14.io"
<tabs:ExtraTab xmlns="https://spacestation14.io"
xmlns:tabs="clr-namespace:Content.Client.Options.UI.Tabs"
xmlns:ui="clr-namespace:Content.Client.Options.UI">
<BoxContainer Orientation="Vertical">
Expand Down Expand Up @@ -26,6 +26,7 @@
<ui:OptionSlider Name="SliderTtsRadio" Title="{Loc 'ui-options-tts-radio-volume'}" />
<ui:OptionSlider Name="SliderTtsAnnounce" Title="{Loc 'ui-options-tts-announce-volume'}" />
<CheckBox Name="TapePlayerClientCheckBox" Text="{Loc 'ui-options-tape-player-enabled'}" />
<CheckBox Name="JumpEnabledSoundCheckBox" Text="{Loc 'ui-options-jump-sound-enabled'}" />

<!-- Graphics -->
<Label Text="{Loc 'ui-options-sunrise-general-graphics'}" StyleClasses="LabelKeyText"/>
Expand All @@ -34,4 +35,4 @@
</ScrollContainer>
<ui:OptionsTabControlRow Name="Control" Access="Public" />
</BoxContainer>
</tabs:SunriseTab>
</tabs:ExtraTab>
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,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);
Expand All @@ -39,6 +39,7 @@ public SunriseTab()

Control.AddOptionCheckBox(SunriseCCVars.TTSClientEnabled, TtsClientCheckBox);
Control.AddOptionCheckBox(SunriseCCVars.TapePlayerClientEnabled, TapePlayerClientCheckBox);
Control.AddOptionCheckBox(SunriseCCVars.JumpSoundEnable, JumpEnabledSoundCheckBox);

_cfg.OnValueChanged(SunriseCCVars.LobbyBackgroundType, OnLobbyBackgroundTypeChanged, true);

Expand Down
15 changes: 14 additions & 1 deletion Content.Client/Stylesheets/StyleNano.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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<Button>().Class(StyleClassNoStyle)
.Prop(Button.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = Color.Transparent,
ContentMarginLeftOverride = 15,
ContentMarginRightOverride = 15,
ContentMarginTopOverride = 12,
ContentMarginBottomOverride = 12
}),
// Sunrise-Edit
}).ToList());
}
}
Expand Down
14 changes: 3 additions & 11 deletions Content.Client/_Sunrise/Animations/EmoteAnimationSystem.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
using System.Numerics;
using Content.Shared._Sunrise.Animations;
using Content.Shared.Chat;
using Content.Shared.Chat.Prototypes;
using Content.Shared.Input;
using Content.Shared.Standing;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;
using Robust.Shared.GameStates;
using Robust.Shared.Input.Binding;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Client._Sunrise.Animations;

Expand All @@ -28,7 +20,7 @@ public override void Initialize()
{
SubscribeLocalEvent<EmoteAnimationComponent, ComponentHandleState>(OnHandleState);

_emoteList.Add("EmoteFlip", uid =>
_emoteList.Add("Flip", uid =>
{
if (_animationSystem.HasRunningAnimation(uid, AnimationKey))
return;
Expand Down Expand Up @@ -63,7 +55,7 @@ public override void Initialize()
_animationSystem.Play(uid, animation, AnimationKey);
});

_emoteList.Add("EmoteJump", uid =>
_emoteList.Add("Jump", uid =>
{
if (_animationSystem.HasRunningAnimation(uid, AnimationKey))
return;
Expand Down Expand Up @@ -93,7 +85,7 @@ public override void Initialize()
_animationSystem.Play(uid, animation, AnimationKey);
});

_emoteList.Add("EmoteTurn", uid =>
_emoteList.Add("Dance", uid =>
{
if (_animationSystem.HasRunningAnimation(uid, AnimationKeyTurn))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ private string GetStateId(FootprintVisualType visualType, FootprintEmitterCompon
return visualType switch
{
FootprintVisualType.BareFootprint => emitter.IsRightStep
? emitter.RightBareFootState
: emitter.LeftBareFootState,
FootprintVisualType.ShoeFootprint => emitter.ShoeFootState,
FootprintVisualType.SuitFootprint => emitter.PressureSuitFootState,
? _random.Pick(emitter.RightBareFootState)
: _random.Pick(emitter.LeftBareFootState),
FootprintVisualType.ShoeFootprint => _random.Pick(emitter.ShoeFootState),
FootprintVisualType.SuitFootprint => _random.Pick(emitter.PressureSuitFootState),
FootprintVisualType.DragMark => _random.Pick(emitter.DraggingStates),
_ => throw new ArgumentOutOfRangeException(
$"Unknown footprint visual type: {visualType}")
Expand Down
Loading

0 comments on commit 36257a3

Please sign in to comment.