Bag: hint and Clear selection stay visible under the list (t20)
The hint and Clear button were inside the scrolling bag list, so a long Ctrl list scrolled them away. They now sit in a footer under the list, and Clear is a full-width, highlighted "Clear selection" button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-9
@@ -210,6 +210,16 @@ function renderBag() {
|
||||
if (key === lastBagKey) return;
|
||||
lastBagKey = key;
|
||||
const box = $('baglist'); box.innerHTML = '';
|
||||
// the hint and Clear sit under the list, outside its scroll, so they never scroll away
|
||||
const foot = $('bagfoot'); foot.innerHTML = '';
|
||||
if (t === 'vacuum') {
|
||||
foot.appendChild(el('div', { class: 'baghint' }, "Click: select only this · Ctrl+click: add to the selection (hold Ctrl to see everything you've found) · Q/E: next"));
|
||||
if (GAME.blow.size) {
|
||||
const clear = el('button', { class: 'bagclear', 'data-bag-clear': '' }, 'Clear selection');
|
||||
clear.onclick = () => { GAME.blow.clear(); lastBagKey = ''; hudDirty = true; playSfx('ui'); };
|
||||
foot.appendChild(clear);
|
||||
}
|
||||
}
|
||||
if (!l.length) { box.appendChild(el('div', { class: 'empty' }, 'Empty. Break rock with the Drill, then use the Vacuum.')); return; }
|
||||
for (const m of l) {
|
||||
if (m === missing[0]) box.appendChild(el('div', { class: 'bagsep' }, 'Not in bag'));
|
||||
@@ -230,13 +240,4 @@ function renderBag() {
|
||||
row.appendChild(b);
|
||||
box.appendChild(row);
|
||||
}
|
||||
if (t === 'vacuum') {
|
||||
const hint = el('div', { class: 'baghint' }, "Click: select only this · Ctrl+click: add to the selection (hold Ctrl to see everything you've found) · Q/E: next");
|
||||
if (GAME.blow.size) {
|
||||
const clear = el('button', { class: 'bagclear', 'data-bag-clear': '' }, 'Clear');
|
||||
clear.onclick = () => { GAME.blow.clear(); lastBagKey = ''; hudDirty = true; playSfx('ui'); };
|
||||
hint.appendChild(clear);
|
||||
}
|
||||
box.appendChild(hint);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user