Merged with development

This commit is contained in:
WBHarry 2025-10-29 19:13:46 +01:00
commit 6d3e5302eb
62 changed files with 1776 additions and 660 deletions

View file

@ -30,6 +30,7 @@ export const GMUpdateEvent = {
UpdateEffect: 'DhGMUpdateEffect',
UpdateSetting: 'DhGMUpdateSetting',
UpdateFear: 'DhGMUpdateFear',
UpdateCountdowns: 'DhGMUpdateCountdowns',
UpdateSaveMessage: 'DhGMUpdateSaveMessage'
};
@ -66,6 +67,10 @@ export const registerSocketHooks = () => {
)
);
break;
case GMUpdateEvent.UpdateCountdowns:
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns, data.update);
Hooks.callAll(socketEvent.Refresh, { refreshType: RefreshType.Countdown });
break;
case GMUpdateEvent.UpdateSaveMessage:
const action = await fromUuid(data.update.action),
message = game.messages.get(data.update.message);
@ -90,14 +95,15 @@ export const registerUserQueries = () => {
CONFIG.queries.reactionRoll = game.system.api.fields.ActionFields.SaveField.rollSaveQuery;
};
export const emitAsGM = async (eventName, callback, update, uuid = null) => {
export const emitAsGM = async (eventName, callback, update, uuid = null, refresh = null) => {
if (!game.user.isGM) {
return await game.socket.emit(`system.${CONFIG.DH.id}`, {
action: socketEvent.GMUpdate,
data: {
action: eventName,
uuid,
update
update,
refresh
}
});
} else return callback(update);