Skip to content

Commit

Permalink
Merge pull request #183 from SubnauticaModding/Dev
Browse files Browse the repository at this point in the history
SMLHelper 2.8.4 Different Sprite issue Hotfix.
  • Loading branch information
toebeann committed Sep 2, 2020
2 parents 4711ad5 + 2d0ed70 commit dc5dbea
Show file tree
Hide file tree
Showing 62 changed files with 9,314 additions and 205 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added Dependencies/BelowZero.stable/0Harmony.dll
Binary file not shown.
2,849 changes: 2,849 additions & 0 deletions Dependencies/BelowZero.stable/0Harmony.xml

Large diffs are not rendered by default.

Binary file not shown.
Binary file added Dependencies/BelowZero.stable/QModInstaller.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Dependencies/BelowZero.stable/UnityEngine.UI.dll
Binary file not shown.
Binary file added Dependencies/BelowZero.stable/UnityEngine.dll
Binary file not shown.
Binary file added Dependencies/Subnautica.exp/0Harmony.dll
Binary file not shown.
2,849 changes: 2,849 additions & 0 deletions Dependencies/Subnautica.exp/0Harmony.xml

Large diffs are not rendered by default.

Binary file added Dependencies/Subnautica.exp/Newtonsoft.Json.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Dependencies/Subnautica.exp/UnityEngine.UI.dll
Binary file not shown.
Binary file added Dependencies/Subnautica.exp/UnityEngine.dll
Binary file not shown.
Binary file added Dependencies/Subnautica.stable/0Harmony.dll
Binary file not shown.
2,849 changes: 2,849 additions & 0 deletions Dependencies/Subnautica.stable/0Harmony.xml

Large diffs are not rendered by default.

File renamed without changes.
Binary file not shown.
569 changes: 569 additions & 0 deletions Dependencies/Subnautica.stable/QModInstaller.xml

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
22 changes: 10 additions & 12 deletions Example mod/Example mod.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\common.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">SN.STABLE</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}</ProjectGuid>
<OutputType>Library</OutputType>
Expand All @@ -14,22 +15,20 @@
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SUBNAUTICA|AnyCPU'">
<OutputPath>bin\SUBNAUTICA\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SN.STABLE|AnyCPU'">
<OutputPath>bin\SN.STABLE\</OutputPath>
<DefineConstants>TRACE;DEBUG;SUBNAUTICA;SUBNAUTICA_STABLE</DefineConstants>
<Optimize>true</Optimize>
<Dependencies>..\Dependencies\Subnautica</Dependencies>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BELOWZERO|AnyCPU'">
<OutputPath>bin\BELOWZERO\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BZ.STABLE|AnyCPU'">
<OutputPath>bin\BZ.STABLE\</OutputPath>
<DefineConstants>TRACE;DEBUG;BELOWZERO;BELOWZERO_STABLE</DefineConstants>
<Optimize>true</Optimize>
<Dependencies>..\Dependencies\BelowZero</Dependencies>
<DebugType>none</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
Expand All @@ -38,7 +37,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\Dependencies\0Harmony.dll</HintPath>
<HintPath>$(Dependencies)\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
Expand All @@ -59,12 +58,11 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="UnityEngine.CoreModule" Condition="'$(Configuration)'=='BELOWZERO'">
<Reference Include="UnityEngine.CoreModule">
<HintPath>$(Dependencies)\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(Dependencies)\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
Expand Down
15 changes: 7 additions & 8 deletions SMLHelper.Tests/SMLHelper.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\common.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">SN.STABLE</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}</ProjectGuid>
<OutputType>Library</OutputType>
Expand All @@ -29,22 +30,20 @@
</UpgradeBackupLocation>
<OldToolsVersion>15.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SUBNAUTICA|AnyCPU'">
<OutputPath>bin\SUBNAUTICA\</OutputPath>
<DefineConstants>TRACE;DEBUG;SUBNAUTICA</DefineConstants>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SN.STABLE|AnyCPU'">
<OutputPath>bin\SN.STABLE\</OutputPath>
<DefineConstants>TRACE;DEBUG;SUBNAUTICA;SUBNAUTICA_STABLE</DefineConstants>
<Optimize>false</Optimize>
<Dependencies>..\Dependencies\Subnautica</Dependencies>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BELOWZERO|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BZ.STABLE|AnyCPU'">
<OutputPath>bin\BELOWZERO\</OutputPath>
<DefineConstants>TRACE;DEBUG;BELOWZERO</DefineConstants>
<DefineConstants>TRACE;DEBUG;BELOWZERO;BELOWZERO_STABLE</DefineConstants>
<Optimize>true</Optimize>
<Dependencies>..\Dependencies\BelowZero</Dependencies>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
Expand Down
38 changes: 24 additions & 14 deletions SMLHelper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,32 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SMLHelper.Tests", "SMLHelpe
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
BELOWZERO|Any CPU = BELOWZERO|Any CPU
SUBNAUTICA|Any CPU = SUBNAUTICA|Any CPU
BZ.EXP|Any CPU = BZ.EXP|Any CPU
BZ.STABLE|Any CPU = BZ.STABLE|Any CPU
SN.EXP|Any CPU = SN.EXP|Any CPU
SN.STABLE|Any CPU = SN.STABLE|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{418502DD-372D-4EF9-8021-B262552DFEDE}.BELOWZERO|Any CPU.ActiveCfg = BELOWZERO|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.BELOWZERO|Any CPU.Build.0 = BELOWZERO|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.SUBNAUTICA|Any CPU.ActiveCfg = SUBNAUTICA|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.SUBNAUTICA|Any CPU.Build.0 = SUBNAUTICA|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.BELOWZERO|Any CPU.ActiveCfg = BELOWZERO|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.BELOWZERO|Any CPU.Build.0 = BELOWZERO|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.SUBNAUTICA|Any CPU.ActiveCfg = SUBNAUTICA|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.SUBNAUTICA|Any CPU.Build.0 = SUBNAUTICA|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.BELOWZERO|Any CPU.ActiveCfg = BELOWZERO|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.BELOWZERO|Any CPU.Build.0 = BELOWZERO|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.SUBNAUTICA|Any CPU.ActiveCfg = SUBNAUTICA|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.SUBNAUTICA|Any CPU.Build.0 = SUBNAUTICA|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.BZ.EXP|Any CPU.ActiveCfg = BZ.EXP|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.BZ.EXP|Any CPU.Build.0 = BZ.EXP|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.BZ.STABLE|Any CPU.ActiveCfg = BZ.STABLE|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.BZ.STABLE|Any CPU.Build.0 = BZ.STABLE|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.SN.EXP|Any CPU.ActiveCfg = SN.EXP|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.SN.EXP|Any CPU.Build.0 = SN.EXP|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.SN.STABLE|Any CPU.ActiveCfg = SN.STABLE|Any CPU
{418502DD-372D-4EF9-8021-B262552DFEDE}.SN.STABLE|Any CPU.Build.0 = SN.STABLE|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.BZ.EXP|Any CPU.ActiveCfg = BZ.STABLE|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.BZ.STABLE|Any CPU.ActiveCfg = BZ.STABLE|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.BZ.STABLE|Any CPU.Build.0 = BZ.STABLE|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.SN.EXP|Any CPU.ActiveCfg = SN.STABLE|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.SN.STABLE|Any CPU.ActiveCfg = SN.STABLE|Any CPU
{C8FB0981-77D2-47C7-BBEF-A3A9EBACACBF}.SN.STABLE|Any CPU.Build.0 = SN.STABLE|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.BZ.EXP|Any CPU.ActiveCfg = BZ.STABLE|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.BZ.STABLE|Any CPU.ActiveCfg = BZ.STABLE|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.BZ.STABLE|Any CPU.Build.0 = BZ.STABLE|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.SN.EXP|Any CPU.ActiveCfg = SN.STABLE|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.SN.STABLE|Any CPU.ActiveCfg = SN.STABLE|Any CPU
{EBC4AAF3-A13B-427E-BF99-3AE23EDEB4B8}.SN.STABLE|Any CPU.Build.0 = SN.STABLE|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
35 changes: 15 additions & 20 deletions SMLHelper/Assets/CustomFabricator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
using UnityEngine;
using Logger = V2.Logger;

#if SUBNAUTICA
using Sprite = Atlas.Sprite;
#elif BELOWZERO
using Sprite = UnityEngine.Sprite;
#endif

/// <summary>
/// An asset class inheriting from <seealso cref="Buildable"/> that streamlines the process of creating a custom fabricator with a custom crafting tree.
/// </summary>
Expand Down Expand Up @@ -151,11 +157,19 @@ public override GameObject GetGameObject()
{
case Models.Fabricator:
default:
#if SUBNAUTICA_EXP
prefab = null; // TODO
#else
prefab = GameObject.Instantiate(CraftData.GetPrefabForTechType(TechType.Fabricator));
#endif
crafter = prefab.GetComponent<Fabricator>();
break;
case Models.Workbench:
#if SUBNAUTICA_EXP
prefab = null; // TODO
#else
prefab = GameObject.Instantiate(CraftData.GetPrefabForTechType(TechType.Workbench));
#endif
crafter = prefab.GetComponent<Workbench>();
break;
#if SUBNAUTICA
Expand Down Expand Up @@ -253,25 +267,7 @@ internal virtual void CreateCustomCraftTree(out CraftTree.Type craftTreeType)
foreach (Action action in OrderedCraftTreeActions)
action.Invoke();
}
#if SUBNAUTICA
/// <summary>
/// Adds a new tab node to the custom crafting tree of this fabricator.
/// </summary>
/// <param name="tabId">The internal ID for the tab node.</param>
/// <param name="displayText">The in-game text shown for the tab node.</param>
/// <param name="tabSprite">The sprite used for the tab node.</param>
/// <param name="parentTabId">Optional. The parent tab of this tab.<para/>
/// When this value is null, the tab will be added to the root of the craft tree.</param>
public void AddTabNode(string tabId, string displayText, Atlas.Sprite tabSprite, string parentTabId = null)
{
OrderedCraftTreeActions.Add(() =>
{
ModCraftTreeLinkingNode parentNode = CraftTreeLinkingNodes[parentTabId ?? RootNode];
ModCraftTreeTab tab = parentNode.AddTabNode(tabId, displayText, tabSprite);
CraftTreeLinkingNodes[tabId] = tab;
});
}
#elif BELOWZERO

/// <summary>
/// Adds a new tab node to the custom crafting tree of this fabricator.
/// </summary>
Expand All @@ -289,7 +285,6 @@ public void AddTabNode(string tabId, string displayText, Sprite tabSprite, strin
CraftTreeLinkingNodes[tabId] = tab;
});
}
#endif

/// <summary>
/// Adds a new crafting node to the custom crafting tree of this fabricator.
Expand Down
2 changes: 2 additions & 0 deletions SMLHelper/Assets/SubnauticaModSprite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ internal static void Add(SpriteManager.Group group, string name, Atlas.Sprite sp
if (!ModSprites.ContainsKey(group))
ModSprites.Add(group, new Dictionary<string, Atlas.Sprite>(StringComparer.InvariantCultureIgnoreCase));

if(ModSprites[group].ContainsKey(name))
Logger.Debug($"ModSprite already registered for {group}/{name}. Old sprite will be overwritten.");
ModSprites[group][name] = sprite;
}

Expand Down
4 changes: 2 additions & 2 deletions SMLHelper/Json/ConfigFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using SMLHelper.V2.Json.Converters;
using SMLHelper.V2.Json.ExtensionMethods;
using SMLHelper.V2.Json.Interfaces;
#if SUBNAUTICA
#if SUBNAUTICA_STABLE
using Oculus.Newtonsoft.Json;
using Oculus.Newtonsoft.Json.Converters;
#elif BELOWZERO
#else
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
#endif
Expand Down
5 changes: 2 additions & 3 deletions SMLHelper/Json/Converters/FloatConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
{
using System;
using System.Globalization;
using UnityEngine;
#if SUBNAUTICA
#if SUBNAUTICA_STABLE
using Oculus.Newtonsoft.Json;
#elif BELOWZERO
#else
using Newtonsoft.Json;
#endif

Expand Down
4 changes: 2 additions & 2 deletions SMLHelper/Json/Converters/KeyCodeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System;
using SMLHelper.V2.Utility;
using UnityEngine;
#if SUBNAUTICA
#if SUBNAUTICA_STABLE
using Oculus.Newtonsoft.Json;
#elif BELOWZERO
#else
using Newtonsoft.Json;
#endif

Expand Down
4 changes: 2 additions & 2 deletions SMLHelper/Json/ExtensionMethods/JsonExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace SMLHelper.V2.Json.ExtensionMethods
{
using SMLHelper.V2.Utility;
#if SUBNAUTICA
#if SUBNAUTICA_STABLE
using Oculus.Newtonsoft.Json;
#elif BELOWZERO
#else
using Newtonsoft.Json;
#endif

Expand Down
4 changes: 2 additions & 2 deletions SMLHelper/Json/Interfaces/IJsonFile.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace SMLHelper.V2.Json.Interfaces
{
#if SUBNAUTICA
#if SUBNAUTICA_STABLE
using Oculus.Newtonsoft.Json;
#elif BELOWZERO
#else
using Newtonsoft.Json;
#endif

Expand Down
6 changes: 4 additions & 2 deletions SMLHelper/Patchers/FishPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ private static void CreatureStart_Postfix(Creature __instance)
{
int randomIndex = Random.Range(0, FishHandler.fishTechTypes.Count);
TechType randomFish = FishHandler.fishTechTypes[randomIndex];

#if SUBNAUTICA_EXP
GameObject fish = null;
#else
GameObject fish = CraftData.InstantiateFromPrefab(randomFish);

#endif
// Deletes the fish if it is a ground creature spawned in water
if (fish.GetComponent<WalkOnGround>() && !__instance.GetComponent<WalkOnGround>())
{
Expand Down
6 changes: 0 additions & 6 deletions SMLHelper/Patchers/LootDistributionPatcher.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
namespace SMLHelper.V2.Patchers
{
using System;
using System.Collections.Generic;
using HarmonyLib;
using Logger = V2.Logger;
#if SUBNAUTICA
using Oculus.Newtonsoft.Json;
#elif BELOWZERO
using Newtonsoft.Json;
#endif

internal class LootDistributionPatcher
{
Expand Down
11 changes: 8 additions & 3 deletions SMLHelper/Patchers/OptionsPanelPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
using UnityEngine.EventSystems;
using UnityEngine.UI;
using QModManager.API;
#if SUBNAUTICA

#if SUBNAUTICA_STABLE
using Oculus.Newtonsoft.Json;
#else
using Newtonsoft.Json;
#endif

#if SUBNAUTICA
using Text = UnityEngine.UI.Text;
#elif BELOWZERO
using Text = TMPro.TextMeshProUGUI;
using Newtonsoft.Json;
#endif

internal class OptionsPanelPatcher
Expand Down Expand Up @@ -88,7 +93,7 @@ internal static void AddTabs_Postfix(uGUI_OptionsPanel __instance)
modOptions.Values.ForEach(options => options.AddOptionsToPanel(optionsPanel, modsTab));
}

#if SUBNAUTICA // it looks like this is fixed in BelowZero
#if SUBNAUTICA_STABLE
// fix for slider, check for zero divider added (in that case just return value unchanged)
// it happens when slider is in pre-awake state, so any given value snaps to default value
[PatchUtils.Transpiler]
Expand Down
3 changes: 2 additions & 1 deletion SMLHelper/Patchers/PrefabDatabasePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ internal static bool GetPrefabAsync_Prefix(ref IPrefabRequest __result, string c

internal static void PrePatch(Harmony harmony)
{
#if !SUBNAUTICA_EXP // TODO
harmony.Patch(AccessTools.Method(typeof(PrefabDatabase), nameof(PrefabDatabase.GetPrefabForFilename)),
prefix: new HarmonyMethod(AccessTools.Method(typeof(PrefabDatabasePatcher), nameof(PrefabDatabasePatcher.GetPrefabForFilename_Prefix))));

#endif
harmony.Patch(tryGetPrefabFilename, prefix: new HarmonyMethod(AccessTools.Method(typeof(PrefabDatabasePatcher), nameof(PrefabDatabasePatcher.TryGetPrefabFilename_Prefix))));

harmony.Patch(AccessTools.Method(typeof(PrefabDatabase), nameof(PrefabDatabase.GetPrefabAsync)),
Expand Down
12 changes: 10 additions & 2 deletions SMLHelper/Patchers/SpritePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ internal static void Patch()
Dictionary<string, Sprite> moddedSprites = moddedSpriteGroup.Value;
foreach (var sprite in moddedSprites)
{
spriteAtlas.Add(sprite.Key, sprite.Value);
Logger.Debug($"Adding Sprite {sprite.Key} to {nameof(SpriteManager.Group)}.{moddedSpriteGroup.Key}");
if (spriteAtlas.ContainsKey(sprite.Key))
{
Logger.Debug($"Overwriting Sprite {sprite.Key} in {nameof(SpriteManager.Group)}.{moddedSpriteGroup.Key}");
spriteAtlas[sprite.Key] = sprite.Value;
}
else
{
Logger.Debug($"Adding Sprite {sprite.Key} to {nameof(SpriteManager.Group)}.{moddedSpriteGroup.Key}");
spriteAtlas.Add(sprite.Key, sprite.Value);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions SMLHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.8.3.0")]
[assembly: AssemblyFileVersion("2.8.3.0")]
[assembly: AssemblyVersion("2.8.4.0")]
[assembly: AssemblyFileVersion("2.8.4.0")]
[assembly: InternalsVisibleTo("SMLHelper.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
Loading

0 comments on commit dc5dbea

Please sign in to comment.