Added actor and tag copying to scene relations.
This commit is contained in:
@@ -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, () => {
|
||||
> ({{ 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;
|
||||
|
||||
Reference in New Issue
Block a user