Skip to content

Commit

Permalink
Bug fixes for 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
edbmods committed Oct 14, 2018
1 parent f611299 commit ac21413
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Resources/Languages/English/Keyed/EdBPrepareCarefully.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- CHANGE NOTES -->
<!-- v1.0.10 -->
<!-- NEW: EdB.PC.Equipment.AnimalLabel -->

<!-- v0.19.9 -->
<!-- NEW: EdB.PC.Dialog.Backstory.Filter.MatchesFaction -->

Expand Down Expand Up @@ -168,6 +171,7 @@

"{0}"</EdB.PC.Dialog.UnrecoverableError.Message>

<EdB.PC.Equipment.AnimalLabel>{0} {1}</EdB.PC.Equipment.AnimalLabel>
<EdB.PC.Equipment.Type.Animals>Animals</EdB.PC.Equipment.Type.Animals>
<EdB.PC.Equipment.Type.Apparel>Apparel</EdB.PC.Equipment.Type.Apparel>
<EdB.PC.Equipment.Type.Buildings>Furniture</EdB.PC.Equipment.Type.Buildings>
Expand Down
9 changes: 3 additions & 6 deletions Source/ControllerPawns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ public class ControllerPawns {

private State state;
private Randomizer randomizer = new Randomizer();
private Regex validNameRegex;
public ControllerPawns(State state) {
this.state = state;
validNameRegex = typeof(CharacterCardUtility).GetField("validNameRegex",
BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) as Regex;
}

public void CheckPawnCapabilities() {
Expand Down Expand Up @@ -65,17 +62,17 @@ public void RandomizeAll() {

// Name-related actions.
public void UpdateFirstName(string name) {
if (name.Length <= 12 && validNameRegex.IsMatch(name)) {
if (name.Length <= 12 && CharacterCardUtility.ValidNameRegex.IsMatch(name)) {
state.CurrentPawn.FirstName = name;
}
}
public void UpdateNickName(string name) {
if (name.Length <= 9 && validNameRegex.IsMatch(name)) {
if (name.Length <= 9 && CharacterCardUtility.ValidNameRegex.IsMatch(name)) {
state.CurrentPawn.NickName = name;
}
}
public void UpdateLastName(string name) {
if (name.Length <= 12 && validNameRegex.IsMatch(name)) {
if (name.Length <= 12 && CharacterCardUtility.ValidNameRegex.IsMatch(name)) {
state.CurrentPawn.LastName = name;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/EquipmentRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public string LabelForAnimal {
get {
Pawn pawn = thing as Pawn;
if (pawn.def.race.hasGenders) {
return "PawnMainDescGendered".Translate(pawn.gender.GetLabel(), pawn.kindDef.label).CapitalizeFirst();
return "EdB.PC.Equipment.AnimalLabel".Translate(pawn.gender.GetLabel(), pawn.kindDef.label).CapitalizeFirst();
}
else {
return pawn.LabelCap;
Expand Down
2 changes: 1 addition & 1 deletion Source/PanelRelationshipsParentChild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ protected string GetTooltipText(CustomPawn pawn) {
"EdB.PC.Pawn.AgeWithChronological".Translate(pawn.BiologicalAge, pawn.ChronologicalAge) :
"EdB.PC.Pawn.AgeWithoutChronological".Translate(pawn.BiologicalAge);
description = pawn.Gender != Gender.None ?
"EdB.PC.Pawn.PawnDescriptionWithGender".Translate(pawn.ProfessionLabel, pawn.Gender.GetLabel()) :
"EdB.PC.Pawn.PawnDescriptionWithGender".Translate(pawn.ProfessionLabel, pawn.Gender.GetLabel(), age) :
"EdB.PC.Pawn.PawnDescriptionNoGender".Translate(pawn.ProfessionLabel, age);
}
else {
Expand Down

0 comments on commit ac21413

Please sign in to comment.