diff --git a/src/003-assets/CSS/tooltip.css b/src/003-assets/CSS/tooltip.css index ddfa39a0d4663251d25e0d3dd91cd16cf1607024..6c5e7e745c5b7987cab9caa4d7048cf15f9cb18b 100644 --- a/src/003-assets/CSS/tooltip.css +++ b/src/003-assets/CSS/tooltip.css @@ -17,6 +17,7 @@ background-color: slategray; color: black; text-decoration: none; + font-style: normal; text-align: center; border-radius: 3px; padding: 5px; @@ -53,13 +54,13 @@ z-index: 999; } -.devotion:hover:after, .trust:hover:after, .defiant:hover:after { +body.tooltipsEnabled .devotion:hover:after, body.tooltipsEnabled .trust:hover:after, body.tooltipsEnabled .defiant:hover:after { visibility: visible; opacity: 1; bottom: 20px; } -.devotion:hover:before, .trust:hover:before, .defiant:hover:before { +body.tooltipsEnabled .devotion:hover:before, body.tooltipsEnabled .trust:hover:before, body.tooltipsEnabled .defiant:hover:before { visibility: visible; opacity: 1; bottom: 15px; diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 6c547f1b0a9aced2f971c88b54bb5d3344575ef9..d79172720d1a0b293722b8ad2e73fcb56aa06cce 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -1012,6 +1012,7 @@ You should have received a copy of the GNU General Public License along with thi <<set $fixedNationality = 0>> <<set $fixedRace = 0>> <<set $ui = "start">> +<<set $tooltipsEnabled = 0>> <<set $brandTarget = {primary: "buttock", secondary: "buttock", local: "buttock"}>> <<set $brandDesign = {primary: "your initials", official: "your initials", local: "your initials"}>> diff --git a/src/js/utilsDOM.js b/src/js/utilsDOM.js index 168c1b8f8c1a6fdf0125241fe63fded1519e9284..f6f1d48f0e18af327797a1dad368a26853d4c9b6 100644 --- a/src/js/utilsDOM.js +++ b/src/js/utilsDOM.js @@ -170,3 +170,12 @@ App.Utils.htmlToElement = function(text) { // @ts-ignore return template.content.firstChild; }; + +/* + * Shows tooltips if they are enabled. Must be called on every passage load, because <body> gets reset. + */ +$(document).on(":passageend", () => { + if (V.tooltipsEnabled === 1) { + document.body.classList.add("tooltipsEnabled"); + } +}); diff --git a/src/uncategorized/options.tw b/src/uncategorized/options.tw index 8d46688a401d5d2be6960145f382a13b72ae17b7..f52b39cffbd4649bbfc711e1737beac62ad22c65 100644 --- a/src/uncategorized/options.tw +++ b/src/uncategorized/options.tw @@ -204,6 +204,14 @@ This save was created using FC version $ver build $releaseID. <<option 0 "Disabled">> <</options>> + <<options $tooltipsEnabled>> + Help tooltips are + <<option 1 "Enabled">> + <<option 0 "Disabled">> + <<comment>> + <span class="devotion inc">Devotion.</span> + <</options>> + <<options $useSummaryCache>> Slave summary caching is <<option true "Enabled">>