Issue 74: Adding all active conditions to the top of dice-picker-dialog so you are...
This commit is contained in:
@@ -513,6 +513,9 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
this._updateVoidPointUsage();
|
this._updateVoidPointUsage();
|
||||||
this.render(false);
|
this.render(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Open journal on effect name
|
||||||
|
html.find(".effect-name").on("click", this._openEffectJournal.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -864,4 +867,34 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the core linked journal effect if exist
|
||||||
|
* @param {Event} event
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
async _openEffectJournal(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
const effectId = $(event.currentTarget).data("effect-id");
|
||||||
|
if (!effectId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const effect = this._actor?.effects?.get(effectId);
|
||||||
|
if (!effect?.system?.id && !effect?.system?.uuid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const journal = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({
|
||||||
|
id: effect.system.id,
|
||||||
|
uuid: effect.system.uuid,
|
||||||
|
type: "JournalEntry",
|
||||||
|
});
|
||||||
|
if (journal) {
|
||||||
|
// Open on the "rules" section. If non exists then it will open the first page
|
||||||
|
journal.sheet.render(true, {pageIndex: 2});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,6 +268,9 @@ export class RollnKeepDialog extends FormApplication {
|
|||||||
], { jQuery: false });
|
], { jQuery: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Open journal on effect name
|
||||||
|
html.find(".effect-name").on("click", this._openEffectJournal.bind(this));
|
||||||
|
|
||||||
// *** 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;
|
||||||
@@ -802,4 +805,34 @@ export class RollnKeepDialog extends FormApplication {
|
|||||||
// Re-enable the button
|
// Re-enable the button
|
||||||
button.attr("disabled", false);
|
button.attr("disabled", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the core linked journal effect if exist
|
||||||
|
* @param {Event} event
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
async _openEffectJournal(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
const effectId = $(event.currentTarget).data("effect-id");
|
||||||
|
if (!effectId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const effect = this.roll.l5r5e?.actor?.effects?.get(effectId);
|
||||||
|
if (!effect?.system?.id && !effect?.system?.uuid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const journal = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({
|
||||||
|
id: effect.system.id,
|
||||||
|
uuid: effect.system.uuid,
|
||||||
|
type: "JournalEntry",
|
||||||
|
});
|
||||||
|
if (journal) {
|
||||||
|
// Open on the "rules" section. If non exists then it will open the first page
|
||||||
|
journal.sheet.render(true, {pageIndex: 2});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -5,9 +5,55 @@
|
|||||||
cursor: url("../assets/cursors/pointer.webp"), pointer;
|
cursor: url("../assets/cursors/pointer.webp"), pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// define a mixin
|
||||||
|
@mixin roll-effects-base {
|
||||||
|
clear: both;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 2px 4px;
|
||||||
|
|
||||||
|
.effect-container {
|
||||||
|
border: 1px solid #5a6e5a;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: rgba(0, 0, 0, 0.4);
|
||||||
|
padding: 3px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.effect-delete {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: contain;
|
||||||
|
text-align: end;
|
||||||
|
cursor: url("../assets/cursors/pointer.webp"), pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.effect-icon {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.effect-name {
|
||||||
|
vertical-align: top;
|
||||||
|
white-space: nowrap;
|
||||||
|
color: $white;
|
||||||
|
margin-left: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Dice Picker
|
// Dice Picker
|
||||||
.dice-picker-dialog {
|
.dice-picker-dialog {
|
||||||
min-width: 35rem;
|
.effects {
|
||||||
|
@include roll-effects-base();
|
||||||
|
}
|
||||||
|
|
||||||
|
width: 35rem;
|
||||||
min-height: auto;
|
min-height: auto;
|
||||||
// Utility
|
// Utility
|
||||||
* {
|
* {
|
||||||
@@ -206,6 +252,12 @@
|
|||||||
|
|
||||||
.profil {
|
.profil {
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column; // stack profile ul and effects ul vertically
|
||||||
|
|
||||||
|
.effects {
|
||||||
|
@include roll-effects-base();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropbox {
|
.dropbox {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<form class="l5r5e dice-picker-dialog" autocomplete="off">
|
<form class="l5r5e dice-picker-dialog" autocomplete="off">
|
||||||
|
{{> 'systems/l5r5e/templates/actors/character/effects.html'}}
|
||||||
<table>
|
<table>
|
||||||
{{!-- First line--}}
|
{{!-- First line--}}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{{> 'systems/l5r5e/templates/actors/character/effects.html' actor=l5r5e.actor}}
|
||||||
</header>
|
</header>
|
||||||
<section class="rnk-ct">
|
<section class="rnk-ct">
|
||||||
{{!-- Body --}}
|
{{!-- Body --}}
|
||||||
|
|||||||
Reference in New Issue
Block a user