From 81f3e3bae7d82f0e0ad72d89ea5a5fdae8804712 Mon Sep 17 00:00:00 2001
From: historia <[not public]>
Date: Sun, 5 Jul 2026 00:41:11 -0400
Subject: fix: remove redundant 'quality' on items, fix ranged str on ammo,
item admin ui updates
---
internal/admin/static/objecteditor.js | 44 ++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
(limited to 'internal/admin/static/objecteditor.js')
diff --git a/internal/admin/static/objecteditor.js b/internal/admin/static/objecteditor.js
index 3f2a875..5153458 100644
--- a/internal/admin/static/objecteditor.js
+++ b/internal/admin/static/objecteditor.js
@@ -2,6 +2,7 @@ var objectData = null;
var objectID = null;
var expandedCards = {};
var cardWidths = {};
+var toolTypes = null;
var SECTIONS = [
{
@@ -48,7 +49,7 @@ var SECTIONS = [
['deplete_timer', 'Deplete', 'number', '45', 'narrow', function(d) { return d.skill === 'woodcutting'; }],
['nest_chance', 'Nest 1/n', 'number', '256', 'narrow', function(d) { return d.skill === 'woodcutting'; }],
]},
- {label:'Tools', key:'tools', type:'tags'},
+ {label:'Tools', key:'tools', type:'tools_checkbox'},
],
subtables: [
{label:'Drops', key:'drops', fields:[
@@ -133,6 +134,7 @@ function initObjectEditor() {
editorType = 'objects';
editorFields = [];
loadList();
+ fetchToolTypes();
if (window.location.hash) loadObject(window.location.hash.substring(1));
}
@@ -266,6 +268,10 @@ function renderCard(sec, data) {
h += '
';
h += renderTags(sec, il, data);
h += '
';
+ } else if (il.type === 'tools_checkbox') {
+ h += '
';
+ h += renderToolsCheckbox(sec, il, data);
+ h += '
';
} else if (il.type === 'kv') {
h += '
';
h += renderKV(sec, il, data);
@@ -286,6 +292,8 @@ function renderCard(sec, data) {
noRow.forEach(function(il) {
if (il.type === 'tags') {
h += renderTags(sec, il, data);
+ } else if (il.type === 'tools_checkbox') {
+ h += renderToolsCheckbox(sec, il, data);
} else if (il.type === 'kv') {
h += renderKV(sec, il, data);
} else {
@@ -518,6 +526,35 @@ function renderKV(sec, il, data) {
return h;
}
+function renderToolsCheckbox(sec, il, data) {
+ var sectionRoot = data[cardPath(sec)] || {};
+ var arr = sectionRoot[il.key] || [];
+ var choices = toolTypes || [];
+ var h = '
';
+ h += '' + esc(il.label) + '';
+ h += '
';
+ choices.forEach(function(t) {
+ var checked = arr.indexOf(t) >= 0 ? ' checked' : '';
+ h += '';
+ });
+ h += '
';
+ if (choices.length === 0) {
+ h += 'Loading tool types...';
+ }
+ h += '