Skip to content

Commit 7e3b4a1

Browse files
committed
Actually fix bug
1 parent d1bcc24 commit 7e3b4a1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/PatchManager.SassyPatching/Nodes/Statements/SelectionLevel/DeleteValue.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public void ExecuteOn(Environment environment, ISelectable selectable, IModifiab
2525
{
2626
throw new InterpreterException(Coordinate, "Attempting to delete an unmodifiable selection");
2727
}
28+
Console.WriteLine($"Deleting modifiable of type {modifiable}");
2829
modifiable.Set(new DataValue(DataValue.DataType.Deletion));
2930
}
3031
}

src/PatchManager.Science/Rulesets/ScienceRuleset.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using PatchManager.SassyPatching.Interfaces;
55
using PatchManager.SassyPatching.NewAssets;
66
using PatchManager.SassyPatching.Selectables;
7+
using PatchManager.Science.Selectables;
78

89
namespace PatchManager.Science.Rulesets;
910

@@ -13,12 +14,12 @@ public class ScienceRuleset : IPatcherRuleSet
1314
public bool Matches(string label) => label == "techNodeData";
1415

1516
public ISelectable ConvertToSelectable(string type, string name, string jsonData) =>
16-
new JTokenSelectable(() => { }, JObject.Parse(jsonData), name, type);
17+
new ScienceSelectable(JObject.Parse(jsonData));
1718

1819

1920
public INewAsset CreateNew(List<DataValue> dataValues)
2021
{
2122
return new NewGenericAsset("techNodeData", dataValues[0].String,
22-
new JTokenSelectable(() => { }, JObject.Parse($"{{\n \"Version\": 12,\n \"ID\": \"{dataValues[0].String}\",\n \"NameLocKey\": \"Science/TechNodes/Names/tNode_4v_docking_01\",\n \"IconID\": \"ICO-RDCenter-Docking-24x\",\n \"CategoryID\": \"\",\n \"HiddenByNodeID\": \"\",\n \"DescriptionLocKey\": \"Science/TechNodes/Descriptions/tNode_4v_docking_01\",\n \"RequiredSciencePoints\": 7000,\n \"UnlockedPartsIDs\": [\n \"dockingring_4v_inline\",\n \"dockingport_3v_inline\"\n ],\n \"RequiredTechNodeIDs\": [\n \"tNode_4v_decouplers_01\"\n ],\n \"TierToUnlock\": 0,\n \"TechTreePosition\": {{\n \"x\": 5220.0,\n \"y\": 310.0\n }}\n}}"), dataValues[0].String, "techNodeData"));
23+
new ScienceSelectable(JObject.Parse($"{{\n \"Version\": 12,\n \"ID\": \"{dataValues[0].String}\",\n \"NameLocKey\": \"Science/TechNodes/Names/tNode_4v_docking_01\",\n \"IconID\": \"ICO-RDCenter-Docking-24x\",\n \"CategoryID\": \"\",\n \"HiddenByNodeID\": \"\",\n \"DescriptionLocKey\": \"Science/TechNodes/Descriptions/tNode_4v_docking_01\",\n \"RequiredSciencePoints\": 7000,\n \"UnlockedPartsIDs\": [\n \"dockingring_4v_inline\",\n \"dockingport_3v_inline\"\n ],\n \"RequiredTechNodeIDs\": [\n \"tNode_4v_decouplers_01\"\n ],\n \"TierToUnlock\": 0,\n \"TechTreePosition\": {{\n \"x\": 5220.0,\n \"y\": 310.0\n }}\n}}")));
2324
}
2425
}

0 commit comments

Comments
 (0)