Skip to content

Commit

Permalink
заготовка для 5 уровня
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyDarkFox committed Sep 14, 2024
1 parent eaf207f commit 12b1e3d
Show file tree
Hide file tree
Showing 17 changed files with 434 additions and 3,762 deletions.
17 changes: 16 additions & 1 deletion Content.Client/LateJoin/LateJoinGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using Robust.Shared.Player;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.LateJoin
{
Expand Down Expand Up @@ -86,6 +90,13 @@ private void RebuildUI()
_jobButtons.Clear();
_jobCategories.Clear();

#if LPP_Sponsors
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif

if (!_gameTicker.DisallowedLateJoin && _gameTicker.StationNames.Count == 0)
Logger.Warning("No stations exist, nothing to display in late-join GUI");

Expand Down Expand Up @@ -273,7 +284,11 @@ private void RebuildUI()
_entityManager,
_prototypeManager,
_configManager,
out var reasons))
out var reasons
#if LPP_Sponsors
, 0, sponsorTier
#endif
))
{
jobButton.Disabled = true;

Expand Down
17 changes: 16 additions & 1 deletion Content.Client/Preferences/UI/AntagPreferenceSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using Content.Shared.Roles;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Preferences.UI;

Expand Down Expand Up @@ -40,6 +43,14 @@ public AntagPreferenceSelector(AntagPrototype proto, JobPrototype highJob) : bas
var protoMan = IoCManager.Resolve<IPrototypeManager>();
var configMan = IoCManager.Resolve<IConfigurationManager>();

#if LPP_Sponsors
Logger.Error("SPONSOR: go check sponsor - Antag");
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif

if (proto.Requirements != null
&& !characterReqs.CheckRequirementsValid(
proto.Requirements,
Expand All @@ -51,7 +62,11 @@ public AntagPreferenceSelector(AntagPrototype proto, JobPrototype highJob) : bas
entMan,
protoMan,
configMan,
out var reasons))
out var reasons
#if LPP_Sponsors
, 0, sponsorTier
#endif
))
LockRequirements(characterReqs.GetRequirementsText(reasons));
}
}
51 changes: 49 additions & 2 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
using Robust.Shared.Utility;
using static Content.Client.Stylesheets.StyleBase;
using Direction = Robust.Shared.Maths.Direction;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Preferences.UI
{
Expand Down Expand Up @@ -751,6 +754,14 @@ private void UpdateRoleRequirements()
_jobCategories.Clear();
var firstCategory = true;

#if LPP_Sponsors
Logger.Error("SPONSOR: go check sponsor - HPE - UpdateRole");
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif

var departments = _prototypeManager.EnumeratePrototypes<DepartmentPrototype>().ToArray();
Array.Sort(departments, DepartmentUIComparer.Instance);

Expand Down Expand Up @@ -817,7 +828,11 @@ private void UpdateRoleRequirements()
_entityManager,
_prototypeManager,
_configurationManager,
out var reasons))
out var reasons
#if LPP_Sponsors
, 0, sponsorTier
#endif
))
selector.LockRequirements(_characterRequirementsSystem.GetRequirementsText(reasons));

category.AddChild(selector);
Expand Down Expand Up @@ -860,6 +875,13 @@ private void UpdateRoleRequirements()
/// </summary>
private void EnsureJobRequirementsValid()
{
#if LPP_Sponsors
Logger.Error("SPONSOR: go check sponsor - HPE - EnsureJob");
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif
foreach (var selector in _jobPriorities)
{
if (selector.Priority == JobPriority.Never
Expand All @@ -873,7 +895,11 @@ private void EnsureJobRequirementsValid()
_entityManager,
_prototypeManager,
_configurationManager,
out _))
out _
#if LPP_Sponsors
, 0, sponsorTier
#endif
))
continue;

selector.Priority = JobPriority.Never;
Expand Down Expand Up @@ -1520,6 +1546,14 @@ private void UpdateTraits(bool showUnusable)
// Get the highest priority job to use for trait filtering
var highJob = _controller.GetPreferredJob(Profile ?? HumanoidCharacterProfile.DefaultWithSpecies());

#if LPP_Sponsors
Logger.Error("SPONSOR: go check sponsor - HPE - UpdateTraits");
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif

_traits.Clear();
foreach (var trait in _prototypeManager.EnumeratePrototypes<TraitPrototype>())
{
Expand All @@ -1534,6 +1568,9 @@ private void UpdateTraits(bool showUnusable)
_prototypeManager,
_configurationManager,
out _
#if LPP_Sponsors
, 0, sponsorTier
#endif
);
_traits.Add(trait, usable);

Expand Down Expand Up @@ -1826,6 +1863,13 @@ private void UpdateLoadouts(bool showUnusable)
_loadoutPointsBar.MaxValue = points;
_loadoutPointsBar.Value = points;

#if LPP_Sponsors
Logger.Error("SPONSOR: go check sponsor - HPE - UpdateLoadouts");
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif

// Get the highest priority job to use for loadout filtering
var highJob = _controller.GetPreferredJob(Profile ?? HumanoidCharacterProfile.DefaultWithSpecies());
Expand All @@ -1844,6 +1888,9 @@ private void UpdateLoadouts(bool showUnusable)
_prototypeManager,
_configurationManager,
out _
#if LPP_Sponsors
, 0, sponsorTier
#endif
);
_loadouts.Add(loadout, usable);

Expand Down
17 changes: 15 additions & 2 deletions Content.Client/Preferences/UI/LoadoutPreferenceSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Preferences.UI;


public sealed class LoadoutPreferenceSelector : Control
{
public LoadoutPrototype Loadout { get; }
Expand Down Expand Up @@ -145,13 +147,24 @@ public LoadoutPreferenceSelector(LoadoutPrototype loadout, JobPrototype highJob,
if (!string.IsNullOrEmpty(desc))
tooltip.Append($"{Loc.GetString(desc)}");

#if LPP_Sponsors
Logger.Error("SPONSOR: go check sponsor - Loadout");
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif

// Get requirement reasons
characterRequirementsSystem.CheckRequirementsValid(
loadout.Requirements, highJob, profile, new Dictionary<string, TimeSpan>(),
jobRequirementsManager.IsWhitelisted(), loadout,
entityManager, prototypeManager, configManager,
out var reasons);
out var reasons
#if LPP_Sponsors
, 0, sponsorTier
#endif
);

// Add requirement reasons to the tooltip
foreach (var reason in reasons)
Expand Down
17 changes: 15 additions & 2 deletions Content.Client/Preferences/UI/TraitPreferenceSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Preferences.UI;


public sealed class TraitPreferenceSelector : Control
{
public TraitPrototype Trait { get; }
Expand Down Expand Up @@ -82,13 +84,24 @@ public TraitPreferenceSelector(TraitPrototype trait, JobPrototype highJob, Human
if (!string.IsNullOrEmpty(desc) && desc != $"trait-description-{trait.ID}")
tooltip.Append(desc);

#if LPP_Sponsors
Logger.Error("SPONSOR: go check sponsor - Trait");
var sys = IoCManager.Resolve<IEntitySystemManager>();
var _checkSponsorSystem = sys.GetEntitySystem<CheckSponsorClientSystem>();
_checkSponsorSystem.GoCheckSponsor();
var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2;
#endif

// Get requirement reasons
characterRequirementsSystem.CheckRequirementsValid(
trait.Requirements, highJob, profile, new Dictionary<string, TimeSpan>(),
jobRequirementsManager.IsWhitelisted(), trait,
entityManager, prototypeManager, configManager,
out var reasons);
out var reasons
#if LPP_Sponsors
, 0, sponsorTier
#endif
);

// Add requirement reasons to the tooltip
foreach (var reason in reasons)
Expand Down
Loading

0 comments on commit 12b1e3d

Please sign in to comment.