Unit control menu only opens automatically if screen is wide

This commit is contained in:
Davide Passoni 2024-08-08 15:49:22 +02:00
parent 19b0eeeffd
commit fd15406f5d

View File

@ -60,7 +60,7 @@ export function UI() {
document.addEventListener("mapStateChanged", (ev) => {
if ((ev as CustomEvent).detail === IDLE) hideAllMenus();
else if ((ev as CustomEvent).detail === CONTEXT_ACTION) setUnitControlMenuVisible(true);
else if ((ev as CustomEvent).detail === CONTEXT_ACTION && window.innerWidth > 1000) setUnitControlMenuVisible(true);
setMapState(String((ev as CustomEvent).detail));
});