TJSGameSettings doesn't respect `onChange` option?

So if I have a standard settings registration:
function dontShowWelcome() {
game.settings.register(MODULE_ID, 'dontShowWelcome', {
name: game.i18n.localize('GAS.Setting.DontShowWelcome.Name'),
hint: game.i18n.localize('GAS.Setting.DontShowWelcome.Hint'),
scope: 'user',
config: true,
default: false,
type: Boolean,
onChange: () => {
alert('o');
}
});
function dontShowWelcome() {
game.settings.register(MODULE_ID, 'dontShowWelcome', {
name: game.i18n.localize('GAS.Setting.DontShowWelcome.Name'),
hint: game.i18n.localize('GAS.Setting.DontShowWelcome.Hint'),
scope: 'user',
config: true,
default: false,
type: Boolean,
onChange: () => {
alert('o');
}
});
The alert will trigger. However, if I wrap a setting via TJSGameSettings it won't trigger the onChange hook. E.g.
class trackerSettings extends TJSGameSettings {
this.register({
namespace,
key: "enable-tracker",
options: {
name: game.i18n.localize('Name'),
hint: game.i18n.localize('Hint'),
scope: "world",
config: true,
type: Boolean,
default: true,
onchange: () => {
alert('o');
}
}
});
class trackerSettings extends TJSGameSettings {
this.register({
namespace,
key: "enable-tracker",
options: {
name: game.i18n.localize('Name'),
hint: game.i18n.localize('Hint'),
scope: "world",
config: true,
type: Boolean,
default: true,
onchange: () => {
alert('o');
}
}
});
Am I doing it wrong?
2 Replies
Vauxs
Vauxs2mo ago
You do notice in your example you changed onChange to be onchange?
geoidesic
geoidesicOP2mo ago
doh!
Want results from more Discord servers?
Add your server