Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CC3 1.0.0.2 bug. #507

Merged
merged 2 commits into from
Dec 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix formatting and misplaced usings
  • Loading branch information
MrPurple6411 committed Dec 10, 2023
commit 7b96ee96eabc052a600800c3f898f884e77a90c0
21 changes: 10 additions & 11 deletions Nautilus/Handlers/CraftTreeHandler.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
namespace Nautilus.Handlers;

using System.Linq;
using Nautilus.Crafting;
using Nautilus.Patchers;
using Nautilus.Utility;

namespace Nautilus.Handlers;

/// <summary>
/// A handler class for creating and modifying crafting trees.
/// </summary>
public static class CraftTreeHandler
public static class CraftTreeHandler
{
/// <summary>
/// Adds a new crafting node to the root of the specified crafting tree, at the provided tab location.
Expand All @@ -23,7 +22,7 @@ public static class CraftTreeHandler
/// </param>
public static void AddCraftingNode(CraftTree.Type craftTree, TechType craftingItem, params string[] stepsToTab)
{
if(CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
if (CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
{
root.AddCraftNode(craftingItem, stepsToTab.LastOrDefault());
return;
Expand All @@ -40,7 +39,7 @@ public static void AddCraftingNode(CraftTree.Type craftTree, TechType craftingIt

public static void AddCraftingNode(CraftTree.Type craftTree, TechType craftingItem)
{
if(CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
if (CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
{
root.AddCraftNode(craftingItem);
return;
Expand All @@ -58,7 +57,7 @@ public static void AddCraftingNode(CraftTree.Type craftTree, TechType craftingIt
/// <param name="sprite">The sprite of the tab.</param>
public static void AddTabNode(CraftTree.Type craftTree, string name, string displayName, Atlas.Sprite sprite)
{
if(CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
if (CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
{
root.AddTabNode(name, displayName, sprite);
return;
Expand All @@ -76,7 +75,7 @@ public static void AddTabNode(CraftTree.Type craftTree, string name, string disp

public static void AddTabNode(CraftTree.Type craftTree, string name, string displayName, UnityEngine.Sprite sprite)
{
if(CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
if (CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
{
root.AddTabNode(name, displayName, sprite);
return;
Expand All @@ -99,7 +98,7 @@ public static void AddTabNode(CraftTree.Type craftTree, string name, string disp
/// </param>
public static void AddTabNode(CraftTree.Type craftTree, string name, string displayName, Atlas.Sprite sprite, params string[] stepsToTab)
{
if(CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
if (CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
{
root.AddTabNode(name, displayName, sprite, "English", stepsToTab.LastOrDefault());
return;
Expand All @@ -122,7 +121,7 @@ public static void AddTabNode(CraftTree.Type craftTree, string name, string disp
/// </param>
public static void AddTabNode(CraftTree.Type craftTree, string name, string displayName, UnityEngine.Sprite sprite, params string[] stepsToTab)
{
if(CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
if (CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
{
root.AddTabNode(name, displayName, sprite, "English", stepsToTab.LastOrDefault());
return;
Expand Down Expand Up @@ -188,7 +187,7 @@ public static void AddTabNode(CraftTree.Type craftTree, string name, string disp

public static void RemoveNode(CraftTree.Type craftTree, params string[] stepsToNode)
{
if(CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
if (CraftTreePatcher.CustomTrees.TryGetValue(craftTree, out var root))
{
root.GetNode(stepsToNode)?.RemoveNode();
return;
Expand Down
Loading