published

This commit is contained in:
33333-33333 2026-06-26 22:35:26 +09:00
commit 0f1cb2fe6c
10 changed files with 497 additions and 198 deletions

View file

@ -125,9 +125,15 @@ function resizeFieldFromWheel(e) {
}
function selectTool(tool) {
const wasCopyArmed = world.tool === "copy" && tool === "copy" && Boolean(world.copyBuffer);
const result = window.TarinaiCommands?.dispatch?.(world, { type: "tool.select", toolId: tool });
const activeTool = result?.toolId || world.tool || tool;
if (activeTool !== "rope" && activeTool !== "rod") world.pendingLinkEndpoint = null;
if (activeTool !== "copy") world.copyBuffer = null;
else if (wasCopyArmed) {
world.copyBuffer = null;
showToast("\u30b3\u30d4\u30fc\u3092\u89e3\u9664\u3057\u307e\u3057\u305f\u3002");
}
for (const btn of uiCache.toolButtons) {
btn.classList.toggle("selected", btn.dataset.tool === activeTool);
}