This commit is contained in:
33333-33333 2026-06-28 13:40:41 +09:00
commit f500279abd
93 changed files with 1893 additions and 1198 deletions

View file

@ -15,12 +15,11 @@
const inputModeManager = global.TarinaiInputMode;
function setMobileInputMode(mode = "auto") {
mode = inputModeManager?.setMode?.(mode) || (["auto", "camera", "tool", "family"].includes(mode) ? mode : "auto");
mode = inputModeManager?.setMode?.(mode) || (["auto", "camera", "tool"].includes(mode) ? mode : "auto");
uiCache.mobileInputMode = mode;
ui.mobileModeControls?.querySelectorAll("[data-mobile-mode]").forEach(btn => btn.classList.toggle("active", btn.dataset.mobileMode === mode));
document.body.classList.toggle("mobile-mode-camera", mode === "camera");
document.body.classList.toggle("mobile-mode-tool", mode === "tool");
document.body.classList.toggle("mobile-mode-family", mode === "family");
return mode;
}
@ -40,13 +39,25 @@
window.addEventListener("resize", updateTouchMobileUiClass, { passive: true });
window.matchMedia?.("(pointer: coarse)")?.addEventListener?.("change", updateTouchMobileUiClass);
setMobileInputMode(uiCache.mobileInputMode || "auto");
ui.mobileModeControls?.addEventListener("click", (e) => {
const btn = e.target.closest("[data-mobile-mode]");
if (!btn) return;
const root = ui.mobileModeControls;
if (!root || root.dataset.bound === "1") return;
root.dataset.bound = "1";
const activate = (e) => {
const btn = e.target?.closest?.("[data-mobile-mode]");
if (!btn || !root.contains(btn)) return;
const now = performance?.now?.() ?? Date.now();
if (now - Number(root.dataset.lastActivateAt || 0) < 180) return;
root.dataset.lastActivateAt = String(now);
e.preventDefault?.();
e.stopPropagation?.();
window.TarinaiTooltips?.hide?.();
audio.uiClick?.();
setMobileInputMode(btn.dataset.mobileMode || "auto");
showToast(`\u30b9\u30de\u30db\u64cd\u4f5c: ${btn.textContent || btn.dataset.mobileMode}`);
});
};
root.addEventListener("pointerup", activate, { passive: false });
root.addEventListener("touchend", activate, { passive: false });
root.addEventListener("click", activate);
}
function touchPoint(touches, index = 0) {
@ -334,7 +345,7 @@
}
function updateShootHoverTarget(point = null) {
// 射撃ツールは照準だけを表示し、対象ハイライトは出さない。
// \u5c04\u6483\u30c4\u30fc\u30eb\u306f\u7167\u6e96\u3060\u3051\u3092\u8868\u793a\u3057\u3001\u5bfe\u8c61\u30cf\u30a4\u30e9\u30a4\u30c8\u306f\u51fa\u3055\u306a\u3044\u3002
if (world.hoverShootTarget) {
world.hoverShootTarget = null;
world.drawListDirty = true;
@ -450,8 +461,8 @@
world.rebuildSpatial?.();
renderStats();
if (removed > 0) {
world.log?.(`範囲削除で${removed}個消した。`, "observe");
showToast(`${removed}個消しました。`);
world.log?.(`\u7bc4\u56f2\u524a\u9664\u3067${removed}\u500b\u6d88\u3057\u305f\u3002`, "observe");
showToast(`${removed}\u500b\u6d88\u3057\u307e\u3057\u305f\u3002`);
}
return true;
}