Merge branch 'issue_74_wounded_condition_in_dice_picker' into 'dev'

Issue 74: Adding all active conditions to the top of dice-picker-dialog so you are...

See merge request teaml5r/l5r5e!60
This commit is contained in:
Litasa
2026-02-26 01:04:30 +00:00
6 changed files with 122 additions and 2 deletions

View File

@@ -513,6 +513,9 @@ export class DicePickerDialog extends FormApplication {
this._updateVoidPointUsage();
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;
}
/**
* 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});
}
}
}

View File

@@ -268,6 +268,9 @@ export class RollnKeepDialog extends FormApplication {
], { 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 ***
if (!this.isEditable) {
return;
@@ -802,4 +805,34 @@ export class RollnKeepDialog extends FormApplication {
// Re-enable the button
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

View File

@@ -5,9 +5,55 @@
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-dialog {
min-width: 35rem;
.effects {
@include roll-effects-base();
}
width: 35rem;
min-height: auto;
// Utility
* {
@@ -206,6 +252,12 @@
.profil {
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 {

View File

@@ -1,4 +1,5 @@
<form class="l5r5e dice-picker-dialog" autocomplete="off">
{{> 'systems/l5r5e/templates/actors/character/effects.html'}}
<table>
{{!-- First line--}}
<tr>

View File

@@ -35,6 +35,7 @@
{{/if}}
</li>
</ul>
{{> 'systems/l5r5e/templates/actors/character/effects.html' actor=l5r5e.actor}}
</header>
<section class="rnk-ct">
{{!-- Body --}}