Conversation
ActorSheetV2 only binds drag handlers to `.draggable`, so owned item rows no longer provided drag data: dropping them on the chat, the Items directory or another sheet did nothing. Bind dragstart on owned item rows again, as the v12 sheet did. Owned items keep the id of the world item they came from, so the Items directory saw them as already existing and only re-sorted them. Add an SR5ItemDirectory that always imports embedded items as new world items. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #535
En V13, les objets d'une fiche d'acteur ne peuvent plus être glissés ailleurs : ni dans le chat, ni dans un dossier de l'onglet Objets, ni sur une autre fiche. Le « grab » est possible mais rien ne se passe au dépôt, sans erreur console. En V12 ça fonctionnait (donner des nuyens, du karma, récupérer un véhicule/esprit/sprite avec son image de token, etc.).
Deux causes :
activateListenersrendait chaqueli.itemdraggable et branchait_onDragStart. En AppV2,ActorSheetV2ne branche sonDragDropque sur.draggable, classe absente des templates SR5. Les lignes d'objets ne transmettaient donc rien.keepId. L'objet possédé a donc le même id que l'objet du monde d'origine. Au dépôt dans l'onglet Objets,DocumentDirectory#_entryAlreadyExistsle considère comme déjà présent et se contente de le trier : aucune copie n'est créée.Changes
modules/entities/actors/baseSheet.js: pour le propriétaire, lesli.item[data-item-id]qui correspondent à un vrai objet de l'acteur redeviennent draggables, avec un nouveau_onDragItemStartqui envoieitem.toDragData(). Les drags spécifiques SR5 (compétences, actions matricielles/résonance, attributs matriciels) et les lignes imbriquées ne sont pas touchés.modules/interface/sr-item-directory.js(nouveau) :SR5ItemDirectoryétendItemDirectoryet surcharge_entryAlreadyExistspour toujours importer un objet embarqué comme nouvel objet du monde.modules/hooks/init.js:CONFIG.ui.items = SR5ItemDirectory, sur le même modèle queCONFIG.ui.combat.Checklist
npm testpassesnpx eslint modules/passes (or only pre-existing warnings)npm run build:csscompiles without errorsen.jsonandfr.json(if localization was touched) — non concernéconsole.logleft in codeTesté dans Foundry 13.351 avec le système 13.0.0-alpha.25 : drag d'un objet de fiche PJ vers le chat (lien inséré) et vers un dossier de l'onglet Objets (copie créée avec ses modifications, dont l'image de token d'un véhicule).
Screenshots
Pas de changement visuel : le glisser-déposer fonctionne de nouveau comme en V12.
🤖 Generated with Claude Code