Skip to content

Commit

Permalink
Merge Sunrise Build
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed May 30, 2024
1 parent 9163af4 commit abeea11
Show file tree
Hide file tree
Showing 9,369 changed files with 105,670 additions and 12,009 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private void PlayRestartSound(RoundRestartCleanupEvent ev)
file,
Filter.Local(),
false,
_roundEndSoundEffectParams.WithVolume(_roundEndSoundEffectParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume)))
_roundEndSoundEffectParams.WithVolume(10f) // Sunrise-Edit
)?.Entity;
}

Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Audio/ContentAudioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
public const float AmbientMusicMultiplier = 3f;
public const float LobbyMultiplier = 3f;
public const float InterfaceMultiplier = 2f;

public const float TtsMultiplier = 3f; // Sunrise-TTS

public override void Initialize()
{
base.Initialize();
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Changelog/ChangelogTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public ChangelogTab()
IoCManager.InjectDependencies(this);
}

// Sunrise-Start
public void CleanChangelog()
{
ChangelogBody.Children.Clear();
}
// Sunrise-End

public void PopulateChangelog(ChangelogManager.Changelog changelog)
{
var byDay = changelog.Entries
Expand Down
2 changes: 2 additions & 0 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<ProjectReference Include="..\RobustToolbox\Robust.Shared\Robust.Shared.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Client\Robust.Client.csproj" />
<ProjectReference Include="..\Content.Shared\Content.Shared.csproj" />
<ProjectReference Include="..\Sunrise\Content.Sunrise.Interfaces.Shared\Content.Sunrise.Interfaces.Shared.csproj" />
<ProjectReference Include="..\Sunrise\Content.Sunrise.Interfaces.Client\Content.Sunrise.Interfaces.Client.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Spawners\" />
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/CrewManifest/CrewManifestUi.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:ui="clr-namespace:Content.Client.CrewManifest.UI"
Title="{Loc 'crew-manifest-window-title'}"
SetSize="450 750">
SetSize="500 800"> <!-- Sunrise-edit -->
<BoxContainer Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True">
<controls:StripeBack Name="StationNameContainer">
<PanelContainer>
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public override void Init()
_prototypeManager.RegisterIgnore("wireLayout");
_prototypeManager.RegisterIgnore("alertLevels");
_prototypeManager.RegisterIgnore("nukeopsRole");
_prototypeManager.RegisterIgnore("stationGoal"); // Sunrise-StationGoal
_prototypeManager.RegisterIgnore("ghostRoleRaffleDecider");

_componentFactory.GenerateNetIds();
Expand Down
10 changes: 8 additions & 2 deletions Content.Client/GameTicking/Managers/ClientGameTicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ public sealed class ClientGameTicker : SharedGameTicker
[ViewVariables] public bool AreWeReady { get; private set; }
[ViewVariables] public bool IsGameStarted { get; private set; }
[ViewVariables] public string? RestartSound { get; private set; }
[ViewVariables] public string? LobbyBackground { get; private set; }
// Sunrise-Start
[ViewVariables] public string? LobbyParalax { get; private set; }
[ViewVariables] public LobbyImage? LobbyImage { get; private set; }
// Sunrise-End
[ViewVariables] public bool DisallowedLateJoin { get; private set; }
[ViewVariables] public string? ServerInfoBlob { get; private set; }
[ViewVariables] public TimeSpan StartTime { get; private set; }
Expand Down Expand Up @@ -118,7 +121,10 @@ private void LobbyStatus(TickerLobbyStatusEvent message)
RoundStartTimeSpan = message.RoundStartTimeSpan;
IsGameStarted = message.IsRoundStarted;
AreWeReady = message.YouAreReady;
LobbyBackground = message.LobbyBackground;
// Sunrise-Start
LobbyParalax = message.LobbyParalax;
LobbyImage = message.LobbyImage;
// Sunrise-End
Paused = message.Paused;

LobbyStatusUpdated?.Invoke();
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Humanoid/MarkingPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
using Content.Sunrise.Interfaces.Shared;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
Expand All @@ -18,6 +19,7 @@ public sealed partial class MarkingPicker : Control
{
[Dependency] private readonly MarkingManager _markingManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors

public Action<MarkingSet>? OnMarkingAdded;
public Action<MarkingSet>? OnMarkingRemoved;
Expand Down Expand Up @@ -123,6 +125,7 @@ public MarkingPicker()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
IoCManager.Instance!.TryResolveType(out _sponsorsManager); // Sunrise-Sponsors

CMarkingCategoryButton.OnItemSelected += OnCategoryChange;
CMarkingsUnused.OnItemSelected += item =>
Expand Down Expand Up @@ -224,6 +227,10 @@ public void Populate(string filter)

var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", marking.Sprites[0].Frame0());
item.Metadata = marking;
// Sunrise-Sponsors-Start
if (marking.SponsorOnly && _sponsorsManager != null)
item.Disabled = !_sponsorsManager.GetClientPrototypes().Contains(marking.ID);
// Sunrise-Sponsors-End
}

CMarkingPoints.Visible = _currentMarkings.PointsLeft(_selectedMarkingCategory) != -1;
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Humanoid/SingleMarkingPicker.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using Content.Shared.Humanoid.Markings;
using Content.Sunrise.Interfaces.Shared;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -11,6 +12,7 @@ namespace Content.Client.Humanoid;
public sealed partial class SingleMarkingPicker : BoxContainer
{
[Dependency] private readonly MarkingManager _markingManager = default!;
private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors

/// <summary>
/// What happens if a marking is selected.
Expand Down Expand Up @@ -122,6 +124,7 @@ public SingleMarkingPicker()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
IoCManager.Instance!.TryResolveType(out _sponsorsManager); // Sunrise-Sponsors

MarkingList.OnItemSelected += SelectMarking;
AddButton.OnPressed += _ =>
Expand Down Expand Up @@ -190,6 +193,10 @@ public void PopulateList(string filter)
{
var item = MarkingList.AddItem(Loc.GetString($"marking-{id}"), marking.Sprites[0].Frame0());
item.Metadata = marking.ID;
// Sunrise-Sponsors-Start
if (marking.SponsorOnly && _sponsorsManager != null)
item.Disabled = !_sponsorsManager.GetClientPrototypes().Contains(marking.ID);
// Sunrise-Sponsors-End

if (_markings[Slot].MarkingId == id)
{
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Info/LinkBanner.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.Changelog;
using Content.Client.Credits;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Content.Client.UserInterface.Systems.Guidebook;
using Content.Shared.CCVar;
Expand Down Expand Up @@ -35,6 +36,12 @@ public LinkBanner()
AddInfoButton("server-info-wiki-button", CCVars.InfoLinksWiki);
AddInfoButton("server-info-forum-button", CCVars.InfoLinksForum);

// Sunrise-Start
var creditsButton = new Button {Text = Loc.GetString("server-info-credits-button")};
creditsButton.OnPressed += args => new CreditsWindow().Open();
buttons.AddChild(creditsButton);
// Sunrise-End

var guidebookController = UserInterfaceManager.GetUIController<GuidebookUIController>();
var guidebookButton = new Button() { Text = Loc.GetString("server-info-guidebook-button") };
guidebookButton.OnPressed += _ =>
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/IoC/ClientContentIoC.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Client.Administration.Managers;
using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
using Content.Client.Clickable;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/LateJoin/LateJoinGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public sealed class LateJoinGui : DefaultWindow

public LateJoinGui()
{
MinSize = SetSize = new Vector2(360, 560);
MinSize = SetSize = new Vector2(450, 560);
IoCManager.InjectDependencies(this);
_sprites = _entitySystem.GetEntitySystem<SpriteSystem>();
_crewManifest = _entitySystem.GetEntitySystem<CrewManifestSystem>();
Expand Down
10 changes: 8 additions & 2 deletions Content.Client/Lobby/ClientPreferencesManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using Content.Shared.Preferences;
using Content.Sunrise.Interfaces.Shared;
using Robust.Client;
using Robust.Client.Player;
using Robust.Shared.Network;
Expand All @@ -12,11 +13,12 @@ namespace Content.Client.Lobby
/// connection.
/// Stores preferences on the server through <see cref="SelectCharacter" /> and <see cref="UpdateCharacter" />.
/// </summary>
public sealed class ClientPreferencesManager : IClientPreferencesManager
public partial class ClientPreferencesManager : IClientPreferencesManager
{
[Dependency] private readonly IClientNetManager _netManager = default!;
[Dependency] private readonly IBaseClient _baseClient = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors

public event Action? OnServerDataLoaded;

Expand All @@ -25,6 +27,7 @@ public sealed class ClientPreferencesManager : IClientPreferencesManager

public void Initialize()
{
IoCManager.Instance!.TryResolveType(out _sponsorsManager); // Sunrise-Sponsors
_netManager.RegisterNetMessage<MsgPreferencesAndSettings>(HandlePreferencesAndSettings);
_netManager.RegisterNetMessage<MsgUpdateCharacter>();
_netManager.RegisterNetMessage<MsgSelectCharacter>();
Expand Down Expand Up @@ -60,7 +63,10 @@ public void SelectCharacter(int slot)
public void UpdateCharacter(ICharacterProfile profile, int slot)
{
var collection = IoCManager.Instance!;
profile.EnsureValid(_playerManager.LocalSession!, collection);
// Sunrise-Sponsors-Start
var sponsorPrototypes = _sponsorsManager?.GetClientPrototypes().ToArray() ?? [];
profile.EnsureValid(_playerManager.LocalSession!, collection, sponsorPrototypes);
// Sunrise-Sponsors-End
var characters = new Dictionary<int, ICharacterProfile>(Preferences.Characters) {[slot] = profile};
Preferences = new PlayerPreferences(characters, Preferences.SelectedCharacterIndex, Preferences.AdminOOCColor);
var msg = new MsgUpdateCharacter
Expand Down
49 changes: 43 additions & 6 deletions Content.Client/Lobby/LobbyState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Client.Changelog;
using Content.Client.Parallax.Managers;
using Robust.Shared.ContentPack;
using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization.Markdown;
using Robust.Shared.Serialization.Markdown.Mapping;


namespace Content.Client.Lobby
Expand All @@ -24,6 +31,9 @@ public sealed class LobbyState : Robust.Client.State.State
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IVoteManager _voteManager = default!;
[Dependency] private readonly IParallaxManager _parallaxManager = default!;
[Dependency] private readonly ISerializationManager _serialization = default!;
[Dependency] private readonly IResourceManager _resource = default!;

private ClientGameTicker _gameTicker = default!;
private ContentAudioSystem _contentAudioSystem = default!;
Expand All @@ -49,9 +59,22 @@ protected override void Startup()

_voteManager.SetPopupContainer(Lobby.VoteContainer);
LayoutContainer.SetAnchorPreset(Lobby, LayoutContainer.LayoutPreset.Wide);
Lobby.ServerName.Text = _baseClient.GameInfo?.ServerName; //The eye of refactor gazes upon you...
// Sunrise-start
//Lobby.ServerName.Text = _baseClient.GameInfo?.ServerName; //The eye of refactor gazes upon you...
UpdateLobbyUi();

Lobby!.LocalChangelogBody.CleanChangelog();

var sunriseChangelog = new ResPath("/Changelog/ChangelogSunrise.yml");

var yamlData = _resource.ContentFileReadYaml(sunriseChangelog);

var node = yamlData.Documents[0].RootNode.ToDataNodeCast<MappingDataNode>();
var changelog = _serialization.Read<ChangelogManager.Changelog>(node, notNullableOverride: true);
Lobby!.LocalChangelogBody.PopulateChangelog(changelog);

// Sunrise-end

Lobby.CharacterPreview.CharacterSetupButton.OnPressed += OnSetupPressed;
Lobby.ReadyButton.OnPressed += OnReadyPressed;
Lobby.ReadyButton.OnToggled += OnReadyToggled;
Expand Down Expand Up @@ -147,7 +170,10 @@ public override void FrameUpdate(FrameEventArgs e)

private void LobbyStatusUpdated()
{
UpdateLobbyBackground();
// Sunrise-Start
UpdateLobbyaralax();
UpdateLobbyImage();
// Sunrise-End
UpdateLobbyUi();
}

Expand Down Expand Up @@ -210,18 +236,29 @@ private void UpdateLobbySoundtrackInfo(LobbySoundtrackChangedEvent ev)
}
}

private void UpdateLobbyBackground()
// Sunrise-start
private void UpdateLobbyaralax()
{
if (_gameTicker.LobbyBackground != null)
if (_gameTicker.LobbyParalax != null)
{
Lobby!.Background.Texture = _resourceCache.GetResource<TextureResource>(_gameTicker.LobbyBackground );
_parallaxManager.LoadParallaxByName(_gameTicker.LobbyParalax);
Lobby!.LobbyParalax = _gameTicker.LobbyParalax;
}
else
{
Lobby!.Background.Texture = null;
Lobby!.LobbyParalax = "FastSpace";
}
}

private void UpdateLobbyImage()
{
if (_gameTicker.LobbyImage == null)
return;

Lobby!.LobbyImage.SetFromSpriteSpecifier(new SpriteSpecifier.Rsi(new ResPath(_gameTicker.LobbyImage.Path), _gameTicker.LobbyImage.State));
Lobby!.LobbyImage.DisplayRect.TextureScale = _gameTicker.LobbyImage.Scale;
}
// Sunrise-end

private void SetReady(bool newReady)
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace Content.Client.Lobby;

public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState>, IOnStateExited<LobbyState>
public sealed partial class LobbyUIController : UIController, IOnStateEntered<LobbyState>, IOnStateExited<LobbyState>
{
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
Expand Down
6 changes: 6 additions & 0 deletions Content.Client/Lobby/UI/CharacterSetupGui.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
Text="{Loc 'character-setup-gui-character-setup-stats-button'}"
StyleClasses="ButtonBig"
HorizontalAlignment="Right" />
<!-- Sunrise-Sponsor-Start -->
<Button Name="SponsorButton"
Text="{Loc 'character-setup-gui-character-setup-sponsor-button'}"
Visible="False"
StyleClasses="ButtonBig" />
<!-- Sunrise-Sponsor-End -->
<Button Name="RulesButton"
Text="{Loc 'character-setup-gui-character-setup-rules-button'}"
StyleClasses="ButtonBig"/>
Expand Down
8 changes: 8 additions & 0 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@
<Control HorizontalExpand="True"/>
<OptionButton Name="SpawnPriorityButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Sunrise-TTS-Start -->
<BoxContainer HorizontalExpand="True" Visible="False" Name="TTSContainer">
<Label Text="{Loc 'humanoid-profile-editor-voice-label'}" />
<Control HorizontalExpand="True"/>
<OptionButton Name="VoiceButton" HorizontalAlignment="Right" />
<Button Name="VoicePlayButton" Text="{Loc 'humanoid-profile-editor-voice-play'}" MaxWidth="80" />
</BoxContainer>
<!-- Sunrise-TTS-End -->
</BoxContainer>
<!-- Skin -->
<BoxContainer Margin="10" HorizontalExpand="True" Orientation="Vertical">
Expand Down
Loading

0 comments on commit abeea11

Please sign in to comment.