From 8952653be9bfeeb9aadf59f845de507630d65dc4 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 13 Jul 2026 17:25:14 -0400 Subject: feat(admin): add drop tables to gui showing 1/n drop chances --- internal/admin/static/mobeditor.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'internal/admin/static/mobeditor.js') diff --git a/internal/admin/static/mobeditor.js b/internal/admin/static/mobeditor.js index 4b136a3..5e2b9cc 100644 --- a/internal/admin/static/mobeditor.js +++ b/internal/admin/static/mobeditor.js @@ -217,6 +217,8 @@ function renderMobEditor(id, data) { renderTalkTree(data); } }); + + setupMobDropViews(); } function renderCurrent() { @@ -674,6 +676,7 @@ function renderMobLootSubtable(sec, st, arr) { h += ''; h += ''; h += ''; + h += '
'; h += ''; return h; } @@ -1001,6 +1004,26 @@ function deleteMob() { }).catch(function(e) { notify('Delete failed: ' + e.message, 'error'); }); } +function setupMobDropViews() { + var dropsCard = document.querySelector('.obj-card[data-card="drops"]'); + if (dropsCard) { + DropView.mount(dropsCard.querySelector('.obj-card-body'), function() { + ced_syncDOMToData(mobData); + var loot = (mobData.drops && mobData.drops.loot) || []; + return loot.filter(function(e) { return e.item_id || e.table; }); + }); + } + var stealCard = document.querySelector('.obj-card[data-card="steal"]'); + if (stealCard) { + DropView.mount(stealCard.querySelector('.obj-card-body'), function() { + ced_syncDOMToData(mobData); + var drops = (mobData.steal && mobData.steal.drops) || []; + return drops.filter(function(e) { return e.item_id || e.table; }); + }); + } + DropView.setupAllInter(); +} + // ---- editor.js compatibility ---- function loadItem(id) { loadMob(id); } -- cgit v1.2.3