mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
Merged with development
This commit is contained in:
commit
6d3e5302eb
62 changed files with 1776 additions and 660 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue