WIP: view squad record sheets

This commit is contained in:
2025-06-16 22:41:33 -07:00
parent e3de50ceef
commit 60da021f13
3 changed files with 7 additions and 52 deletions

View File

@@ -263,13 +263,14 @@ function endMove() {
const selected = getSelected();
if (selected) {
const list = selected.closest('.records').querySelectorAll('.soldier-record:not(.movement-ended, .inactive)');
const index = [...list].findIndex(s => s === selected);
const next = list.length > 1 ? list[(index + 1) % list.length] : null;
selected.classList.toggle('movement-ended');
const next = selected.parentElement.querySelector(`.soldier-record[data-squad="${selected.dataset.squad}"]:not(.movement-ended, .inactive)`);
deselect();
if (next) {
Observable.notify('select', next);
next.scrollIntoView({ behavior: 'smooth' });
}
}
}