mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-24 17:31:47 +00:00
Dropping the same resource onto factory deselects it
This commit is contained in:
parent
9e0ed21a2f
commit
e2480e2966
1 changed files with 6 additions and 1 deletions
|
@ -414,7 +414,12 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
return otherNode.type === "resource";
|
||||
},
|
||||
onDrop(node, otherNode) {
|
||||
node.state = (otherNode.state as unknown as ResourceState).type;
|
||||
const droppedType = (otherNode.state as unknown as ResourceState).type;
|
||||
if (node.state === droppedType) {
|
||||
node.state = undefined;
|
||||
} else {
|
||||
node.state = droppedType;
|
||||
}
|
||||
board.selectedNode.value = node;
|
||||
},
|
||||
draggable: true
|
||||
|
|
Loading…
Reference in a new issue