Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Binary file modified 1.6/Assemblies/FactionLoadout.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions 1.6/Source/Dialog_XenotypeEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public override void DoWindowContents(Rect inRect)
if (_edit.xenotypeChances.NullOrEmpty())
{
_edit.xenotypeChances = _edit.Faction?.Def?.xenotypeSet?.xenotypeChances?.ToDictionary(x => x.xenotype.defName, x => x.chance) ?? new Dictionary<string, float>();
if (!_edit.xenotypeChances.ContainsKey(FactionEditUI.BaselinerDefName))
_edit.xenotypeChances.Add(FactionEditUI.BaselinerDefName, _edit.Faction?.Def?.xenotypeSet?.BaselinerChance ?? 1f);
if (!_edit.xenotypeChances.ContainsKey(FactionEdit.BaselinerDefName))
_edit.xenotypeChances.Add(FactionEdit.BaselinerDefName, _edit.Faction?.Def?.xenotypeSet?.BaselinerChance ?? 1f);
}

_edit.xenotypeChances[FactionEditUI.BaselinerDefName] = Math.Max(0f, 1f - _edit.xenotypeChances.Sum(x => x.Key == FactionEditUI.BaselinerDefName ? 0 : x.Value));
_edit.xenotypeChances[FactionEdit.BaselinerDefName] = Math.Max(0f, 1f - _edit.xenotypeChances.Sum(x => x.Key == FactionEdit.BaselinerDefName ? 0 : x.Value));

// Reserve space for add buttons at bottom.
const float addButtonsHeight = 70f;
Expand Down
3 changes: 3 additions & 0 deletions 1.6/Source/FactionEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ namespace FactionLoadout;
[HotSwappable]
public class FactionEdit : IExposable
{
/// <summary>Xenotype defName used to represent the "Baseliner" chance in xenotype edits.</summary>
public const string BaselinerDefName = "Baseliner";

private static readonly Dictionary<string, FactionDef> originalFactionDefs = new();
private static Dictionary<(FactionDef, PawnKindDef), PawnKindDef> factionSpecificPawnKindReplacements = new();
public bool Active = true;
Expand Down
Loading