Skip to content

Commit

Permalink
Merge pull request #24 from nickc01/develop
Browse files Browse the repository at this point in the history
Added Linux Support and more bug fixes
  • Loading branch information
nickc01 authored May 25, 2024
2 parents b30a2f9 + 7236ec1 commit 0b713e0
Show file tree
Hide file tree
Showing 61 changed files with 9,378 additions and 4,185 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Other Projects~/WeaverCore.Game/CompilationLog.txt
Other Projects~/WeaverCore.Game/WeaverCore.Game/CompilationLog.txt

Other Projects~/WeaverCore.Game/WeaverCore Build/
Other Projects~/WeaverCore.Game/Settings.txt
16 changes: 8 additions & 8 deletions Hollow Knight/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private void OnApplicationQuit()

public void BeginSceneTransition(GameManager.SceneLoadInfo info)
{
//info.SceneName = ModHooks.BeforeSceneLoad(info.SceneName);
info.SceneName = ModHooks.BeforeSceneLoad(info.SceneName);
orig_BeginSceneTransition(info);
}

Expand Down Expand Up @@ -1231,15 +1231,15 @@ public void SetState(GameState newState)

public void LoadScene(string destScene)
{
//destScene = ModHooks.BeforeSceneLoad(destScene);
destScene = ModHooks.BeforeSceneLoad(destScene);
orig_LoadScene(destScene);
//ModHooks.OnSceneChanged(destScene);
ModHooks.OnSceneChanged(destScene);
}

public IEnumerator LoadSceneAdditive(string destScene)
{
Debug.Log("Loading " + destScene);
//destScene = ModHooks.BeforeSceneLoad(destScene);
destScene = ModHooks.BeforeSceneLoad(destScene);
tilemapDirty = true;
startedOnThisScene = false;
nextSceneName = destScene;
Expand All @@ -1257,7 +1257,7 @@ public IEnumerator LoadSceneAdditive(string destScene)
asyncOperation.allowSceneActivation = true;
yield return asyncOperation;
yield return UnityEngine.SceneManagement.SceneManager.UnloadSceneAsync(exitingScene);
//ModHooks.OnSceneChanged(destScene);
ModHooks.OnSceneChanged(destScene);
RefreshTilemapInfo(destScene);
if (IsUnloadAssetsRequired(exitingScene, destScene))
{
Expand Down Expand Up @@ -2443,9 +2443,9 @@ public void LoadGame(int saveSlot, Action<bool> callback)

public void ClearSaveFile(int saveSlot, Action<bool> callback)
{
/*ModHooks.OnSavegameClear(saveSlot);
this.orig_ClearSaveFile(saveSlot, callback);
ModHooks.OnAfterSaveGameClear(saveSlot);*/
ModHooks.OnSavegameClear(saveSlot);
//this.orig_ClearSaveFile(saveSlot, callback);
ModHooks.OnAfterSaveGameClear(saveSlot);
}

/*public void GetSaveStatsForSlot(int saveSlot, Action<SaveStats> callback)
Expand Down
8 changes: 6 additions & 2 deletions Hollow Knight/HeroPlatformStick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ public class HeroPlatformStick : MonoBehaviour
private void OnCollisionEnter2D(Collision2D collision)
{
GameObject gameObject = collision.gameObject;
if (gameObject.layer == 9)
if (gameObject.layer == 9 || gameObject.GetComponent<HeroController>() != null)
{
HeroController component = gameObject.GetComponent<HeroController>();
if (component.cState.transitioning)
{
return;
}
if (component != null)
{
component.SetHeroParent(transform);
Expand All @@ -27,7 +31,7 @@ private void OnCollisionEnter2D(Collision2D collision)
private void OnCollisionExit2D(Collision2D collision)
{
GameObject gameObject = collision.gameObject;
if (gameObject.layer == 9)
if (gameObject.layer == 9 || gameObject.GetComponent<HeroController>() != null)
{
HeroController component = gameObject.GetComponent<HeroController>();
if (component != null)
Expand Down
74 changes: 72 additions & 2 deletions Hollow Knight/Modding/ModHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,78 @@ internal static float OnFocusCost()

return result;
}

/// <summary>

/// <summary>
/// Called right before a scene gets loaded, can change which scene gets loaded
/// </summary>
/// <remarks>N/A</remarks>
internal static string BeforeSceneLoad(string sceneName)
{
//Debug.Log("BeforeSceneLoad Invoked");

if (BeforeSceneLoadHook == null)
{
return sceneName;
}

Delegate[] invocationList = BeforeSceneLoadHook.GetInvocationList();

foreach (Func<string, string> toInvoke in invocationList)
{
try
{
sceneName = toInvoke.Invoke(sceneName);
}
catch (Exception ex)
{
Debug.LogError(ex);
}
}

return sceneName;
}

/// <summary>
/// Called after a new Scene has been loaded
/// </summary>
/// <remarks>N/A</remarks>
internal static void OnSceneChanged(string targetScene)
{
Debug.Log("OnSceneChanged Invoked");

if (SceneChanged == null)
{
return;
}

Delegate[] invocationList = SceneChanged.GetInvocationList();

foreach (Action<string> toInvoke in invocationList)
{
try
{
toInvoke.Invoke(targetScene);
}
catch (Exception ex)
{
Debug.LogError(ex);
}
}
}

/// <summary>
/// Called after a new Scene has been loaded
/// </summary>
/// <remarks>N/A</remarks>
public static event Action<string> SceneChanged;

/// <summary>
/// Called right before a scene gets loaded, can change which scene gets loaded
/// </summary>
/// <remarks>N/A</remarks>
public static event Func<string, string> BeforeSceneLoadHook;

/// <summary>
/// Called whenever focus cost is calculated, allows a focus cost multiplier.
/// </summary>
public static event Func<float> FocusCostHook;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 2185737cc0508734aa7386644f6a477e, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 60a836d715be9a247b83bdb65dd4382d, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: d2627649b701d9141a6507c7efbff250, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 774cdb224155cee4ba5fa38929c07c3b, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: a98fb8a1d49582841abecec09d8d5732, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 2edecbaeb5eabd54f8eafc52ceb07d8b, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 35ad0f3b09dbc1747bb59a9c83f86243, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 5e594fbf23cbc344982af33961eeafea, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: c6f692727898ca145aaa2636704815f4, type: 3}
m_Texture: {fileID: 2800000, guid: 8acfdb48cc2a635439fbd1eff244a928, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
Expand Down
Binary file modified Libraries/0Harmony.dll
Binary file not shown.
Binary file added Libraries/0Harmony.pdb
Binary file not shown.
7 changes: 7 additions & 0 deletions Libraries/0Harmony.pdb.meta

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

Loading

0 comments on commit 0b713e0

Please sign in to comment.