Skip to content

Commit

Permalink
Merge branch 'master' into announcer-aces
Browse files Browse the repository at this point in the history
  • Loading branch information
Hqlle authored Jan 19, 2025
2 parents 0507ce4 + c882afa commit d82c68f
Show file tree
Hide file tree
Showing 28 changed files with 9,339 additions and 7,123 deletions.
36 changes: 32 additions & 4 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility;
using Robust.Client.Player;
using Robust.Shared.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Map;
Expand Down Expand Up @@ -720,6 +721,14 @@ public void RefreshJobs()
_jobPriorities.Clear();
var firstCategory = true;

#if LPP_Sponsors
var sys = IoCManager.Resolve<SponsorsManager>();
var sponsorTier = 0;
if (sys.TryGetInfo(out var sponsorInfo))
sponsorTier = sponsorInfo.Tier;
var uuid = _playerManager.LocalUser != null ? _playerManager.LocalUser.ToString() ?? "" : "";
#endif

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

Expand Down Expand Up @@ -800,7 +809,11 @@ public void RefreshJobs()
_entManager,
_prototypeManager,
_cfgManager,
out var reasons))
out var reasons
#if LPP_Sponsors
, 0, sponsorTier, uuid
#endif
))
selector.LockRequirements(_characterRequirementsSystem.GetRequirementsText(reasons));
else
selector.UnlockRequirements();
Expand Down Expand Up @@ -2161,7 +2174,15 @@ out _
.ToList());
var categories = new Dictionary<string, object>();
foreach (var (key, value) in cats)
{
if (key == "Sponsors"
#if LPP_Sponsors
&& sponsorTier == 0
#endif
) // не добавлять категорию неспонсорам
continue;
categories.Add(key, value);
}

// Create the UI elements for the category tree
CreateCategoryUI(categories, LoadoutsTabs);
Expand Down Expand Up @@ -2190,10 +2211,17 @@ out _
AddSelector(selector);

// Look for an existing category tab
var match = FindCategory(loadout.Category, LoadoutsTabs);
if (!(loadout.Category == "Sponsors"
#if LPP_Sponsors
&& sponsorTier == 0
#endif
)) //не добавлять спонсорские предметы никуда если нет уровня
{
var match = FindCategory(loadout.Category, LoadoutsTabs);

// If there is no category put it in Uncategorized (this shouldn't happen)
(match ?? uncategorized).Children.First().Children.First().AddChild(selector);
// If there is no category put it in Uncategorized (this shouldn't happen)
(match ?? uncategorized).Children.First().Children.First().AddChild(selector);
}
}

// Hide any empty tabs
Expand Down
43 changes: 11 additions & 32 deletions Content.Shared/Customization/Systems/CharacterRequirements.Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,11 @@ public override bool IsValid(JobPrototype job,
return !Inverted;
}

#if LPP_Sponsors
if (job.Requirements != null && job.Requirements.OfType<CharacterWhitelistRequirement>().Any())
if (!whitelisted)
{
reason = null;
return false;
}

#if LPP_Sponsors //поскольку проверка на ВЛ происходит до вызова этого блока, то доп проверка не нужна
if (sponsorTier >= 5)
{
reason = null;
return true;
return !Inverted;
}
#endif

Expand Down Expand Up @@ -244,17 +237,10 @@ public override bool IsValid(JobPrototype job,
}

#if LPP_Sponsors
if (job.Requirements != null && job.Requirements.OfType<CharacterWhitelistRequirement>().Any())
if (!whitelisted)
{
reason = null;
return false;
}

if (sponsorTier >= 5)
{
reason = null;
return true;
return !Inverted;
}
#endif

Expand Down Expand Up @@ -324,6 +310,14 @@ public override bool IsValid(JobPrototype job,
return !Inverted;
}

#if LPP_Sponsors //игнорируем любые требования по времени (только времени)
if (sponsorTier >= 5)
{
reason = null;
return !Inverted;
}
#endif

// Get SharedJobSystem
if (!entityManager.EntitySysManager.TryGetEntitySystem(out SharedJobSystem? jobSystem))
{
Expand All @@ -349,21 +343,6 @@ public override bool IsValid(JobPrototype job,
var time = playTimes.GetValueOrDefault(Tracker);
reason = null;

#if LPP_Sponsors
if (job.Requirements != null && job.Requirements.OfType<CharacterWhitelistRequirement>().Any())
if (!whitelisted)
{
reason = null;
return false;
}

if (sponsorTier >= 5)
{
reason = null;
return true;
}
#endif

if (time > Max)
{
// Show the reason if invalid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public override bool IsValid(
int sponsorTier = 0,
string uuid = "")
{
reason = Loc.GetString("character-uuid-requirement", ("uuid", Uuid));
reason = Loc.GetString("character-uuid-requirement"); //не нужно сообщать uuid
return uuid == Uuid;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public bool CheckRequirementValid(CharacterRequirement requirement, JobPrototype
return
!requirement.IsValid(job, profile, playTimes, whitelisted, prototype,
entityManager, prototypeManager, configManager,
out reason, depth)
out reason, depth
#if LPP_Sponsors
, sponsorTier, uuid
#endif
)
? requirement.Inverted
: !requirement.Inverted;
}
Expand All @@ -53,7 +57,7 @@ public bool CheckRequirementsValid(List<CharacterRequirement> requirements, JobP
entityManager, prototypeManager, configManager,
out var reason, depth
#if LPP_Sponsors
, sponsorTier = 0, uuid = ""
, sponsorTier, uuid
#endif
))
{
Expand Down
92 changes: 92 additions & 0 deletions Resources/Changelog/ChangelogLPP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3023,3 +3023,95 @@
id: 162
time: '2024-12-29T18:59:40.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/370
- author: Farrellka
changes:
- message: "\u041F\u0440\u043E\u0432\u0435\u0434\u0451\u043D \u0410\u043F\u0441\u0442\
\u0440\u0438\u043C."
type: Add
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u041A\u0443\u043B\u044C\
\u0442 \u041A\u0440\u043E\u0432\u0438 \u041D\u0430\u0440'\u0421\u0438."
type: Add
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430 \u0425\u0438\u0440\
\u0443\u0440\u0433\u0438\u044F."
type: Add
- message: "\u0418 \u043C\u043D\u043E\u0433\u043E\u0435 \u0434\u0440\u0443\u0433\
\u043E\u0435!..."
type: Add
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E \u043C\u043D\
\u043E\u0436\u0435\u0441\u0442\u0432\u043E \u0431\u0430\u0433\u043E\u0432."
type: Fix
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E \u0435\u0449\u0451\
\ \u0431\u043E\u043B\u044C\u0448\u0435 \u0431\u0430\u0433\u043E\u0432!"
type: Add
- message: "\u0423\u0431\u0440\u0430\u043D\u043E \u0432\u0435\u0441\u0435\u043B\u044C\
\u0435 \u0443 \u044D\u043B\u044C\u0444\u0430..."
type: Remove
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430 \u0443\u0441\u0442\
\u0430\u043B\u043E\u0441\u0442\u044C \u044D\u043B\u044C\u0444\u0443..."
type: Add
id: 163
time: '2025-01-04T20:20:13.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/360
- author: Farrellka
changes:
- message: "\u041F\u0440\u043E\u0432\u0435\u0434\u0451\u043D \u0410\u043F\u0441\u0442\
\u0440\u0438\u043C."
type: Add
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u041A\u0443\u043B\u044C\
\u0442 \u041A\u0440\u043E\u0432\u0438 \u041D\u0430\u0440'\u0421\u0438."
type: Add
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430 \u0425\u0438\u0440\
\u0443\u0440\u0433\u0438\u044F."
type: Add
- message: "\u0418 \u043C\u043D\u043E\u0433\u043E\u0435 \u0434\u0440\u0443\u0433\
\u043E\u0435!..."
type: Add
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E \u043C\u043D\
\u043E\u0436\u0435\u0441\u0442\u0432\u043E \u0431\u0430\u0433\u043E\u0432."
type: Fix
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E \u0435\u0449\u0451\
\ \u0431\u043E\u043B\u044C\u0448\u0435 \u0431\u0430\u0433\u043E\u0432!"
type: Add
- message: "\u0423\u0431\u0440\u0430\u043D\u043E \u0432\u0435\u0441\u0435\u043B\u044C\
\u0435 \u0443 \u044D\u043B\u044C\u0444\u0430..."
type: Remove
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430 \u0443\u0441\u0442\
\u0430\u043B\u043E\u0441\u0442\u044C \u044D\u043B\u044C\u0444\u0443..."
type: Add
id: 164
time: '2025-01-05T22:34:35.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/377
- author: JayJacobs
changes:
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430 \u043A\u043E\u043C\
\u043D\u0430\u0442\u0430 \u0438 \u0441\u043F\u0430\u0432\u043D \u0420\u0435\u043F\
\u043E\u0440\u0442\u0451\u0440\u0430 \u043D\u0430 \u0410\u0439\u0441\u0411\u043E\
\u043A\u0441."
type: Add
- message: "\u0417\u0430\u043C\u0435\u043D\u0435\u043D\u044B \u043F\u043E\u043B\u044B\
\ \u043D\u0430 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0441\u043F\u0430\
\u0432\u043D\u0438\u0442\u0441\u044F \u043C\u0435\u0442\u0435\u043B\u044C \u043D\
\u0430 \u0410\u0439\u0441\u0411\u043E\u043A\u0441."
type: Tweak
- message: "\u041F\u043E\u0432\u044B\u0448\u0435\u043D\u043E \u043A\u043E\u043B\u0438\
\u0447\u0435\u0441\u0442\u0432\u043E \u0441\u043B\u043E\u0442\u043E\u0432 \u043D\
\u0430 \u0440\u043E\u043B\u0438 \u0422\u044E\u0440\u0435\u043C\u0449\u0438\u043A\
\u0430 \u043D\u0430 \u043A\u0430\u0440\u0442\u0435 \u0410\u0439\u0441\u0411\u043E\
\u043A\u0441."
type: Tweak
- message: "\u0423\u0434\u0430\u043B\u0451\u043D \u043A\u0435\u043D\u0433\u0443\u0440\
\u0443 \u0441 \u043A\u0430\u0440\u0442\u044B \u0410\u0439\u0441\u0411\u043E\u043A\
\u0441."
type: Remove
id: 165
time: '2025-01-12T16:26:33.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/357
- author: JayJacobs
changes:
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u0441\u043F\
\u0430\u0432\u043D\u044B \u0441 \u043D\u0430\u0448\u0435\u0433\u043E \u0410\u0434\
\u044C\u044E \u043D\u0430 \u0410\u0434\u044C\u044E \u0415\u0415"
type: Fix
id: 166
time: '2025-01-12T17:06:22.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/384
Loading

0 comments on commit d82c68f

Please sign in to comment.