Skip to content

Commit

Permalink
Release v1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmBatby committed Feb 3, 2025
1 parent 78dbace commit 0d1b614
Show file tree
Hide file tree
Showing 32 changed files with 272 additions and 436 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
**Changelog**
--

**<details><summary>Version 1.4.5</summary>**

**<details><summary>Fixes</summary>**

* Fixed issue where SpawnSyncedObjects in Tile Injection TileSets were not being network registered

</details>

</details>

**<details><summary>Version 1.4.4</summary>**

**<details><summary>Fixes</summary>**

* Fixed additional networking issues related to AssetBundle Hotloading

</details>

</details>

**<details><summary>Version 1.4.3</summary>**

**<details><summary>Fixes</summary>**

* Fixed issue with onBundlesFinishedLoading callback not being invoked
* Re-wrote AssetBundle Hotloading networking to hopefully improve issues in multiplayer and pre-existing saves
* Fixed issue with custom content that is manually registered not being processed correctly

</details>

</details>

**<details><summary>Version 1.4.2</summary>**

**<details><summary>Features</summary>**
Expand Down
6 changes: 5 additions & 1 deletion LethalLevelLoader/AssetBundles/AssetBundleLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ public static AssetBundleLoader Instance
private static int processedBundleCount;
private static int requestedBundleCount;

private void OnEnable() => instance = this;
private void OnEnable()
{
instance = this;
OnBundlesFinishedProcessing.AddListener(LethalLevelLoader.AssetBundleLoader.InvokeBundlesFinishedLoading);
}

internal static bool AllowLoading { get; set; } = true;

Expand Down
9 changes: 6 additions & 3 deletions LethalLevelLoader/AssetBundles/LethalBundleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public enum ModProcessingStatus { Inactive, Loading, Complete };

public static ExtendedEvent OnFinishedProcessing { get; private set; } = new ExtendedEvent();

public static bool HasFinalisedFoundContent { get; internal set; }

//Semi legacy
internal static Dictionary<string, List<Action<ExtendedMod>>> onExtendedModLoadedRequestDict = new Dictionary<string, List<Action<ExtendedMod>>>();

Expand All @@ -29,8 +31,7 @@ internal static void Start()

PatchedContent.VanillaMod = ExtendedMod.Create("LethalCompany", "Zeekerss");

if (TryLoadLethalBundles() == false)
FinialiseFoundContent();
TryLoadLethalBundles();
}

private static bool TryLoadLethalBundles()
Expand Down Expand Up @@ -235,7 +236,7 @@ internal static ExtendedMod GetOrCreateExtendedMod(AssetBundleGroup source, stri
}
}

private static void FinialiseFoundContent()
internal static void FinialiseFoundContent()
{
foreach (ExtendedMod obtainedExtendedMod in obtainedExtendedModsList)
{
Expand Down Expand Up @@ -265,6 +266,8 @@ private static void FinialiseFoundContent()

DebugHelper.Log("Custom Content Processed. Unlocking Main Menu.", DebugType.User);

HasFinalisedFoundContent = true;

CurrentStatus = ModProcessingStatus.Complete;

OnFinishedProcessing.Invoke();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine;
using UnityEngine.Video;

namespace LethalLevelLoader
Expand Down
4 changes: 2 additions & 2 deletions LethalLevelLoader/Components/ExtendedContent/ExtendedItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public void Initialize()
DebugHelper.Log("Initializing Custom Item: " + Item.itemName + ". Is Buyable: " + IsBuyableItem + ". Is Scrap: " + Item.isScrap, DebugType.Developer);

TryCreateMatchingProperties();

Patches.StartOfRound.allItemsList.itemsList.Add(Item);
if (!Patches.StartOfRound.allItemsList.itemsList.Contains(Item))
Patches.StartOfRound.allItemsList.itemsList.Add(Item);
if (IsBuyableItem)
TerminalManager.CreateItemTerminalData(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ExtendedLevel : ExtendedContent

[field: SerializeField] public bool IsRouteHidden { get; set; } = false;
[field: SerializeField] public bool IsRouteLocked { get; set; } = false;
public bool IsRouteRemoved { get; set; } = false;
[field: SerializeField] public string LockedRouteNodeText { get; set; } = string.Empty;

[field: Space(5)]
Expand Down
2 changes: 0 additions & 2 deletions LethalLevelLoader/Components/LLLSaveFile.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using LethalModDataLib.Base;
using System;
using System.Collections.Generic;
using System.Text;
using Unity.Netcode;

namespace LethalLevelLoader
Expand Down
5 changes: 1 addition & 4 deletions LethalLevelLoader/Components/MoonsCataloguePage.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace LethalLevelLoader
{
Expand Down
6 changes: 1 addition & 5 deletions LethalLevelLoader/Components/Networking/NetworkSceneInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using Steamworks.Data;
using System;
using System.Collections.Generic;
using System.Text;
using Unity.Netcode;
using Unity.Netcode;
using UnityEngine.SceneManagement;
using static LethalLevelLoader.LethalLevelLoaderNetworkManager;

Expand Down
2 changes: 0 additions & 2 deletions LethalLevelLoader/General/Content.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using DunGen.Graph;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.Audio;

Expand Down
28 changes: 13 additions & 15 deletions LethalLevelLoader/General/EventPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.InputSystem.HID;
using UnityEngine.SceneManagement;

namespace LethalLevelLoader
Expand Down Expand Up @@ -36,7 +34,7 @@ internal static void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(StoryLog), "CollectLog")]
[HarmonyPrefix]
internal static void StoryLogCollectLog_Prefix(StoryLog __instance)
Expand Down Expand Up @@ -79,7 +77,7 @@ internal static void RoundManagerSpawnRandomOutsideEnemy_Postfix(RoundManager __

////////// Dungeon Patches //////////

[HarmonyPriority(Patches.harmonyPriority + 1)] // +1 Because this needs to run after the Patch in Patches, second patch here for consistency.
[HarmonyPriority(Patches.priority + 1)] // +1 Because this needs to run after the Patch in Patches, second patch here for consistency.
[HarmonyPatch(typeof(DungeonGenerator), "Generate")]
[HarmonyPrefix]
internal static void DungeonGeneratorGenerate_Prefix()
Expand All @@ -91,7 +89,7 @@ internal static void DungeonGeneratorGenerate_Prefix()
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(RoundManager), "SwitchPower")]
[HarmonyPrefix]
internal static void RoundManagerSwitchPower_Prefix(bool on)
Expand All @@ -108,7 +106,7 @@ internal static void RoundManagerSwitchPower_Prefix(bool on)
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")]
[HarmonyPostfix]
internal static void RoundManagerSpawnScrapInLevel_Postfix()
Expand All @@ -121,7 +119,7 @@ internal static void RoundManagerSpawnScrapInLevel_Postfix()
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(RoundManager), "SpawnSyncedProps")]
[HarmonyPostfix]
internal static void RoundManagerSpawnSyncedProps_Postfix()
Expand All @@ -134,7 +132,7 @@ internal static void RoundManagerSpawnSyncedProps_Postfix()
}

private static EnemyVent cachedSelectedVent;
[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(RoundManager), "SpawnEnemyFromVent")]
[HarmonyPrefix]
internal static void RoundManagerSpawnEventFromVent_Prefix(EnemyVent vent)
Expand All @@ -143,7 +141,7 @@ internal static void RoundManagerSpawnEventFromVent_Prefix(EnemyVent vent)
cachedSelectedVent = vent;
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(RoundManager), "SpawnEnemyGameObject")]
[HarmonyPostfix]
internal static void RoundManagerSpawnEventFromVent_Postfix()
Expand All @@ -156,7 +154,7 @@ internal static void RoundManagerSpawnEventFromVent_Postfix()
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(RoundManager), "SpawnMapObjects")]
[HarmonyPostfix]
internal static void RoundManagerSpawnMapObjects_Postfix()
Expand All @@ -173,7 +171,7 @@ internal static void RoundManagerSpawnMapObjects_Postfix()
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(StartOfRound), "OnShipLandedMiscEvents")]
[HarmonyPrefix]
internal static void StartOfRoundOnShipLandedMiscEvents_Prefix()
Expand All @@ -190,7 +188,7 @@ internal static void StartOfRoundOnShipLandedMiscEvents_Prefix()
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(StartOfRound), "ShipLeave")]
[HarmonyPrefix]
internal static void StartOfRoundShipLeave_Prefix()
Expand All @@ -207,7 +205,7 @@ internal static void StartOfRoundShipLeave_Prefix()
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(EntranceTeleport), "TeleportPlayerServerRpc")]
[HarmonyPrefix]
internal static void EntranceTeleportTeleportPlayerServerRpc_Prefix(EntranceTeleport __instance, int playerObj)
Expand Down Expand Up @@ -246,7 +244,7 @@ internal static void EntranceTeleportTeleportPlayerServerRpc_Prefix(EntranceTele
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(LungProp), "EquipItem")]
[HarmonyPrefix]
internal static void LungPropEquipItem_Prefix(LungProp __instance)
Expand All @@ -266,7 +264,7 @@ internal static void LungPropEquipItem_Prefix(LungProp __instance)
}
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch(typeof(TimeOfDay), "GetDayPhase")]
[HarmonyPostfix]
internal static void TimeOfDayGetDayPhase_Postfix(DayMode __result)
Expand Down
12 changes: 6 additions & 6 deletions LethalLevelLoader/General/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using DunGen;
using DunGen.Graph;
using HarmonyLib;
using Mono.Cecil;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using UnityEngine;

namespace LethalLevelLoader
{
Expand All @@ -19,7 +15,11 @@ public static List<Tile> GetTiles(this DungeonFlow dungeonFlow)

foreach (GraphNode dungeonNode in dungeonFlow.Nodes)
foreach (TileSet dungeonTileSet in dungeonNode.TileSets)
tilesList.AddRange(GetTilesInTileSet(dungeonTileSet));
if (dungeonTileSet != null)
tilesList.AddRange(GetTilesInTileSet(dungeonTileSet));

foreach (TileInjectionRule tileInjectionRule in dungeonFlow.TileInjectionRules)
tilesList.AddRange(GetTilesInTileSet(tileInjectionRule.TileSet));

foreach (GraphLine dungeonLine in dungeonFlow.Lines)
foreach (DungeonArchetype dungeonArchetype in dungeonLine.DungeonArchetypes)
Expand Down Expand Up @@ -148,4 +148,4 @@ public static List<DungeonFlow> GetDungeonFlows(this RoundManager roundManager)
return roundManager.dungeonFlowTypes.Select(i => i.dungeonFlow).ToList();
}
}
}
}
12 changes: 5 additions & 7 deletions LethalLevelLoader/General/OptionalPatches/LethalLibPatches.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Text;

namespace LethalLevelLoader
{
internal class LethalLibPatches
{
[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPatch(typeof(LethalLib.Modules.Dungeon), "RoundManager_Start")]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch("LethalLib.Modules.Dungeon", "RoundManager_Start")]
[HarmonyPrefix]
internal static bool Dungeon_Start_Prefix(Action<RoundManager> orig, RoundManager self)
{
Expand All @@ -17,8 +15,8 @@ internal static bool Dungeon_Start_Prefix(Action<RoundManager> orig, RoundManage
return (false);
}

[HarmonyPriority(Patches.harmonyPriority)]
[HarmonyPatch(typeof(LethalLib.Modules.Dungeon), "RoundManager_GenerateNewFloor")]
[HarmonyPriority(Patches.priority)]
[HarmonyPatch("LethalLib.Modules.Dungeon", "RoundManager_GenerateNewFloor")]
[HarmonyPrefix]
internal static bool Dungeon_GenerateNewFloor_Prefix(Action<RoundManager> orig, RoundManager self)
{
Expand All @@ -27,4 +25,4 @@ internal static bool Dungeon_GenerateNewFloor_Prefix(Action<RoundManager> orig,
return (false);
}
}
}
}
Loading

0 comments on commit 0d1b614

Please sign in to comment.