mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-22 00:21:31 +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: "🛠️",
|
title: "🛠️",
|
||||||
label: node =>
|
label: node =>
|
||||||
node === board.selectedNode.value ? { text: "Broken Forge" } : null,
|
node === board.selectedNode.value ? { text: "Broken Forge" } : null,
|
||||||
actionDistance: 80,
|
actionDistance: 100,
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
id: "repair",
|
id: "repair",
|
||||||
|
@ -207,6 +207,45 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
node === board.selectedNode.value
|
node === board.selectedNode.value
|
||||||
? { text: hasForged.value ? "Forge" : "Forge - Drag a material to me!" }
|
? { text: hasForged.value ? "Forge" : "Forge - Drag a material to me!" }
|
||||||
: null,
|
: 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
|
draggable: true
|
||||||
},
|
},
|
||||||
resource: {
|
resource: {
|
||||||
|
|
Loading…
Reference in a new issue