Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions MiniMapMod/MiniMapMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
<Private>false</Private>
</Reference>
<Reference Include="BepInEx">
<HintPath>libs\BepInEx.dll</HintPath>
<Private>false</Private>
<HintPath>libs\BepInEx.dll</HintPath>
</Reference>
<Reference Include="com.unity.multiplayer-hlapi.Runtime">
<HintPath>libs\com.unity.multiplayer-hlapi.Runtime.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Steamworks">
<HintPath>libs\Facepunch.Steamworks.dll</HintPath>
Expand Down Expand Up @@ -81,6 +83,9 @@
<HintPath>libs\Rewired_Windows_Lib.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="RoR2">
<HintPath>libs\RoR2.dll</HintPath>
</Reference>
<Reference Include="SimpleJSON">
<HintPath>libs\SimpleJSON.dll</HintPath>
<Private>false</Private>
Expand Down Expand Up @@ -181,6 +186,9 @@
<HintPath>libs\UnityEngine.IMGUIModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>libs\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>libs\UnityEngine.InputModule.dll</HintPath>
<Private>false</Private>
Expand Down
21 changes: 12 additions & 9 deletions MiniMapMod/MiniMapPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
using BepInEx;
using R2API;
using R2API.Utils;
using RoR2;
using UnityEngine;
using MiniMapLibrary;
using System.Collections.Generic;
using System.Linq;
using System;
using UnityEngine.UI;
using UnityEngine.Networking;

namespace MiniMapMod
{
[BepInPlugin("MiniMap", "Mini Map Mod", "2.0.4")]
[BepInPlugin("MiniMap", "Mini Map Mod", "3.0.0")]
public class MiniMapPlugin : BaseUnityPlugin
{
private readonly ISpriteManager SpriteManager = new SpriteManager();
Expand All @@ -31,19 +27,22 @@ public void Awake()
{
Log.Init(Logger);

Log.LogInfo("MINIMAP: Creating scene scan hooks");

GlobalEventManager.onCharacterDeathGlobal += (x) => ScanScene();
GlobalEventManager.OnInteractionsGlobal += (x, y, z) => ScanScene();
}

//The Update() method is run on every frame of the game.
private void Update()
{
if (Input.GetKeyDown(KeyCode.M))
if (UnityEngine.Input.GetKeyDown(KeyCode.M))
{
Enable = !Enable;

if (Enable == false)
{
Log.LogInfo("MINIMAP: Resetting minimap");
Reset();
return;
}
Expand Down Expand Up @@ -129,23 +128,25 @@ private bool TryCreateMinimap()

if (objectivePanel == null || this.SpriteManager == null)
{
Log.LogInfo("MINIMAP: ObjectivePanel was not found, cancelling creating minimap");
Minimap.Destroy();
return false;
}

Transform parentTransform = objectivePanel.transform.Find("StripContainer");
Transform parentTransform = objectivePanel.transform;//objectivePanel.transform.Find("StripContainer");

if (parentTransform == null)
{
Log.LogInfo("MINIMAP: Subcontainer on ObjectivePanel wasn't found, cancelling creating minimap");
Minimap.Destroy();
return false;
}

Log.LogInfo("Creating Minimap");
Log.LogInfo("MINIMAP: Creating Minimap object");

Minimap.CreateMinimap(this.SpriteManager, parentTransform.gameObject);

Log.LogInfo("Finished creating Minimap");
Log.LogInfo("MINIMAP: Finished creating Minimap");

return true;
}
Expand Down Expand Up @@ -174,6 +175,8 @@ private void ScanStaticTypes()
return;
}

Log.LogInfo("MINIMAP: Scanning scene for container/object changes");

RegisterMonobehaviorType<ChestBehavior>(InteractableKind.Chest, dynamicObject: false);

RegisterMonobehaviorType<ShrineBloodBehavior>(InteractableKind.Shrine, dynamicObject: false);
Expand Down
3 changes: 3 additions & 0 deletions MiniMapMod/Minimap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public void CreateMinimap(ISpriteManager spriteManager, GameObject Parent)

SetParent(gameObject, Parent);

// make sure it's the last thing within the objective box
gameObject.transform.SetAsFirstSibling();

CreateIconContainer();

CreatePlayerIcon(spriteManager);
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "MiniMapMod",
"version_number": "2.0.4",
"version_number": "3.0.0",
"website_url": "https://github.com/DekuDesu",
"description": "Adds a MiniMap to your game v2.0.4",
"description": "Adds a MiniMap to your game v3.0",
"dependencies": [
"bbepis-BepInExPack-5.4.9",
"RiskofThunder-HookGenPatcher-1.2.1"
Expand Down