From beb0b73a9e56fdc717d55bbf1a1c7c5b49d4c6a4 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sun, 12 Jul 2026 19:23:19 -0400 Subject: feat: remains drop is optional --- internal/admin/static/mobeditor.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'internal/admin/static/mobeditor.js') diff --git a/internal/admin/static/mobeditor.js b/internal/admin/static/mobeditor.js index 29664dc..2c8db21 100644 --- a/internal/admin/static/mobeditor.js +++ b/internal/admin/static/mobeditor.js @@ -248,6 +248,8 @@ function renderMobCard(sec, data) { h += renderMobCoreCard(data); } else if (sec.id === 'combat') { h += renderMobCombatCard(data); + } else if (sec.id === 'drops') { + h += renderMobDropsCard(data); } else if (sec.isArray) { h += renderMobArraySection(sec, data); } else if (sec.subtables) { @@ -579,6 +581,27 @@ function renderMobSubtable(sec, st, data) { return h; } +function renderMobDropsCard(data) { + var h = ''; + var drops = data.drops || {}; + var hasRemains = drops.remains !== undefined && drops.remains !== null; + + if (hasRemains) { + h += '
'; + h += ''; + h += ''; + h += '
'; + } else { + h += ''; + } + + var lootSec = MOB_SECTIONS.find(function(s) { return s.id === 'drops'; }); + var lootSt = lootSec.subtables[0]; + h += renderMobLootSubtable(lootSec, lootSt, drops.loot || []); + + return h; +} + function renderMobLootSubtable(sec, st, arr) { var byKey = {}; st.fields.forEach(function(f) { byKey[f[0]] = f; }); @@ -713,7 +736,7 @@ function mobAddSection() { size: 'small' }; } else if (id === 'drops') { - mobData[sec.path] = {remains:'bones', loot:[]}; + mobData[sec.path] = {loot:[]}; } else if (id === 'talk') { mobData[sec.path] = {nodes:{start:{messages:[],options:[]}}}; } else if (id === 'shop') { -- cgit v1.2.3