Merge pull request #256 from tobifroe/master
Allow disabling the display of skill tooltips
This commit is contained in:
@@ -2,11 +2,16 @@
|
||||
|
||||
## Version 1.6.1 - ????-??-??
|
||||
|
||||
### **Features:**
|
||||
|
||||
- [#255](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/255) - Added option to toggle display of tooltips per client
|
||||
|
||||
### **Bug Fixes:**
|
||||
|
||||
- [#259](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/259) - Fixed "Keep Sanity Private" setting in agent sheets.
|
||||
- [#263](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/263) - Fixed inability to edit item descriptions.
|
||||
- [#253](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/253) - Close "Automation Menu" & "Handler Settings" when settings are saved.
|
||||
- [#252](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/252) - Removed redundant lines in tooltip texts
|
||||
|
||||
## Version 1.6.0 - 2025-09-04
|
||||
|
||||
|
||||
@@ -395,6 +395,8 @@
|
||||
"DG.Settings.charactersheet.program": "The Program",
|
||||
"DG.Settings.sortskills.name": "Sort Skills By Column?",
|
||||
"DG.Settings.sortskills.hint": "Checked sorts by column. Unchecked sorts by row.",
|
||||
"DG.Settings.hideSkillTooltips.name": "Hide Skill Tooltips",
|
||||
"DG.Settings.hideSkillTooltips.hint": "Do not display skill tooltips in Agent sheets.",
|
||||
"DG.Settings.keepSanityPrivate.name": "Keep Sanity Private",
|
||||
"DG.Settings.keepSanityPrivate.hint": "Hide sanity from players in both Agent sheets and rolls.",
|
||||
"DG.Settings.skillImprovementFormula.name": "Default Skill Improvement Roll",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import DG, { BASE_TEMPLATE_PATH } from "./config.js";
|
||||
import DGActorSheet from "./sheets/base-actor-sheet.js";
|
||||
|
||||
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
|
||||
|
||||
@@ -312,6 +313,22 @@ export default function registerSystemSettings() {
|
||||
default: false,
|
||||
});
|
||||
|
||||
game.settings.register("deltagreen", "hideSkillTooltips", {
|
||||
name: game.i18n.localize("DG.Settings.hideSkillTooltips.name"),
|
||||
hint: game.i18n.localize("DG.Settings.hideSkillTooltips.hint"),
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: Boolean,
|
||||
default: false,
|
||||
onChange: () => {
|
||||
foundry.applications.instances.forEach((app) => {
|
||||
if (app instanceof DGActorSheet) {
|
||||
app.render();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// obsolete - will be removed at some point
|
||||
game.settings.register("deltagreen", "characterSheetFont", {
|
||||
name: "World Font Choice",
|
||||
|
||||
@@ -83,6 +83,17 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) {
|
||||
this._sortSkills();
|
||||
this._sortCustomSkills();
|
||||
|
||||
// Wether to hide skill tooltips
|
||||
context.hideSkillTooltips = game.settings.get(
|
||||
"deltagreen",
|
||||
"hideSkillTooltips",
|
||||
);
|
||||
|
||||
if (!context.hideSkillTooltips) {
|
||||
// Setup tooltips
|
||||
this._prepareSkillTooltips();
|
||||
}
|
||||
|
||||
// Set sanity block per actor type.
|
||||
context.sanityInputs = await foundry.applications.handlebars.renderTemplate(
|
||||
`${DGActorSheet.TEMPLATE_PATH}/partials/sanity-${this.actor.type}.html`,
|
||||
@@ -390,6 +401,24 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the list of sorted skills with their respective tooltips.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
_prepareSkillTooltips() {
|
||||
for (const skill of Object.values(this.actor.system.sortedSkills)) {
|
||||
skill.tooltip = game.i18n.localize(`DG.Skills.Tooltip.${skill.key}`);
|
||||
if (!skill.proficiency) {
|
||||
skill.tooltip = skill.tooltip.concat(
|
||||
skill.tooltip,
|
||||
"<br><br>",
|
||||
game.i18n.localize("DG.Tooltip.CannotRollSkillLabel"),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares a simplified version of the special training for display on sheet.
|
||||
*
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
data-key="{{skill.key}}"
|
||||
data-rolltype="skill"
|
||||
for="system.skills.{{skill.key}}.value"
|
||||
data-tooltip="{{concat (localize (concat 'DG.Skills.Tooltip.' skill.key)) '<br><br>' (localize (ifThen skill.proficiency 'DG.Tooltip.SkillLabel' 'DG.Tooltip.CannotRollSkillLabel')) }}">
|
||||
{{#unless ../hideSkillTooltips }}
|
||||
data-tooltip="{{ skill.tooltip }}"
|
||||
{{/unless }}
|
||||
>
|
||||
{{localizeWithFallback (concat "DG.Skills." skill.key) skill.label }}
|
||||
<i class="fas fa-dice"></i>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user