From f601a40776843f6196221e74ba502c571a5b1bcd Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sun, 12 Jul 2026 21:16:58 -0400 Subject: fix(admin): standardize most search dropdowns and radio buttons --- internal/admin/static/itemeditor.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'internal/admin/static/itemeditor.js') diff --git a/internal/admin/static/itemeditor.js b/internal/admin/static/itemeditor.js index 53242ab..d48d70e 100644 --- a/internal/admin/static/itemeditor.js +++ b/internal/admin/static/itemeditor.js @@ -53,8 +53,8 @@ var SECTIONS = [ ['xp', 'XP', 'number', '', 'narrow'], ['ticks_per_cycle', 'Ticks/Cycle', 'number', '', 'narrow'], ['output_qty', 'Output Qty', 'number', '', 'narrow'], - ['station', 'Station', 'select', '|anvil|cooking_range|fire|furnace|pottery_oven|pottery_wheel|spinning_wheel|workbench'], - ['tool', 'Tool', 'select', '|pickaxe|axe|fire|chisel|hammer|knife|needle|rake|saw|shears|spade|watering_can|fishing_rod|fly_rod|harpoon|small_net|big_net|lobster_pot'], + ['station', 'Station', 'select', 'dyn:stations'], + ['tool', 'Tool', 'select', 'dyn:tools'], ['fail', 'Fail Item', 'search', 'e.g. burnt_fish', '', null, 'items'], ['success_base', 'Base', 'number', '0.5', 'narrow'], ['success_per_level', 'Per Lvl', 'number', '0.01', 'narrow'], @@ -125,6 +125,7 @@ function initItemEditor() { window._ieRenderCurrent = renderCurrent; window._ieRenderOnly = function() { if (itemID && itemData) renderItemEditor(itemID, itemData); }; window._ieSyncAll = function(ed) { if (ed) ie_syncAllInteractions(ed, SECTIONS); }; + fetchDynamicOptions(); editorType = 'items'; editorFields = []; loadList(); @@ -647,7 +648,11 @@ function renderSubFieldHTML(sec, stKey, idx, f, val) { return ''; } if (f[2] === 'select') { - var opts = f[3] ? f[3].split('|') : []; + var hint = f[3] || ''; + if (hint.indexOf('dyn:') === 0) { + return ''; + } + var opts = hint.split('|'); var sel = '