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
22 changes: 11 additions & 11 deletions MiniMapLibrary/Interactible/InteractableKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ namespace MiniMapLibrary
public enum InteractableKind
{
none = 0,
Primary = 1 << 0,
Chest = 1 << 1,
Utility = 1 << 2,
Teleporter = 1 << 3,
Shrine = 1 << 4,
Special = 1 << 5,
Player = 1 << 6,
Drone = 1 << 7,
Barrel = 1 << 8,
Enemy = 1 << 9,
Printer = 1 << 10,
Chest = 1 << 0,
Utility = 1 << 1,
Teleporter = 1 << 2,
Shrine = 1 << 3,
Special = 1 << 4,
Player = 1 << 5,
Drone = 1 << 6,
Barrel = 1 << 7,
Enemy = 1 << 8,
Printer = 1 << 9,
LunarPod = 1 << 10,
All = 0b_1111_11
}
}
6 changes: 3 additions & 3 deletions MiniMapLibrary/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static Settings()

private static void InitializeDefaultSettings()
{
void AddSize(InteractableKind type, float width = -1, float height = -1, Color ActiveColor = default, Color InactiveColor = default)
static void AddSize(InteractableKind type, float width = -1, float height = -1, Color ActiveColor = default, Color InactiveColor = default)
{
ActiveColor = ActiveColor == default ? DefaultActiveColor : ActiveColor;
InactiveColor = InactiveColor == default ? DefaultInactiveColor : InactiveColor;
Expand Down Expand Up @@ -58,11 +58,11 @@ void AddSize(InteractableKind type, float width = -1, float height = -1, Color A
AddSize(InteractableKind.Player, 8, 8, ActiveColor: PlayerIconColor, InactiveColor: PlayerIconColor);
AddSize(InteractableKind.Barrel, 5, 5);
AddSize(InteractableKind.Drone, 7, 7);
AddSize(InteractableKind.Primary);
AddSize(InteractableKind.Special, 7, 7);
AddSize(InteractableKind.Enemy, 3, 3, ActiveColor: Color.red);
AddSize(InteractableKind.Utility);
AddSize(InteractableKind.Printer, 10, 10);
AddSize(InteractableKind.Printer, 10, 8);
AddSize(InteractableKind.LunarPod, 7, 7);
}

public static InteractibleSetting GetSetting(InteractableKind type)
Expand Down
2 changes: 1 addition & 1 deletion MiniMapLibrary/SpriteManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static void Add(InteractableKind type, string ResourcePath)
s_ResourceDictionary.Add(type, ResourcePath);
}

Add(InteractableKind.Primary, DefaultResourcePath);
Add(InteractableKind.Shrine, "Textures/MiscIcons/texShrineIconOutlined");
Add(InteractableKind.Special, DefaultResourcePath);
Add(InteractableKind.Teleporter, "Textures/MiscIcons/texTeleporterIconOutlined");
Expand All @@ -39,6 +38,7 @@ static void Add(InteractableKind type, string ResourcePath)
Add(InteractableKind.Enemy, "Textures/MiscIcons/texBarrelIcon");
Add(InteractableKind.Player, "Textures/MiscIcons/texBarrelIcon");
Add(InteractableKind.Printer, "Textures/MiscIcons/texInventoryIconOutlined");
Add(InteractableKind.LunarPod, "Textures/MiscIcons/texLootIconOutlined");
Add(InteractableKind.All, DefaultResourcePath);
}

Expand Down
26 changes: 22 additions & 4 deletions MiniMapMod/MiniMapPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace MiniMapMod
{
[BepInPlugin("MiniMap", "Mini Map Mod", "3.1.0")]
[BepInPlugin("MiniMap", "Mini Map Mod", "3.1.1")]
public class MiniMapPlugin : BaseUnityPlugin
{
private readonly ISpriteManager SpriteManager = new SpriteManager();
Expand All @@ -26,18 +26,32 @@ public class MiniMapPlugin : BaseUnityPlugin

private readonly Dictionary<InteractableKind, ConfigEntry<bool>> ScanOptions = new();

private readonly Dictionary<InteractableKind, string> InteractibleKindDescriptions = new();

public void Awake()
{
Log.Init(Logger);

InteractibleKindDescriptions.Add(InteractableKind.Chest, "Chests, including shops");
InteractibleKindDescriptions.Add(InteractableKind.Utility, "Scrappers");
InteractibleKindDescriptions.Add(InteractableKind.Teleporter, "Boss teleporter");
InteractibleKindDescriptions.Add(InteractableKind.Shrine, "All shrines (excluding Newt)");
InteractibleKindDescriptions.Add(InteractableKind.Special, "Special interactibles such as the landing pod");
InteractibleKindDescriptions.Add(InteractableKind.Player, "Players");
InteractibleKindDescriptions.Add(InteractableKind.Drone, "Drones");
InteractibleKindDescriptions.Add(InteractableKind.Barrel, "Barrels");
InteractibleKindDescriptions.Add(InteractableKind.Enemy, "Enemies");
InteractibleKindDescriptions.Add(InteractableKind.Printer, "Printers");
InteractibleKindDescriptions.Add(InteractableKind.LunarPod, "Lunar pods (chests)");

// bind options
InteractableKind[] kinds = Enum.GetValues(typeof(InteractableKind)).Cast<InteractableKind>().ToArray();
InteractableKind[] kinds = Enum.GetValues(typeof(InteractableKind)).Cast<InteractableKind>().Where(x=>x != InteractableKind.none && x != InteractableKind.All).ToArray();

for (int i = 0; i < kinds.Length; i++)
{
InteractableKind kind = kinds[i];

ScanOptions.Add(kind, Config.Bind<bool>($"Icon.{kind}", "enabled", true, $"Whether or or {kind} should be shown on the minimap"));
ScanOptions.Add(kind, Config.Bind<bool>($"Icon.{kind}", "enabled", true, $"Whether or {InteractibleKindDescriptions[kind]} should be shown on the minimap."));

ConfigEntry<Color> activeColor = Config.Bind<Color>($"Icon.{kind}", "activeColor", Settings.GetColor(kind, true), "The color the icon should be when it has not been interacted with");
ConfigEntry<Color> inactiveColor = Config.Bind<Color>($"Icon.{kind}", "inactiveColor", Settings.GetColor(kind, false), "The color the icon should be when it has used/bought");
Expand Down Expand Up @@ -187,7 +201,11 @@ private void ScanStaticTypes()
return;
}

RegisterMonobehaviorType<ChestBehavior>(InteractableKind.Chest, dynamicObject: false);
RegisterMonobehaviorType<ChestBehavior>(InteractableKind.Chest, dynamicObject: false, selector: chest => chest.GetComponent<PurchaseInteraction>().contextToken != "LUNAR_CHEST_CONTEXT");

RegisterMonobehaviorType<ChestBehavior>(InteractableKind.LunarPod, dynamicObject: false, selector: chest => chest.GetComponent<PurchaseInteraction>().contextToken == "LUNAR_CHEST_CONTEXT");

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

RegisterMonobehaviorType<ShrineBloodBehavior>(InteractableKind.Shrine, dynamicObject: false);

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ None - Final Release
### If you like my Mod please consider donating to the Autism Research Institute
https://www.autism.org/donate-autism-research-institute/

### If you REALLY like my code I am looking for work
Contact me for my resume

### Bug Reports
If you have an issue, discover a bug, or have a recommendation please file an issue on my github page.

### Change Log
Minor 3.1.1
- fixed adapative chests not appearing on minimap(hopefully)
- added descriptions to the config sections
- removed Icon.None and Icon.Primary sections from config
- added seperate lunar pod icons and config section

Major 3.1
- Added config toggle to enable or disable each individual icon
- Added config option to choose color for each individual icon
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MiniMapMod",
"version_number": "3.1",
"version_number": "3.1.1",
"website_url": "https://github.com/DekuDesu",
"description": "Adds a MiniMap to your game v3.1",
"dependencies": [
Expand Down