mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-21 16:13:54 +00:00
Added some actions to the factory
(Not actually usable yet until materials can be selected)
This commit is contained in:
parent
1ed499b720
commit
3b1ca588cf
1 changed files with 40 additions and 1 deletions
|
@ -174,7 +174,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
title: "🛠️",
|
||||
label: node =>
|
||||
node === board.selectedNode.value ? { text: "Broken Forge" } : null,
|
||||
actionDistance: 80,
|
||||
actionDistance: 100,
|
||||
actions: [
|
||||
{
|
||||
id: "repair",
|
||||
|
@ -207,6 +207,45 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
node === board.selectedNode.value
|
||||
? { text: hasForged.value ? "Forge" : "Forge - Drag a material to me!" }
|
||||
: null,
|
||||
actionDistance: 100,
|
||||
actions: [
|
||||
{
|
||||
id: "deselect",
|
||||
icon: "",
|
||||
tooltip: { text: "De-select material" },
|
||||
onClick(node) {
|
||||
if (board.selectedAction.value === this) {
|
||||
node.state = undefined;
|
||||
} else {
|
||||
((board as GenericBoard).state as Persistent<BoardData>).value = {
|
||||
...((board as GenericBoard).state as Persistent<BoardData>)
|
||||
.value,
|
||||
selectedAction: this.id
|
||||
};
|
||||
}
|
||||
return true;
|
||||
},
|
||||
visibility: node => node.state != null
|
||||
},
|
||||
{
|
||||
id: "craft",
|
||||
icon: "",
|
||||
tooltip: node => ({ text: "Craft unknown item" }),
|
||||
onClick(node) {
|
||||
if (board.selectedAction.value === this) {
|
||||
// TODO create tool
|
||||
} else {
|
||||
((board as GenericBoard).state as Persistent<BoardData>).value = {
|
||||
...((board as GenericBoard).state as Persistent<BoardData>)
|
||||
.value,
|
||||
selectedAction: this.id
|
||||
};
|
||||
}
|
||||
return true;
|
||||
},
|
||||
visibility: node => node.state != null
|
||||
}
|
||||
],
|
||||
draggable: true
|
||||
},
|
||||
resource: {
|
||||
|
|
Loading…
Reference in a new issue