Skip to content

Commit

Permalink
Merge branch 'wlastas#122'
Browse files Browse the repository at this point in the history
  • Loading branch information
Queuete committed Apr 18, 2021
2 parents 9902c53 + 89f3490 commit f6da90b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions Core/PoEMemory/Components/MinimapIcon.cs
@@ -1,4 +1,5 @@
using ExileCore.Shared.Cache;
using ExileCore.PoEMemory.MemoryObjects;
using ExileCore.Shared.Cache;
using ExileCore.Shared.Helpers;
using GameOffsets;
using GameOffsets.Native;
Expand All @@ -11,11 +12,8 @@ public class MinimapIcon : Component
private MinimapIconOffsets MinimapIconOffsets => cachedValue.Value;
public bool IsVisible => MinimapIconOffsets.IsVisible == 0; //M.Read<byte>(Address + 0x30) == 0;
public bool IsHide => MinimapIconOffsets.IsHide == 1; //M.Read<byte>(Address + 0x34) == 1;
private NativeStringU Test => M.Read<NativeStringU>(MinimapIconOffsets.NamePtr); //M.Read<NativeStringU>(Address + 0x28, 0);
public string TestString => Test.ToString(M);
public string Name => Cache.StringCache.Read($"{MinimapIconOffsets.NamePtr}{Address}", () => TestString);

protected override void OnAddressChange()
public string Name => NativeStringReader.ReadString(MinimapIconOffsets.NamePtr, M);
protected override void OnAddressChange()
{
cachedValue = new FrameCache<MinimapIconOffsets>(() => M.Read<MinimapIconOffsets>(Address));
}
Expand Down
2 changes: 1 addition & 1 deletion GameOffsets/MinimapIconOffsets.cs
Expand Up @@ -5,7 +5,7 @@ namespace GameOffsets
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public struct MinimapIconOffsets
{
[FieldOffset(0x28)] public long NamePtr;
[FieldOffset(0x20)] public long NamePtr;
[FieldOffset(0x30)] public byte IsVisible;
[FieldOffset(0x34)] public byte IsHide;
}
Expand Down

0 comments on commit f6da90b

Please sign in to comment.