Skip to content

Commit

Permalink
Merge pull request #55 from SpicyDarkFox/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg authored Sep 3, 2024
2 parents 3357781 + 8bbf58d commit fb80acd
Show file tree
Hide file tree
Showing 33 changed files with 4,246 additions and 117 deletions.
1 change: 1 addition & 0 deletions Content.Client/Corvax/TTS/TTSSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define LPP_TTS_play //комментировать при ошибках
using Content.Shared.Chat;
using Content.Shared.Corvax.CCCVars;
using Content.Shared.Corvax.TTS;
Expand Down
16 changes: 10 additions & 6 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define LPP_Sponsors //комментировать при ошибках
using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
Expand Down Expand Up @@ -37,6 +38,9 @@
using Robust.Shared.ContentPack;
using Robust.Shared.Prototypes;
using Robust.Shared.Replays;
#if LPP_Sponsors // _LostParadise-Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Entry
{
Expand Down Expand Up @@ -74,9 +78,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
#if LPP_Sponsors // _LostParadise-Sponsors
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
#endif

public override void Init()
{
Expand Down Expand Up @@ -169,9 +173,9 @@ public override void PostInit()
_userInterfaceManager.SetDefaultTheme("SS14DefaultTheme");
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CVars.InterfaceTheme));

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

_documentParsingManager.Initialize();
_joinQueue.Initialize();
Expand Down
10 changes: 7 additions & 3 deletions Content.Client/IoC/ClientContentIoC.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define LPP_Sponsors //комментировать при ошибках
using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
Expand All @@ -24,6 +25,9 @@
using Content.Client.Replay;
using Content.Shared.Administration.Managers;
using Content.Shared.Players.PlayTimeTracking;
#if LPP_Sponsors // _LostParadise-Sponsors
using Content.Client._LostParadise.Sponsors;
#endif


namespace Content.Client.IoC
Expand Down Expand Up @@ -57,9 +61,9 @@ public static void Register()
collection.Register<ISharedPlaytimeManager, JobRequirementsManager>();
IoCManager.Register<JoinQueueManager>();
IoCManager.Register<DiscordAuthManager>();
#if LPP_Sponsors // _LostParadise-Sponsors
collection.Register<SponsorsManager>();
#endif
#if LPP_Sponsors // _LostParadise-Sponsors
collection.Register<SponsorsManager>();
#endif
}
}
}
10 changes: 6 additions & 4 deletions Content.Client/PDA/PdaMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public sealed partial class PdaMenu : PdaWindow
private string _stationName = Loc.GetString("comp-pda-ui-unknown");
private string _alertLevel = Loc.GetString("comp-pda-ui-unknown");
private string _instructions = Loc.GetString("comp-pda-ui-unknown");


private int _currentView;

Expand Down Expand Up @@ -160,12 +159,13 @@ public void UpdateState(PdaUpdateState state)
_stationName = state.StationName ?? Loc.GetString("comp-pda-ui-unknown");
StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station",
("station", _stationName)));


var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan);

StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time",
("time", stationTime.ToString("hh\\:mm\\:ss"))));
("time", stationTime.ToString("hh\\:mm\\:ss")),
("date", DateTime.Now.AddYears(544).ToString("dd MMMM yyyy"))
));

var alertLevel = state.PdaOwnerInfo.StationAlertLevel;
var alertColor = state.PdaOwnerInfo.StationAlertColor;
Expand Down Expand Up @@ -339,7 +339,9 @@ protected override void Draw(DrawingHandleScreen handle)
var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan);

StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time",
("time", stationTime.ToString("hh\\:mm\\:ss"))));
("time", stationTime.ToString("hh\\:mm\\:ss")),
("date", DateTime.Now.AddYears(544).ToString("dd MMMM yyyy"))
));
}
}
}
21 changes: 11 additions & 10 deletions Content.Client/Preferences/ClientPreferencesManager.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define LPP_Sponsors //комментировать при ошибках
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -10,7 +11,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
#if LPP_Sponsors // _LostParadise-Sponsors
using Content.Client._LostParadise.Sponsors;
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Preferences
Expand All @@ -27,9 +28,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
#if LPP_Sponsors // _LostParadise-Sponsors
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
#endif

public event Action? OnServerDataLoaded;

Expand Down Expand Up @@ -74,13 +75,13 @@ 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

#if LPP_Sponsors // _LostParadise-Sponsors
var allowedMarkings = _sponsorsManager.TryGetInfo(out var sponsor) ? sponsor.AllowedMarkings : [];
var session = _playerManager.LocalSession!;
profile.EnsureValid(session, collection, allowedMarkings);
#else
profile.EnsureValid(_playerManager.LocalSession!, collection);
#endif
var characters = new Dictionary<int, ICharacterProfile>(Preferences.Characters) {[slot] = profile};
Preferences = new PlayerPreferences(characters, Preferences.SelectedCharacterIndex, Preferences.AdminOOCColor);
var msg = new MsgUpdateCharacter
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Linq;
using System.Numerics;
using Content.Client.Humanoid;
Expand Down Expand Up @@ -122,8 +123,8 @@ private void UpdateUI()
continue;
}

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

Expand Down
8 changes: 8 additions & 0 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@
<humanoid:MarkingPicker Name="CMarkings" IgnoreCategories="Hair,FacialHair" />
</ScrollContainer>
</BoxContainer>
<!-- Lost Paradise Donate Preferences Begin -->
<BoxContainer Orientation="Vertical" Margin="10" Name="LPPDonate">
<!-- Donate -->
<ScrollContainer VerticalExpand="True">
<BoxContainer Name="DonateList" Orientation="Vertical" />
</ScrollContainer>
</BoxContainer>
<!-- Lost Paradise Donate Preferences End -->
</TabContainer>
</BoxContainer>
<!-- Right side -->
Expand Down
43 changes: 43 additions & 0 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Linq;
using System.Numerics;
using Content.Client.Guidebook;
Expand Down Expand Up @@ -83,6 +84,11 @@ public sealed partial class HumanoidProfileEditor : BoxContainer
private Button _loadoutsShowUnusableButton => LoadoutsShowUnusableButton;
private BoxContainer _loadoutsTab => CLoadoutsTab;
private TabContainer _loadoutsTabs => CLoadoutsTabs;

private BoxContainer _donateList => DonateList; // Lost Paradise Donate Preferences
#if LPP_Sponsors
private List<_LostParadise.Donate.DonatePreferenceSelector> _donatePreferences; // Lost Paradise Donate Preferences
#endif
private readonly List<JobPrioritySelector> _jobPriorities;
private OptionButton _preferenceUnavailableButton => CPreferenceUnavailableButton;
private readonly Dictionary<string, BoxContainer> _jobCategories;
Expand Down Expand Up @@ -588,6 +594,43 @@ public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IProt

#endregion Dummy

#if LPP_Sponsors // Lost Paradise Donate Preferences
#region Donate

var donate = prototypeManager.EnumeratePrototypes<Shared._LostParadise.Donate.DonatePrototype>().OrderBy(t => Loc.GetString(t.Name)).ToList();
_donatePreferences = new List<_LostParadise.Donate.DonatePreferenceSelector>();
_tabContainer.SetTabTitle(5, Loc.GetString("lost-donate-editor"));
var granted = false;
if (donate.Count > 0)
{
foreach (var donatet in donate)
{
var selector = new _LostParadise.Donate.DonatePreferenceSelector(donatet);
_donateList.AddChild(selector);
_donatePreferences.Add(selector);

selector.PreferenceChanged += preference =>
{
Profile = Profile?.WithDonatePreference(donatet.ID, preference);
};
if (selector.Gave)
granted = true;
}
}
if (!granted)
{
_donateList.AddChild(new Label
{
Text = Loc.GetString("lost-nodonate"),
FontColorOverride = Color.Gray,
});
}
// Lost Paradise Donate Preferences End
#endregion

#else
LPPDonate.Dispose();
#endif
#endregion Left

if (preferencesManager.ServerDataLoaded)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Collections.Generic;
using System.Linq;
using Content.Server.Database;
Expand Down Expand Up @@ -67,6 +68,9 @@ private static HumanoidCharacterProfile CharlieCharlieson()
antagPreferences: new List<string>(),
traitPreferences: new List<string>(),
loadoutPreferences: new List<string>()
#if LPP_Sponsors
, new List<string>() // Lost Paradise Donate Preferences
#endif
);
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable
Expand All @@ -18,6 +18,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ooccolor = table.Column<string>(type: "text", nullable: false),
have_priority_join = table.Column<bool>(type: "boolean", nullable: false),
allowed_markings = table.Column<string>(type: "text", nullable: false),
expire_date = table.Column<DateTime>(type: "TEXT", nullable: false),
extra_slots = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fb80acd

Please sign in to comment.