darkness-dependent-vision/src/hooks/renderTokenConfig.js

21 lines
656 B
JavaScript

// SPDX-FileCopyrightText: 2021 Johannes Loher
//
// SPDX-License-Identifier: MIT
import { packageName } from '../config';
export default function registerForRenderTokenConfigHook() {
Hooks.on('renderTokenConfig', onRenderTokenConfig);
}
async function onRenderTokenConfig(app, html, data) {
if (game.settings.get(packageName, 'configurationViaHeaderButton')) {
return;
}
const contents = await renderTemplate(
'modules/darkness-dependent-vision/templates/darkness-dependent-vision-config-form-groups.hbs',
data,
);
html.find(`div[data-tab="vision"] .form-group`).last().after(contents);
app.setPosition({ height: 'auto' });
}