mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-24 17:18:14 +03:00
* Fix hide categories logic (it works!) * Optimization code * Fix for new loadouts * Rabbit + my ltl fix * Full translation loadouts, traits & hub menu * Auto-hide categories for new loadouts (incomplete) * Search fix done * Now fix definitely done * Format * System of hide categories * Add flavour fill warning * Old save characters now can be import!! * Add placeholders in 'Customize' * 'Weight update on change' fix * Markings fix * New translate pack * IPC markings screen fix * Fix tests * Rabbit fix * Fix characters export & zero weight * Translate * Fix tests mb * Rabbit fix 2 * Rabbit fix 3
72 lines
1.8 KiB
C#
72 lines
1.8 KiB
C#
using Content.Shared.Clothing.Loadouts.Systems;
|
|
using Content.Shared.Clothing.Loadouts.Prototypes;
|
|
|
|
|
|
namespace Content.Client.Lobby.UI;
|
|
|
|
// WWDP PARTIAL CLASS
|
|
public sealed partial class HumanoidProfileEditor
|
|
{
|
|
private void InitializeCharacterMenu()
|
|
{
|
|
Loadouts.OnLoadoutsChanged += OnLoadoutsChange;
|
|
}
|
|
|
|
private void UpdateLoadouts()
|
|
{
|
|
if (Profile == null)
|
|
return;
|
|
|
|
var highJob = _controller.GetPreferredJob(Profile);
|
|
|
|
_loadouts.Clear();
|
|
|
|
foreach (var loadout in Profile.LoadoutPreferencesList)
|
|
{
|
|
if (!_prototypeManager.TryIndex<LoadoutPrototype>(loadout.LoadoutName, out var loadoutProto))
|
|
continue;
|
|
|
|
var usable = _characterRequirementsSystem.CheckRequirementsValid(
|
|
loadoutProto.Requirements,
|
|
highJob,
|
|
Profile,
|
|
_requirements.GetRawPlayTimeTrackers(),
|
|
_requirements.IsWhitelisted(),
|
|
loadoutProto,
|
|
_entManager,
|
|
_prototypeManager,
|
|
_cfgManager,
|
|
out _
|
|
);
|
|
|
|
_loadouts.Add(loadoutProto, usable);
|
|
}
|
|
|
|
UpdateLoadoutsRemoveButton();
|
|
|
|
Loadouts.SetData(
|
|
Profile.LoadoutPreferencesList,
|
|
new(highJob, Profile, _requirements.GetRawPlayTimeTrackers(), _requirements.IsWhitelisted()));
|
|
|
|
Loadouts.ShowUnusable = LoadoutsShowUnusableButton.Pressed;
|
|
}
|
|
|
|
private void CheckpointLoadouts()
|
|
{
|
|
if (Profile == null)
|
|
return;
|
|
Loadouts.SetCheckpoint();
|
|
}
|
|
|
|
private void OnLoadoutsChange(List<Loadout> loadouts)
|
|
{
|
|
if (Profile is null)
|
|
return;
|
|
|
|
Profile = Profile.WithLoadoutPreference(loadouts);
|
|
ReloadProfilePreview();
|
|
ReloadClothes();
|
|
UpdateLoadouts();
|
|
}
|
|
}
|