Skip to content

Commit

Permalink
Merge pull request #54 from etiquettestartshere/1.1.8
Browse files Browse the repository at this point in the history
more expansion fixes...
  • Loading branch information
etiquettestartshere authored Apr 12, 2024
2 parents 002044d + 57c7b67 commit 429c032
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "effectivetray",
"title": "Effective Tray",
"version": "1.1.7",
"version": "1.1.8",
"compatibility": {
"minimum": "11",
"verified": "11"
Expand Down
36 changes: 18 additions & 18 deletions scripts/effective-tray.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ export class effectiveTray {
if (!game.settings.get(MODULE, "expandEffect")) return;
const tray = html.querySelector('.effects-tray');
if (!tray) return;
const mid = message.id;
await new Promise(r => setTimeout(r, 100));
tray.classList.remove("collapsed");
if (game.settings.get(MODULE, "systemDefault")) return;
tray.classList.remove("collapsed");
if (game.settings.get(MODULE, "scrollOnExpand")) _scroll(mid);
};

// Check and see if the effects tray needs to be scrolled
Expand Down Expand Up @@ -273,9 +273,9 @@ export class effectiveDamage {
// Expand the damage tray
static async _expandDamage(message, html) {
if (!game.settings.get(MODULE, "expandDamage")) return;
await new Promise(r => setTimeout(r, 100));
const tray = html.querySelector('.damage-tray');
if (!tray) return;
await new Promise(r => setTimeout(r, 100));
tray.classList.remove("collapsed");
tray.classList.add("et-uncollapsed");
const mid = message.id;
Expand Down Expand Up @@ -338,6 +338,21 @@ export class effectiveDamage {
/* Socket Handling */
/* -------------------------------------------- */

// Register the socket
export class effectiveSocket {
static init() {
game.socket.on(socketID, (data) => {
switch (data.type) {
case "firstCase":
_effectSocket(data);
break;
case "secondCase":
_damageSocket(data);
};
});
};
};

// Make the GM client apply effects to the socket emitter's targets
async function _effectSocket(data) {
if (game.user !== game.users.activeGM) return;
Expand All @@ -364,21 +379,6 @@ function _damageSocket(data) {
_applyTargetDamage(id, options, dmg);
};

// Register the socket
export class effectiveSocket {
static init() {
game.socket.on(socketID, (data) => {
switch (data.type) {
case "firstCase":
_effectSocket(data);
break;
case "secondCase":
_damageSocket(data);
};
});
};
};

/* -------------------------------------------- */
/* Functions */
/* -------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion scripts/settings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class moduleSettings {
game.settings.register(MODULE, "contextTarget", {
name: "EFFECTIVETRAY.ContextTargetSettingName",
hint: "EFFECTIVETRAY.ContextTargetSettingHint",
scope: "world",
scope: "client",
config: true,
type: Boolean,
default: false,
Expand Down

0 comments on commit 429c032

Please sign in to comment.