Skip to content

Commit 5f324be

Browse files
committed
chore: remove pixelated, adjusted prompt check hooks
1 parent fc9e9e0 commit 5f324be

File tree

2 files changed

+25
-33
lines changed

2 files changed

+25
-33
lines changed

module/projectfu.mjs

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { FUItemSheet } from './sheets/item-sheet.mjs';
88
import { preloadHandlebarsTemplates } from './helpers/templates.mjs';
99
import { FU, SYSTEM } from './helpers/config.mjs';
1010
import { registerSystemSettings, SETTINGS } from './settings.js';
11-
import { addRollContextMenuEntries, createCheckMessage, promptCheck, rollCheck } from './helpers/checks.mjs';
11+
import { addRollContextMenuEntries, createCheckMessage, promptCheck, promptOpenCheck, rollCheck } from './helpers/checks.mjs';
1212
import { FUCombatTracker } from './ui/combat-tracker.mjs';
1313
import { FUCombat } from './ui/combat.mjs';
1414
import { FUCombatant } from './ui/combatant.mjs';
@@ -188,18 +188,22 @@ Hooks.once('init', async () => {
188188
Actors.unregisterSheet('core', ActorSheet);
189189
Actors.registerSheet('projectfu', FUStandardActorSheet, {
190190
makeDefault: true,
191+
label: 'Standard Actor Sheet',
191192
});
192193
Items.unregisterSheet('core', ItemSheet);
193194
Items.registerSheet('projectfu', FUItemSheet, {
194195
makeDefault: true,
196+
label: 'Standard Item Sheet',
195197
});
196198
Items.registerSheet(SYSTEM, FUClassFeatureSheet, {
197199
types: ['classFeature'],
198200
makeDefault: true,
201+
label: 'Class Feature Sheet',
199202
});
200203
Items.registerSheet(SYSTEM, FUOptionalFeatureSheet, {
201204
types: ['optionalFeature'],
202205
makeDefault: true,
206+
label: 'Optional Feature Sheet',
203207
});
204208

205209
Hooks.on('getChatLogEntryContext', addRollContextMenuEntries);
@@ -460,20 +464,33 @@ Hooks.once('ready', async function () {
460464
rollEquipment(actor, slot, isShift);
461465
});
462466

463-
Hooks.on('promptCheckCalled', (actor) => {
467+
function handleNoActor(actor) {
464468
if (!actor) {
465-
return ui.notification.error('No character for this user');
469+
ui.notification.error('No character for this user');
470+
return true;
466471
}
467-
// Call promptCheck function
472+
return false;
473+
}
474+
475+
Hooks.on('promptOpenCheckCalled', (actor) => {
476+
if (handleNoActor(actor)) return;
477+
promptOpenCheck(actor);
478+
});
479+
480+
Hooks.on('promptAttributeCheckCalled', (actor) => {
481+
if (handleNoActor(actor)) return;
468482
promptCheck(actor);
469483
});
470484

471485
Hooks.on('promptGroupCheckCalled', (actor) => {
472-
if (!actor) {
473-
return ui.notification.error('No character for this user');
474-
}
486+
if (handleNoActor(actor)) return;
487+
let isShift = false;
488+
GroupCheck.promptCheck(actor, isShift);
489+
});
490+
491+
Hooks.on('promptInitiativeCheckCalled', (actor) => {
492+
if (handleNoActor(actor)) return;
475493
let isShift = true;
476-
// Call Group Check promptCheck function
477494
GroupCheck.promptCheck(actor, isShift);
478495
});
479496

@@ -568,20 +585,6 @@ Hooks.once('ready', async function () {
568585

569586
Hooks.once('socketlib.ready', onSocketLibReady);
570587

571-
Hooks.once('mmo-hud.ready', () => {
572-
// Do this
573-
});
574-
575-
Hooks.once('ready', () => {
576-
const isPixelated = game.settings.get('projectfu', 'optionImagePixelated');
577-
const applyPixelatedStyle = () => {
578-
// Apply the style to specific selectors
579-
$('img').css('image-rendering', isPixelated ? 'pixelated' : '');
580-
};
581-
// Apply the style initially
582-
applyPixelatedStyle();
583-
});
584-
585588
/* -------------------------------------------- */
586589
/* Other Hooks */
587590
/* -------------------------------------------- */

module/settings.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const SETTINGS = Object.freeze({
1515
optionDefaultTargetingMode: 'optionDefaultTargetingMode',
1616
optionStudySavePath: 'optionStudySavePath',
1717
useRevisedStudyRule: 'useRevisedStudyRule',
18-
optionImagePixelated: 'optionImagePixelated',
1918
optionAlwaysFavorite: 'optionAlwaysFavorite',
2019
optionNPCNotesTab: 'optionNPCNotesTab',
2120
optionBondMaxLength: 'optionBondMaxLength',
@@ -184,16 +183,6 @@ export const registerSystemSettings = async function () {
184183
type: String,
185184
});
186185

187-
game.settings.register(SYSTEM, SETTINGS.optionImagePixelated, {
188-
name: game.i18n.localize('FU.PixelatedViewSettings'),
189-
hint: game.i18n.localize('FU.PixelatedViewSettingsHint'),
190-
scope: 'world',
191-
config: true,
192-
type: Boolean,
193-
default: false,
194-
requiresReload: true,
195-
});
196-
197186
game.settings.register(SYSTEM, SETTINGS.optionAlwaysFavorite, {
198187
name: game.i18n.localize('FU.AlwaysFavoriteSettings'),
199188
hint: game.i18n.localize('FU.AlwaysFavoriteSettingsHint'),

0 commit comments

Comments
 (0)