Skip to content

Commit

Permalink
fix: Pass rolldialog into actor on socket message (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
aMediocreDad authored Mar 24, 2024
1 parent 9176a10 commit 25ba933
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
"show-tag-window-on-load-hint": "Al activarlo el gestor de etiquetas será automáticamente mostrado cuando cargue el juego. Siempre puedes hacer click en el icono de etiqueta para mostrarlo manualmente.",
"special-features": "Rasgos especiales",
"status": "Modificadores finales de estado",
"story-tags-help": "Añade etiquetas haciendo Shift+Click en la caja de texto y escribiendo una etiqueta como [etiqueta] o [estado-3].",
"tags-statuses": "Etiquetas y Estados",
"toggle-burnt": "<span class='reference'>OPCIÓN + Click</span> para quemar/restablecer etiqueta.",
"toggle-roll": "<span class='reference'>Click</span> para añadir/quitar a la tirada. <br /> <span class='reference'>MAYUS + Click</span> para quemar una etiqueta para la tirada. <br /> <span class='reference'>OPCIÓN + Click</span> para quemar/restablecer una etiqueta.",
Expand All @@ -198,4 +197,4 @@
"failure": "Fallo",
"consequence": "Éxito parcial",
"success": "Éxito completo"
}
}
4 changes: 4 additions & 0 deletions scripts/actor/character/character-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export class CharacterSheet extends ActorSheet {
return [...this.system.storyTags, ...this.system.statuses];
}

set roll(app) {
this.#roll = app;
}

renderRollDialog() {
this.#roll.render(true);
}
Expand Down
5 changes: 5 additions & 0 deletions scripts/system/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ export class LitmHooks {
shouldRoll,
} = app;

const actor = game.actors.get(actorId);

const characterTags = tags.filter(
(tag) => tag.type !== "tag" && tag.type !== "status",
);
Expand All @@ -234,7 +236,10 @@ export class LitmHooks {
id: data.id,
});

// Put the creatd dialog in the actor for convenience
actor.sheet.roll = dialog;
dialog.render(true);

ui.notifications.info(
game.i18n.format("Litm.ui.roll-gm-moderate", { name: user.name }),
{ permanent: true },
Expand Down

0 comments on commit 25ba933

Please sign in to comment.