From 704823eae462f9fec8b0b40926ef1dc8155f74fe Mon Sep 17 00:00:00 2001 From: Svornost <11434-svornost@users.noreply.gitgud.io> Date: Tue, 4 May 2021 22:28:50 -0700 Subject: [PATCH] Allow reminders to be set on the scope of a slave. --- devTools/types/FC/gameState.d.ts | 7 + js/002-config/fc-js-init.js | 1 - js/003-data/gameVariableData.js | 1 + src/Mods/Reminder/reminder.js | 120 ++++++++++++------ src/endWeek/reports/arcadeReport.js | 2 +- src/endWeek/reports/brothelReport.js | 4 +- src/endWeek/reports/cellblockReport.js | 4 +- src/endWeek/reports/clinicReport.js | 4 +- src/endWeek/reports/clubReport.js | 4 +- src/endWeek/reports/dairyReport.js | 4 +- src/endWeek/reports/farmyardReport.js | 4 +- src/endWeek/reports/masterSuiteReport.js | 4 +- src/endWeek/reports/nurseryReport.js | 4 +- src/endWeek/reports/penthouseReport.js | 2 +- src/endWeek/reports/schoolroomReport.js | 4 +- src/endWeek/reports/servantsQuartersReport.js | 4 +- src/endWeek/reports/spaReport.js | 4 +- src/endWeek/standardSlaveReport.js | 12 ++ src/interaction/siDescription.js | 2 + 19 files changed, 127 insertions(+), 64 deletions(-) diff --git a/devTools/types/FC/gameState.d.ts b/devTools/types/FC/gameState.d.ts index fb42f6230fc..b28d13f53d1 100644 --- a/devTools/types/FC/gameState.d.ts +++ b/devTools/types/FC/gameState.d.ts @@ -93,6 +93,13 @@ declare namespace FC { training: HeadGirlTraining; } + export interface ReminderEntry { + message: string | Node; + week: number; + category: string; + slaveID?: number; + } + /** * These variables shall not be in the game state and there is a hope they will be exterminated in the future */ diff --git a/js/002-config/fc-js-init.js b/js/002-config/fc-js-init.js index 326ce62de2a..94fe0fe8421 100644 --- a/js/002-config/fc-js-init.js +++ b/js/002-config/fc-js-init.js @@ -60,7 +60,6 @@ App.Medicine.OrganFarm = {}; App.Medicine.Salon = {}; App.Medicine.Surgery = {}; App.RA = {}; -App.Reminders = {}; App.SF = {}; App.SecExp = {}; App.SlaveAssignment = {}; diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 1adec966874..e1cebc9bf31 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -482,6 +482,7 @@ App.Data.resetOnNGPlus = { /** @type {FC.SlaveStateOrZero} */ activeSlave: 0, activeChild: 0, + /** @type {Array<FC.ReminderEntry>} */ reminders: [], /** @type {FC.SlaveStateOrZero} */ diff --git a/src/Mods/Reminder/reminder.js b/src/Mods/Reminder/reminder.js index 1112e9fc965..3604b896ed8 100644 --- a/src/Mods/Reminder/reminder.js +++ b/src/Mods/Reminder/reminder.js @@ -1,11 +1,12 @@ App.Reminders = (function() { - const fullDisplayDiv = document.createElement("div"); + const displayDiv = document.createElement("div"); const addDiv = document.createElement("div"); return { add: add, list: list, - addField: addField, fullDisplay: fullDisplay, + slaveDisplay: slaveDisplay, + slaveLink: slaveLink, dialog: dialog, }; @@ -13,12 +14,16 @@ App.Reminders = (function() { * @param {string|Node} message * @param {number} week * @param {string} [category] + * @param {number} [slaveID] */ - function add(message, week, category = "manual") { + function add(message, week, category = "manual", slaveID = 0) { if (message === "" || message === null) { return; } const entry = {message: message, week: week, category: category}; + if (slaveID) { + entry.slaveID = slaveID; + } // V.reminders is sorted by week from low to high, we insert at the correct place so it remains sorted. const index = V.reminders.findIndex(e => e.week >= week); @@ -32,29 +37,28 @@ App.Reminders = (function() { /** * @param {Object} [obj] * @param {number} [obj.maxFuture] how far into the future should reminders be displayed. - * @param {string} [obj.category] - * @param {boolean} [obj.link] show link to managePersonalAffairs.tw + * @param {function(FC.ReminderEntry):boolean} [obj.filter] + * @param {boolean} [obj.link] permit passage links * @returns {HTMLSpanElement|DocumentFragment} */ - function list({maxFuture = Number.POSITIVE_INFINITY, category = "all", link = false} = {}) { + function list({maxFuture = Number.POSITIVE_INFINITY, filter = null, link = false} = {}) { if (V.reminders.length === 0) { return document.createDocumentFragment(); } - /** - * @param {string} c - * @returns {boolean} - */ - const includedCategory = category === "all" ? () => true : c => c === category; + if (!filter) { + filter = () => true; + } - const replace = () => App.UI.DOM.replace("#reminder-list", list({ + const outerSpan = document.createElement("span"); + + const replace = () => App.UI.DOM.replace(outerSpan, list({ maxFuture: maxFuture, - category: category, - link: link + filter: filter })); /** - * @param {{}} entry + * @param {FC.ReminderEntry} entry */ function clearEntry(entry) { V.reminders.splice(V.reminders.indexOf(entry), 1); @@ -63,21 +67,19 @@ App.Reminders = (function() { // We only want to remove visible entries function clearOverdue() { - V.reminders = V.reminders.filter(e => e.week >= V.week || e.week > V.week + maxFuture || !includedCategory(e.category)); + V.reminders = V.reminders.filter(e => e.week >= V.week || e.week > V.week + maxFuture || !filter(e)); replace(); } function clearAll() { - V.reminders = V.reminders.filter(e => e.week > V.week + maxFuture || !includedCategory(e.category)); + V.reminders = V.reminders.filter(e => e.week > V.week + maxFuture || !filter(e)); replace(); } - let outerSpan = document.createElement("span"); - outerSpan.id = "reminder-list"; - - let overdue = 0, any = false; + let overdue = 0; + let any = false; - V.reminders.filter(e => e.week <= V.week + maxFuture && includedCategory(e.category)) + V.reminders.filter(e => e.week <= V.week + maxFuture && filter(e)) .forEach(entry => { any = true; let week; @@ -96,9 +98,12 @@ App.Reminders = (function() { week = `in ${numberWithPluralOne(entry.week - V.week, 'week')}`; } const div = document.createElement("div"); - div.append(entry.message, - " ", App.UI.DOM.makeElement("span", week.toString(), classes), - " ", App.UI.DOM.link("Clear", clearEntry, [entry])); + div.append(entry.message, " ", App.UI.DOM.makeElement("span", week.toString(), classes)); + const slave = getSlave(entry.slaveID); + if (slave) { + div.append(" (for ", link ? App.UI.DOM.passageLink(SlaveFullName(slave), "Slave Interact", () => V.AS = slave.ID) : SlaveFullName(slave), ")"); + } + div.append(" ", App.UI.DOM.link("Clear", clearEntry, [entry])); outerSpan.append(div); }); @@ -113,9 +118,12 @@ App.Reminders = (function() { } /** + * @param {function():void} refresh + * @param {string} [category] + * @param {number} [slaveID] * @returns {HTMLDivElement} */ - function addField() { + function addField(refresh, category, slaveID) { jQuery(addDiv).empty(); let entry = ""; @@ -125,9 +133,9 @@ App.Reminders = (function() { App.UI.DOM.makeTextBox("", v => { entry = v; }), " in ", App.UI.DOM.makeTextBox(0, v => { week = v; }, true), " weeks.", " ", App.UI.DOM.link("Add", () => { - add(entry, V.week + week); - fullDisplay(); - jQuery(addDiv).append(addField()); + add(entry, V.week + week, category, slaveID); + refresh(); + jQuery(addDiv).append(addField(refresh, category, slaveID)); }) ); @@ -135,29 +143,63 @@ App.Reminders = (function() { } /** + * @param {boolean} [link=false] show passage links * @returns {HTMLElement} */ - function fullDisplay() { - jQuery(fullDisplayDiv).empty(); - fullDisplayDiv.append(App.UI.DOM.makeElement("h2", "Reminders")); + function fullDisplay(link) { + jQuery(displayDiv).empty(); + displayDiv.append(App.UI.DOM.makeElement("h2", "Reminders")); - const listEl = list(); + const listEl = list({link}); if (listEl !== null) { - fullDisplayDiv.append(App.UI.DOM.makeElement("p", listEl, "indent")); + displayDiv.append(App.UI.DOM.makeElement("p", listEl, "indent")); } - fullDisplayDiv.append(App.UI.DOM.makeElement("h3", "Add new")); - fullDisplayDiv.append(App.UI.DOM.makeElement("p", addField())); + displayDiv.append(App.UI.DOM.makeElement("h3", "Add new")); + displayDiv.append(App.UI.DOM.makeElement("p", addField(() => fullDisplay(link)))); - return fullDisplayDiv; + return displayDiv; } - function dialog() { + /** + * @param {number} slaveID + * @returns {HTMLElement} + */ + function slaveDisplay(slaveID) { + jQuery(displayDiv).empty(); + displayDiv.append(App.UI.DOM.makeElement("h2", `Reminders for ${SlaveFullName(getSlave(slaveID))}`)); + + const listEl = list({filter: e => e.slaveID === slaveID}); + if (listEl !== null) { + displayDiv.append(App.UI.DOM.makeElement("p", listEl, "indent")); + } + + displayDiv.append(App.UI.DOM.makeElement("h3", "Add new")); + displayDiv.append(App.UI.DOM.makeElement("p", addField(() => slaveDisplay(slaveID), "slave", slaveID))); + + return displayDiv; + } + + /** + * @param {number} slaveID + * @returns {HTMLElement} + */ + function slaveLink(slaveID) { + return App.UI.DOM.link(String.fromCharCode(0x23f0), () => { + dialog(slaveID); + }); + } + + /** + * @param {number} [slaveID] + */ + function dialog(slaveID) { if (Dialog.isOpen()) { Dialog.close(); } Dialog.setup("Reminders", "reminders"); - $(Dialog.body()).empty().append(fullDisplay()); + const showLinks = Story.lookup("tags", "jump-from-safe").some(x => x.title === passage()); + $(Dialog.body()).empty().append(slaveID ? slaveDisplay(slaveID) : fullDisplay(showLinks)); Dialog.open(); } })(); diff --git a/src/endWeek/reports/arcadeReport.js b/src/endWeek/reports/arcadeReport.js index 3f1826394cb..86bf873ce2d 100644 --- a/src/endWeek/reports/arcadeReport.js +++ b/src/endWeek/reports/arcadeReport.js @@ -83,7 +83,7 @@ App.EndWeek.arcadeReport = function() { const {He} = getPronouns(slave); const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); r = []; r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/reports/brothelReport.js b/src/endWeek/reports/brothelReport.js index 0137e618c46..f984c14f4b8 100644 --- a/src/endWeek/reports/brothelReport.js +++ b/src/endWeek/reports/brothelReport.js @@ -267,7 +267,7 @@ App.EndWeek.brothelReport = function() { if (V.showEWD !== 0) { const madamEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(madamEntry, madam); - madamEntry.append(App.UI.favoriteToggle(madam), " "); + App.SlaveAssignment.appendSlaveLinks(madamEntry, madam); App.Events.addNode( madamEntry, [ @@ -339,7 +339,7 @@ App.EndWeek.brothelReport = function() { const {He} = getPronouns(slave); const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); r = []; r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/reports/cellblockReport.js b/src/endWeek/reports/cellblockReport.js index 148b09e67dd..61ec7021206 100644 --- a/src/endWeek/reports/cellblockReport.js +++ b/src/endWeek/reports/cellblockReport.js @@ -175,7 +175,7 @@ App.EndWeek.cellblockReport = function() { if (V.showEWD !== 0) { const wardenessEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(wardenessEntry, slave); - wardenessEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(wardenessEntry, slave); App.Events.addNode( wardenessEntry, [ @@ -294,7 +294,7 @@ App.EndWeek.cellblockReport = function() { if (V.showEWD !== 0) { const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); r = []; r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/reports/clinicReport.js b/src/endWeek/reports/clinicReport.js index 0317c4012b8..f75cb416b2c 100644 --- a/src/endWeek/reports/clinicReport.js +++ b/src/endWeek/reports/clinicReport.js @@ -258,7 +258,7 @@ App.EndWeek.clinicReport = function() { if (V.showEWD !== 0) { const nurseEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(nurseEntry, slave); - nurseEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(nurseEntry, slave); $(nurseEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as the clinical nurse.`); nurseEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false)); } else { @@ -399,7 +399,7 @@ App.EndWeek.clinicReport = function() { if (V.showEWD !== 0) { const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); $(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `); if (slave.choosesOwnAssignment === 2) { $(slaveEntry).append(App.SlaveAssignment.choosesOwnJob(slave)); diff --git a/src/endWeek/reports/clubReport.js b/src/endWeek/reports/clubReport.js index 406c1a17c8e..0d79a0438f8 100644 --- a/src/endWeek/reports/clubReport.js +++ b/src/endWeek/reports/clubReport.js @@ -152,7 +152,7 @@ App.EndWeek.clubReport = function() { if (V.showEWD !== 0) { const DJEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(DJEntry, slave); - DJEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(DJEntry, slave); App.Events.addNode( DJEntry, [ @@ -204,7 +204,7 @@ App.EndWeek.clubReport = function() { if (V.showEWD !== 0) { const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); r = []; r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/reports/dairyReport.js b/src/endWeek/reports/dairyReport.js index 11c056000cb..6889ebac713 100644 --- a/src/endWeek/reports/dairyReport.js +++ b/src/endWeek/reports/dairyReport.js @@ -345,7 +345,7 @@ App.EndWeek.dairyReport = function() { if (V.showEWD !== 0) { const milkMaidEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(milkMaidEntry, slave); - milkMaidEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(milkMaidEntry, slave); App.Events.addNode( milkMaidEntry, [ @@ -467,7 +467,7 @@ App.EndWeek.dairyReport = function() { if (V.showEWD !== 0) { const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); r = []; r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/reports/farmyardReport.js b/src/endWeek/reports/farmyardReport.js index 559e43a2f23..409f6c45057 100644 --- a/src/endWeek/reports/farmyardReport.js +++ b/src/endWeek/reports/farmyardReport.js @@ -257,7 +257,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { if (V.showEWD) { const farmerEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(farmerEntry, Farmer); - farmerEntry.append(App.UI.favoriteToggle(Farmer), " "); + App.SlaveAssignment.appendSlaveLinks(farmerEntry, slave); $(farmerEntry).append(`<span class="slave-name">${SlaveFullName(Farmer)}</span> is serving as the Farmer.`); farmerEntry.append(App.SlaveAssignment.standardSlaveReport(Farmer, false)); } else { @@ -352,7 +352,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { if (V.showEWD) { const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); $(slaveEntry).append(`<span class="slave-name">${SlaveFullName(slave)}</span> `); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/reports/masterSuiteReport.js b/src/endWeek/reports/masterSuiteReport.js index 0129ed1c0e0..a86843b1f28 100644 --- a/src/endWeek/reports/masterSuiteReport.js +++ b/src/endWeek/reports/masterSuiteReport.js @@ -432,14 +432,14 @@ App.EndWeek.masterSuiteReport = function() { tired(concubine); const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, concubine); - slaveEntry.append(App.UI.favoriteToggle(concubine), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, concubine); App.Events.addNode(slaveEntry, [concubineText(), commonText(concubine)]); } for (const slave of App.SlaveAssignment.reportSlaves(slaves)) { const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); App.Events.addNode(slaveEntry, [nonConcubineText(slave), commonText(slave)]); } diff --git a/src/endWeek/reports/nurseryReport.js b/src/endWeek/reports/nurseryReport.js index dcc6676edb9..71540f5f083 100644 --- a/src/endWeek/reports/nurseryReport.js +++ b/src/endWeek/reports/nurseryReport.js @@ -141,7 +141,7 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { if (V.showEWD !== 0) { const matronEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(matronEntry, slave); - matronEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(matronEntry, slave); $(matronEntry).append(`<span class="slave-name">${SlaveFullName(slave)}</span> is serving as your Matron.`); matronEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false)); } else { @@ -197,7 +197,7 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { const {He} = getPronouns(slave); const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); $(slaveEntry).append(`<span class="slave-name">${SlaveFullName(slave)}</span> `); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/reports/penthouseReport.js b/src/endWeek/reports/penthouseReport.js index 3a7628e1c40..5de638689bb 100644 --- a/src/endWeek/reports/penthouseReport.js +++ b/src/endWeek/reports/penthouseReport.js @@ -22,7 +22,7 @@ App.EndWeek.penthouseReport = function() { if (penthouseArtRenderer) { App.UI.DOM.appendNewElement("div", slaveEntry, penthouseArtRenderer.render(slave), ["imageRef", "medImg"]); } - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); slaveEntry.append(fullReport(slave)); if (slave.ID === V.HeadGirlID && hgSlave) { diff --git a/src/endWeek/reports/schoolroomReport.js b/src/endWeek/reports/schoolroomReport.js index d2cee049162..c80b267bce9 100644 --- a/src/endWeek/reports/schoolroomReport.js +++ b/src/endWeek/reports/schoolroomReport.js @@ -153,7 +153,7 @@ App.EndWeek.schoolroomReport = function() { if (V.showEWD !== 0) { const schoolteacherEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(schoolteacherEntry, slave); - schoolteacherEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(schoolteacherEntry, slave); $(schoolteacherEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as your Schoolteacher.`); schoolteacherEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false)); } else { @@ -226,7 +226,7 @@ App.EndWeek.schoolroomReport = function() { const {He} = getPronouns(slave); const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); $(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `); if (slave.choosesOwnAssignment === 2) { $(slaveEntry).append(App.SlaveAssignment.choosesOwnJob(slave)); diff --git a/src/endWeek/reports/servantsQuartersReport.js b/src/endWeek/reports/servantsQuartersReport.js index aa84a62f84f..4f53b6ce6d9 100644 --- a/src/endWeek/reports/servantsQuartersReport.js +++ b/src/endWeek/reports/servantsQuartersReport.js @@ -222,7 +222,7 @@ App.EndWeek.servantsQuartersReport = function() { if (V.showEWD !== 0) { const stewardessEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(stewardessEntry, slave); - stewardessEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(stewardessEntry, slave); $(stewardessEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as your Stewardess.`); stewardessEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false)); } else { @@ -295,7 +295,7 @@ App.EndWeek.servantsQuartersReport = function() { const {He} = getPronouns(slave); const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); $(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `); if (slave.choosesOwnAssignment === 2) { $(slaveEntry).append(App.SlaveAssignment.choosesOwnJob(slave)); diff --git a/src/endWeek/reports/spaReport.js b/src/endWeek/reports/spaReport.js index 3f85560e835..1e9884e14d9 100644 --- a/src/endWeek/reports/spaReport.js +++ b/src/endWeek/reports/spaReport.js @@ -290,7 +290,7 @@ App.EndWeek.spaReport = function() { if (V.showEWD !== 0) { const attendantEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(attendantEntry, slave); - attendantEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(attendantEntry, slave); App.Events.addNode( attendantEntry, [ @@ -375,7 +375,7 @@ App.EndWeek.spaReport = function() { if (V.showEWD !== 0) { const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); App.SlaveAssignment.appendSlaveArt(slaveEntry, slave); - slaveEntry.append(App.UI.favoriteToggle(slave), " "); + App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave); r = []; r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); if (slave.choosesOwnAssignment === 2) { diff --git a/src/endWeek/standardSlaveReport.js b/src/endWeek/standardSlaveReport.js index a76d7a14d01..5de0aa6debf 100644 --- a/src/endWeek/standardSlaveReport.js +++ b/src/endWeek/standardSlaveReport.js @@ -45,3 +45,15 @@ App.SlaveAssignment.appendSlaveArt = function(node, slave) { App.UI.DOM.appendNewElement("div", node, App.EndWeek.saVars.slaveArt.render(slave), ["imageRef", "tinyImg"]); } }; + +/** + * Render favorite and reminder links + * @param {ParentNode} node + * @param {App.Entity.SlaveState} slave + */ +App.SlaveAssignment.appendSlaveLinks = function(node, slave) { + node.append( + App.UI.favoriteToggle(slave), " ", + App.Reminders.slaveLink(slave.ID), " " + ); +}; diff --git a/src/interaction/siDescription.js b/src/interaction/siDescription.js index 09b0a872c71..cbf71e275f2 100644 --- a/src/interaction/siDescription.js +++ b/src/interaction/siDescription.js @@ -26,6 +26,8 @@ App.UI.SlaveInteract.description = function(slave) { el.append(descriptionLink); } + el.append(App.Reminders.slaveDisplay(slave.ID)); + return el; function showOptions() { -- GitLab