Skip to content

Commit

Permalink
Merge pull request #153 from edbmods/develop
Browse files Browse the repository at this point in the history
Merge to master for v0.17.1.4 release candidate 4
  • Loading branch information
edbmods authored Jun 2, 2017
2 parents 8c9fc51 + 2bfdda2 commit a1c5783
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 32 deletions.
1 change: 0 additions & 1 deletion EdBPrepareCarefully.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
<Compile Include="Source\PanelRelationshipsParentChild.cs" />
<Compile Include="Source\PawnGenerationRequestWrapper.cs" />
<Compile Include="Source\PawnLayers.cs" />
<Compile Include="Source\PawnRace.cs" />
<Compile Include="Source\PrepareCarefully.cs" />
<Compile Include="Source\PresetFiles.cs" />
<Compile Include="Source\PresetLoader.cs" />
Expand Down
2 changes: 0 additions & 2 deletions Source/ColonistLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public static CustomPawn LoadFromFile(PrepareCarefully loadout, string name) {
else {
throw new Exception("Invalid preset version");
}

return null;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion Source/PanelRelationshipsParentChild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class PanelRelationshipsParentChild : PanelBase {
public event AddChildToGroupHandler ChildAddedToGroup;
public event RemoveChildFromGroupHandler ChildRemovedFromGroup;
public event AddGroupHandler GroupAdded;
public event RemoveGroupHandler GroupRemoved;

private ScrollViewHorizontal scrollView = new ScrollViewHorizontal();
private Rect RectScrollView;
Expand Down
16 changes: 0 additions & 16 deletions Source/PawnRace.cs

This file was deleted.

23 changes: 19 additions & 4 deletions Source/RelationshipBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,26 @@ public void Build() {
AddRelationship(rel.source.Pawn, rel.target.Pawn, rel.def);
}

// For any parent/child group that is missing parents, create a parent.
// For any parent/child group that is missing parents, create them.
foreach (var group in parentChildGroups) {
if (group.Children.Count > 1 && group.Parents.Count == 0) {
CustomParentChildPawn parent = CreateParent(null, group.Children);
group.Parents.Add(parent);
if (group.Children.Count > 1) {
// Siblings need to have 2 parents, or they will be considered half-siblings.
if (group.Parents.Count == 0) {
CustomParentChildPawn parent1 = CreateParent(Gender.Female, group.Children);
CustomParentChildPawn parent2 = CreateParent(Gender.Male, group.Children);
group.Parents.Add(parent1);
group.Parents.Add(parent2);
}
else if (group.Parents.Count == 1) {
if (group.Parents[0].Gender == Gender.Male) {
CustomParentChildPawn parent = CreateParent(Gender.Female, group.Children);
group.Parents.Add(parent);
}
else {
CustomParentChildPawn parent = CreateParent(Gender.Male, group.Children);
group.Parents.Add(parent);
}
}
}
}

Expand Down
9 changes: 1 addition & 8 deletions Source/Version3/ColonistLoaderVersion3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,11 @@ public CustomPawn Load(PrepareCarefully loadout, string name) {
return loadedPawn;
}
else {
Messages.Message("EdB.PC.Dialog.Preset.Error.NoCharacter".Translate(), MessageSound.SeriousAlert);
Log.Warning("Preset was created with the following mods: " + modString);
return null;
}
if (loader.Failed) {
loadout.State.AddError(loader.ModString);
loadout.State.AddError("EdB.PC.Dialog.PawnPreset.Error.Failed".Translate());
loadout.State.AddError("EdB.PC.Dialog.Preset.Error.NoCharacter".Translate());
Log.Warning("Preset was created with the following mods: " + modString);
return null;
}

return null;
}
}
}
Expand Down

0 comments on commit a1c5783

Please sign in to comment.