diff --git a/src/templates/CharacterArchiver.hbs b/src/templates/CharacterArchiver.hbs index 603033d..bd26ac4 100644 --- a/src/templates/CharacterArchiver.hbs +++ b/src/templates/CharacterArchiver.hbs @@ -1,13 +1,34 @@
| Alias | +Player | +Table | +Version | +
|---|---|---|---|
| {{this.characterName}} | +{{this.playerName}} | +{{this.sourceTable}} | +{{this.version}} | +
| + | + | ++ | + |
( - callback: (...args: P) => any, - time: number -): (...args: P) => void { - let timer: NodeJS.Timeout | undefined; - return function (this: any, ...args: P) { - clearTimeout(timer); - timer = setTimeout(() => callback.apply(this, args), time); - return timer; - } - -} +export const TABLE_NAME = "table_name"; diff --git a/src/ts/settings.ts b/src/ts/settings.ts index b1a4876..2aaa79d 100644 --- a/src/ts/settings.ts +++ b/src/ts/settings.ts @@ -1,23 +1,34 @@ -import {MODULE_ID, URI_SETTING_NAME, API_KEY_NAME} from "./common.js" +import {MODULE_ID, URI_SETTING_NAME, API_KEY_NAME, TABLE_NAME} from "./common" export function initializeSettings() { - (game as Game).settings!.register(MODULE_ID, URI_SETTING_NAME, { - name: "Archive Server URI", - hint: "Address of the character archive server.", - scope: "world", - config: true, - // restricted: true, - default: "https://chararchive.cyberpunkrush.com", - type: String, - }); + if ((game as Game).settings) { + (game as Game).settings.register(MODULE_ID, URI_SETTING_NAME, { + name: "Archive Server URI", + hint: "Address of the character archive server.", + scope: "world", + config: true, + // restricted: true, + default: "https://chararchive.cyberpunkrush.com", + type: String, + }); - (game as Game).settings!.register(MODULE_ID, API_KEY_NAME, { - name: "API Key", - hint: "API key to use when communicating with the archive server.", - scope: "world", - config: true, - // restricted: true, - default: "", - type: String, - }); + (game as Game).settings.register(MODULE_ID, API_KEY_NAME, { + name: "API Key", + hint: "API key to use when communicating with the archive server.", + scope: "world", + config: true, + // restricted: true, + default: "", + type: String, + }); + + (game as Game).settings.register(MODULE_ID, TABLE_NAME, { + name: "Table Name", + hint: "Table name to attatch to archived characters.", + scope: "world", + config: true, + default: "My Table", + type: String, + }); + } }