Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
Change import paths, delete LootApp
Browse files Browse the repository at this point in the history
  • Loading branch information
Djphoenix719 committed Jul 22, 2021
1 parent 70578c1 commit a65c0be
Show file tree
Hide file tree
Showing 27 changed files with 33 additions and 1,835 deletions.
1 change: 1 addition & 0 deletions src/module/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

export const MODULE_NAME = `pf2e-toolbox`;
export const MODULE_TITLE = `PF2E Toolbox`;
export const PF2E_PC_SHEET_NAME = `CharacterSheetPF2e`;
export const PF2E_LOOT_SHEET_NAME = `LootSheetPF2e`;
export const PF2E_NPC_SHEET_NAME = `NPCSheetPF2e`;
34 changes: 16 additions & 18 deletions src/module/Handlebars.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2021 Andrew Cuccinello
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { MODULE_NAME } from './Constants';

export async function registerHandlebarsTemplates() {
Expand All @@ -6,24 +22,6 @@ export async function registerHandlebarsTemplates() {
`modules/${MODULE_NAME}/templates/roll-app/index.html`,
`modules/${MODULE_NAME}/templates/roll-app/cell.html`,
`modules/${MODULE_NAME}/templates/roll-app/table.html`,
`modules/${MODULE_NAME}/templates/loot-app/LootApp.html`,
`modules/${MODULE_NAME}/templates/loot-app/LootAppSidebar.html`,
`modules/${MODULE_NAME}/templates/loot-app/LootAppTreasure.html`,
`modules/${MODULE_NAME}/templates/loot-app/LootAppConsumables.html`,
`modules/${MODULE_NAME}/templates/loot-app/LootAppMagicItems.html`,
`modules/${MODULE_NAME}/templates/loot-app/LootAppScrolls.html`,

`modules/${MODULE_NAME}/templates/settings-app/SettingsApp.html`,
`modules/${MODULE_NAME}/templates/settings-app/tabs/About.html`,
`modules/${MODULE_NAME}/templates/settings-app/tabs/Features.html`,
`modules/${MODULE_NAME}/templates/settings-app/tabs/License.html`,

`modules/${MODULE_NAME}/templates/loot-app/create/CreateTab.html`,
`modules/${MODULE_NAME}/templates/loot-app/create/CreateShared.html`,
`modules/${MODULE_NAME}/templates/loot-app/create/CreateArmor.html`,
`modules/${MODULE_NAME}/templates/loot-app/create/CreateWeapon.html`,
`modules/${MODULE_NAME}/templates/loot-app/create/SelectRow.html`,
`modules/${MODULE_NAME}/templates/loot-app/create/RuneStats.html`,
];
await loadTemplates(templatePaths);

Expand Down
26 changes: 9 additions & 17 deletions src/module/Setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ import { readyDefaultArt } from './features/DefaultArt';
import { setupQuantities } from './features/QuickQuantities';
import { setupFlattenProficiency } from './features/FlattenProficiency';
import { setupNPCScaler } from './features/NPCScaler';
import { readyLootApp } from './features/LootApp';
import { setupHeroPoints } from './features/HeroPoints';
import { setupTokens } from './features/Tokens';
import ModuleSettings, { ATTR_RELOAD_REQUIRED, ATTR_REOPEN_SHEET_REQUIRED, IFeatureDefinition } from '../../FVTT-Common/src/module/settings-app/ModuleSettings';
import { MODULE_NAME } from './Constants';
import { MODULE_NAME, MODULE_TITLE } from './Constants';
import { registerHandlebarsHelpers, registerHandlebarsTemplates } from './Handlebars';
import { fixMaterials, FixMaterials } from './commands/FixMaterials';
import secretSkillRoll from './macros/secret-skill-roll';
import { distributeHeroPoints } from './macros/distribute-hero-points';
import { groupSave, registerGroupSaveHooks } from './macros/group-saves';
import ModuleSettings, { ATTR_RELOAD_REQUIRED, ATTR_REOPEN_SHEET_REQUIRED, IFeatureDefinition } from '../../FVTT-Common/src/module/ModuleSettings';

export const CREATURE_BUILDER = 'CREATURE_BUILDER';
export const FLATTEN_PROFICIENCY = 'FLATTEN_PROFICIENCY';
Expand Down Expand Up @@ -159,17 +158,6 @@ export const FEATURES: IFeatureDefinition[] = [
],
onSetup: setupNPCScaler,
},
{
id: LOOT_APP,
title: 'Loot Enhancements',
attributes: [ATTR_RELOAD_REQUIRED],
description: `Adds a new loot actor sheet with many enhancements such as a treasure roller, magic item creator, and more.`,
help: `You must set all loot actors back to the default sheet before disabling this option or the actor will not function after
it is disabled.`,
inputs: [],
register: [],
onReady: readyLootApp,
},
{
id: HERO_POINTS,
title: 'Maximum Hero Points',
Expand Down Expand Up @@ -267,7 +255,12 @@ export const FEATURES: IFeatureDefinition[] = [

export const setup = () => {
Hooks.on('init', () => {
ModuleSettings.instance.registerAllSettings(MODULE_NAME, FEATURES);
ModuleSettings.initialize({
moduleName: MODULE_NAME,
moduleTitle: MODULE_TITLE,
features: FEATURES,
});

ModuleSettings.instance.reg(LAST_SEEN_SYSTEM, {
name: 'Last Seen System Version',
scope: 'world',
Expand All @@ -276,8 +269,8 @@ export const setup = () => {
config: false,
restricted: true,
});
ModuleSettings.instance.onInit();
});

Hooks.on('setup', () => ModuleSettings.instance.onSetup());
Hooks.on('ready', () => ModuleSettings.instance.onReady());

Expand Down Expand Up @@ -323,4 +316,3 @@ export const setup = () => {
registerGroupSaveHooks();
});
};
// /pf2e-toolbox fix-materials
2 changes: 1 addition & 1 deletion src/module/commands/FixMaterials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { ChatCommand } from '../../../FVTT-Common/src/module/chat-command/ChatCommand';
import ModuleSettings from '../../../FVTT-Common/src/module/settings-app/ModuleSettings';
import ModuleSettings from '../../../FVTT-Common/src/module/ModuleSettings';
import { MATERIALS_FIXED } from '../Setup';

export class FixMaterials extends ChatCommand {
Expand Down
2 changes: 1 addition & 1 deletion src/module/cr-scaler/NPCScaler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { IDataUpdates, IHandledItemType } from './NPCScalerTypes';
import { getActor, getFolder, getFolderInFolder } from '../Utilities';
import { getAreaDamageData, getDamageData, getHPData, getLeveledData, getMinMaxData } from './NPCScalerUtil';
import ModuleSettings from '../../../FVTT-Common/src/module/settings-app/ModuleSettings';
import ModuleSettings from '../../../FVTT-Common/src/module/ModuleSettings';
import { SCALED_FOLDER } from '../Setup';

const EMBEDDED_ENTITY_TYPE = 'Item';
Expand Down
2 changes: 1 addition & 1 deletion src/module/features/DefaultArt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import ModuleSettings from '../../../FVTT-Common/src/module/settings-app/ModuleSettings';
import { LAST_SEEN_SYSTEM } from '../Setup';
import ModuleSettings from '../../../FVTT-Common/src/module/ModuleSettings';

export async function readyDefaultArt() {
if (game.system.data.version === ModuleSettings.instance.get(LAST_SEEN_SYSTEM)) {
Expand Down
2 changes: 1 addition & 1 deletion src/module/features/HeroPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { PF2E_PC_SHEET_NAME } from '../Constants';
import ModuleSettings from '../../../FVTT-Common/src/module/settings-app/ModuleSettings';
import ModuleSettings from '../../../FVTT-Common/src/module/ModuleSettings';
import { MAX_HERO_POINTS } from '../Setup';

export const setupHeroPoints = () => Hooks.on(`render${PF2E_PC_SHEET_NAME}`, onSheetRender);
Expand Down
28 changes: 0 additions & 28 deletions src/module/features/LootApp.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/module/features/QuickQuantities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import ModuleSettings from '../../../FVTT-Common/src/module/settings-app/ModuleSettings';
import ModuleSettings from '../../../FVTT-Common/src/module/ModuleSettings';
import { CONTROL_QUANTITY, SHIFT_QUANTITY } from '../Setup';

export const setupQuantities = () => Hooks.on('renderActorSheet', onQuantitiesHook);
Expand Down
2 changes: 1 addition & 1 deletion src/module/features/Tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import ModuleSettings from '../../../FVTT-Common/src/module/settings-app/ModuleSettings';
import ModuleSettings from '../../../FVTT-Common/src/module/ModuleSettings';
import { TOKEN_PATH, TOKEN_TARGET, TOKEN_TARGET_BUCKET } from '../Setup';

export const setupTokens = () => Hooks.on('getActorDirectoryEntryContext', onSetupTokensContextHook);
Expand Down
Loading

0 comments on commit a65c0be

Please sign in to comment.