Skip to content

Commit 22070e8

Browse files
committed
fix: use optionRenameCurrency over zenit
1 parent 7690d6f commit 22070e8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

module/helpers/inline-resources.mjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,22 @@ const inlineLossEnricher = {
3030
onRender: onRender,
3131
};
3232

33+
function getCurrencyLocalizationKey() {
34+
return game.settings.get('projectfu', 'optionRenameCurrency') || 'FU.Zenit';
35+
}
36+
3337
function createReplacementElement(amount, type, elementClass, uncapped, tooltip, label) {
3438
if (type in FU.resources) {
3539
const anchor = document.createElement('a');
3640
anchor.dataset.type = type;
37-
anchor.setAttribute('data-tooltip', `${game.i18n.localize(tooltip)} (${amount} ${type})`);
41+
42+
let typeName = game.i18n.localize(FU.resourcesAbbr[type]);
43+
if (type === 'zenit') {
44+
const currencyKey = getCurrencyLocalizationKey();
45+
typeName = game.i18n.localize(currencyKey);
46+
}
47+
48+
anchor.setAttribute('data-tooltip', `${game.i18n.localize(tooltip)} (${amount} ${typeName})`);
3849

3950
// Used to enable over-healing
4051
if (uncapped === true) {
@@ -55,7 +66,7 @@ function createReplacementElement(amount, type, elementClass, uncapped, tooltip,
5566
// AMOUNT
5667
InlineHelper.appendAmountToAnchor(anchor, amount);
5768
// TYPE
58-
anchor.append(` ${game.i18n.localize(FU.resourcesAbbr[type])}`);
69+
anchor.append(` ${typeName}`);
5970
}
6071
// ICON
6172
const icon = document.createElement('i');

0 commit comments

Comments
 (0)