Synced "Gm Monitor" with actor updates
This commit is contained in:
@@ -40,7 +40,6 @@
|
|||||||
"global": {
|
"global": {
|
||||||
"add": "Add",
|
"add": "Add",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"refresh": "Refresh",
|
|
||||||
"delete_confirm": "Are you sure you want to delete '{name}' ?",
|
"delete_confirm": "Are you sure you want to delete '{name}' ?",
|
||||||
"drop_here": "Drop here",
|
"drop_here": "Drop here",
|
||||||
"send_to_chat": "To Chat",
|
"send_to_chat": "To Chat",
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"global": {
|
"global": {
|
||||||
"add": "Añadir",
|
"add": "Añadir",
|
||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"refresh": "Refresh",
|
|
||||||
"delete_confirm": "¿Estás seguro de que quieres borrar '{name}' ?",
|
"delete_confirm": "¿Estás seguro de que quieres borrar '{name}' ?",
|
||||||
"drop_here": "Dejar caer aquí",
|
"drop_here": "Dejar caer aquí",
|
||||||
"send_to_chat": "To Chat",
|
"send_to_chat": "To Chat",
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"global": {
|
"global": {
|
||||||
"add": "Ajouter",
|
"add": "Ajouter",
|
||||||
"edit": "Modifier",
|
"edit": "Modifier",
|
||||||
"refresh": "Actualiser",
|
|
||||||
"delete_confirm": "Etes-vous sûr de vouloir supprimer '{name}' ?",
|
"delete_confirm": "Etes-vous sûr de vouloir supprimer '{name}' ?",
|
||||||
"drop_here": "Déposez ici",
|
"drop_here": "Déposez ici",
|
||||||
"send_to_chat": "Vers Conv.",
|
"send_to_chat": "Vers Conv.",
|
||||||
|
|||||||
@@ -186,7 +186,18 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
if (formData["data.description"]) {
|
if (formData["data.description"]) {
|
||||||
formData["data.description"] = game.l5r5e.HelpersL5r5e.convertSymbols(formData["data.description"], true);
|
formData["data.description"] = game.l5r5e.HelpersL5r5e.convertSymbols(formData["data.description"], true);
|
||||||
}
|
}
|
||||||
return super._updateObject(event, formData);
|
|
||||||
|
return super._updateObject(event, formData).then(() => {
|
||||||
|
// Notify the "Gm Monitor" if this actor is watched
|
||||||
|
if (game.settings.get("l5r5e", "gm-monitor-actors").find((e) => e === this.actor.id)) {
|
||||||
|
game.l5r5e.sockets.refreshAppId("l5r5e-gm-monitor");
|
||||||
|
if (game.user.isGM) {
|
||||||
|
Object.values(ui.windows)
|
||||||
|
.find((e) => e.id === "l5r5e-gm-monitor")
|
||||||
|
?.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,29 +25,11 @@ export class GmMonitor extends FormApplication {
|
|||||||
resizable: true,
|
resizable: true,
|
||||||
closeOnSubmit: false,
|
closeOnSubmit: false,
|
||||||
submitOnClose: false,
|
submitOnClose: false,
|
||||||
submitOnChange: true,
|
submitOnChange: false,
|
||||||
dragDrop: [{ dragSelector: null, dropSelector: null }],
|
dragDrop: [{ dragSelector: null, dropSelector: null }],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add the Refresh button on top of sheet
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
_getHeaderButtons() {
|
|
||||||
let buttons = super._getHeaderButtons();
|
|
||||||
|
|
||||||
// Send To Chat
|
|
||||||
buttons.unshift({
|
|
||||||
label: game.i18n.localize("l5r5e.global.refresh"),
|
|
||||||
class: "refresh",
|
|
||||||
icon: "fas fa-sync-alt",
|
|
||||||
onclick: async () => this.refresh(),
|
|
||||||
});
|
|
||||||
|
|
||||||
return buttons;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param {ApplicationOptions} options
|
* @param {ApplicationOptions} options
|
||||||
@@ -103,8 +85,6 @@ export class GmMonitor extends FormApplication {
|
|||||||
if (!game.user.isGM) {
|
if (!game.user.isGM) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// this.position.width = "auto";
|
|
||||||
// this.position.height = "auto";
|
|
||||||
return super.render(force, options);
|
return super.render(force, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,17 +150,6 @@ export class GmMonitor extends FormApplication {
|
|||||||
}); // tooltips
|
}); // tooltips
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called upon form submission after form data is validated
|
|
||||||
* @param event The initial triggering submission event
|
|
||||||
* @param formData The object of validated form data with which to update the object
|
|
||||||
* @returns A Promise which resolves once the update operation has completed
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
async _updateObject(event, formData) {
|
|
||||||
this.render(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle dropped data on the Actor sheet
|
* Handle dropped data on the Actor sheet
|
||||||
* @param {DragEvent} event
|
* @param {DragEvent} event
|
||||||
@@ -258,8 +227,8 @@ export class GmMonitor extends FormApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.object.actors = this.object.actors.filter((e) => e.id !== id);
|
this.object.actors = this.object.actors.filter((e) => e.id !== id);
|
||||||
await this._saveActorsIds();
|
|
||||||
|
|
||||||
|
await this._saveActorsIds();
|
||||||
return this.refresh();
|
return this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -241,5 +241,11 @@ export class GmToolbox extends FormApplication {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ui.notifications.info(game.i18n.localize(`l5r5e.gm_toolbox.${type}_info`));
|
ui.notifications.info(game.i18n.localize(`l5r5e.gm_toolbox.${type}_info`));
|
||||||
|
|
||||||
|
// Refresh gm-monitor
|
||||||
|
Object.values(ui.windows)
|
||||||
|
.find((e) => e.id === "l5r5e-gm-monitor")
|
||||||
|
?.refresh();
|
||||||
|
game.l5r5e.sockets.refreshAppId("l5r5e-gm-monitor");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -400,7 +400,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#l5r5e-gm-monitor {
|
#l5r5e-gm-monitor {
|
||||||
min-height: 270px;
|
min-height: 170px;
|
||||||
min-width: 500px;
|
min-width: 500px;
|
||||||
|
|
||||||
.window-content {
|
.window-content {
|
||||||
@@ -414,6 +414,9 @@
|
|||||||
max-width: 28px;
|
max-width: 28px;
|
||||||
max-height: 28px;
|
max-height: 28px;
|
||||||
}
|
}
|
||||||
|
.overvalue {
|
||||||
|
color: $red-dice;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,11 @@
|
|||||||
<td>
|
<td>
|
||||||
{{actor.data.data.social.honor}} / {{actor.data.data.social.glory}} / {{actor.data.data.social.status}}
|
{{actor.data.data.social.honor}} / {{actor.data.data.social.glory}} / {{actor.data.data.social.status}}
|
||||||
</td>
|
</td>
|
||||||
<td>{{actor.data.data.fatigue.value}} / {{actor.data.data.fatigue.max}}</td>
|
<td><span class="{{#ifCond actor.data.data.fatigue.value '>' actor.data.data.fatigue.max}}overvalue{{/ifCond}}">{{actor.data.data.fatigue.value}}</span> / {{actor.data.data.fatigue.max}}</td>
|
||||||
<td>{{actor.data.data.strife.value}} / {{actor.data.data.strife.max}}</td>
|
<td><span class="{{#ifCond actor.data.data.strife.value '>' actor.data.data.strife.max}}overvalue{{/ifCond}}">{{actor.data.data.strife.value}}</span> / {{actor.data.data.strife.max}}</td>
|
||||||
<td>{{actor.data.data.focus}} / {{actor.data.data.vigilance}}</td>
|
<td>
|
||||||
|
{{actor.data.data.focus}} / {{#if actor.data.data.is_compromised}}<span class="overvalue">1</span>{{else}}{{actor.data.data.vigilance}}{{/if}}
|
||||||
|
</td>
|
||||||
<td>{{actor.data.data.void_points.value}} / {{actor.data.data.void_points.max}}</td>
|
<td>{{actor.data.data.void_points.value}} / {{actor.data.data.void_points.max}}</td>
|
||||||
<td><i data-actor-id="{{actor.id}}" class="fas fa-question-circle actor-infos-control"></i></td>
|
<td><i data-actor-id="{{actor.id}}" class="fas fa-question-circle actor-infos-control"></i></td>
|
||||||
<td><span data-actor-id="{{actor.id}}" class="actor-remove-control pointer" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></span></td>
|
<td><span data-actor-id="{{actor.id}}" class="actor-remove-control pointer" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></span></td>
|
||||||
|
|||||||
Reference in New Issue
Block a user