diff options
| author | historia <[not public]> | 2026-07-13 16:10:40 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-13 16:10:40 -0400 |
| commit | 3274b700a6f655b8ecc3505e814ac5d782ae6ffe (patch) | |
| tree | e669b47726f8cb93b75c7df85997cc8556009f20 /internal/admin/static/objecteditor.js | |
| parent | 93a412aed2b11406399504c81d6d19ed1341908a (diff) | |
| download | thehouseoficarus-3274b700a6f655b8ecc3505e814ac5d782ae6ffe.tar.gz | |
feat(admin): reminder text for color tags and item variables, improve placeholder text
Diffstat (limited to 'internal/admin/static/objecteditor.js')
| -rw-r--r-- | internal/admin/static/objecteditor.js | 33 |
1 files changed, 20 insertions, 13 deletions
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 += '</div>'; } + + if (sec.id === 'gather') { + h += ced_renderTagHelp('gather'); + } } h += '</div>'; } @@ -447,13 +451,15 @@ function renderCoreCard(data) { } if (showInRoom) { h += '<div style="display:flex;gap:6px;align-items:flex-start">'; - h += '<div style="flex:1">' + renderField(sec, sec.fields[4], data, -1) + '</div>'; + h += '<div style="flex:1;display:flex;flex-direction:column">' + renderField(sec, sec.fields[4], data, -1); + h += '<div style="font-size:10px;color:#888;font-style:italic;margin-top:1px">Alternative way this object can appear with the \'look\' command</div></div>'; h += '<button class="btn btn-sm btn-danger" onclick="hideCoreField(\'inroom_description\')" style="margin-top:2px">X</button>'; h += '</div>'; } if (showRemoval) { h += '<div style="display:flex;gap:6px;align-items:flex-start">'; - h += '<div style="flex:1">' + renderField(sec, sec.fields[6], data, -1) + '</div>'; + h += '<div style="flex:1;display:flex;flex-direction:column">' + renderField(sec, sec.fields[6], data, -1); + h += '<div style="font-size:10px;color:#888;font-style:italic;margin-top:1px">Item left behind when this object is removed</div></div>'; h += '<button class="btn btn-sm btn-danger" onclick="hideCoreField(\'removal_item\')" style="margin-top:2px">X</button>'; h += '</div>'; } @@ -471,6 +477,8 @@ function renderCoreCard(data) { } h += '</div>'; + h += ced_renderTagHelp('color'); + return h; } @@ -672,8 +680,7 @@ function renderToolsCheckbox(sec, il, data) { return '<span style="color:#888;font-size:11px">Loading tool types...</span>'; } if (arr.length === 0) { - var hint = il.hint ? '<div style="font-size:10px;color:#888;margin-bottom:4px;font-style:italic">' + esc(il.hint) + '</div>' : ''; - return hint + '<button class="btn btn-sm obj-sub-add" onclick="addToolRow(\'' + sec.id + '\',\'' + il.key + '\')">+ Add Tools</button>'; + return '<button class="btn btn-sm obj-sub-add" onclick="addToolRow(\'' + sec.id + '\',\'' + il.key + '\')">+ Add Tools</button>'; } var h = '<div class="obj-inline-group">'; h += '<span class="obj-inline-label">' + esc(il.label) + (il.hint ? ' <span style="color:#666;font-size:10px;font-weight:normal;font-style:italic">(' + esc(il.hint) + ')</span>' : '') + '</span>'; @@ -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; |
