diff --git a/src/Mods/Reminder/reminder.js b/src/Mods/Reminder/reminder.js index 7de0700054e437f65e3fb994bc0bc3df444a0dd1..18fd2c2401404fb33c99ac4c3b97d0e060f20416 100644 --- a/src/Mods/Reminder/reminder.js +++ b/src/Mods/Reminder/reminder.js @@ -19,9 +19,10 @@ App.Reminders.add = function(message, week, category = "manual") { /** * @param {number} [maxFuture] how far into the future should reminders be displayed. * @param {string} [category] + * @param {boolean} [link] show link to managePersonalAffairs.tw * @return {string} */ -App.Reminders.list = function list({maxFuture = Number.POSITIVE_INFINITY, category = "all"} = {}) { +App.Reminders.list = function list({maxFuture = Number.POSITIVE_INFINITY, category = "all", link = false} = {}) { if (V.reminders.length === 0) { return ""; } @@ -30,9 +31,9 @@ App.Reminders.list = function list({maxFuture = Number.POSITIVE_INFINITY, catego * @param {string} c * @return boolean */ - let includedCategory = category === "all" ? () => true : c => c === category; + const includedCategory = category === "all" ? () => true : c => c === category; - let replace = () => App.UI.replace("#reminder", list({maxFuture: maxFuture, category: category})); + const replace = () => App.UI.replace("#reminder", list({maxFuture: maxFuture, category: category, link: link})); /** * @param {{}} entry @@ -83,6 +84,9 @@ App.Reminders.list = function list({maxFuture = Number.POSITIVE_INFINITY, catego } if (any) { r += `<div>${App.UI.link("Clear All", clearAll, [])}</div>`; + if (link) { + r += `<div>${App.UI.link("Manage reminders", () => {}, [], "Manage Personal Affairs")}</div>`; + } } return `<span id="reminder">${r}</span>`; diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 1ae82b504bef339a036c7b08e4cc70f152090186..bc9f10e33541fb2b62e106ea7563fef07911b6c8 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3794,6 +3794,13 @@ Done<br> })>> <<set $completedOrgans = _newOrgans>> +<<if def $organsCompleted>> + <<unset $organsCompleted>> +<</if>> + +<<if ($PC.customTitle == "")>> + <<set $PC.customTitle = undefined, $PC.customTitleLisp = undefined>> +<</if>> /* leave this at the bottom of BC */ <<if $releaseID < App.Version.release>> diff --git a/src/uncategorized/main.tw b/src/uncategorized/main.tw index 1b51418f2a42a1f7e1544f793598203bad25f06c..e36e0bc5eaad74cdb0a66c0a01cb04d3810dc8fa 100644 --- a/src/uncategorized/main.tw +++ b/src/uncategorized/main.tw @@ -15,16 +15,6 @@ <br><br> <</if>> -<<if def $organsCompleted>> - <<unset $organsCompleted>> -<</if>> - -<<set $currentRule = $defaultRules[0]>> - -<<SlaveSort $slaves>> - -<<set _SL = $slaves.length>> - /* extra sanity checks and repair */ <<if $slaves.includes(null)>> <br><br>@@.red;ERROR: Main slaves array contains a null entry! Please report this.@@ <<link "Repair">><<set $slaves.delete(null)>><</link>><<goto "Main">><br><br> @@ -46,13 +36,16 @@ <br><br>@@.red;ERROR: Your husk slave order has taken on a mutated life of its own and has been summarily shot. Refile your husk slave order, if necessary, and notify the appropriate authorities if you see this message again.@@<br><br> <<set $huskSlave = new App.Entity.CustomSlaveOrder()>> <</if>> -/* end extra sanity checks and repair */ <<set _duplicateSlaves = _($slaves).countBy(s => s.ID).pickBy(v => v > 1).keys().map(v => Number(v)).value()>> <<for _i range _duplicateSlaves>> <br><br>@@.red;Duplicate slave ID _i at indices <<= _($slaves).map((s, idx) => ({ID: s.ID, idx: idx, name: s.slaveName, assignment: s.assignment})).filter(s => s.ID === _i).map(s => s.idx + ' - ' + s.name + ' (' + s.assignment + ')').join(', ')>>@@ <</for>> + +/* end extra sanity checks and repair */ + + <<set _visibleSlaves = $slaves.filter(s => assignmentVisible(s) && (s.assignment != "be your Head Girl" || $HGSuite != 1) && (s.assignment != "guard you" || $dojo <= 1)), $slavesVisible = _visibleSlaves.length, $dormitoryPopulation = _visibleSlaves.filter(s => s.rules.living != "luxurious").length, @@ -69,9 +62,11 @@ <<set $nextButton = "END WEEK", $nextLink = "End Week", $showEncyclopedia = 1, $encyclopedia = "How to Play">> <<set $costs = Math.trunc(calculateCosts.predict())>> -<<if ($PC.customTitle == "")>> - <<set $PC.customTitle = undefined, $PC.customTitleLisp = undefined>> -<</if>> +<<set $currentRule = $defaultRules[0]>> + +<<run SlaveSort.slaves($slaves)>> + +<<set _SL = $slaves.length>> <<if $newModelUI == 1>><<DisplayBuilding>><</if>> <<if $seeArcology == 1>> <<include "Arcology Description">> | [[Hide|Main][$seeArcology = 0]]<br><</if>> @@ -81,10 +76,7 @@ [[Hide|Main][$seeDesk = 0]] <</if>> -<<= App.Reminders.list({maxFuture: 5})>> -<<if $reminders.length > 0>> - <div>[[Manage reminders|Manage Personal Affairs]]</div> -<</if>> +<<= App.Reminders.list({maxFuture: 5, link: true})>> <<if $seeFCNN == 1>> <<if $FCNNstation != 1 && $week >= 90>> diff --git a/src/utility/miscWidgets.tw b/src/utility/miscWidgets.tw index 91a9c8c21be9ed0270b781e0132667432d76ecaa..21a0bdcf29c7721b1da91454e7c7995b3061f325 100644 --- a/src/utility/miscWidgets.tw +++ b/src/utility/miscWidgets.tw @@ -615,14 +615,6 @@ $args[1]: Fetish. <</widget>> -/% -Call as <<SlaveSort [$slaves]>> -$args[0]: array to sort -%/ -<<widget "SlaveSort">> - <<run SlaveSort.slaves($args[0])>> -<</widget>> - /% Call as <<SlaveIDSort [slaveIDs]>> $args[0]: array to sort