Added ability to remove condition from actor sheet + journal on click.

This commit is contained in:
Vlyan
2025-09-04 13:18:17 +02:00
parent 1357ec9b6d
commit eb675f24ea
12 changed files with 390 additions and 47 deletions

View File

@@ -6,6 +6,12 @@ Date format : day/month/year
> - `foundry-version`: Stick to the major version of FoundryVTT.
> - `system-version`: System functionalities and Fixes.
## 1.13.1 - ??/09/2025 - Fixes
- Fix for Clicking on items doesn't show item window (!65 Thx to Litasa)
- Fix for fade configuration (!66)
- Added basic token conditions (Thanks to Putty)
- Added ability to remove condition from actor sheet and core journal on click.
## 1.13.0 - 24/08/2025 - Foundry v13 Compatibility (Thx to Litasa)
__! Be certain to carefully back up any critical user data before installing this update !__
- Updated the System to FoundryVTT v13.

View File

@@ -84,28 +84,36 @@
"afflicted": "Afflicted",
"bleeding": "Bleeding",
"burning": "Burning",
"centered": "Centered",
"compromised": "Compromised",
"dazed": "Dazed",
"disoriented": "Disoriented",
"dying": "Dying",
"emboldened": "Emboldened",
"enraged": "Enraged",
"exhausted": "Exhausted",
"immobilized": "Immobilized",
"illness_coughing_illness": "Illness: Coughing Illness",
"illness_fire_rash": "Illness: Fire Rash",
"illness_gut_sickness": "Illness: Gut Sickness",
"illness_oozing_sore_disease": "Illness: Oozing Sore Disease",
"illness_unsteady_illness": "Illness: Unsteady Illness",
"incapacitated": "Incapacitated",
"intoxicated": "Intoxicated",
"possessed": "Possessed",
"prone": "Prone",
"silenced": "Silenced",
"unconscious": "Unconscious",
"lightlyWoundedFire": "Lightly Wounded (Fire)",
"lightlyWoundedWater": "Lightly Wounded (Water)",
"lightlyWoundedAir": "Lightly Wounded (Air)",
"lightlyWoundedEarth": "Lightly Wounded (Earth)",
"lightlyWoundedVoid": "Lightly Wounded (Void)",
"severelyWoundedFire": "Severely Wounded (Fire)",
"severelyWoundedWater": "Severely Wounded (Water)",
"severelyWoundedAir": "Severely Wounded (Air)",
"severelyWoundedEarth": "Severely Wounded (Earth)",
"severelyWoundedVoid": "Severely Wounded (Void)"
"lightly_wounded_fire": "Lightly Wounded (Fire)",
"lightly_wounded_water": "Lightly Wounded (Water)",
"lightly_wounded_air": "Lightly Wounded (Air)",
"lightly_wounded_earth": "Lightly Wounded (Earth)",
"lightly_wounded_void": "Lightly Wounded (Void)",
"severely_wounded_fire": "Severely Wounded (Fire)",
"severely_wounded_water": "Severely Wounded (Water)",
"severely_wounded_air": "Severely Wounded (Air)",
"severely_wounded_earth": "Severely Wounded (Earth)",
"severely_wounded_void": "Severely Wounded (Void)"
},
"global": {
"edge_translation_disclaimer": "",

View File

@@ -80,6 +80,41 @@
},
"l5r5e": {
"title": "Legend of the five Rings",
"conditions": {
"afflicted": "Afflicted",
"bleeding": "Bleeding",
"burning": "Burning",
"centered": "Centered",
"compromised": "Compromised",
"dazed": "Dazed",
"disoriented": "Disoriented",
"dying": "Dying",
"emboldened": "Emboldened",
"enraged": "Enraged",
"exhausted": "Exhausted",
"immobilized": "Immobilized",
"illness_coughing_illness": "Illness: Coughing Illness",
"illness_fire_rash": "Illness: Fire Rash",
"illness_gut_sickness": "Illness: Gut Sickness",
"illness_oozing_sore_disease": "Illness: Oozing Sore Disease",
"illness_unsteady_illness": "Illness: Unsteady Illness",
"incapacitated": "Incapacitated",
"intoxicated": "Intoxicated",
"possessed": "Possessed",
"prone": "Prone",
"silenced": "Silenced",
"unconscious": "Unconscious",
"lightly_wounded_fire": "Lightly Wounded (Fire)",
"lightly_wounded_water": "Lightly Wounded (Water)",
"lightly_wounded_air": "Lightly Wounded (Air)",
"lightly_wounded_earth": "Lightly Wounded (Earth)",
"lightly_wounded_void": "Lightly Wounded (Void)",
"severely_wounded_fire": "Severely Wounded (Fire)",
"severely_wounded_water": "Severely Wounded (Water)",
"severely_wounded_air": "Severely Wounded (Air)",
"severely_wounded_earth": "Severely Wounded (Earth)",
"severely_wounded_void": "Severely Wounded (Void)"
},
"global": {
"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.",
"add": "Añadir",

View File

@@ -79,7 +79,42 @@
}
},
"l5r5e": {
"title": "Legend of the five Rings",
"title": "La Légende des Cinq Anneaux",
"conditions": {
"afflicted": "Tourmenté",
"bleeding": "En sang",
"burning": "En feu",
"centered": "Centered",
"compromised": "Compromis",
"dazed": "Hébété",
"disoriented": "Désorienté",
"dying": "Mourant",
"emboldened": "Emboldened",
"enraged": "Enragé",
"exhausted": "Épuisé",
"immobilized": "Immobilisé",
"illness_coughing_illness": "Maladie : Mauvaise toux",
"illness_fire_rash": "Maladie : Rougeurs",
"illness_gut_sickness": "Maladie : Mal des entrailles",
"illness_oozing_sore_disease": "Maladie : Bubons purulents",
"illness_unsteady_illness": "Maladie : Vertiges",
"incapacitated": "Hors de combat",
"intoxicated": "Ivre",
"possessed": "Possédé",
"prone": "A terre",
"silenced": "Aphone",
"unconscious": "Inconscient",
"lightly_wounded_fire": "Légèrement Blessé (Feu)",
"lightly_wounded_water": "Légèrement Blessé (Eau)",
"lightly_wounded_air": "Légèrement Blessé (Air)",
"lightly_wounded_earth": "Légèrement Blessé (Terre)",
"lightly_wounded_void": "Légèrement Blessé (Vide)",
"severely_wounded_fire": "Gravement blessé (Feu)",
"severely_wounded_water": "Gravement blessé (Eau)",
"severely_wounded_air": "Gravement blessé (Air)",
"severely_wounded_earth": "Gravement blessé (Terre)",
"severely_wounded_void": "Gravement blessé (Vide)"
},
"global": {
"edge_translation_disclaimer": "",
"add": "Ajouter",

View File

@@ -80,6 +80,41 @@
},
"l5r5e": {
"title": "Legend of the five Rings",
"conditions": {
"afflicted": "Afflicted",
"bleeding": "Bleeding",
"burning": "Burning",
"centered": "Centered",
"compromised": "Compromised",
"dazed": "Dazed",
"disoriented": "Disoriented",
"dying": "Dying",
"emboldened": "Emboldened",
"enraged": "Enraged",
"exhausted": "Exhausted",
"immobilized": "Immobilized",
"illness_coughing_illness": "Illness: Coughing Illness",
"illness_fire_rash": "Illness: Fire Rash",
"illness_gut_sickness": "Illness: Gut Sickness",
"illness_oozing_sore_disease": "Illness: Oozing Sore Disease",
"illness_unsteady_illness": "Illness: Unsteady Illness",
"incapacitated": "Incapacitated",
"intoxicated": "Intoxicated",
"possessed": "Possessed",
"prone": "Prone",
"silenced": "Silenced",
"unconscious": "Unconscious",
"lightly_wounded_fire": "Lightly Wounded (Fire)",
"lightly_wounded_water": "Lightly Wounded (Water)",
"lightly_wounded_air": "Lightly Wounded (Air)",
"lightly_wounded_earth": "Lightly Wounded (Earth)",
"lightly_wounded_void": "Lightly Wounded (Void)",
"severely_wounded_fire": "Severely Wounded (Fire)",
"severely_wounded_water": "Severely Wounded (Water)",
"severely_wounded_air": "Severely Wounded (Air)",
"severely_wounded_earth": "Severely Wounded (Earth)",
"severely_wounded_void": "Severely Wounded (Void)"
},
"global": {
"edge_translation_disclaimer": "",
"add": "Aggiungi",

View File

@@ -321,6 +321,73 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
// Fatigue/Strife +/-
html.find(".addsub-control").on("click", this._modifyFatigueOrStrife.bind(this));
// Effect remove/display
html.find(".effect-delete").on("click", this._removeEffectId.bind(this));
html.find(".effect-name").on("click", this._openEffectJournal.bind(this));
}
/**
* Remove an effect
* @param {Event} event
* @private
*/
_removeEffectId(event) {
event.preventDefault();
event.stopPropagation();
const effectId = $(event.currentTarget).data("effect-id");
if (!effectId) {
return;
}
const tmpItem = this.actor.effects.get(effectId);
if (!tmpItem) {
return;
}
const callback = async () => {
return this.actor.deleteEmbeddedDocuments("ActiveEffect", [effectId]);
};
// Holing Ctrl = without confirm
if (event.ctrlKey) {
return callback();
}
game.l5r5e.HelpersL5r5e.confirmDeleteDialog(
game.i18n.format("l5r5e.global.delete_confirm", { name: tmpItem.name }),
callback
);
}
/**
* 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) {
journal.sheet.render(true);
}
}
/**

View File

@@ -14,33 +14,172 @@ export const L5R5E = {
skillCostMultiplier: 2,
techniqueCost: 3,
},
conditions: [
{id: "afflicted", name: "l5r5e.conditions.afflicted", img: "icons/magic/death/undead-ghost-scream-teal.webp"},
{id: "bleeding", name: "l5r5e.conditions.bleeding", img: "icons/skills/wounds/blood-drip-droplet-red.webp"},
{id: "burning", name: "l5r5e.conditions.burning", img: "icons/magic/fire/flame-burning-creature-skeleton.webp"},
{id: "compromised", name: "l5r5e.conditions.compromised", img: "icons/creatures/abilities/mouth-teeth-human.webp"},
{id: "dazed", name: "l5r5e.conditions.dazed", img: "icons/magic/light/beam-explosion-orange.webp"},
{id: "disoriented", name: "l5r5e.conditions.disoriented", img: "icons/magic/control/hypnosis-mesmerism-eye.webp"},
{id: "dying", name: "l5r5e.conditions.dying", img: "icons/magic/death/skull-humanoid-white-blue.webp"},
{id: "enraged", name: "l5r5e.conditions.enraged", img: "icons/skills/wounds/injury-face-impact-orange.webp"},
{id: "exhausted", name: "l5r5e.conditions.exhausted", img: "icons/magic/life/heart-glowing-red.webp"},
{id: "immobilized", name: "l5r5e.conditions.immobilized", img: "icons/magic/nature/root-vine-entangle-foot-green.webp"},
{id: "incapacitated", name: "l5r5e.conditions.incapacitated", img: "icons/magic/control/silhouette-hold-change-green.webp"},
{id: "intoxicated", name: "l5r5e.conditions.intoxicated", img: "icons/consumables/drinks/alcohol-jar-spirits-gray.webp"},
{id: "prone", name: "l5r5e.conditions.prone", img: "icons/magic/control/silhouette-fall-slip-prone.webp"},
{id: "silenced", name: "l5r5e.conditions.silenced", img: "icons/magic/control/mouth-smile-deception-purple.webp"},
{id: "unconscious", name: "l5r5e.conditions.unconscious", img: "icons/magic/control/sleep-bubble-purple.webp"},
{id: "lightlyWoundedFire", name: "l5r5e.conditions.lightlyWoundedFire", img: "systems/l5r5e/assets/icons/conditions/fire-white.webp"},
{id: "lightlyWoundedWater", name: "l5r5e.conditions.lightlyWoundedWater", img: "systems/l5r5e/assets/icons/conditions/water-white.webp"},
{id: "lightlyWoundedAir", name: "l5r5e.conditions.lightlyWoundedAir", img: "systems/l5r5e/assets/icons/conditions/air-white.webp"},
{id: "lightlyWoundedEarth", name: "l5r5e.conditions.lightlyWoundedEarth", img: "systems/l5r5e/assets/icons/conditions/earth-white.webp"},
{id: "lightlyWoundedVoid", name: "l5r5e.conditions.lightlyWoundedVoid", img: "systems/l5r5e/assets/icons/conditions/void-white.webp"},
{id: "severelyWoundedFire", name: "l5r5e.conditions.severelyWoundedFire", img: "systems/l5r5e/assets/icons/conditions/fire-black.webp"},
{id: "severelyWoundedWater", name: "l5r5e.conditions.severelyWoundedWater", img: "systems/l5r5e/assets/icons/conditions/water-black.webp"},
{id: "severelyWoundedAir", name: "l5r5e.conditions.severelyWoundedAir", img: "systems/l5r5e/assets/icons/conditions/air-black.webp"},
{id: "severelyWoundedEarth", name: "l5r5e.conditions.severelyWoundedEarth", img: "systems/l5r5e/assets/icons/conditions/earth-black.webp"},
{id: "severelyWoundedVoid", name: "l5r5e.conditions.severelyWoundedVoid", img: "systems/l5r5e/assets/icons/conditions/void-black.webp"},
],
conditions: [{
id: "afflicted",
name: "l5r5e.conditions.afflicted",
img: "icons/magic/death/undead-ghost-scream-teal.webp",
system: { id: "L5RCoreCon000001" }
},{
id: "bleeding",
name: "l5r5e.conditions.bleeding",
img: "icons/skills/wounds/blood-drip-droplet-red.webp",
system: { id: "L5RCoreCon000002" }
},{
id: "burning",
name: "l5r5e.conditions.burning",
img: "icons/magic/fire/flame-burning-creature-skeleton.webp",
system: { id: "L5RCoreCon000003" }
},{
id: "centered",
name: "l5r5e.conditions.centered",
img: "systems/l5r5e/assets/icons/social.svg",
system: { id: "L5RCoreCon000022" }
},{
id: "compromised",
name: "l5r5e.conditions.compromised",
img: "icons/creatures/abilities/mouth-teeth-human.webp",
system: { id: "L5RCoreCon000004" }
},{
id: "dazed",
name: "l5r5e.conditions.dazed",
img: "icons/magic/light/beam-explosion-orange.webp",
system: { id: "L5RCoreCon000005" }
},{
id: "disoriented",
name: "l5r5e.conditions.disoriented",
img: "icons/magic/control/hypnosis-mesmerism-eye.webp",
system: { id: "L5RCoreCon000006" }
},{
id: "dying",
name: "l5r5e.conditions.dying",
img: "icons/magic/death/skull-humanoid-white-blue.webp",
system: { id: "L5RCoreCon000007" }
},{
id: "emboldened",
name: "l5r5e.conditions.emboldened",
img: "systems/l5r5e/assets/icons/social.svg",
system: { id: "L5RCoreCon000023" }
},{
id: "enraged",
name: "l5r5e.conditions.enraged",
img: "icons/skills/wounds/injury-face-impact-orange.webp",
system: { id: "L5RCoreCon000008" }
},{
id: "exhausted",
name: "l5r5e.conditions.exhausted",
img: "icons/magic/life/heart-glowing-red.webp",
system: { id: "L5RCoreCon000009" }
},{
id: "illness_coughing_illness",
name: "l5r5e.conditions.illness_coughing_illness",
img: "icons/svg/poison.svg",
system: { id: "L5RCoreCon000019" }
},{
id: "illness_fire_rash",
name: "l5r5e.conditions.illness_fire_rash",
img: "icons/svg/fire.svg",
system: { id: "L5RCoreCon000021" }
},{
id: "illness_gut_sickness",
name: "l5r5e.conditions.illness_gut_sickness",
img: "icons/svg/poison.svg",
system: { id: "L5RCoreCon000018" }
},{
id: "illness_oozing_sore_disease",
name: "l5r5e.conditions.illness_oozing_sore_disease",
img: "icons/svg/eye.svg",
system: { id: "L5RCoreCon000017" }
},{
id: "illness_unsteady_illness",
name: "l5r5e.conditions.illness_unsteady_illness",
img: "icons/svg/daze.svg",
system: { id: "L5RCoreCon000020" }
},{
id: "immobilized",
name: "l5r5e.conditions.immobilized",
img: "icons/magic/nature/root-vine-entangle-foot-green.webp",
system: { id: "L5RCoreCon000010" }
},{
id: "incapacitated",
name: "l5r5e.conditions.incapacitated",
img: "icons/magic/control/silhouette-hold-change-green.webp",
system: { id: "L5RCoreCon000011" }
},{
id: "intoxicated",
name: "l5r5e.conditions.intoxicated",
img: "icons/consumables/drinks/alcohol-jar-spirits-gray.webp",
system: { id: "L5RCoreCon000012" }
},{
id: "possessed",
name: "l5r5e.conditions.possessed",
img: "icons/svg/terror.svg",
system: { id: "L5RCoreCon000024" }
},{
id: "prone",
name: "l5r5e.conditions.prone",
img: "icons/magic/control/silhouette-fall-slip-prone.webp",
system: { id: "L5RCoreCon000013" }
},{
id: "silenced",
name: "l5r5e.conditions.silenced",
img: "icons/magic/control/mouth-smile-deception-purple.webp",
system: { id: "L5RCoreCon000014" }
},{
id: "unconscious",
name: "l5r5e.conditions.unconscious",
img: "icons/magic/control/sleep-bubble-purple.webp",
system: { id: "L5RCoreCon000015" }
},{
id: "lightly_wounded_fire",
name: "l5r5e.conditions.lightly_wounded_fire",
img: "systems/l5r5e/assets/icons/conditions/fire-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_water",
name: "l5r5e.conditions.lightly_wounded_water",
img: "systems/l5r5e/assets/icons/conditions/water-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_air",
name: "l5r5e.conditions.lightly_wounded_air",
img: "systems/l5r5e/assets/icons/conditions/air-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_earth",
name: "l5r5e.conditions.lightly_wounded_earth",
img: "systems/l5r5e/assets/icons/conditions/earth-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_void",
name: "l5r5e.conditions.lightly_wounded_void",
img: "systems/l5r5e/assets/icons/conditions/void-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_fire",
name: "l5r5e.conditions.severely_wounded_fire",
img: "systems/l5r5e/assets/icons/conditions/fire-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_water",
name: "l5r5e.conditions.severely_wounded_water",
img: "systems/l5r5e/assets/icons/conditions/water-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_air",
name: "l5r5e.conditions.severely_wounded_air",
img: "systems/l5r5e/assets/icons/conditions/air-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_earth",
name: "l5r5e.conditions.severely_wounded_earth",
img: "systems/l5r5e/assets/icons/conditions/earth-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_void",
name: "l5r5e.conditions.severely_wounded_void",
img: "systems/l5r5e/assets/icons/conditions/void-black.webp",
system: { id: "L5RCoreCon000016" }
}],
regex: {
techniqueDifficulty: /^@([TS]):([^|]+?)(?:\|(min|max)(?:\(([^)]+?)\))?)?$/,
},

View File

@@ -1,6 +1,15 @@
import { L5r5eHtmlMultiSelectElement } from "./misc/l5r5e-multiselect.js";
export default class HooksL5r5e {
/**
* Do initialization
*/
static async init() {
// Replace all foundry conditions with L5R conditions only
CONFIG.statusEffects = CONFIG.l5r5e.conditions;
// CONFIG.statusEffects.push(...CONFIG.l5r5e.conditions);
}
/**
* Do anything after initialization but before ready
*/
@@ -14,10 +23,6 @@ export default class HooksL5r5e {
}
}
static async init() {
CONFIG.statusEffects = CONFIG.l5r5e.conditions
}
/**
* Do anything once the system is ready
*/

File diff suppressed because one or more lines are too long

View File

@@ -67,13 +67,21 @@
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;
float: left;
}
.effect-name {
vertical-align: top;
@@ -81,7 +89,6 @@
text-overflow: ellipsis;
white-space: nowrap;
color: $white;
float: right;
margin-left: 4px;
font-size: 14px;
line-height: 16px;

View File

@@ -2,7 +2,10 @@
{{#each actor.effects as |effect|}}
<li class="effect-container" title="{{name}}">
<div class="effect-icon" style="background-image: url({{effect.img}})"></div>
<div class="effect-name"><label>{{name}}</label></div>
<div data-effect-id="{{effect.id}}" class="effect-name"><label>{{name}}</label></div>
{{#if ../data.editable_not_soft_locked}}
<div data-effect-id="{{effect.id}}" class="effect-delete" title="{{localize 'Delete'}}"><i class="fas fa-remove"></i></div>
{{/if}}
</li>
{{/each}}
</ul>

View File

@@ -2,7 +2,10 @@
{{#each actor.effects as |effect|}}
<li class="effect-container" title="{{name}}">
<div class="effect-icon" style="background-image: url({{effect.img}})"></div>
<div class="effect-name"><label>{{name}}</label></div>
<div data-effect-id="{{effect.id}}" class="effect-name"><label>{{name}}</label></div>
{{#if ../data.editable_not_soft_locked}}
<div data-effect-id="{{effect.id}}" class="effect-delete" title="{{localize 'Delete'}}"><i class="fas fa-remove"></i></div>
{{/if}}
</li>
{{/each}}
</ul>