Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Дополнения и фиксы #54

Merged
merged 5 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Content.Client/Corvax/TTS/TTSSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ private void OnTtsVolumeChanged(float volume)

private void OnPlayTTS(PlayTTSEvent ev)
{
var canPlay = false;
#if LPP_TTS_play //это предназначено для того, чтобы в случае отсутствия ссылки на ТТС, игра не пыталась выполнить обработку звука
canPlay = true;
#endif
if (!canPlay)
return;
_sawmill.Debug($"Play TTS audio {ev.Data.Length} bytes from {ev.SourceUid} entity");

var volume = AdjustVolume(ev.IsWhisper);
Expand Down
8 changes: 8 additions & 0 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public sealed class EntryPoint : GameClient
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly JoinQueueManager _joinQueue = default!;
[Dependency] private readonly DiscordAuthManager _discordAuth = default!;
#if LPP_Sponsors // _LostParadise-Sponsors
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
#endif

public override void Init()
{
Expand Down Expand Up @@ -165,6 +168,11 @@ public override void PostInit()
_voteManager.Initialize();
_userInterfaceManager.SetDefaultTheme("SS14DefaultTheme");
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CVars.InterfaceTheme));

#if LPP_Sponsors
_sponsorsManager.Initialize(); // _LostParadise-Sponsors
#endif

_documentParsingManager.Initialize();
_joinQueue.Initialize();
_discordAuth.Initialize();
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/IoC/ClientContentIoC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public static void Register()
collection.Register<ISharedPlaytimeManager, JobRequirementsManager>();
IoCManager.Register<JoinQueueManager>();
IoCManager.Register<DiscordAuthManager>();
#if LPP_Sponsors // _LostParadise-Sponsors
collection.Register<SponsorsManager>();
#endif
}
}
}
13 changes: 13 additions & 0 deletions Content.Client/Preferences/ClientPreferencesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
#if LPP_Sponsors // _LostParadise-Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Preferences
{
Expand All @@ -24,6 +27,9 @@ public sealed class ClientPreferencesManager : IClientPreferencesManager
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IPrototypeManager _prototypes = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
#if LPP_Sponsors // _LostParadise-Sponsors
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
#endif

public event Action? OnServerDataLoaded;

Expand Down Expand Up @@ -67,6 +73,13 @@ public void SelectCharacter(int slot)
public void UpdateCharacter(ICharacterProfile profile, int slot)
{
var collection = IoCManager.Instance!;

#if LPP_Sponsors // _LostParadise-Sponsors
var allowedMarkings = _sponsorsManager.TryGetInfo(out var sponsor) ? sponsor.AllowedMarkings : [];
var session = _playerManager.LocalSession!;
profile.EnsureValid(session, collection, allowedMarkings);
#endif

profile.EnsureValid(_playerManager.LocalSession!, collection);
var characters = new Dictionary<int, ICharacterProfile>(Preferences.Characters) {[slot] = profile};
Preferences = new PlayerPreferences(characters, Preferences.SelectedCharacterIndex, Preferences.AdminOOCColor);
Expand Down
18 changes: 18 additions & 0 deletions Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,22 @@ private void UpdateUI()
Loc.GetString("character-setup-gui-create-new-character-button-tooltip",
("maxCharacters", _preferencesManager.Settings!.MaxCharacterSlots));

#if LPP_Sponsors
var isDisplayedMaxSlots = false; // _LostParadise-Sponsors возможно использование дополнительных слотов
#endif

foreach (var (slot, character) in _preferencesManager.Preferences!.Characters)
{
if (character is null)
{
continue;
}

#if LPP_SUBS // _LostParadise-Sponsors
isDisplayedMaxSlots = numberOfFullSlots >= _preferencesManager.Settings.MaxCharacterSlots;
if (isDisplayedMaxSlots) break;
#endif

numberOfFullSlots++;
var characterPickerButton = new CharacterPickerButton(_entityManager,
_preferencesManager,
Expand All @@ -133,8 +147,12 @@ private void UpdateUI()
};
}

#if LPP_Sponsors // _LostParadise-Sponsors
_createNewCharacterButton.Disabled = isDisplayedMaxSlots;
#else
_createNewCharacterButton.Disabled =
numberOfFullSlots >= _preferencesManager.Settings.MaxCharacterSlots;
#endif
Characters.AddChild(_createNewCharacterButton);
// TODO: Move this shit to the Lobby UI controller
}
Expand Down
Loading
Loading