Added a new button bar for system specific buttons
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 1.6.0 - SoftLock
|
## 1.6.0 - QoL & SoftLock
|
||||||
- Added SoftLock on PC/NPC/Armies sheet.
|
- PC/NPC/Armies sheet:
|
||||||
- PC & NPC Sheet : Added +/- button to add or subtract Fatigue and Strife.
|
- Added SoftLock functionality.
|
||||||
- Armies Sheet : Added +/- button to add or subtract Casualties and Panic.
|
- Added a new button bar for system specific buttons.
|
||||||
|
- Added +/- buttons to add or subtract Fatigue and Strife (PC & NPC Sheet), Casualties and Panic (Armies Sheet).
|
||||||
- GmMonitor : Added ability to add or subtract fatigue/strife/void/casualties/panic points on mouse clic (left/right).
|
- GmMonitor : Added ability to add or subtract fatigue/strife/void/casualties/panic points on mouse clic (left/right).
|
||||||
- Compendiums :
|
- Compendiums :
|
||||||
- Techniques : QoL - Trying a cheap Rank filter.
|
- Techniques : QoL - Trying a cheap Rank filter.
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
"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",
|
||||||
|
"locked": "Locked",
|
||||||
|
"unlocked": "Unlocked",
|
||||||
"edge_translation_disclaimer": ""
|
"edge_translation_disclaimer": ""
|
||||||
},
|
},
|
||||||
"logo": {
|
"logo": {
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
"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",
|
||||||
|
"locked": "Locked",
|
||||||
|
"unlocked": "Unlocked",
|
||||||
"edge_translation_disclaimer": "Edge Studio nos da su permiso para ofrecer este módulo a la comunidad, pero tanto los textos así como los códigos que lo constituyen no tienen su aprobación explícita."
|
"edge_translation_disclaimer": "Edge Studio nos da su permiso para ofrecer este módulo a la comunidad, pero tanto los textos así como los códigos que lo constituyen no tienen su aprobación explícita."
|
||||||
},
|
},
|
||||||
"logo": {
|
"logo": {
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
"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.",
|
||||||
|
"locked": "Verrouillé",
|
||||||
|
"unlocked": "Déverrouillé",
|
||||||
"edge_translation_disclaimer": ""
|
"edge_translation_disclaimer": ""
|
||||||
},
|
},
|
||||||
"logo": {
|
"logo": {
|
||||||
|
|||||||
@@ -17,15 +17,40 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the SendToChat button on top of sheet
|
* Add buttons to L5R specific bar
|
||||||
* @override
|
* @return {{label: string, class: string, icon: string, onclick: Function|null}[]}
|
||||||
*/
|
*/
|
||||||
_getHeaderButtons() {
|
_getL5rHeaderButtons() {
|
||||||
let buttons = super._getHeaderButtons();
|
/**
|
||||||
|
* @var {{label: string, class: string, icon: string, onclick: Function|null}[]}
|
||||||
|
*/
|
||||||
|
const buttons = [];
|
||||||
|
|
||||||
|
if (this.isEditable && !this.actor.limited) {
|
||||||
|
// Lock/Unlock
|
||||||
|
buttons.unshift({
|
||||||
|
label: `l5r5e.global.${this.actor.data.data.soft_locked ? "" : "un"}locked`,
|
||||||
|
class: "l5r-softlock",
|
||||||
|
icon: this.actor.data.data.soft_locked ? "fas fa-lock" : "fas fa-unlock",
|
||||||
|
onclick: () =>
|
||||||
|
game.l5r5e.HelpersL5r5e.debounce(
|
||||||
|
"lock-" + this.object.id,
|
||||||
|
() => {
|
||||||
|
this.actor.update({
|
||||||
|
data: {
|
||||||
|
soft_locked: !this.actor.data.data.soft_locked,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
500,
|
||||||
|
true
|
||||||
|
)(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Send To Chat
|
// Send To Chat
|
||||||
buttons.unshift({
|
buttons.unshift({
|
||||||
label: game.i18n.localize("l5r5e.global.send_to_chat"),
|
label: "l5r5e.global.send_to_chat",
|
||||||
class: "send-to-chat",
|
class: "send-to-chat",
|
||||||
icon: "fas fa-comment-dots",
|
icon: "fas fa-comment-dots",
|
||||||
onclick: () =>
|
onclick: () =>
|
||||||
@@ -44,6 +69,9 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
getData(options = {}) {
|
getData(options = {}) {
|
||||||
const sheetData = super.getData(options);
|
const sheetData = super.getData(options);
|
||||||
|
|
||||||
|
// System Header Buttons
|
||||||
|
sheetData.l5rHeaderButtons = this._getL5rHeaderButtons();
|
||||||
|
|
||||||
sheetData.data.dtypes = ["String", "Number", "Boolean"];
|
sheetData.data.dtypes = ["String", "Number", "Boolean"];
|
||||||
|
|
||||||
// Sort Items by name
|
// Sort Items by name
|
||||||
@@ -109,6 +137,14 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
// Commons
|
// Commons
|
||||||
game.l5r5e.HelpersL5r5e.commonListeners(html, this.actor);
|
game.l5r5e.HelpersL5r5e.commonListeners(html, this.actor);
|
||||||
|
|
||||||
|
// System Header Buttons
|
||||||
|
const l5rHeaderButtons = this._getL5rHeaderButtons();
|
||||||
|
html.find(".l5r-header-button").click((event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
const button = l5rHeaderButtons.find((b) => event.currentTarget.classList.contains(b.class));
|
||||||
|
button.onclick(event);
|
||||||
|
});
|
||||||
|
|
||||||
// *** Everything below here is only needed if the sheet is editable ***
|
// *** Everything below here is only needed if the sheet is editable ***
|
||||||
if (!this.isEditable) {
|
if (!this.isEditable) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -17,11 +17,12 @@ export class CharacterSheetL5r5e extends BaseCharacterSheetL5r5e {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the TwentyQuestions button on top of sheet
|
* Add the TwentyQuestions button in L5R specific bar
|
||||||
* @override
|
* @override
|
||||||
|
* @return {{label: string, class: string, icon: string, onclick: Function|null}[]}
|
||||||
*/
|
*/
|
||||||
_getHeaderButtons() {
|
_getL5rHeaderButtons() {
|
||||||
let buttons = super._getHeaderButtons();
|
const buttons = super._getL5rHeaderButtons();
|
||||||
if (!this.isEditable || this.actor.limited) {
|
if (!this.isEditable || this.actor.limited) {
|
||||||
return buttons;
|
return buttons;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ export class TwentyQuestions {
|
|||||||
parseInt(formData.step18.heritage_add_honor);
|
parseInt(formData.step18.heritage_add_honor);
|
||||||
|
|
||||||
// Update the actor
|
// Update the actor
|
||||||
|
actorDatas.soft_locked = true;
|
||||||
actorDatas.template = formData.template;
|
actorDatas.template = formData.template;
|
||||||
actorDatas.zeni = Math.floor(formData.step2.wealth * 50);
|
actorDatas.zeni = Math.floor(formData.step2.wealth * 50);
|
||||||
actorDatas.identity = {
|
actorDatas.identity = {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -6,6 +6,20 @@
|
|||||||
text-shadow: 0 0 2px $red;
|
text-shadow: 0 0 2px $red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.l5r-buttons-bar {
|
||||||
|
display: flex;
|
||||||
|
flex: 0 0 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 8px;
|
||||||
|
line-height: 30px;
|
||||||
|
justify-content: flex-end;
|
||||||
|
background: rgba(186, 187, 177, 0.5);
|
||||||
|
|
||||||
|
a.l5r-header-button {
|
||||||
|
flex: none;
|
||||||
|
margin: 0 0 0 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
&.actor {
|
&.actor {
|
||||||
.sheet-header {
|
.sheet-header {
|
||||||
height: 26rem;
|
height: 26rem;
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
|
<form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
|
||||||
|
{{!-- L5R Button bar --}}
|
||||||
|
<div class="l5r-buttons-bar">
|
||||||
|
{{#each l5rHeaderButtons}}
|
||||||
|
<a class="l5r-header-button {{this.class}}"><i class="{{this.icon}}"></i>{{localize this.label}}</a>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
{{!-- Sheet Header --}}
|
{{!-- Sheet Header --}}
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img dragndrop-actor-id pointer" src="{{data.img}}" {{#if data.editable_not_soft_locked}}data-edit="img"{{/if}} data-actor-id="{{actor.id}}" draggable="true" title="{{data.name}}"/>
|
<img class="profile-img dragndrop-actor-id pointer" src="{{data.img}}" {{#if data.editable_not_soft_locked}}data-edit="img"{{/if}} data-actor-id="{{actor.id}}" draggable="true" title="{{data.name}}"/>
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
|
<form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
|
||||||
|
{{!-- L5R Button bar --}}
|
||||||
|
<div class="l5r-buttons-bar">
|
||||||
|
{{#each l5rHeaderButtons}}
|
||||||
|
<a class="l5r-header-button {{this.class}}"><i class="{{this.icon}}"></i>{{localize this.label}}</a>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
{{!-- Sheet Header --}}
|
{{!-- Sheet Header --}}
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img dragndrop-actor-id pointer" src="{{data.img}}" {{#if data.editable_not_soft_locked}}data-edit="img"{{/if}} data-actor-id="{{actor.id}}" draggable="true" title="{{data.name}}"/>
|
<img class="profile-img dragndrop-actor-id pointer" src="{{data.img}}" {{#if data.editable_not_soft_locked}}data-edit="img"{{/if}} data-actor-id="{{actor.id}}" draggable="true" title="{{data.name}}"/>
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
|
<form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
|
||||||
|
{{!-- L5R Button bar --}}
|
||||||
|
<div class="l5r-buttons-bar">
|
||||||
|
{{#each l5rHeaderButtons}}
|
||||||
|
<a class="l5r-header-button {{this.class}}"><i class="{{this.icon}}"></i>{{localize this.label}}</a>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
{{!-- Sheet Header --}}
|
{{!-- Sheet Header --}}
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<div class="header-fields identity-wrapper">
|
<div class="header-fields identity-wrapper">
|
||||||
|
|||||||
Reference in New Issue
Block a user