From 774b84048a3884ac515178745686b034f17f0b2a Mon Sep 17 00:00:00 2001 From: lowercase-donkey <lowercasedonkey@gmail.com> Date: Thu, 27 Jun 2019 23:34:42 -0400 Subject: [PATCH] Restore encyc links --- src/js/slaveListing.js | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js index 74ca168b468..ab3d2b8d0a9 100644 --- a/src/js/slaveListing.js +++ b/src/js/slaveListing.js @@ -680,6 +680,43 @@ App.UI.SlaveList.penthousePage = function() { }; } + /** + * Displays encyclopedia entries for occupations at the top of the tab, if enabled + * @returns {string} + */ + function encycTips(jn) { + if (V.showTipsFromEncy) { + switch (jn) { + case "rest": + return `<<encyclopediaEntryRest>>`; + case "chooseOwn": + break; /* no entry written for choose own */ + case "fucktoy": + return `<<encyclopediaEntryFucktoy>>`; + case "classes": + return `<<encyclopediaEntryAttendingClasses>>`; + case "houseServant": + return `<<encyclopediaEntryServitude>>`; + case "whore": + return `<<encyclopediaEntryWhoring>>`; + case "publicServant": + return `<<encyclopediaEntryPublicService>>`; + case "subordinateSlave": + return `<<encyclopediaEntrySexualServitude>>`; + case "cow": + return `<<encyclopediaEntryMilking>>`; + case "gloryhole": + return `<<encyclopediaEntryGloryHole>>`; + case "confinement": + return `<<encyclopediaEntryConfinement>>`; + default: + return `missing tip for this tab`; + } + } else { + return ``; + } + } + let r = ''; if (V.positionMainLinks >= 0) { @@ -694,14 +731,16 @@ App.UI.SlaveList.penthousePage = function() { /** @type {tabDesc[]} */ let tabs = []; + // Overview tab if (V.useSlaveSummaryOverviewTab) { tabs.push(makeTabDesc('overview', 'Overview', overviewTabContent())); } + // tabs for each assignment for (const jn of ph.jobsNames) { const slaves = _slavesForJob(jn); if (slaves.n > 0) { - tabs.push(makeTabDesc(jn, `${ph.desc.jobs[jn].position} (${slaves.n})`, slaves.text)); + tabs.push(makeTabDesc(jn, `${ph.desc.jobs[jn].position} (${slaves.n})`, encycTips(jn) + slaves.text)); } } -- GitLab