-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
27 changed files
with
189 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Core/TimberApi/BottomBarSystem/Patchers/ToolbarButtonRetrieverPatcher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using HarmonyLib; | ||
using TimberApi.HarmonyPatcherSystem; | ||
using Timberborn.ToolSystem; | ||
|
||
namespace TimberApi.BottomBarSystem.Patchers | ||
{ | ||
public class ToolbarButtonRetrieverPatcher : BaseHarmonyPatcher | ||
{ | ||
public override string UniqueId => "TimberApi.ToolButtonRetriever"; | ||
|
||
public override void Apply(Harmony harmony) | ||
{ | ||
harmony.Patch( | ||
GetMethodInfo<ToolbarButtonRetriever>(nameof(ToolbarButtonRetriever.TryGetPreviousVisibleButton)), | ||
GetHarmonyMethod(nameof(TryGetPreviousVisibleButtonPatch)) | ||
); | ||
} | ||
|
||
public static bool TryGetPreviousVisibleButtonPatch(IEnumerable<IToolbarButton> buttons, out IToolbarButton? previousButton) | ||
{ | ||
previousButton = null; | ||
return buttons.Any(button => button.IsVisible); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
|
1 change: 0 additions & 1 deletion
1
Core/TimberApi/SpecificationSystem/SpecificationTypes/FileSpecification.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using System.IO; | ||
using UnityEngine; | ||
|
||
namespace TimberApi.SpecificationSystem.SpecificationTypes | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Linq; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace TimberApi.ToolSystem | ||
{ | ||
public interface IUnselectableTool | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Core/TimberApi/ToolSystem/Tools/Demolishing/DeleteRubbleToolFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Timberborn.RecoveredGoodSystemUI; | ||
using Timberborn.ToolSystem; | ||
|
||
namespace TimberApi.ToolSystem.Tools.Demolishing | ||
{ | ||
public class DeleteRubbleToolFactory : IToolFactory | ||
{ | ||
public string Id => "DeleteRecoveredGoodStackTool"; | ||
|
||
private readonly RecoveredGoodStackDeletionTool _recoveredGoodStackDeletionTool; | ||
|
||
public DeleteRubbleToolFactory(RecoveredGoodStackDeletionTool recoveredGoodStackDeletionTool) | ||
{ | ||
_recoveredGoodStackDeletionTool = recoveredGoodStackDeletionTool; | ||
} | ||
|
||
public Tool Create(ToolSpecification toolSpecification, ToolGroup? toolGroup = null) | ||
{ | ||
_recoveredGoodStackDeletionTool.Initialize(toolGroup); | ||
return _recoveredGoodStackDeletionTool; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Core/TimberApi/ToolSystem/Tools/WaterGenerator/WaterGeneratorToolConfigurator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Bindito.Core; | ||
using TimberApi.ConfiguratorSystem; | ||
using TimberApi.SceneSystem; | ||
using TimberApi.SpecificationSystem; | ||
|
||
namespace TimberApi.ToolSystem.Tools.WaterGenerator | ||
{ | ||
[Configurator(SceneEntrypoint.InGame)] | ||
public class WaterGeneratorToolConfigurator : IConfigurator | ||
{ | ||
public void Configure(IContainerDefinition containerDefinition) | ||
{ | ||
containerDefinition.MultiBind<IToolFactory>().To<WaterGeneratorToolFactory>().AsSingleton(); | ||
containerDefinition.MultiBind<ISpecificationGenerator>().To<WaterGeneratorToolGenerator>().AsSingleton(); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Core/TimberApi/ToolSystem/Tools/WaterGenerator/WaterGeneratorToolFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Timberborn.ToolSystem; | ||
using Timberborn.WaterBrushesUI; | ||
|
||
namespace TimberApi.ToolSystem.Tools.WaterGenerator | ||
{ | ||
public class WaterGeneratorToolFactory : IToolFactory | ||
{ | ||
public string Id => "WaterGeneratorTool"; | ||
|
||
private readonly WaterHeightBrushTool _waterHeightBrushTool; | ||
|
||
public WaterGeneratorToolFactory(WaterHeightBrushTool waterHeightBrushTool) | ||
{ | ||
_waterHeightBrushTool = waterHeightBrushTool; | ||
} | ||
|
||
public Tool Create(ToolSpecification toolSpecification, ToolGroup? toolGroup = null) | ||
{ | ||
_waterHeightBrushTool.ToolGroup = toolGroup; | ||
return _waterHeightBrushTool; | ||
} | ||
} | ||
} |
Oops, something went wrong.