Skip to content

Commit 7a4b653

Browse files
committed
- equipment drones no longer show up as equipment
- fixed stack trace logging to be more meaningful
1 parent 054c8ad commit 7a4b653

7 files changed

Lines changed: 23 additions & 5 deletions

File tree

MiniMapMod/Log.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ public void LogException(Exception head, string message = "")
2424
{
2525
LogError(message);
2626

27-
LogError($"\t{head?.StackTrace ?? "no stack trace available"}");
28-
2927
// log the exception linked list's messages
3028
// this is only really used for weird event and async method
3129
// behaviour, most of the time this is unnessesary
3230
while (head != null)
3331
{
3432
LogError($"\t{head.Message}");
3533

34+
LogError($"\t{head.StackTrace}");
35+
3636
if (head.InnerException != null)
3737
{
3838
head = head.InnerException;

MiniMapMod/MiniMapPlugin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace MiniMapMod
1414
{
15-
[BepInPlugin("MiniMap", "Mini Map Mod", "3.3.0")]
15+
[BepInPlugin("MiniMap", "Mini Map Mod", "3.3.1")]
1616
public class MiniMapPlugin : BaseUnityPlugin
1717
{
1818
private ISpriteManager SpriteManager;
@@ -341,7 +341,7 @@ private ITrackedObjectScanner CreatePurchaseInteractionScanner()
341341

342342
bool ShopSelector(PurchaseInteraction interaction) => interaction?.contextToken?.Contains("TERMINAL") ?? false;
343343

344-
bool EquipmentSelector(PurchaseInteraction interaction) => interaction?.contextToken?.Contains("EQUIP") ?? false;
344+
bool EquipmentSelector(PurchaseInteraction interaction) => interaction?.contextToken?.Contains("EQUIPMENTBARREL") ?? false;
345345

346346
bool GoldShoresSelector(PurchaseInteraction interaction) => interaction?.contextToken?.Contains("GOLDSHORE") ?? false;
347347

MiniMapMod/MinimapExtensions.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Text;
55
using UnityEngine;
66

7+
#nullable enable
78
namespace MiniMapMod
89
{
910
public static class MinimapExtensions
@@ -31,5 +32,18 @@ public static Vector2 ToMinimapPosition(this Vector3 position, Range3D dimension
3132

3233
return new(x * Settings.MinimapSize.Width, z * Settings.MinimapSize.Height);
3334
}
35+
36+
/// <summary>
37+
/// Checks the given expression, if it returns true, value passed in is returned allowing chaining of check
38+
/// other wise returns null, use with colaescing operators to short circuit
39+
/// </summary>
40+
/// <typeparam name="T"></typeparam>
41+
/// <param name="value"></param>
42+
/// <param name="expression"></param>
43+
/// <returns></returns>
44+
public static T? Check<T>(this T value, Func<T, bool> expression) where T : class
45+
{
46+
return expression?.Invoke(value) is null or false ? (T?)null : value;
47+
}
3448
}
3549
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Huge thanks to these awesome people who assisted in creating awesome features fo
7676
[Arcafanetiz](https://github.com/Arcafanetiz)
7777

7878
### Change Log
79+
Minor 3.1.1
80+
- equipment drones no longer show up as equipment
81+
- fixed stack trace logging to be more meaningful
82+
7983
Major 3.3
8084
- performance major, limited min time between scans to 2 seconds, previous was unlimited, when in 2hr+ runs auto-enemy killing builds caused constant scene scanning
8185
- fixed bug where chosing wrong icon path in config would lag and crash game with MissingTextureExceptions thrown by `SpriteManager.GetOrCache`

icon.png

-17.7 KB
Loading

icon.psd

810 KB
Binary file not shown.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MiniMapMod",
3-
"version_number": "3.3",
3+
"version_number": "3.3.1",
44
"website_url": "https://github.com/DekuDesu",
55
"description": "Adds a MiniMap to your game v3.3",
66
"dependencies": [

0 commit comments

Comments
 (0)