From 84fd6b257d52ceb21892cadc39a9e29992091c19 Mon Sep 17 00:00:00 2001 From: gator Date: Thu, 24 Sep 2026 21:32:50 +0000 Subject: [PATCH] Background: shared-set warning, earlier pictures of a place with Use this one --- trailer.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/trailer.html b/trailer.html index 6d17a04..2ba2537 100644 --- a/trailer.html +++ b/trailer.html @@ -1453,6 +1453,13 @@ var body = 'Background ' + esc(st.name || s.scene || key) + (s.place ? ' ยท set by you' : '') + ''; if (st.error) body += '
' + esc(st.error) + '
'; if (editing) { + var sharers = (PKG.shots || []).filter(function (x) { return x.id !== s.id && placeOf(x) === key && (x.opening_url || x.clip_url); }); + if (url && sharers.length) body += '
Shots ' + esc(sharers.map(function (x) { return x.id; }).join(", ")) + + ' already use this picture and keep it. Generating here gives shot ' + esc(s.id) + ' a background of its own.
'; + var hist = (st.history || []).slice().reverse(); + if (hist.length) body += '
Earlier pictures of this place:
' + + hist.map(function (h) { return '' + + ''; }).join("") + '
'; body += '' + '
' + '
'; @@ -1824,6 +1831,13 @@ } if ((el = hit("data-bgedit"))) { BGEDIT = el.getAttribute("data-bgedit"); openTab(CUR); return; } if ((el = hit("data-bgcancel"))) { BGEDIT = null; openTab(CUR); return; } + if ((el = hit("data-bgrestore"))) { + var bgr = el.getAttribute("data-bgrestore"), bgi = bgr.indexOf("|"); + el.disabled = true; + r = await act("background", { draft_id: CUR, shot_id: bgr.slice(0, bgi), op: "restore", ref_url: bgr.slice(bgi + 1) }); + if (r) { BGEDIT = null; showMsg("msg", "The earlier picture is back for every shot in this place. Pictures drawn from the other one are marked to redraw.", "ok"); await refresh(); } + return; + } if ((el = hit("data-bggen"))) { var sidb = el.getAttribute("data-bggen"), ta = document.querySelector('[data-bgdesc="' + sidb + '"]'); el.disabled = true;