diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index 8015d2efcfd9edc6a6d64417e83dd1e354ad6a29..ad8d3c2ede3c7c9436e556bd97bfe23ba1457a7c 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -3656,24 +3656,6 @@ window.capFirstChar = function capFirstChar(string) { return string.charAt(0).toUpperCase() + string.substr(1); }; -window.getSlaveDisplayName = function (slave) { - if ((!slave) || (!State)) - return undefined; - var surnamesFirstCountries = [ - "Cambodian", - "Chinese", - "Hungarian", - "Japanese", - "Korean", - "Mongolian", - "Taiwanese", - "Vietnamese"]; - var names = [slave.slaveName, slave.slaveSurname || ""]; - if ((1 !== State.variables.surnameOrder) && (surnamesFirstCountries.includes(slave.nationality))) - names.reverse(); - return names.join(" ").trim(); -}; - window.getSlaveDevotionClass = function (slave) { if ((!slave) || (!State)) return undefined; @@ -7689,11 +7671,10 @@ window.PlayerName = function PlayerName() { "Mongolian", "Taiwanese", "Vietnamese"]; - let names = [V.PC.name, V.PC.surname || ""]; - + let names = V.PC.surname ? [V.PC.name, V.PC.surname] : [V.PC.name]; if ((V.surnameOrder !== 1) && (surnamesFirstCountries.includes(V.PC.nationality))) names.reverse(); - return names.join(" ").trim(); + return names.join(" "); }; window.PCTitle = function PCTitle() { diff --git a/src/facilities/nursery/nursery.tw b/src/facilities/nursery/nursery.tw index 9d9d3e027c04e482fefad9c20bed0c047d6887ee..339ced17038527204813591c4a40122e272b8275 100644 --- a/src/facilities/nursery/nursery.tw +++ b/src/facilities/nursery/nursery.tw @@ -203,7 +203,7 @@ Reserve an eligible mother-to-be's child to be placed in a room upon birth. Of $ <<set _pregCount = $slaves[_u].pregType>> <<set _reservedSpots = $slaves[_u].reservedChildrenNursery>> <<set _pregWeek = $slaves[_u].pregWeek>> - <<set _slaveName = getSlaveDisplayName($slaves[_u])>> + <<set _slaveName = SlaveFullName($slaves[_u])>> <div class="possible" @id="_slaveId" @data-preg-count="_pregCount" @data-reserved-spots="_reservedSpots" @data-preg-week="_pregWeek" @data-name="_slaveName"> <<print "[[_slaveName|Long Slave Description][$activeSlave = $slaves[" + _u + "], $nextLink = passage()]]">> is $slaves[_u].pregWeek weeks pregnant with <<if $slaves[_u].pregSource == 0 || $slaves[_u].preg <= 5>>someone's<<if $slaves[_u].preg <= 5>>, though it is too early to tell whose,<</if>> diff --git a/src/js/assayJS.tw b/src/js/assayJS.tw index 3b55388da760bfa9d80af4e2f7f3f46c9b72e09e..011db808b35f82f666e6aa1dc98d76ec3c57704f 100644 --- a/src/js/assayJS.tw +++ b/src/js/assayJS.tw @@ -585,11 +585,10 @@ window.PlayerName = function PlayerName() { "Mongolian", "Taiwanese", "Vietnamese"]; - let names = [V.PC.name, V.PC.surname || ""]; - + let names = V.PC.surname ? [V.PC.name, V.PC.surname] : [V.PC.name]; if ((V.surnameOrder !== 1) && (surnamesFirstCountries.includes(V.PC.nationality))) names.reverse(); - return names.join(" ").trim(); + return names.join(" "); }; window.PCTitle = function PCTitle() { diff --git a/src/js/utilJS.tw b/src/js/utilJS.tw index 59530845c7604474bba3a94f0d8c508dd1c6250f..b2c3ac6e22c662a65dcfacaf7e0a5db81d7258cf 100644 --- a/src/js/utilJS.tw +++ b/src/js/utilJS.tw @@ -631,24 +631,6 @@ window.capFirstChar = function capFirstChar(string) { return string.charAt(0).toUpperCase() + string.substr(1); }; -window.getSlaveDisplayName = function (slave) { - if ((!slave) || (!State)) - return undefined; - var surnamesFirstCountries = [ - "Cambodian", - "Chinese", - "Hungarian", - "Japanese", - "Korean", - "Mongolian", - "Taiwanese", - "Vietnamese"]; - var names = [slave.slaveName, slave.slaveSurname || ""]; - if ((1 !== State.variables.surnameOrder) && (surnamesFirstCountries.includes(slave.nationality))) - names.reverse(); - return names.join(" ").trim(); -}; - window.getSlaveDevotionClass = function (slave) { if ((!slave) || (!State)) return undefined; diff --git a/src/pregmod/incubator.tw b/src/pregmod/incubator.tw index 3e33f6b013b34d072611685ee7aff52cb977180f..73c7f2fb8c2c3b76f71b831fd6c2fce28833c5ca 100644 --- a/src/pregmod/incubator.tw +++ b/src/pregmod/incubator.tw @@ -77,7 +77,7 @@ Reserve an eligible mother-to-be's child to be placed in a tank upon birth. Of $ <<set _pregCount = $slaves[_u].pregType>> <<set _reservedSpots = $slaves[_u].reservedChildren>> <<set _pregWeek = $slaves[_u].pregWeek>> - <<set _slaveName = getSlaveDisplayName($slaves[_u])>> + <<set _slaveName = SlaveFullName($slaves[_u])>> <div class="possible" @id="_slaveId" @data-preg-count="_pregCount" @data-reserved-spots="_reservedSpots" @data-preg-week="_pregWeek" @data-name="_slaveName"> <<print "[[_slaveName|Long Slave Description][$activeSlave = $slaves[" + _u + "], $nextLink = passage()]]">> is $slaves[_u].pregWeek weeks pregnant with <<if $slaves[_u].pregSource == 0 || $slaves[_u].preg <= 5>>someone's<<if $slaves[_u].preg <= 5>>, though it is too early to tell whose,<</if>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index ae8a39ebeb2b615ff2bc93aaf8c546852421515b..a4685e2b5376e4c34f752e6c111835a39cf931d9 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3512,6 +3512,8 @@ Setting missing slave variables: <</if>> <</for>> +<<set _Slave.chem = Number(_Slave.chem) || 0>> + <<set $slaves[_bci] = _Slave>> <</for>> diff --git a/src/uncategorized/recETSWorkaround.tw b/src/uncategorized/recETSWorkaround.tw index 17f73bd7e7d9412541aa7a609191b41883f0f535..a252105b857ddfcb6f41693476553a625b69c45a 100644 --- a/src/uncategorized/recETSWorkaround.tw +++ b/src/uncategorized/recETSWorkaround.tw @@ -30,6 +30,7 @@ Unsurprisingly the daughter is an addict too, and before long she's given her si <<set $activeSlave.relation = "daughter">> <<set $activeSlave.relationTarget = $activeSlave.ID - 1000>> <</if>> +<<set $activeSlave.birthsTotal = 0>> <<set $activeSlave.visualAge = $activeSlave.actualAge>> <<set $activeSlave.physicalAge = $activeSlave.actualAge>> <<set $activeSlave.ovaryAge = $activeSlave.actualAge>> @@ -69,6 +70,7 @@ Her daughter walks in angrily demanding to know why you called her here. She see <<set $activeSlave.relation = "daughter">> <<set $activeSlave.relationTarget = $activeSlave.ID - 1000>> <</if>> +<<set $activeSlave.birthsTotal = 0>> <<set $activeSlave.visualAge = $activeSlave.actualAge>> <<set $activeSlave.physicalAge = $activeSlave.actualAge>> <<set $activeSlave.ovaryAge = $activeSlave.actualAge>> diff --git a/src/uncategorized/slaveSummary.tw b/src/uncategorized/slaveSummary.tw index c6bf3e0a7f681483b6a10546070490cad2eeb2b7..0685dd1662f846550574d0bbdcb119e1b9f559a0 100644 --- a/src/uncategorized/slaveSummary.tw +++ b/src/uncategorized/slaveSummary.tw @@ -82,7 +82,7 @@ _indexSlavesIdxs = $slaves.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; })>> <<for !_.isUndefined(_ssi = _filteredSlaveIdxs.shift())>> <<set _Slave = $slaves[_ssi]>> -<<set _slaveName = getSlaveDisplayName(_Slave);>> +<<set _slaveName = SlaveFullName(_Slave);>> <<capture _ssi>> @@ -111,7 +111,7 @@ <<htag _divAttributes>> <<for !_.isUndefined(_ssii = _indexSlavesIdxs.shift())>> <<set _IndexSlave = $slaves[_ssii]>> - <<set _indexSlaveName = getSlaveDisplayName(_IndexSlave);>> + <<set _indexSlaveName = SlaveFullName(_IndexSlave);>> <<set _devotionClass = getSlaveDevotionClass(_IndexSlave);>> <<set _trustClass = getSlaveTrustClass(_IndexSlave);>> <<set _buttons.push({'data-name': _indexSlaveName, 'data-scroll-to': '#slave-' + _IndexSlave.ID, 'data-scroll-offset': _offset, 'data-devotion': _IndexSlave.devotion, 'data-trust': _IndexSlave.trust, class: _devotionClass + ' ' + _trustClass });>>