Add better status indicators, and a setting to prevent movement history recording
This commit is contained in:
parent
344e9c55ab
commit
c2601ba69c
18 changed files with 183 additions and 79 deletions
17
module/hooks/init.mjs
Normal file
17
module/hooks/init.mjs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Settings
|
||||
import { preventMovementHistory } from "../settings/preventMovementHistory.mjs";
|
||||
|
||||
// Utils
|
||||
import { Logger } from "../utils/Logger.mjs";
|
||||
|
||||
/*
|
||||
This is only here for setting that **require** being registered during
|
||||
initialization due to documentClass changes. If there is any way that
|
||||
these settings can be implemented to work during the setup hook, that is
|
||||
where they ideally should be implemented.
|
||||
*/
|
||||
Hooks.on(`init`, () => {
|
||||
Logger.log(`Initializing`);
|
||||
|
||||
preventMovementHistory();
|
||||
});
|
||||
58
module/hooks/setup.mjs
Normal file
58
module/hooks/setup.mjs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// Settings
|
||||
import { addGlobalDocReferrer } from "../settings/addGlobalDocReferrer.mjs";
|
||||
import { autoUnpauseOnLoad } from "../settings/autoUnpauseOnLoad.mjs";
|
||||
import { chatImageLinks } from "../settings/chatImageLinks.mjs";
|
||||
import { chatSidebarBackground } from "../settings/chatSidebarBackground.mjs";
|
||||
import { hotbarButtonGap } from "../settings/hotbarButtonGap.mjs";
|
||||
import { hotbarButtonSize } from "../settings/hotbarButtonSize.mjs";
|
||||
import { preventTokenRotation } from "../settings/preventTokenRotation.mjs";
|
||||
import { preventUserConfigOpen } from "../settings/preventUserConfigOpen.mjs";
|
||||
import { repositionHotbar } from "../settings/repositionHotbar.mjs";
|
||||
import { startingSidebarTab } from "../settings/startingSidebarTab.mjs";
|
||||
import { startSidebarExpanded } from "../settings/startSidebarExpanded.mjs";
|
||||
|
||||
// Apps
|
||||
import { DevSettingsMenu } from "../apps/DevSettingsMenu.mjs";
|
||||
import { HotbarSettingsMenu } from "../apps/HotbarSettingsMenu.mjs";
|
||||
|
||||
// Misc
|
||||
import { __ID__ } from "../consts.mjs";
|
||||
import { status } from "../utils/SettingStatus.mjs";
|
||||
|
||||
const { deepFreeze } = foundry.utils;
|
||||
|
||||
Hooks.on(`setup`, () => {
|
||||
|
||||
game.settings.registerMenu(__ID__, `devSettings`, {
|
||||
name: `OFT.menu.devSettings.name`,
|
||||
hint: `OFT.menu.devSettings.hint`,
|
||||
label: `OFT.menu.devSettings.label`,
|
||||
restricted: false,
|
||||
type: DevSettingsMenu,
|
||||
});
|
||||
addGlobalDocReferrer();
|
||||
autoUnpauseOnLoad();
|
||||
|
||||
game.settings.registerMenu(__ID__, `hotbarSettings`, {
|
||||
name: `OFT.menu.hotbarSettings.name`,
|
||||
hint: `OFT.menu.hotbarSettings.hint`,
|
||||
label: `OFT.menu.hotbarSettings.label`,
|
||||
restricted: false,
|
||||
type: HotbarSettingsMenu,
|
||||
});
|
||||
hotbarButtonSize();
|
||||
hotbarButtonGap();
|
||||
repositionHotbar();
|
||||
|
||||
chatImageLinks();
|
||||
chatSidebarBackground();
|
||||
startSidebarExpanded();
|
||||
startingSidebarTab();
|
||||
preventTokenRotation();
|
||||
preventUserConfigOpen();
|
||||
|
||||
Hooks.callAll(`oft.settingStatuses`, deepFreeze(status));
|
||||
game.modules.get(__ID__).api = deepFreeze({
|
||||
settings: status,
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue