Trait Points (#434)

# Description

Some improvements to loadouts too.

---

# TODO

- [x] Points logic
- [x] Server-side validation
- [x] Categorize traits
- [x] Assign points to traits
- [x] Header costs
- [x] Sort entries
- [x] Max traits
	- [x] Communicate max traits
- [x] Point bar
- [x] Group exclusivity
- Black outline on text
- [x] Fix existing component whitelists

---

<details><summary><h1>Media</h1></summary>
<p>

## Accurate except for small details


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/c0ab2fbf-3bce-4e54-81d5-8e546d6b3c0b)

### Something to note:


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/09a3948e-0c9f-4f57-b297-f62063b11845)


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/35d76095-0714-4613-a17b-73df25a9a832)


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/87149e5c-0af2-4ac0-bbde-52f317a008a0)

</p>
</details>

---

# Changelog

🆑
- add: Added trait points
- add: Added categories for traits

---------

Co-authored-by: VMSolidus <evilexecutive@gmail.com>
This commit is contained in:
DEATHB4DEFEAT
2024-06-20 16:39:30 -07:00
committed by GitHub
parent 2961bf4375
commit d3ed34ff4e
60 changed files with 1623 additions and 962 deletions

View File

@@ -0,0 +1,43 @@
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Shared.Customization.Systems;
public sealed class CharacterRequirementsSystem : EntitySystem
{
public bool CheckRequirementsValid(IPrototype prototype, List<CharacterRequirement> requirements, JobPrototype job,
HumanoidCharacterProfile profile, Dictionary<string, TimeSpan> playTimes,
IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager,
out List<FormattedMessage> reasons)
{
reasons = new List<FormattedMessage>();
var valid = true;
foreach (var requirement in requirements)
{
// Set valid to false if the requirement is invalid and not inverted
// If it's inverted set valid to false when it's valid
if (!requirement.IsValid(prototype, job, profile, playTimes,
entityManager, prototypeManager, configManager,
out var reason))
{
if (valid)
valid = requirement.Inverted;
}
else
{
if (valid)
valid = !requirement.Inverted;
}
if (reason != null) // To appease the compiler
reasons.Add(reason);
}
return valid;
}
}