diff --git a/4.0.0/MiniMapLibrary.dll b/4.0.0/MiniMapLibrary.dll
deleted file mode 100644
index af5d162..0000000
Binary files a/4.0.0/MiniMapLibrary.dll and /dev/null differ
diff --git a/4.0.0/MiniMapMod.dll b/4.0.0/MiniMapMod.dll
deleted file mode 100644
index 3182d44..0000000
Binary files a/4.0.0/MiniMapMod.dll and /dev/null differ
diff --git a/4.0.0/manifest.json b/4.0.0/manifest.json
deleted file mode 100644
index 0fe10bf..0000000
--- a/4.0.0/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "MiniMapMod",
- "version_number": "4.0.0",
- "website_url": "/ArtyRedd",
- "description": "Adds a MiniMap to your game v4",
- "dependencies": [
- "bbepis-BepInExPack-5.4.9",
- "RiskofThunder-HookGenPatcher-1.2.1"
- ]
-}
diff --git a/4.2.0/MiniMapLibrary.dll b/4.2.0/MiniMapLibrary.dll
new file mode 100644
index 0000000..cac428f
Binary files /dev/null and b/4.2.0/MiniMapLibrary.dll differ
diff --git a/4.2.0/MiniMapMod.dll b/4.2.0/MiniMapMod.dll
new file mode 100644
index 0000000..d75f827
Binary files /dev/null and b/4.2.0/MiniMapMod.dll differ
diff --git a/4.0.0/README.md b/4.2.0/README.md
similarity index 76%
rename from 4.0.0/README.md
rename to 4.2.0/README.md
index 136c6be..cbfb5b4 100644
--- a/4.0.0/README.md
+++ b/4.2.0/README.md
@@ -5,8 +5,10 @@ Adds a contemporary Minimap to the game.
- Implements a Mini Map In-Game.
- Show interactable items, shrines, teleporters, enemies and more.
+- Shows dropped items and equipment as small cyan dots.
- Single and Multiplayer Compatible.
- Every icon is configurable for color, size and can be toggled on/off.
+- Works with all DLCs (Survivors of the Void, Seekers of the Storm, Alloyed Collective, Hallowed Concepts).
#### Available Icons
| Icon | Available | Configurable |
@@ -32,10 +34,11 @@ Adds a contemporary Minimap to the game.
| Fans/Special | ✔ | ✔ |
| Portals | ✔ | ✔ |
| Totems | ✔ | ✔ |
-| Dropped Items | ✔ | ✔ |
+| Dropped Items / Equipment / Lunar Coins | ✔ | ✔ |
+| Command Cubes / Void Potentials | ✔ | ✔ |
| Newt Altar | ✔ | ✔ |
-| Timed Chests | ❌ | ❌ |
-| Stealth Chests | ❌ | ❌ |
+| Timed Chests | ✔ (off by default) | ✔ |
+| Stealth Chests | ✔ (off by default) | ✔ |
### Showcase
@@ -43,16 +46,21 @@ Adds a contemporary Minimap to the game.
### Dependencies
- BepInEx
+- HookGenPatcher
+- RoR2BepInExPack
### Manual Installation
- Place MiniMapLibrary.dll into your BepInEx/plugins folder.
- Place MiniMapMod.dll into your BepInEx/plugins folder.
+- BepInExPack 5.4.2122 needs Newtonsoft.Json, which the game doesn't ship anymore. RoR2BepInExPack provides it, so install that too (mod managers do this automatically).
### How to Use
-- Use 'M' to hide or show the minimap.
+- Use 'M' to hide or show the minimap.
+- Use '=' and '-' to zoom in and out.
### Troubleshooting
- Toggle 'M' to hide and show minimap to force a refresh and/or a re-draw if something wonky is happening on the minimap.
+- Set `LogLevel = debug` under `[Settings.General]` in the config and play a stage. Every few seconds the log shows what the minimap found and drew, which helps a lot with bug reports.
### Config
BepInEx Config. Each icon is individually configurable.
@@ -67,6 +75,8 @@ BepInEx Config. Each icon is individually configurable.
- Elevation Marker Height
- Elevation Marker Offset
+Map size, position, camera rotation, zoom keys and scan intervals are configurable too.
+
### Upcoming Changes
None - Final Release
@@ -76,8 +86,21 @@ If you have an issue, discover a bug, or have a recommendation please file an is
### Collaborators
Huge thanks to these awesome people who assisted in creating awesome features for this mod
[Arcafanetiz](https://github.com/Arcafanetiz)
+[winterofhell](https://github.com/winterofhell)
### Change Log
+Release 4.2.0
+- updated for the current game version and all DLCs (Seekers of the Storm, Alloyed Collective, Hallowed Concepts)
+- dropped items, equipment, lunar coins, command cubes and void potentials now show up as small light-cyan dots, and disappear as soon as they're picked up
+- all icons are about 10% bigger, old configs that still use the default sizes get the new ones automatically
+- objects are now tracked through the game's own registries instead of rescanning the whole scene, so no more stutter every few seconds
+- timed and stealth chests can be turned on in the config (still off by default)
+- added End of the Cycle enemies
+- map no longer overlaps the objective panel
+- added map size, position and rotation settings
+- added debug logging for bug reports
+- fixed duplicate icons and icons sticking around after objects were destroyed
+
Release 4.0.0
- Finally added newt altars to the search, since everyone has been begging for it for literally years
diff --git a/4.0.0/icon.png b/4.2.0/icon.png
similarity index 100%
rename from 4.0.0/icon.png
rename to 4.2.0/icon.png
diff --git a/4.2.0/manifest.json b/4.2.0/manifest.json
new file mode 100644
index 0000000..1741848
--- /dev/null
+++ b/4.2.0/manifest.json
@@ -0,0 +1,11 @@
+{
+ "name": "MiniMapMod",
+ "version_number": "4.2.0",
+ "website_url": "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/artyredd/MiniMapMod",
+ "description": "A configurable HUD minimap showing chests, shops, shrines, teleporters, drones, players, enemies and dropped items, with elevation arrows and zoom. Supports all DLCs.",
+ "dependencies": [
+ "bbepis-BepInExPack-5.4.2122",
+ "RiskofThunder-HookGenPatcher-1.2.9",
+ "RiskofThunder-RoR2BepInExPack-1.46.0"
+ ]
+}
diff --git a/MiniMapLibrary/Basic/Dimension2D.cs b/MiniMapLibrary/Basic/Dimension2D.cs
index ab01a8a..0374481 100644
--- a/MiniMapLibrary/Basic/Dimension2D.cs
+++ b/MiniMapLibrary/Basic/Dimension2D.cs
@@ -15,6 +15,8 @@ public float Width
get => _Width;
set
{
+ if (_Width == value)
+ return;
_Width = value;
OnChanged?.Invoke(this);
}
@@ -24,6 +26,8 @@ public float Height
get => _Height;
set
{
+ if (_Height == value)
+ return;
_Height = value;
OnChanged?.Invoke(this);
}
diff --git a/MiniMapLibrary/Basic/MapProjection.cs b/MiniMapLibrary/Basic/MapProjection.cs
new file mode 100644
index 0000000..2e9745f
--- /dev/null
+++ b/MiniMapLibrary/Basic/MapProjection.cs
@@ -0,0 +1,51 @@
+using System;
+using UnityEngine;
+
+namespace MiniMapLibrary
+{
+ public static class MapProjection
+ {
+ // Use one scale on both axes so bearings remain accurate on narrow stages.
+ public static float GetScale(Range3D bounds, Dimension2D size, float zoom, float worldRadius = 0f)
+ {
+ float width = Numeric.Clamp(size.Width, 1f, 4096f, 180f);
+ float height = Numeric.Clamp(size.Height, 1f, 4096f, 180f);
+ zoom = Numeric.Clamp(zoom, 0.1f, 20f, 1f);
+
+ if (Numeric.IsFinite(worldRadius) && worldRadius > 0f)
+ return Math.Min(width, height) * zoom / (2f * Math.Max(worldRadius, 1f));
+
+ float xSpan = Numeric.Clamp(bounds?.X.Difference ?? 0f, 100f, 1000000f, 100f);
+ float zSpan = Numeric.Clamp(bounds?.Z.Difference ?? 0f, 100f, 1000000f, 100f);
+ return Math.Min(width / xSpan, height / zSpan) * zoom;
+ }
+
+ public static Vector2 ProjectOffset(Vector3 position, Vector3 origin, float scale)
+ {
+ return new Vector2((position.x - origin.x) * scale, (position.z - origin.z) * scale);
+ }
+
+ public static bool TryProject(Vector3 position, Vector3 origin, float scale, float sine, float cosine, out Vector2 result)
+ {
+ result = Vector2.zero;
+ if (!Numeric.IsFinite(position.x) || !Numeric.IsFinite(position.y) || !Numeric.IsFinite(position.z)
+ || !Numeric.IsFinite(origin.x) || !Numeric.IsFinite(origin.y) || !Numeric.IsFinite(origin.z)
+ || !Numeric.IsFinite(scale) || scale <= 0f || !Numeric.IsFinite(sine) || !Numeric.IsFinite(cosine))
+ return false;
+ result = Rotate(ProjectOffset(position, origin, scale), sine, cosine);
+ return Numeric.IsFinite(result.x) && Numeric.IsFinite(result.y);
+ }
+
+ public static bool IsInside(Vector2 position, float sine, float cosine, float halfWidth, float halfHeight, float padding)
+ {
+ return IsInside(Rotate(position, sine, cosine), halfWidth, halfHeight, padding);
+ }
+
+ public static Vector2 Rotate(Vector2 position, float sine, float cosine) => new(
+ position.x * cosine - position.y * sine, position.x * sine + position.y * cosine);
+
+ public static bool IsInside(Vector2 position, float halfWidth, float halfHeight, float padding) =>
+ Numeric.IsFinite(position.x) && Numeric.IsFinite(position.y)
+ && Math.Abs(position.x) <= halfWidth + padding && Math.Abs(position.y) <= halfHeight + padding;
+ }
+}
diff --git a/MiniMapLibrary/Basic/Numeric.cs b/MiniMapLibrary/Basic/Numeric.cs
new file mode 100644
index 0000000..3af5d8a
--- /dev/null
+++ b/MiniMapLibrary/Basic/Numeric.cs
@@ -0,0 +1,14 @@
+using System;
+
+namespace MiniMapLibrary
+{
+ public static class Numeric
+ {
+ public static bool IsFinite(float value) => !float.IsNaN(value) && !float.IsInfinity(value);
+
+ public static float Clamp(float value, float minimum, float maximum, float fallback)
+ {
+ return IsFinite(value) ? Math.Max(minimum, Math.Min(maximum, value)) : fallback;
+ }
+ }
+}
diff --git a/MiniMapLibrary/Basic/Range.cs b/MiniMapLibrary/Basic/Range.cs
index 9f61a93..d60bc19 100644
--- a/MiniMapLibrary/Basic/Range.cs
+++ b/MiniMapLibrary/Basic/Range.cs
@@ -1,43 +1,29 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace MiniMapLibrary
{
public class Range1D
{
- public float Min { get; set; }
-
- public float Max { get; set; }
+ public float Min { get; set; } = float.PositiveInfinity;
+ public float Max { get; set; } = float.NegativeInfinity;
- ///
- /// Equivalent to -
- ///
- public float Difference => Max - Min;
-
- ///
- /// Equivalent to -(neg)
- ///
- public float Offset => -Min;
+ public bool IsValid => Numeric.IsFinite(Min) && Numeric.IsFinite(Max) && Min <= Max;
+ public float Difference => IsValid ? Max - Min : 0f;
+ public float Offset => IsValid ? -Min : 0f;
public void CheckValue(float value)
{
+ if (!Numeric.IsFinite(value))
+ return;
+
if (value < Min)
- {
Min = value;
- return;
- }
if (value > Max)
- {
Max = value;
- return;
- }
}
public void Clear()
{
- Min = float.MaxValue;
- Max = float.MinValue;
+ Min = float.PositiveInfinity;
+ Max = float.NegativeInfinity;
}
}
}
diff --git a/MiniMapLibrary/Basic/Range3D.cs b/MiniMapLibrary/Basic/Range3D.cs
index 6be178f..15ee703 100644
--- a/MiniMapLibrary/Basic/Range3D.cs
+++ b/MiniMapLibrary/Basic/Range3D.cs
@@ -1,22 +1,17 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
using UnityEngine;
namespace MiniMapLibrary
{
public class Range3D
{
- public Range1D X { get; set; } = new Range1D();
-
- public Range1D Y { get; set; } = new Range1D();
-
- public Range1D Z { get; set; } = new Range1D();
+ public Range1D X { get; set; } = new();
+ public Range1D Y { get; set; } = new();
+ public Range1D Z { get; set; } = new();
public void CheckValue(Vector3 position)
{
X.CheckValue(position.x);
- //Y.CheckValue(position.y);
+ Y.CheckValue(position.y);
Z.CheckValue(position.z);
}
diff --git a/MiniMapLibrary/Basic/Timer.cs b/MiniMapLibrary/Basic/Timer.cs
index 2c5df6c..7c53173 100644
--- a/MiniMapLibrary/Basic/Timer.cs
+++ b/MiniMapLibrary/Basic/Timer.cs
@@ -1,46 +1,51 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
+using System;
#nullable enable
namespace MiniMapLibrary
{
public class Timer
{
- public float Duration { get; private set; } = 1.0f;
+ public float Duration { get; }
public float Value { get; set; }
public event Action