Skip to content

Commit dd8a09d

Browse files
Updated for game version 2.3.3k, added compatibility with More Party Slots
1 parent c98ea42 commit dd8a09d

File tree

4 files changed

+63
-16
lines changed

4 files changed

+63
-16
lines changed

AutoMount/Info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"Id": "AutoMount",
33
"DisplayName": "Auto Mount for TabletopTweaks",
44
"Author": "Zepheon, DarthParametric",
5-
"Version": "1.1.0",
5+
"Version": "1.1.1",
66
"ManagerVersion": "0.27.14",
77
"Requirements": [ "TabletopTweaks-Core-0.7.6", "TabletopTweaks-Base-2.6.7", "ModMenu-1.3.2" ],
8-
"LoadAfter": [ "MewsiferConsole.Mod", "TabletopTweaks-Core", "TabletopTweaks-Base" ],
8+
"LoadAfter": [ "MewsiferConsole.Mod", "TabletopTweaks-Core", "TabletopTweaks-Base", "MorePartySlots" ],
99
"AssemblyName": "AutoMount.dll",
1010
"EntryMethod": "AutoMount.Main.Load",
1111
"Repository": "https://raw.githubusercontent.com/DarthParametric/AutoMount_for_TabletopTweaks/master/AutoMount/Repository.json",

AutoMount/Repository.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Releases": [
33
{
44
"Id": "AutoMount",
5-
"Version": "1.1.0"
5+
"Version": "1.1.1"
66
}
77
]
88
}

AutoMount/Settings.cs

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,14 @@ public static void Init()
115115

116116
/* Whitelist */
117117
var whitelist = settings.AddSubHeader(GetString(Whitelist, "Character Whitelist"), true);
118-
119-
for (int i = 0; i < 6; i++)
118+
int slotCount = 6;
119+
120+
if (GetMPSSlots() != null)
121+
{
122+
slotCount = Convert.ToInt32(GetMPSSlots());
123+
}
124+
125+
for (int i = 0; i < slotCount; i++)
120126
{
121127
whitelist.AddToggle(
122128
Toggle.New(
@@ -169,6 +175,47 @@ private static LocalizedString GetString(string partialKey, string text)
169175
{
170176
return Helpers.CreateString(GetKey(partialKey), text);
171177
}
178+
179+
// Checks for the presence of xADDBx's "More Party Slots" mod and returns its config value, kindly supplied by microsoftenator2022
180+
public static int? GetMPSSlots()
181+
{
182+
int? mpsSlots = null;
183+
184+
if (UnityModManager.FindMod("MorePartySlots") is { } morePartySlots && morePartySlots.Active)
185+
{
186+
Main.Logger.Log($"Found {morePartySlots.Info.DisplayName} v{morePartySlots.Info.Version}");
187+
188+
var mpsSettingsType = morePartySlots.Assembly.GetType("MorePartySlots.Settings");
189+
190+
if (mpsSettingsType is null)
191+
{
192+
Main.Logger.Error("Could not get MorePartySlots settings type");
193+
194+
return null;
195+
}
196+
197+
Main.Logger.Log($"Settings type: {mpsSettingsType.FullName}");
198+
199+
var mpsSlotsField = mpsSettingsType.GetField("Slots");
200+
201+
if (mpsSlotsField is null)
202+
{
203+
Main.Logger.Error("Could not get slots count field");
204+
return null;
205+
}
206+
207+
var mpsSettings =
208+
typeof(UnityModManager.ModSettings)
209+
.GetMethods()
210+
.First(mi => mi.Name == nameof(UnityModManager.ModSettings.Load) && mi.GetParameters().Length == 1)
211+
.MakeGenericMethod([mpsSettingsType])
212+
.Invoke(null, [morePartySlots]);
213+
214+
mpsSlots = (int)mpsSlotsField.GetValue(mpsSettings);
215+
}
216+
217+
return mpsSlots;
218+
}
172219
}
173220

174221
[HarmonyPatch(typeof(BlueprintsCache))]

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
Mount all your animal companions automatically with a customizable keybind. Adapted for compatibility with TabletopTweaks and its Undersized Mount feat, allowing a rider to mount a pet of the same size class (e.g. human riding a level 1 wolf).
44

55
# Install
6-
1. Download latest release from [here](https://github.com/DarthParametric/AutoMount_for_TabletopTweaks/releases/latest).
7-
1. Download ModMenu for prettier mod menu [here](https://github.com/WittleWolfie/ModMenu/releases/latest).
8-
1. Download TabletopTweaks-Core [here](https://github.com/Vek17/TabletopTweaks-Core/releases/latest).
9-
1. Download TabletopTweaks-Base [here](https://github.com/Vek17/TabletopTweaks-Base/releases/latest).
106
1. Download and install [Unity Mod Manager](https://www.nexusmods.com/site/mods/21).
11-
* You can also use ModFinder. Download it from [here](https://github.com/Pathfinder-WOTR-Modding-Community/ModFinder/releases/latest).
12-
1. Drag mod zips into Unity Mod Manager (or ModFinder).
7+
* You can also use ModFinder. Download it [here](https://github.com/Pathfinder-WOTR-Modding-Community/ModFinder/releases/latest).
8+
1. Download ModMenu [here](https://github.com/WittleWolfie/ModMenu/releases/latest) for a prettier in-game mod settings menu.
9+
1. Download [AutoMount for TabletopTweaks](https://github.com/DarthParametric/AutoMount_for_TabletopTweaks/releases/latest).
10+
1. Download [TabletopTweaks-Core](https://github.com/Vek17/TabletopTweaks-Core/releases/latest).
11+
1. Download [TabletopTweaks-Base](https://github.com/Vek17/TabletopTweaks-Base/releases/latest).
12+
1. Drag the mod zips into Unity Mod Manager (or ModFinder).
1313
1. Run your game.
1414

1515
# Features
1616
- Allows mount/dismount with a customizable keybind.
1717
- Mount: **Ctrl+Shift+A** (default).
1818
- Dismount: **Ctrl+Shift+D** (default).
19-
- Auto mount when entering area (toggleable).
20-
- Whitelist/blacklist party members mounting by party slot position (default is all enabled).
19+
- Auto mount when entering an area (toggleable).
20+
- Whitelist/blacklist party members mounting by party slot position (default is all enabled). Includes provision for larger parties via the [More Party Slots](https://www.nexusmods.com/pathfinderwrathoftherighteous/mods/694/) mod, if installed.
2121

2222
# Notes
23-
- You can make the mount/dismount toggleable by assigning the same keybind to both functions.
24-
- Even though you can technically mount/dismount anywhere anytime (as long as the game allows it) it **will** consume your move action if you perform it while in combat.
25-
- On mounting, riders will teleport to their respective mounts. I don't intend to implement any movement animation for the time being.
23+
- Even though you can technically mount/dismount anywhere, any time (as long as the game allows it) it **will** consume your move action if you perform it while in combat.
24+
- On mounting, riders will teleport directly to their respective mounts.
2625
- If using the ToyBox cheat to autorest at the end of combat, you will be dismounted. No plans to change this.
26+
- Enabling auto mount when entering an area may cause issues in certain cutscenes (e.g. Arueshalae dream sequences), but the dismount hotkey should work in these cases.
2727

0 commit comments

Comments
 (0)