[feat] donate
# Conflicts: # Content.Client/Entry/EntryPoint.cs # Content.Client/IoC/ClientContentIoC.cs # Content.Server/Chat/Managers/ChatManager.cs # Content.Server/Entry/EntryPoint.cs # Content.Server/GameTicking/GameTicker.Player.cs # Content.Server/GameTicking/GameTicker.StatusShell.cs # Content.Server/IoC/ServerContentIoC.cs # Content.Shared/Humanoid/HumanoidCharacterAppearance.cs # Content.Shared/Humanoid/Markings/MarkingPrototype.cs # Content.Shared/Preferences/HumanoidCharacterProfile.cs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Client.White.Sponsors;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
@@ -19,6 +20,10 @@ public sealed partial class MarkingPicker : Control
|
||||
[Dependency] private readonly MarkingManager _markingManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
//WD-EDIT
|
||||
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
|
||||
//WD-EDIT
|
||||
|
||||
public Action<MarkingSet>? OnMarkingAdded;
|
||||
public Action<MarkingSet>? OnMarkingRemoved;
|
||||
public Action<MarkingSet>? OnMarkingColorChange;
|
||||
@@ -202,6 +207,18 @@ public sealed partial class MarkingPicker : Control
|
||||
|
||||
var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", marking.Sprites[0].Frame0());
|
||||
item.Metadata = marking;
|
||||
|
||||
//WD-EDIT
|
||||
if (marking.SponsorOnly)
|
||||
{
|
||||
item.Disabled = true;
|
||||
if (_sponsorsManager.TryGetInfo(out var sponsor))
|
||||
{
|
||||
item.Disabled = !sponsor.AllowedMarkings.Contains(marking.ID);
|
||||
}
|
||||
}
|
||||
//WD-EDIT
|
||||
|
||||
}
|
||||
|
||||
CMarkingPoints.Visible = _currentMarkings.PointsLeft(_selectedMarkingCategory) != -1;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Client.White.Sponsors;
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -12,6 +13,10 @@ public sealed partial class SingleMarkingPicker : BoxContainer
|
||||
{
|
||||
[Dependency] private readonly MarkingManager _markingManager = default!;
|
||||
|
||||
//WD-EDIT
|
||||
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
|
||||
//WD-EDIT
|
||||
|
||||
/// <summary>
|
||||
/// What happens if a marking is selected.
|
||||
/// It will send the 'slot' (marking index)
|
||||
@@ -191,6 +196,17 @@ public sealed partial class SingleMarkingPicker : BoxContainer
|
||||
var item = MarkingList.AddItem(Loc.GetString($"marking-{id}"), marking.Sprites[0].Frame0());
|
||||
item.Metadata = marking.ID;
|
||||
|
||||
//WD-EDIT
|
||||
if (marking.SponsorOnly)
|
||||
{
|
||||
item.Disabled = true;
|
||||
if (_sponsorsManager.TryGetInfo(out var sponsor))
|
||||
{
|
||||
item.Disabled = !sponsor.AllowedMarkings.Contains(marking.ID);
|
||||
}
|
||||
}
|
||||
//WD-EDIT
|
||||
|
||||
if (_markings[Slot].MarkingId == id)
|
||||
{
|
||||
_ignoreItemSelected = true;
|
||||
|
||||
Reference in New Issue
Block a user