Move some generic constants and functions, or supporting functions to a new file. This makes the main script smaller and makes it more focused on the core functionality of the module.
58 lines
1.9 KiB
JavaScript
58 lines
1.9 KiB
JavaScript
import { module_id } from "./utils.mjs";
|
|
|
|
export const module_settings = Object.freeze({
|
|
MessageDialogTitle: "messageDialogTitle",
|
|
MessageDialogSenderTitle: "messageDialogSenderTitle",
|
|
HistoryJournalTitle: "historyJournalTitle",
|
|
StoreHistory: "storeHistory",
|
|
NotificationSound: "notificationSound",
|
|
})
|
|
|
|
export function register_settings() {
|
|
game.settings.register(module_id, module_settings.MessageDialogTitle, {
|
|
name: "MM.Settings.MessageDialogTitle.Title",
|
|
hint: "MM.Settings.MessageDialogTitle.Hint",
|
|
type: String,
|
|
config: true,
|
|
scope: "world",
|
|
default: game.i18n.localize("MM.Dialogs.MessageDialog.Title"),
|
|
})
|
|
|
|
game.settings.register(module_id, module_settings.MessageDialogSenderTitle, {
|
|
name: "MM.Settings.MessageDialogSenderTitle.Title",
|
|
hint: "MM.Settings.MessageDialogSenderTitle.Hint",
|
|
type: String,
|
|
config: true,
|
|
scope: "world",
|
|
default: game.i18n.localize("MM.Dialogs.MessageDialog.Header"),
|
|
})
|
|
|
|
game.settings.register(module_id, module_settings.StoreHistory, {
|
|
name: "MM.Settings.StoreHistory.Title",
|
|
hint: "MM.Settings.StoreHistory.Hint",
|
|
type: Boolean,
|
|
config: true,
|
|
scope: "world",
|
|
default: true,
|
|
})
|
|
|
|
game.settings.register(module_id, module_settings.HistoryJournalTitle, {
|
|
name: "MM.Settings.HistoryJournalTitle.Title",
|
|
hint: "MM.Settings.HistoryJournalTitle.Hint",
|
|
type: String,
|
|
config: true,
|
|
scope: "world",
|
|
default: game.i18n.localize("MM.UI.HistoryJournalTitle"),
|
|
})
|
|
|
|
game.settings.register(module_id, module_settings.NotificationSound, {
|
|
name: "MM.Settings.NotificationSound.Title",
|
|
hint: "MM.Settings.NotificationSound.Hint",
|
|
type: String,
|
|
config: true,
|
|
scope: "world",
|
|
requiresReload: true,
|
|
filePicker: 'sound',
|
|
default: "",
|
|
})
|
|
}
|