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

[Fix, Feature] Some Fixes, sponsor traits #968

Merged
merged 10 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
4 changes: 2 additions & 2 deletions Content.Client/Access/UI/AccessOverriderWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public void UpdateState(IPrototypeManager protoManager, AccessOverriderBoundUser
button.Disabled = !interfaceEnabled;
if (interfaceEnabled)
{
button.Pressed = state.TargetAccessReaderIdAccessList?.Contains(accessName) ?? false;
button.Disabled = (!state.AllowedModifyAccessList?.Contains(accessName)) ?? true;
button.Pressed = state.TargetAccessReaderIdAccessList?.Select(x => x.Id).Contains(accessName) ?? false;
button.Disabled = (!state.AllowedModifyAccessList?.Select(x => x.Id).Contains(accessName)) ?? true;
}
}
}
Expand Down
72 changes: 0 additions & 72 deletions Content.Client/Backmen/OfferItem/OfferItemIndicatorsOverlay.cs

This file was deleted.

53 changes: 0 additions & 53 deletions Content.Client/Backmen/OfferItem/OfferItemSystem.cs

This file was deleted.

1 change: 0 additions & 1 deletion Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.ToggleStanding); // Ataraxia
human.AddFunction(ContentKeyFunctions.LookUp); // BACKMEN EDIT
human.AddFunction(CMKeyFunctions.CMUniqueAction); // BACKMEN EDIT
human.AddFunction(ContentKeyFunctions.OfferItem); // Ataraxia
human.AddFunction(ContentKeyFunctions.TargetHead);
human.AddFunction(ContentKeyFunctions.TargetTorso);
human.AddFunction(ContentKeyFunctions.TargetLeftArm);
Expand Down
6 changes: 5 additions & 1 deletion Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Content.Client.Lobby.UI;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.Station;
using Content.Corvax.Interfaces.Client;
using Content.Corvax.Interfaces.Shared;
using Content.Shared.CCVar;
using Content.Shared.Clothing;
using Content.Shared.GameTicking;
Expand Down Expand Up @@ -40,6 +42,7 @@ public sealed partial class LobbyUIController : UIController, IOnStateEntered<Lo
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly JobRequirementsManager _requirements = default!;
[Dependency] private readonly MarkingManager _markings = default!;
[Dependency] private readonly ISharedSponsorsManager _clientSponsorsManager = default!;
[UISystemDependency] private readonly HumanoidAppearanceSystem _humanoid = default!;
[UISystemDependency] private readonly ClientInventorySystem _inventory = default!;
[UISystemDependency] private readonly StationSpawningSystem _spawn = default!;
Expand Down Expand Up @@ -273,7 +276,8 @@ private void OpenSavePanel()
_prototypeManager,
_resourceCache,
_requirements,
_markings);
_markings,
_clientSponsorsManager);

_profileEditor.OnOpenGuidebook += _guide.OpenHelp;

Expand Down
16 changes: 15 additions & 1 deletion Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using Content.Client.Sprite;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Guidebook;
using Content.Corvax.Interfaces.Client;
using Content.Corvax.Interfaces.Shared;
using Content.Shared.CCVar;
using Content.Shared.Clothing;
using Content.Shared.Corvax.CCCVars;
Expand Down Expand Up @@ -50,6 +52,7 @@ public sealed partial class HumanoidProfileEditor : BoxContainer
private readonly MarkingManager _markingManager;
private readonly JobRequirementsManager _requirements;
private readonly LobbyUIController _controller;
private readonly ISharedSponsorsManager _clientSponsorsManager;

private FlavorText.FlavorText? _flavorText;
private TextEdit? _flavorTextEdit;
Expand Down Expand Up @@ -114,7 +117,8 @@ public HumanoidProfileEditor(
IPrototypeManager prototypeManager,
IResourceManager resManager,
JobRequirementsManager requirements,
MarkingManager markings)
MarkingManager markings,
ISharedSponsorsManager clientSponsorsManager)
{
RobustXamlLoader.Load(this);
_sawmill = logManager.GetSawmill("profile.editor");
Expand All @@ -124,6 +128,7 @@ public HumanoidProfileEditor(
_playerManager = playerManager;
_prototypeManager = prototypeManager;
_markingManager = markings;
_clientSponsorsManager = clientSponsorsManager;
_preferencesManager = preferencesManager;
_resManager = resManager;
_requirements = requirements;
Expand Down Expand Up @@ -590,6 +595,15 @@ public void RefreshTraits()
if (selector == null)
continue;

//backmen-start: sponsor traits
if (selector.Trait.SponsorOnly && !_clientSponsorsManager.GetClientPrototypes().Contains(selector.Trait.ID))
{
selector.Checkbox.Label.FontColorOverride = Color.Gray;
selector.Checkbox.Disabled = true;
selector.Checkbox.Pressed = false;
}
//backmen-end: sponsor traits

if (category is { MaxTraitPoints: >= 0 } &&
selector.Cost + selectionCount > category.MaxTraitPoints)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Content.Client.Lobby.UI.Roles;
public sealed partial class TraitPreferenceSelector : Control
{
public int Cost;
public readonly TraitPrototype Trait;

public bool Preference
{
Expand All @@ -23,6 +24,7 @@ public TraitPreferenceSelector(TraitPrototype trait)
{
RobustXamlLoader.Load(this);

Trait = trait;
var text = trait.Cost != 0 ? $"[{trait.Cost}] " : "";
text += Loc.GetString(trait.Name);

Expand Down
1 change: 0 additions & 1 deletion Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ void HandleToggleAutoGetUp(BaseButton.ButtonToggledEventArgs args) // BACKMEN ED
AddButton(ContentKeyFunctions.SaveItemLocation);
AddButton(ContentKeyFunctions.ToggleStanding); // backmen: Laying System
AddButton(ContentKeyFunctions.LookUp); // BACKMEN EDIT
AddButton(ContentKeyFunctions.OfferItem); // Ataraxia
AddCheckBox("ui-options-function-hold-look-up", _cfg.GetCVar(BackmenCCvars.CCVars.HoldLookUp), HandleHoldLookUp); // WD EDIT

AddHeader("ui-options-header-interaction-adv");
Expand Down
Loading
Loading