Skip to content

Commit 2cef750

Browse files
committed
Fixed sprites loading
1 parent df87745 commit 2cef750

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

MiniMapLibrary/MiniMapLibrary.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<Reference Include="UnityEngine.UIModule">
1818
<HintPath>..\MiniMapMod\libs\UnityEngine.UIModule.dll</HintPath>
1919
</Reference>
20+
<Reference Include="LegacyResourcesAPI">
21+
<HintPath>..\MiniMapMod\libs\LegacyResourcesAPI.dll</HintPath>
22+
</Reference>
2023
</ItemGroup>
2124

2225
</Project>

MiniMapLibrary/Sprites/SpriteManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using UnityEngine;
7+
using RoR2;
78

89
#nullable enable
910
namespace MiniMapLibrary
@@ -48,15 +49,15 @@ public void Dispose()
4849
return SpriteCache[Path];
4950
}
5051

51-
Sprite? loaded = Resources.Load<Sprite>(Path);
52+
Sprite? loaded = RoR2.LegacyResourcesAPI.Load<Sprite>(Path);
5253

5354
if (loaded != null)
5455
{
5556
SpriteCache.Add(Path, loaded);
5657
}
5758
else
5859
{
59-
loaded = Resources.Load<Sprite>(Settings.Icons.Default);
60+
loaded = RoR2.LegacyResourcesAPI.Load<Sprite>(Settings.Icons.Default);
6061

6162
if (loaded is null)
6263
{

0 commit comments

Comments
 (0)