diff options
Diffstat (limited to 'internal/admin/static/itemeditor.js')
| -rw-r--r-- | internal/admin/static/itemeditor.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/internal/admin/static/itemeditor.js b/internal/admin/static/itemeditor.js index d48d70e..6375c16 100644 --- a/internal/admin/static/itemeditor.js +++ b/internal/admin/static/itemeditor.js @@ -55,14 +55,14 @@ var SECTIONS = [ ['output_qty', 'Output Qty', 'number', '', 'narrow'], ['station', 'Station', 'select', 'dyn:stations'], ['tool', 'Tool', 'select', 'dyn:tools'], - ['fail', 'Fail Item', 'search', 'e.g. burnt_fish', '', null, 'items'], + ['fail', 'Fail Item', 'search', 'burnt_fish', '', null, 'items'], ['success_base', 'Base', 'number', '0.5', 'narrow'], ['success_per_level', 'Per Lvl', 'number', '0.01', 'narrow'], ['success_cap', 'Cap', 'number', '0.95', 'narrow'], - ['start_message', 'Start Message', 'text', 'e.g. You begin smithing %i1.', 'wide'], - ['success_message', 'Success Message', 'text', 'e.g. You smith a %n.', 'wide'], - ['fail_message', 'Fail Message', 'text', 'e.g. You accidentally burn the %i1.', 'wide', function(item) { return item.type === 'cooking' || item.subtype === 'smelt'; }], - ['end_message', 'End Message', 'text', 'e.g. You\'ve finished smithing.', 'wide'], + ['start_message', 'Start Message', 'text', 'You begin smithing %i1.', 'wide'], + ['success_message', 'Success Message', 'text', 'You smith a %n.', 'wide'], + ['fail_message', 'Fail Message', 'text', 'You accidentally burn the %i1.', 'wide', function(item) { return item.type === 'cooking' || item.subtype === 'smelt'; }], + ['end_message', 'End Message', 'text', 'You\'ve finished smithing.', 'wide'], ], fieldGroups: [ ['type', 'subtype', 'level', 'xp', 'ticks_per_cycle', 'output_qty'], @@ -101,7 +101,7 @@ var SECTIONS = [ detect: function(d) { return d.farm_patch_type; }, fields: [ ['farm_patch_type', 'Patch Type', 'select', 'herb|allotment|flower|bush|tree'], - ['farm_product', 'Product', 'search', 'e.g. tomato', '', null, 'items'], + ['farm_product', 'Product', 'search', 'tomato', '', null, 'items'], ['farm_plant_xp', 'Plant XP', 'number', '5', 'narrow'], ['farm_harvest_xp', 'Harvest XP', 'number', '10', 'narrow'], ['farm_level', 'Farm Level', 'number', '1', 'narrow'], @@ -307,6 +307,10 @@ function renderCard(sec, data) { h += renderSubtable(sec, st, data); }); } + + if (sec.id === 'crafting') { + h += ced_renderTagHelp('crafting'); + } } h += '</div>'; } @@ -334,6 +338,7 @@ function renderCoreCard(data) { var descVal = getVal(itemData, sec, 'description'); var dstr = typeof descVal === 'object' ? (Array.isArray(descVal) ? descVal.map(function(v){return v.text||'';}).join('\n') : JSON.stringify(descVal)) : String(descVal); h += '<label class="obj-field obj-wide"><span>Description</span><textarea id="' + descFid + '" rows="6" style="min-height:56px">' + esc(dstr) + '</textarea></label>'; + h += ced_renderTagHelp('color'); return h; } @@ -1009,7 +1014,7 @@ function addArrayItem(cardID) { } else { var 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); } @@ -1061,7 +1066,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); @@ -1110,7 +1115,7 @@ function addSubSubRow(cardID, subKey, rowIdx, subSubKey) { var sst = st.subSubtables.find(function(ss) { return ss.key === subSubKey; }); if (sst) { sst.fields.forEach(function(f) { - empty[f[0]] = f[2] === 'checkbox' ? false : (f[2] === 'number' ? 0 : ''); + empty[f[0]] = f[2] === 'checkbox' ? false : ''; }); } } |
