Added actor and tag copying to scene relations.

This commit is contained in:
2026-11-26 00:23:31 +01:00
parent 449e3c9d74
commit 7e28595a19
9 changed files with 864 additions and 80 deletions
+33
View File
@@ -62,9 +62,29 @@ function toEdit(relation) {
type: relation.type,
direction: relation.direction,
comment: relation.comment || null,
share: relation.share || null,
};
}
const shareModeLabels = {
from: 'from',
to: 'to',
both: 'both ways',
};
// e.g. 'Copies tags both ways, actors from'
function getShareSummary(relation) {
const share = getEditRelation(relation)?.share;
if (!share) {
return null;
}
const summary = Object.entries(share).map(([field, mode]) => `${field} ${shareModeLabels[mode] || mode}`).join(', ');
return `Copies ${summary} the related scene`.replace(/ both ways the related scene$/, ' both ways');
}
// adding an existing relation again replaces its comment
function addRelation(relation) {
showDialog.value = false;
@@ -116,6 +136,13 @@ watch(() => props.scene, () => {
>&nbsp;({{ getComment(relation) }})</span>
</span>
<Icon
v-if="getShareSummary(relation)"
v-tooltip="getShareSummary(relation)"
icon="copy"
class="shared"
/>
<Icon
v-if="edits.relations && !isIncluded(relation)"
icon="checkmark"
@@ -251,6 +278,12 @@ watch(() => props.scene, () => {
text-decoration: inherit;
}
.shared {
height: auto;
padding: .25rem .3rem;
fill: var(--primary);
}
.relation-comment {
display: inline-block;
max-width: 15rem;