Skip to content

Commit

Permalink
added item identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniMacaroni committed Mar 13, 2024
1 parent 608b8ec commit bffe0b4
Show file tree
Hide file tree
Showing 7 changed files with 389 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "./build.schema.json",
"Solution": "MelonLoader.sln",
"GamePath": "C:/Program Files (x86)/Steam/steamapps/common/Sons Of The Forest"
"GamePath": "F:\\SteamLibrary\\steamapps\\common\\Sons Of The Forest"
}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Added `aighostplayer` command back in.
- Removed `addcharacter` and `goto` commands.
- Removed `addcharacter` and `goto` commands.
- Added a list of item identifiers (`ItemTools.Identifers`).
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<ProjectAlias>_RedLoader</ProjectAlias>
<GamePath>C:\Program Files (x86)\Steam\steamapps\common\Sons Of The Forest</GamePath>
<GamePath>F:\SteamLibrary\steamapps\common\Sons Of The Forest</GamePath>
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions SonsGameManager/SonsGameManager.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions SonsSdk/CustomState.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using RedLoader;
using Sons.Gui;
using Sons.Input;
using UnityEngine.InputSystem;
using InputSystem = UnityEngine.InputSystem.InputSystem;

namespace SonsSdk;

Expand All @@ -11,6 +14,10 @@ public abstract class CustomState
public bool IsActive { get; private set; }

protected InputAction[] ActionsToDisable;
protected string[] UisToToggle;
protected InputAction[] CustomActions;

private SonsInputMapping.DefaultActions DefaultInputs => Sons.Input.InputSystem._sonsInputMapping.@default;

protected CustomState() {}

Expand All @@ -25,6 +32,14 @@ public void Start()
foreach (var action in ActionsToDisable)
action.Disable();

if(UisToToggle != null)
foreach (var ui in UisToToggle)
UiManager.SetActive(ui, true);

if(CustomActions != null)
foreach (var action in CustomActions)
action.Enable();

OnStart();
GlobalEvents.OnUpdate.Subscribe(OnUpdateInternal);
IsActive = true;
Expand All @@ -39,6 +54,14 @@ public void End()
if(ActionsToDisable != null)
foreach (var action in ActionsToDisable)
action.Enable();

if(UisToToggle != null)
foreach (var ui in UisToToggle)
UiManager.SetActive(ui, false);

if(CustomActions != null)
foreach (var action in CustomActions)
action.Disable();
}

private void OnUpdateInternal()
Expand Down
Loading

0 comments on commit bffe0b4

Please sign in to comment.