Add styling to sight line target hex
This commit is contained in:
parent
ba1e9009a3
commit
ac9b456314
7
index.js
7
index.js
@ -653,11 +653,16 @@ const RecordSheet = new function() {
|
||||
const SightLine = new function() {
|
||||
this.clear = function() {
|
||||
let sl = grid.querySelector('line.sight-line');
|
||||
let target = grid.querySelector(`use[href="#point"].sight-line-target`);
|
||||
|
||||
if (sl) {
|
||||
sl.remove();
|
||||
}
|
||||
|
||||
if (target) {
|
||||
target.classList.remove('sight-line-target');
|
||||
}
|
||||
|
||||
this.clearHexes();
|
||||
};
|
||||
|
||||
@ -808,6 +813,8 @@ POINTS.forEach((row, index) => row.forEach(([x, y]) => {
|
||||
|
||||
if (sl.classList.contains('active')) {
|
||||
SightLine.clear();
|
||||
} else {
|
||||
group.querySelector(`use[href="#point"]`).classList.add('sight-line-target');
|
||||
}
|
||||
|
||||
group.dispatchEvent(new MouseEvent('pointerover'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user