published
This commit is contained in:
parent
077d4ab9ac
commit
0f1cb2fe6c
10 changed files with 497 additions and 198 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue