diff --git a/src/events/eventUtils.js b/src/events/eventUtils.js index c3245d1ea5014fa985ba628de0604478113edcf9..34c3c611986837001e2ebb20f2837939ac6ab59e 100644 --- a/src/events/eventUtils.js +++ b/src/events/eventUtils.js @@ -221,7 +221,7 @@ App.Events.Result = class { * @param {string} [text] - the link text for the response * @param {resultHandler} [handler] - the function to call to generate the result when the link is clicked * @param {string|HTMLElement|DocumentFragment} [note] - a note to provide alongside the link (for example, a cost or virginity loss warning) - * To mark an option as disabled, construct the result with only the note. String may NOT contain HTML. + * To mark an option as disabled, construct the result with only the note. String may NOT contain HTML, but a WARNING# tag may be included in the note string to add a warning text ("This is the information note. WARNING# This is a warning text."). */ constructor(text, handler, note) { this.text = text; @@ -256,7 +256,20 @@ App.Events.Result = class { node.append(" "); } if (this.note) { - node.appendChild(App.UI.DOM.makeElement("span", this.note, ["detail"])); + if (typeof this.note === "string" && this.note.includes("WARNING#")) { + let warning = ""; + let subnote = ""; + warning = this.note.substring(this.note.indexOf("WARNING#") + 8); + subnote = this.note.substring(0, this.note.indexOf("WARNING#")); + if (subnote.length) { + node.appendChild(App.UI.DOM.makeElement("span", subnote, ["detail"])); + } + if (warning.length) { + node.appendChild(App.UI.DOM.makeElement("span", warning, ["warning"])); + } + } else { + node.appendChild(App.UI.DOM.makeElement("span", this.note, ["detail"])); + } wrote = true; } return wrote; diff --git a/src/js/utilsPC.js b/src/js/utilsPC.js index 8117443c930494a3bb24d0fbd6f02b855a889be9..9e88a1c2bfc351b6aaab597580c10f91743f9dfa 100644 --- a/src/js/utilsPC.js +++ b/src/js/utilsPC.js @@ -1099,12 +1099,12 @@ globalThis.PCPenetrationWarning = function(holes = "vaginal first", escape = fal return result; } else if (virgins.length === 2) { if (holes === "either") { - result += ` WARNING: This option ${action} take your vaginal or anal virginities.`; + result += `WARNING# This option ${action} take your vaginal or anal virginities.`; } else { - result += ` WARNING: This option ${action} take your vaginal and anal virginities.`; + result += `WARNING# This option ${action} take your vaginal and anal virginities.`; } } else { - result += ` WARNING: This option ${action} take your ${virgins[0]} virginity.`; + result += `WARNING# This option ${action} take your ${virgins[0]} virginity.`; } return result; }