From 3274b700a6f655b8ecc3505e814ac5d782ae6ffe Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 13 Jul 2026 16:10:40 -0400 Subject: feat(admin): reminder text for color tags and item variables, improve placeholder text --- internal/admin/static/objecteditor.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'internal/admin/static/objecteditor.js') diff --git a/internal/admin/static/objecteditor.js b/internal/admin/static/objecteditor.js index 88bc5b7..b4d8282 100644 --- a/internal/admin/static/objecteditor.js +++ b/internal/admin/static/objecteditor.js @@ -14,7 +14,7 @@ var SECTIONS = [ ['hidden', 'Hidden', 'checkbox'], ['inroom_description', 'In-Room Description', 'text', 'A copper rock juts from the ground.'], ['description', 'Description', 'textarea', 'A vein of copper runs through this rock.'], - ['removal_item', 'Removal Item ID', 'search', 'e.g. ashes', '', null, 'items'], + ['removal_item', 'Removal Item ID', 'search', 'ashes', '', null, 'items'], ] }, { @@ -73,10 +73,10 @@ var SECTIONS = [ ['tier', 'Tier', 'number', '1', 'narrow'], ['max_block_size', 'Max Block Size', 'select', '|small|medium|large|massive'], ['max_occupants', 'Max Occupants', 'number', '1', 'narrow'], - ['unsafe_chance', 'Unsafe Chance', 'number', '0 = never, e.g. 0.05', 'narrow'], - ['decay_ticks', 'Decay Ticks', 'number', '0 = never, e.g. 100', 'narrow'], - ['decay_chance', 'Decay Chance', 'number', '0 = never, e.g. 0.01', 'narrow'], - ['respawn_ticks', 'Respawn Ticks', 'number', '0 = no respawn, e.g. 50', 'narrow'], + ['unsafe_chance', 'Unsafe Chance', 'number', '0.05', 'narrow'], + ['decay_ticks', 'Decay Ticks', 'number', '100', 'narrow'], + ['decay_chance', 'Decay Chance', 'number', '0.01', 'narrow'], + ['respawn_ticks', 'Respawn Ticks', 'number', '50', 'narrow'], ['respawn_on_hide', 'Respawn on hide', 'checkbox'], ], subtables: [ @@ -89,7 +89,7 @@ var SECTIONS = [ id: 'on_use', label: 'Use', labelHint: '(what happens when you use items on this)', path: 'on_use', isArray: true, fullWidth: true, interactionStyle: true, detect: function(d) { return d.on_use && Array.isArray(d.on_use); }, fields: [ - ['item_id', 'Item ID', 'search', 'e.g. keycard (empty = bare use)', '', null, 'items'], + ['item_id', 'Item ID', 'search', 'keycard', '', null, 'items'], ] }, { @@ -340,6 +340,10 @@ function renderCard(sec, data) { } h += ''; } + + if (sec.id === 'gather') { + h += ced_renderTagHelp('gather'); + } } h += ''; } @@ -447,13 +451,15 @@ function renderCoreCard(data) { } if (showInRoom) { h += '
'; - h += '
' + renderField(sec, sec.fields[4], data, -1) + '
'; + h += '
' + renderField(sec, sec.fields[4], data, -1); + h += '
Alternative way this object can appear with the \'look\' command
'; h += ''; h += '
'; } if (showRemoval) { h += '
'; - h += '
' + renderField(sec, sec.fields[6], data, -1) + '
'; + h += '
' + renderField(sec, sec.fields[6], data, -1); + h += '
Item left behind when this object is removed
'; h += ''; h += '
'; } @@ -471,6 +477,8 @@ function renderCoreCard(data) { } h += ''; + h += ced_renderTagHelp('color'); + return h; } @@ -672,8 +680,7 @@ function renderToolsCheckbox(sec, il, data) { return 'Loading tool types...'; } if (arr.length === 0) { - var hint = il.hint ? '
' + esc(il.hint) + '
' : ''; - return hint + ''; + return ''; } var h = '
'; h += '' + esc(il.label) + (il.hint ? ' (' + esc(il.hint) + ')' : '') + ''; @@ -822,7 +829,7 @@ function addArrayItem(cardID) { } else { empty = {}; sec.fields.forEach(function(f) { - empty[f[0]] = f[2] === 'checkbox' ? false : (f[2] === 'number' ? 0 : ''); + empty[f[0]] = f[2] === 'checkbox' ? false : ''; }); } arr.push(empty); @@ -848,7 +855,7 @@ function addSubRow(cardID, subKey) { var st = (sec.subtables || []).find(function(s) { return s.key === subKey; }); if (st) { st.fields.forEach(function(f) { - empty[f[0]] = f[2] === 'checkbox' ? false : (f[2] === 'number' ? 0 : ''); + empty[f[0]] = f[2] === 'checkbox' ? false : ''; }); } arr.push(empty); @@ -884,7 +891,7 @@ function addDropRow(cardID, subKey, dropType) { var empty = { _type: (dropType === 'table' ? 't' : 'i') }; if (st) { st.fields.forEach(function(f) { - empty[f[0]] = f[2] === 'checkbox' ? false : (f[2] === 'number' ? 0 : ''); + empty[f[0]] = f[2] === 'checkbox' ? false : ''; }); } empty.weight = 10; -- cgit v1.2.3