diff --git a/src/facilities/nursery/widgets/children/childSummary.js b/src/facilities/nursery/widgets/children/childSummary.js index 10fa981d65c73e6ce1cc98135cfaa8b3c319ac93..8a0322fc34b2e2eb20ad11c4b6e8ee667c2c7f5e 100644 --- a/src/facilities/nursery/widgets/children/childSummary.js +++ b/src/facilities/nursery/widgets/children/childSummary.js @@ -224,7 +224,7 @@ App.Facilities.Nursery.ChildSummary = function(child) { longSexQuirk(child); } if (child.custom.label) { - r += `<strong><span class="yellow">${capFirstChar(child.custom.label)}</span></strong> `; + r += `<span class="custom-label">${capFirstChar(child.custom.label)}</span> `; } if ((child.relationship !== 0) || (abbreviate.clothes === 2) || (abbreviate.rulesets === 2)) { r += `<br> `; diff --git a/src/facilities/nursery/widgets/children/longChildDescription.js b/src/facilities/nursery/widgets/children/longChildDescription.js index 66ca127dd85567f908093d664e5b79976600f1d9..78e5d86fc110e2ef4fee1c27e292aada45e3b150 100644 --- a/src/facilities/nursery/widgets/children/longChildDescription.js +++ b/src/facilities/nursery/widgets/children/longChildDescription.js @@ -6066,10 +6066,10 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event r += ` `; - r += `<span id="childName"><strong><span class="pink">${SlaveFullName(child)}</span></strong></span> `; + r += `<span id="childName" class="slave name simple">${SlaveFullName(child)}</span> `; if (child.custom.label) { - r += ` (<strong><span class="yellow">${child.custom.label}</span></strong>) `; + r += ` (<span class="custom-label">${child.custom.label}</span>) `; } r += ` is `; diff --git a/src/facilities/nursery/widgets/infants/longInfantDescription.js b/src/facilities/nursery/widgets/infants/longInfantDescription.js index 47303ce6e875c2ef845be3471f9933e638d588c2..f229127e0f32766e46b08971527029cf21eb5136 100644 --- a/src/facilities/nursery/widgets/infants/longInfantDescription.js +++ b/src/facilities/nursery/widgets/infants/longInfantDescription.js @@ -55,11 +55,11 @@ App.Facilities.Nursery.LongInfantDescription = function(child, {market = 0, even r += ` `; - r += `<span id="childName"><strong><span class="pink">${SlaveFullName(child)}</span></strong></span> `; + r += `<span id="childName" class="slave name simple">${SlaveFullName(child)}</span> `; if (jsDef(child.custom)) { if (child.custom.label) { - r += ` (<strong><span class="yellow">${child.custom.label}</span></strong>) `; + r += ` (<span class="custom-label">${child.custom.label}</span>) `; } } diff --git a/src/facilities/statistics.css b/src/facilities/statistics.css index ff051f66e5d10ac824483267ef58ecc7e482ffbe..91320c60544b476fb4f354b35bdc4ce5e865ca77 100644 --- a/src/facilities/statistics.css +++ b/src/facilities/statistics.css @@ -22,11 +22,6 @@ table.stats > tr > th.wide { text-align: right; } -table.stats > tr > td.value { - padding-right: 3px; - text-align: right; -} - table.stats-slave { width: 100%; font-size: 90%; @@ -50,7 +45,7 @@ table.stats-slave > tr > th.wide { text-align: right; } -table.stats-slave > tr > td.value { +td.value { padding-right: 3px; text-align: right; } diff --git a/src/facilities/statistics.js b/src/facilities/statistics.js index 19cd4a92d32ce074d325abee6b8b8a8c879fbc02..4343717cc4c14862f9368349b4da253ba61c1cda 100644 --- a/src/facilities/statistics.js +++ b/src/facilities/statistics.js @@ -18,7 +18,7 @@ App.Facilities.StatsHelper = class { /** Adds a value row to a stats table, with the given label and value cells * @param {HTMLTableElement} table - * @param {string} label + * @param {string|Node} label * @param {HTMLTableCellElement[]} valueCells * @param {boolean} [totals] */ @@ -33,6 +33,23 @@ App.Facilities.StatsHelper = class { } } + /** Makes a slave label + * @param {string} slaveName + * @param {string} customLabel + * @returns {Node} + */ + makeSlaveLabel(slaveName, customLabel) { + if (!customLabel) { + return document.createTextNode(slaveName); + } else { + const frag = document.createDocumentFragment(); + const label = App.UI.DOM.appendNewElement("span", frag, `(${customLabel}) `, "custom-label"); + frag.appendChild(label); + frag.appendChild(document.createTextNode(slaveName)); + return frag; + } + } + /** Makes a value cell * @param {string} type - "reputation" or "cash" * @param {number} value - numeric value @@ -212,7 +229,7 @@ App.Facilities.Brothel.Stats = (function() { for (const record of b.income.values()) { const revenue = record.income + record.adsIncome; const netIncome = revenue - record.cost; - H.addValueRow(slaveStats, record.slaveName, [ + H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [ H.makeCustomersCell(record.customers), makeRevenueCell(revenue, record.adsIncome), H.makeValueCell("cash", record.cost, {forceNeg: true}), @@ -311,7 +328,7 @@ App.Facilities.Club.Stats = (function() { const slaveStats = H.makeSlaveStatsTable(stats, "Public slut details", ["Slut", "Customers", "Rep. Gain", "Expenses", "Rep/Expenses", "Extra Income"]); for (const record of b.income.values()) { const netIncome = record.income / record.cost; - H.addValueRow(slaveStats, record.slaveName, [ + H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [ H.makeCustomersCell(record.customers), H.makeValueCell("reputation", record.income, {showSign: true, showZero: true}), H.makeValueCell("cash", record.cost, {forceNeg: true}), @@ -393,7 +410,7 @@ App.Facilities.Arcade.Stats = (function() { for (const record of b.income.values()) { const revenue = record.income + record.adsIncome; const netIncome = revenue - record.cost; - H.addValueRow(slaveStats, record.slaveName, [ + H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [ H.makeCustomersCell(record.customers), H.makeValueCell("cash", revenue), H.makeValueCell("cash", record.cost, {forceNeg: true}), @@ -458,7 +475,7 @@ App.Facilities.Dairy.Stats = (function() { const slaveStats = H.makeSlaveStatsTable(stats, "Cow details", ["Cow", "Milk/Cum/Fluids", "Revenue", "Expenses", "Net Income", "Rep. Change"]); for (const record of b.income.values()) { const netIncome = record.income - record.cost; - H.addValueRow(slaveStats, record.slaveName, [ + H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [ H.makeProductionCell(record.milk, record.cum, record.fluid), H.makeValueCell("cash", record.income), H.makeValueCell("cash", record.cost, {forceNeg: true}), @@ -523,7 +540,7 @@ App.Facilities.Farmyard.Stats = (function() { const slaveStats = H.makeSlaveStatsTable(stats, "Farmhand details", ["Farmhand", "Milk/Cum/Fluids", "Revenue", "Expenses", "Net Income", "Rep. Change"]); for (const record of b.income.values()) { const netIncome = record.income - record.cost; - H.addValueRow(slaveStats, record.slaveName, [ + H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [ H.makeProductionCell(record.milk, record.cum, record.fluid), H.makeValueCell("cash", record.income), H.makeValueCell("cash", record.cost, {forceNeg: true}), diff --git a/src/gui/css/mainStyleSheet.css b/src/gui/css/mainStyleSheet.css index e380ff8791f1bc0c60203b6c2562700912828939..47af08439aa425221b30d19aad0d3ea1023f235f 100644 --- a/src/gui/css/mainStyleSheet.css +++ b/src/gui/css/mainStyleSheet.css @@ -355,6 +355,11 @@ div.double-choices, p.double-choices { font-weight: bold; } +.custom-label { + color: yellow; + font-weight: bold; +} + div.cheat-menu { font-style: italic; position: absolute; diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index 748d642bc296921f0e4413b398d51bbfb108a9c6..e0adc5cbe33f5bddf80a9a136338c11fdcafe010 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -931,7 +931,7 @@ App.UI.SlaveSummary = function() { delegates.skills(slave, para); delegates.mental(slave, para); if (slave.custom.label) { - helpers.makeSpan(res, `${capFirstChar(slave.custom.label)}.`, ["yellow", "strong"]); + helpers.makeSpan(res, `${capFirstChar(slave.custom.label)}.`, ["custom-label"]); } if ((slave.relationship !== 0) || (slave.relationship !== 0) || (abbrSettings.clothes === 2) || (abbrSettings.rulesets === 2)) { para = helpers.makeParagraph(res); diff --git a/src/npc/descriptions/longSlave.js b/src/npc/descriptions/longSlave.js index 1dfe8a00ec76d152dbb7b42d96da0c0716e34587..aebac2d7193ac4467db7eb733f840d671d70d636 100644 --- a/src/npc/descriptions/longSlave.js +++ b/src/npc/descriptions/longSlave.js @@ -42,7 +42,7 @@ App.Desc.longSlave = function(slave = V.activeSlave, {market = 0, eventDescripti frag = new DocumentFragment(); frag.append("("); span = document.createElement('span'); - span.style.fontWeight = "bold"; + span.classList.add("custom-label"); span.textContent = slave.custom.label; frag.append(span); frag.append(") ");