Cleanup code

This commit is contained in:
2026-05-12 00:34:47 +02:00
parent 389517a774
commit 503ee9395a
92 changed files with 567 additions and 1012 deletions
-15
View File
@@ -17,17 +17,6 @@ export function registerHandlebarsHelpers() {
const { Handlebars } = globalThis
if (!Handlebars) return
Handlebars.registerHelper("select", function (selected, options) {
const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected))
const rgx = new RegExp(` value=["']${escapedValue}["']`)
const html = options.fn(this)
return html.replace(rgx, "$& selected")
})
Handlebars.registerHelper("getMagicBackground", function (magic) {
return game.i18n.localize(MAGICS[magic]?.background ?? "")
})
Handlebars.registerHelper("getMagicLabel", function (magic) {
return game.i18n.localize(MAGICS[magic]?.label ?? "")
})
@@ -44,10 +33,6 @@ export function registerHandlebarsHelpers() {
return MAGICS[magic]?.speciality?.[speciality]?.classicon ?? ""
})
Handlebars.registerHelper("getMagicSpecialityIcon", function (magic, speciality) {
return MAGICS[magic]?.speciality?.[speciality]?.icon ?? ""
})
Handlebars.registerHelper("getMagicSpecialityElementIcon", function (magic, speciality) {
return MAGICS[magic]?.speciality?.[speciality]?.elementicon ?? ""
})