From c705ae942573984784ef501bf8198f61f5206ddd Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 9 Jul 2026 05:27:10 -0400 Subject: refactor: simplify yaml, remove support for old scalar fields --- internal/admin/static/intereditor.js | 19 ------------------- internal/admin/static/map.js | 25 +++---------------------- 2 files changed, 3 insertions(+), 41 deletions(-) (limited to 'internal/admin/static') diff --git a/internal/admin/static/intereditor.js b/internal/admin/static/intereditor.js index 4e48df1..b46c456 100644 --- a/internal/admin/static/intereditor.js +++ b/internal/admin/static/intereditor.js @@ -944,23 +944,6 @@ function ie_syncActEntry(ed, secId, secPath, idx) { delete ed[secPath][idx].message; } -// ── Upgrade: migrate legacy message/condition/action on load ── - -function ie_upgradeItem(item) { - if (!item) return; - if (item.message && typeof item.message === 'string' && item.message.trim()) { - if (!item.action || typeof item.action !== 'object') item.action = {}; - if (!item.action.message) item.action.message = item.message; - delete item.message; - } - if (item.condition && typeof item.condition === 'string') { - try { item.condition = JSON.parse(item.condition); } catch(e) { delete item.condition; } - } - if (item.action && typeof item.action === 'string') { - try { item.action = JSON.parse(item.action); } catch(e) { delete item.action; } - } -} - // ── Shared interaction-style array-section renderer ── // // Replaces the duplicated `renderArraySection` (objecteditor.js) and @@ -984,8 +967,6 @@ function ie_renderArraySection(ctx) { var h = ''; arr.forEach(function(item, idx) { - ie_upgradeItem(item); - visMap[idx] = visMap[idx] || {}; var vis = visMap[idx]; var showItem = vis.item_id || (item.item_id && item.item_id !== ''); diff --git a/internal/admin/static/map.js b/internal/admin/static/map.js index 3507e2d..aeb2d57 100644 --- a/internal/admin/static/map.js +++ b/internal/admin/static/map.js @@ -1433,11 +1433,9 @@ function renderExitsSection(r) { var target = typeof exit === 'object' ? exit.room : exit; var cond = (typeof exit === 'object' && exit.condition) ? exit.condition : null; var bmsg = (typeof exit === 'object' && exit.blocked_message) ? exit.blocked_message : ''; - var setFlags = (typeof exit === 'object' && exit.set_flags) ? exit.set_flags : null; - var setPlayerFlags = (typeof exit === 'object' && exit.set_player_flags) ? exit.set_player_flags : null; var hidden = (typeof exit === 'object' && exit.hidden) ? exit.hidden : false; var alwaysBlocked = (typeof exit === 'object' && exit.always_blocked) ? exit.always_blocked : false; - var isConditional = !!(cond || bmsg || setFlags || setPlayerFlags || hidden || alwaysBlocked); + var isConditional = !!(cond || bmsg || hidden || alwaysBlocked); var isBidi = mapData && mapData.links && mapData.links.some(function(l) { return l.bidirectional && ((l.from === r.id && l.to === target) || (l.from === target && l.to === r.id)); }); @@ -1475,16 +1473,9 @@ function editExitCondition(dir) { if (typeof exit !== 'object') { exit = {room: exit}; } var cond = exit.condition || null; var bmsg = exit.blocked_message || ''; - var setFlags = exit.set_flags || null; - var setPlayerFlags = exit.set_player_flags || null; var hidden = exit.hidden || false; var alwaysBlocked = exit.always_blocked || false; - var flagsStr = ''; - if (setFlags) flagsStr = Object.keys(setFlags).map(function(k) { return k + '=' + setFlags[k]; }).join(', '); - var pflagsStr = ''; - if (setPlayerFlags) pflagsStr = Object.keys(setPlayerFlags).map(function(k) { return k + '=' + setPlayerFlags[k]; }).join(', '); - var parsed = parseCondition(cond); var overlay = document.createElement('div'); @@ -1494,8 +1485,6 @@ function editExitCondition(dir) { menu.style.cssText = 'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);min-width:520px;max-width:90vw;max-height:85vh;overflow-y:auto;overflow-x:hidden;padding:14px;z-index:201'; var h = '