This mod is useless on its own, but it is allowing other mods to extend car inspector window height.
- Download
CarInspectorResizer-VERSION.zip
from the releases page - Install with Railloader
This mod is not compatible with any mod that modified CarInspector window height.
- Add reference to this mod (duh)
- Add this harmony patch to your mod:
[HarmonyPatch]
internal static class CarInspectorPatches {
[HarmonyPostfix]
[HarmonyPatch(typeof(CarInspector), "Populate")]
public static void Populate(ref Window ____window) {
var windowAutoHeight = ____window.gameObject!.GetComponent<CarInspectorAutoHeightBehavior>()!;
// car inspector window minimal height (330 is default value)
windowAutoHeight.MinHeight = 330;
// this will expand car inspector window 30 unit
windowAutoHeight.ExpandAlways(30);
// this will expand car inspector window by 75 units when equipment tab is selected
windowAutoHeight.ExpandTab("equipment", 75);
// this will expand car inspector window by 50 units when Road mode on orders tab is selected
windowAutoHeight.ExpandOrders(AutoEngineerMode.Road, 50);
}
}
Vanila game tab names are car
, equipment
, pass
, ops
and orders
. You need to use those in ExpandTab
method
You can look how CarInspectorResizer.Example#
project is constructed to have working example.
In order to get going with this, follow the following steps:
- Clone the repo
- Copy the
Paths.user.example
toPaths.user
, open the newPaths.user
and set the<GameDir>
to your game's directory. - Open the Solution
- You're ready!
Make sure you're using the Debug configuration. Every time you build your project, the files will be copied to your Mods folder and you can immediately start the game to test it.
Make sure you're using the Release configuration. The build pipeline will then automatically do a few things:
- Makes sure it's a proper release build without debug symbols
- Replaces
$(AssemblyVersion)
in theDefinition.json
with the actual assembly version. - Copies all build outputs into a zip file inside
bin
with a ready-to-extract structure inside, named like the project they belonged to and the version of it.