284 - Armor/Weapon Feature Improvements (#292)

* Added parsing of effect values from Item data model. Almost finished with itemConfig.

* Added the last to itemConfig

* Fixed armor

* ContextMenu localization fixes

* Better tooltips for tagify

* Corrected resource logic
This commit is contained in:
WBHarry 2025-07-09 13:06:49 +02:00 committed by GitHub
parent eae4f12910
commit b3e7c6b9b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 3043 additions and 2310 deletions

View file

@ -45,7 +45,13 @@ export const registerSocketHooks = () => {
await game.settings.set(
CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.Resources.Fear,
Math.max(0, Math.min(game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxFear, data.update))
Math.max(
0,
Math.min(
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxFear,
data.update
)
)
);
/* Hooks.callAll(socketEvent.DhpFearUpdate);
await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.DhpFearUpdate }); */
@ -64,7 +70,7 @@ export const registerSocketHooks = () => {
};
export const emitAsGM = async (eventName, callback, update, uuid = null) => {
if(!game.user.isGM) {
if (!game.user.isGM) {
return await game.socket.emit(`system.${CONFIG.DH.id}`, {
action: socketEvent.GMUpdate,
data: {
@ -74,11 +80,11 @@ export const emitAsGM = async (eventName, callback, update, uuid = null) => {
}
});
} else return callback(update);
}
};
export const emitAsOwner = (eventName, userId, args) => {
if(userId === game.user.id) return;
if(!eventName || !userId) return false;
if (userId === game.user.id) return;
if (!eventName || !userId) return false;
game.socket.emit(`system.${CONFIG.DH.id}`, {
action: eventName,
data: {
@ -87,4 +93,4 @@ export const emitAsOwner = (eventName, userId, args) => {
}
});
return false;
}
};