mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-30 20:33:43 +01:00
Redundancy is stupid.
This commit is contained in:
parent
d831b61c02
commit
cd94c73d93
1 changed files with 21 additions and 7 deletions
|
|
@ -7,6 +7,7 @@ using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using Penumbra.GameData.Actors;
|
using Penumbra.GameData.Actors;
|
||||||
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.UI;
|
using Penumbra.UI;
|
||||||
using Penumbra.Util;
|
using Penumbra.Util;
|
||||||
|
|
@ -433,32 +434,45 @@ public class ActiveCollections : ISavable, IDisposable
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
// Yourself is redundant if
|
|
||||||
case CollectionType.Yourself:
|
case CollectionType.Yourself:
|
||||||
var yourself = ByType(CollectionType.Yourself);
|
var yourself = ByType(CollectionType.Yourself);
|
||||||
if (yourself == null)
|
if (yourself == null)
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
||||||
|
var racial = false;
|
||||||
|
foreach (var race in Enum.GetValues<SubRace>().Skip(1))
|
||||||
|
{
|
||||||
|
var m = ByType(CollectionTypeExtensions.FromParts(race, Gender.Male, false));
|
||||||
|
if (m != null && m != yourself)
|
||||||
|
return string.Empty;
|
||||||
|
var f = ByType(CollectionTypeExtensions.FromParts(race, Gender.Female, false));
|
||||||
|
if (f != null && f != yourself)
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
racial |= m != null || f != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var racialString = racial ? " and Racial Assignments" : string.Empty;
|
||||||
var @base = ByType(CollectionType.Default);
|
var @base = ByType(CollectionType.Default);
|
||||||
var male = ByType(CollectionType.MalePlayerCharacter);
|
var male = ByType(CollectionType.MalePlayerCharacter);
|
||||||
var female = ByType(CollectionType.FemalePlayerCharacter);
|
var female = ByType(CollectionType.FemalePlayerCharacter);
|
||||||
if (male == yourself && female == yourself)
|
if (male == yourself && female == yourself)
|
||||||
return
|
return
|
||||||
"Assignment is redundant due to overwriting Male Players and Female Players with an identical collection.\nYou can remove it.";
|
$"Assignment is redundant due to overwriting Male Players and Female Players{racialString} with an identical collection.\nYou can remove it.";
|
||||||
|
|
||||||
if (male == null)
|
if (male == null)
|
||||||
{
|
{
|
||||||
if (female == null && @base == yourself)
|
if (female == null && @base == yourself)
|
||||||
return "Assignment is redundant due to overwriting Base with an identical collection.\nYou can remove it.";
|
return $"Assignment is redundant due to overwriting Base{racialString} with an identical collection.\nYou can remove it.";
|
||||||
if (female == yourself && @base == yourself)
|
if (female == yourself && @base == yourself)
|
||||||
return
|
return
|
||||||
"Assignment is redundant due to overwriting Base and Female Players with an identical collection.\nYou can remove it.";
|
$"Assignment is redundant due to overwriting Base and Female Players{racialString} with an identical collection.\nYou can remove it.";
|
||||||
}
|
}
|
||||||
else if (male == yourself && female == null && @base == yourself)
|
else if (male == yourself && female == null && @base == yourself)
|
||||||
{
|
{
|
||||||
return "Assignment is redundant due to overwriting Base and Male Players with an identical collection.\nYou can remove it.";
|
return $"Assignment is redundant due to overwriting Base and Male Players{racialString} with an identical collection.\nYou can remove it.";
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
// Check individual assignments. We can only be sure of redundancy for world-overlap or ownership overlap.
|
// Check individual assignments. We can only be sure of redundancy for world-overlap or ownership overlap.
|
||||||
case CollectionType.Individual:
|
case CollectionType.Individual:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue