mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-27 17:23:21 +00:00
Fixing unit movements and phaseAnimation
This commit is contained in:
parent
9fb022c782
commit
b5dcd78898
2 changed files with 8 additions and 11 deletions
|
|
@ -1,9 +1,14 @@
|
|||
export const addMapMouseEvents = (mapView: HTMLElement, display: HTMLElement) => {
|
||||
const isDebugMode = process.env.NODE_ENV === 'development' || localStorage.getItem('debug') === 'true';
|
||||
|
||||
mapView.addEventListener("mousemove", (event) => {
|
||||
const rect = mapView.getBoundingClientRect();
|
||||
const x = event.clientX - rect.left;
|
||||
const y = event.clientY - rect.top;
|
||||
display.textContent = `X: ${x.toFixed(2)}, Y: ${y.toFixed(2)}\nrect ${JSON.stringify(rect)}`;
|
||||
|
||||
if (isDebugMode) {
|
||||
display.textContent = `X: ${x.toFixed(2)}, Y: ${y.toFixed(2)}\nrect ${JSON.stringify(rect)}`;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue