From b701fe60a1e7bd30764ba227b53ed0b2f08c24fb Mon Sep 17 00:00:00 2001 From: Svornost <11434-svornost@users.noreply.gitgud.io> Date: Sat, 22 Feb 2020 23:19:45 -0800 Subject: [PATCH] Use PCrelationshipTerm more broadly. --- src/facilities/nursery/nurseryWidgets.js | 57 +++++++----------------- src/js/slaveSummaryWidgets.js | 14 ++---- 2 files changed, 21 insertions(+), 50 deletions(-) diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index 9bfded0a9fe..99a09008e9f 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -1522,11 +1522,8 @@ App.Facilities.Nursery.InfantSummary = function(child) { r += " "; } else if (child.mother === -1) { r += `Your daughter`; - if (child.relationship === -3) { - r += ` & wife`; - handled = 1; - } else if (child.relationship === -2) { - r += ` & lover`; + if (child.relationship < -1) { + res += ` & ${PCrelationshipTerm(child)}`; handled = 1; } r += " "; @@ -1548,11 +1545,8 @@ App.Facilities.Nursery.InfantSummary = function(child) { r += " "; } else if (child.father === -1 && child.mother !== -1) { r += `Your daughter`; - if (child.relationship === -3) { - r += ` & wife`; - handled = 1; - } else if (child.relationship === -2) { - r += ` & lover`; + if (child.relationship < -1) { + res += ` & ${PCrelationshipTerm(child)}`; handled = 1; } r += " "; @@ -1664,11 +1658,9 @@ App.Facilities.Nursery.InfantSummary = function(child) { } } else if (child.mother === -1) { r += `Your `; - if (child.relationship === -3) { - r += `<span class="lightgreen">daughter and wife.</span> `; - handled = 1; - } else if (child.relationship === -2) { - r += `<span class="lightgreen">daughter and lover.</span> `; + + if (child.relationship < -1) { + r += `<span class="lightgreen">daughter and ${PCrelationshipTerm(child)}.</span> `; handled = 1; } else { r += `<span class="lightgreen">daughter.</span> `; @@ -1691,11 +1683,8 @@ App.Facilities.Nursery.InfantSummary = function(child) { } } else if (child.father === -1 && child.father !== child.mother) { r += `Your `; - if (child.relationship === -3) { - r += `<span class="lightgreen">daughter and wife.</span> `; - handled = 1; - } else if (child.relationship === -2) { - r += `<span class="lightgreen">daughter and lover.</span> `; + if (child.relationship < -1) { + r += `<span class="lightgreen">daughter and ${PCrelationshipTerm(child)}.</span> `; handled = 1; } else { r += `<span class="lightgreen">daughter.</span> `; @@ -6205,11 +6194,8 @@ App.Facilities.Nursery.ChildSummary = function(child) { r += " "; } else if (child.mother === -1) { r += `Your daughter`; - if (child.relationship === -3) { - r += ` & wife`; - handled = 1; - } else if (child.relationship === -2) { - r += ` & lover`; + if (child.relationship < -1) { + res += ` & ${PCrelationshipTerm(child)}`; handled = 1; } r += " "; @@ -6231,11 +6217,8 @@ App.Facilities.Nursery.ChildSummary = function(child) { r += " "; } else if (child.father === -1 && child.mother !== -1) { r += `Your daughter`; - if (child.relationship === -3) { - r += ` & wife`; - handled = 1; - } else if (child.relationship === -2) { - r += ` & lover`; + if (child.relationship < -1) { + res += ` & ${PCrelationshipTerm(child)}`; handled = 1; } r += " "; @@ -6390,11 +6373,8 @@ App.Facilities.Nursery.ChildSummary = function(child) { } } else if (child.mother === -1) { r += `Your `; - if (child.relationship === -3) { - r += `<span class="lightgreen">daughter and wife.</span> `; - handled = 1; - } else if (child.relationship === -2) { - r += `<span class="lightgreen">daughter and lover.</span> `; + if (child.relationship < -1) { + r += `<span class="lightgreen">daughter and ${PCrelationshipTerm(child)}.</span> `; handled = 1; } else { r += `<span class="lightgreen">daughter.</span> `; @@ -6417,11 +6397,8 @@ App.Facilities.Nursery.ChildSummary = function(child) { } } else if (child.father === -1 && child.father !== child.mother) { r += `Your `; - if (child.relationship === -3) { - r += `<span class="lightgreen">daughter and wife.</span> `; - handled = 1; - } else if (child.relationship === -2) { - r += `<span class="lightgreen">daughter and lover.</span> `; + if (child.relationship < -1) { + r += `<span class="lightgreen">daughter and ${PCrelationshipTerm(child)}.</span> `; handled = 1; } else { r += `<span class="lightgreen">daughter.</span> `; diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index 48258a7302a..426c0a6aff9 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -3654,11 +3654,8 @@ window.SlaveSummaryUncached = (function() { res += " "; } else if (slave.mother === -1) { res += `Your ${getPronouns(slave).daughter}`; - if (slave.relationship === -3) { - res += ` & ${getPronouns(slave).wife}`; - handled = 1; - } else if (slave.relationship === -2) { - res += ` & lover`; + if (slave.relationship < -1) { + res += ` & ${PCrelationshipTerm(slave)}`; handled = 1; } res += " "; @@ -3678,11 +3675,8 @@ window.SlaveSummaryUncached = (function() { res += " "; } else if (slave.father === -1 && slave.mother !== -1) { res += `Your ${getPronouns(slave).daughter}`; - if (slave.relationship === -3) { - res += ` & ${getPronouns(slave).wife}`; - handled = 1; - } else if (slave.relationship === -2) { - res += ` & lover`; + if (slave.relationship < -1) { + res += ` & ${PCrelationshipTerm(slave)}`; handled = 1; } res += " "; -- GitLab