Skip to content

Commit 2bac2fc

Browse files
authored
Merge pull request #25 from DekuDesu/development
added lunar pod icon, removed useless config options, fixed adaptive …
2 parents 9abb69f + 2b15760 commit 2bac2fc

File tree

6 files changed

+47
-20
lines changed

6 files changed

+47
-20
lines changed

MiniMapLibrary/Interactible/InteractableKind.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ namespace MiniMapLibrary
99
public enum InteractableKind
1010
{
1111
none = 0,
12-
Primary = 1 << 0,
13-
Chest = 1 << 1,
14-
Utility = 1 << 2,
15-
Teleporter = 1 << 3,
16-
Shrine = 1 << 4,
17-
Special = 1 << 5,
18-
Player = 1 << 6,
19-
Drone = 1 << 7,
20-
Barrel = 1 << 8,
21-
Enemy = 1 << 9,
22-
Printer = 1 << 10,
12+
Chest = 1 << 0,
13+
Utility = 1 << 1,
14+
Teleporter = 1 << 2,
15+
Shrine = 1 << 3,
16+
Special = 1 << 4,
17+
Player = 1 << 5,
18+
Drone = 1 << 6,
19+
Barrel = 1 << 7,
20+
Enemy = 1 << 8,
21+
Printer = 1 << 9,
22+
LunarPod = 1 << 10,
2323
All = 0b_1111_11
2424
}
2525
}

MiniMapLibrary/Settings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static Settings()
3030

3131
private static void InitializeDefaultSettings()
3232
{
33-
void AddSize(InteractableKind type, float width = -1, float height = -1, Color ActiveColor = default, Color InactiveColor = default)
33+
static void AddSize(InteractableKind type, float width = -1, float height = -1, Color ActiveColor = default, Color InactiveColor = default)
3434
{
3535
ActiveColor = ActiveColor == default ? DefaultActiveColor : ActiveColor;
3636
InactiveColor = InactiveColor == default ? DefaultInactiveColor : InactiveColor;
@@ -58,11 +58,11 @@ void AddSize(InteractableKind type, float width = -1, float height = -1, Color A
5858
AddSize(InteractableKind.Player, 8, 8, ActiveColor: PlayerIconColor, InactiveColor: PlayerIconColor);
5959
AddSize(InteractableKind.Barrel, 5, 5);
6060
AddSize(InteractableKind.Drone, 7, 7);
61-
AddSize(InteractableKind.Primary);
6261
AddSize(InteractableKind.Special, 7, 7);
6362
AddSize(InteractableKind.Enemy, 3, 3, ActiveColor: Color.red);
6463
AddSize(InteractableKind.Utility);
65-
AddSize(InteractableKind.Printer, 10, 10);
64+
AddSize(InteractableKind.Printer, 10, 8);
65+
AddSize(InteractableKind.LunarPod, 7, 7);
6666
}
6767

6868
public static InteractibleSetting GetSetting(InteractableKind type)

MiniMapLibrary/SpriteManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ static void Add(InteractableKind type, string ResourcePath)
2828
s_ResourceDictionary.Add(type, ResourcePath);
2929
}
3030

31-
Add(InteractableKind.Primary, DefaultResourcePath);
3231
Add(InteractableKind.Shrine, "Textures/MiscIcons/texShrineIconOutlined");
3332
Add(InteractableKind.Special, DefaultResourcePath);
3433
Add(InteractableKind.Teleporter, "Textures/MiscIcons/texTeleporterIconOutlined");
@@ -39,6 +38,7 @@ static void Add(InteractableKind type, string ResourcePath)
3938
Add(InteractableKind.Enemy, "Textures/MiscIcons/texBarrelIcon");
4039
Add(InteractableKind.Player, "Textures/MiscIcons/texBarrelIcon");
4140
Add(InteractableKind.Printer, "Textures/MiscIcons/texInventoryIconOutlined");
41+
Add(InteractableKind.LunarPod, "Textures/MiscIcons/texLootIconOutlined");
4242
Add(InteractableKind.All, DefaultResourcePath);
4343
}
4444

MiniMapMod/MiniMapPlugin.cs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace MiniMapMod
1111
{
12-
[BepInPlugin("MiniMap", "Mini Map Mod", "3.1.0")]
12+
[BepInPlugin("MiniMap", "Mini Map Mod", "3.1.1")]
1313
public class MiniMapPlugin : BaseUnityPlugin
1414
{
1515
private readonly ISpriteManager SpriteManager = new SpriteManager();
@@ -26,18 +26,32 @@ public class MiniMapPlugin : BaseUnityPlugin
2626

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

29+
private readonly Dictionary<InteractableKind, string> InteractibleKindDescriptions = new();
30+
2931
public void Awake()
3032
{
3133
Log.Init(Logger);
3234

35+
InteractibleKindDescriptions.Add(InteractableKind.Chest, "Chests, including shops");
36+
InteractibleKindDescriptions.Add(InteractableKind.Utility, "Scrappers");
37+
InteractibleKindDescriptions.Add(InteractableKind.Teleporter, "Boss teleporter");
38+
InteractibleKindDescriptions.Add(InteractableKind.Shrine, "All shrines (excluding Newt)");
39+
InteractibleKindDescriptions.Add(InteractableKind.Special, "Special interactibles such as the landing pod");
40+
InteractibleKindDescriptions.Add(InteractableKind.Player, "Players");
41+
InteractibleKindDescriptions.Add(InteractableKind.Drone, "Drones");
42+
InteractibleKindDescriptions.Add(InteractableKind.Barrel, "Barrels");
43+
InteractibleKindDescriptions.Add(InteractableKind.Enemy, "Enemies");
44+
InteractibleKindDescriptions.Add(InteractableKind.Printer, "Printers");
45+
InteractibleKindDescriptions.Add(InteractableKind.LunarPod, "Lunar pods (chests)");
46+
3347
// bind options
34-
InteractableKind[] kinds = Enum.GetValues(typeof(InteractableKind)).Cast<InteractableKind>().ToArray();
48+
InteractableKind[] kinds = Enum.GetValues(typeof(InteractableKind)).Cast<InteractableKind>().Where(x=>x != InteractableKind.none && x != InteractableKind.All).ToArray();
3549

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

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

4256
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");
4357
ConfigEntry<Color> inactiveColor = Config.Bind<Color>($"Icon.{kind}", "inactiveColor", Settings.GetColor(kind, false), "The color the icon should be when it has used/bought");
@@ -187,7 +201,11 @@ private void ScanStaticTypes()
187201
return;
188202
}
189203

190-
RegisterMonobehaviorType<ChestBehavior>(InteractableKind.Chest, dynamicObject: false);
204+
RegisterMonobehaviorType<ChestBehavior>(InteractableKind.Chest, dynamicObject: false, selector: chest => chest.GetComponent<PurchaseInteraction>().contextToken != "LUNAR_CHEST_CONTEXT");
205+
206+
RegisterMonobehaviorType<ChestBehavior>(InteractableKind.LunarPod, dynamicObject: false, selector: chest => chest.GetComponent<PurchaseInteraction>().contextToken == "LUNAR_CHEST_CONTEXT");
207+
208+
RegisterMonobehaviorType<RouletteChestController>(InteractableKind.Chest, dynamicObject: false);
191209

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

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,19 @@ None - Final Release
3939
### If you like my Mod please consider donating to the Autism Research Institute
4040
https://www.autism.org/donate-autism-research-institute/
4141

42+
### If you REALLY like my code I am looking for work
43+
Contact me for my resume
44+
4245
### Bug Reports
4346
If you have an issue, discover a bug, or have a recommendation please file an issue on my github page.
4447

4548
### Change Log
49+
Minor 3.1.1
50+
- fixed adapative chests not appearing on minimap(hopefully)
51+
- added descriptions to the config sections
52+
- removed Icon.None and Icon.Primary sections from config
53+
- added seperate lunar pod icons and config section
54+
4655
Major 3.1
4756
- Added config toggle to enable or disable each individual icon
4857
- Added config option to choose color for each individual icon

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.1",
3+
"version_number": "3.1.1",
44
"website_url": "https://github.com/DekuDesu",
55
"description": "Adds a MiniMap to your game v3.1",
66
"dependencies": [

0 commit comments

Comments
 (0)