Skip to content

Commit

Permalink
fixed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
CzBuCHi committed Jul 27, 2024
1 parent 2cc9b32 commit f93b309
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
internal static class CarInspectorPatches {

[HarmonyPostfix]
[HarmonyPatch(typeof(CarInspector), "Awake")]
public static void Awake(ref Window ____window) {
[HarmonyPatch(typeof(CarInspector), "Populate")]
public static void Populate(ref Window ____window) {
var windowAutoHeight = ____window.gameObject!.GetComponent<CarInspectorAutoHeightBehavior>()!;
windowAutoHeight.ExpandAlways(30);
windowAutoHeight.ExpandTab("equipment", 50);
windowAutoHeight.ExpandOrders(AutoEngineerMode.Road, 50);
windowAutoHeight.UpdateWindowHeight();
}

[HarmonyPostfix]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
internal static class CarInspectorPatches {

[HarmonyPostfix]
[HarmonyPatch(typeof(CarInspector), "Awake")]
public static void Awake(ref Window ____window) {
[HarmonyPatch(typeof(CarInspector), "Populate")]
public static void Populate(ref Window ____window) {
var windowAutoHeight = ____window.gameObject!.GetComponent<CarInspectorAutoHeightBehavior>()!;
windowAutoHeight.ExpandOrders(AutoEngineerMode.Road, 100);
windowAutoHeight.ExpandOrders(AutoEngineerMode.Yard, 50);
windowAutoHeight.UpdateWindowHeight();
}

[HarmonyPostfix]
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ This mod is useless on its own, but it is allowing other mods to extend car insp
internal static class CarInspectorPatches {
[HarmonyPostfix]
[HarmonyPatch(typeof(CarInspector), "Awake")]
public static void Awake(ref Window ____window) {
[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)
Expand All @@ -34,6 +34,9 @@ internal static class CarInspectorPatches {
// this will expand car inspector window by 100 units when Yard mode on orders tab is selected
windowAutoHeight.ExpandOrders(AutoEngineerMode.Yard, 100);
// update window height
windowAutoHeight.UpdateWindowHeight();
}
}
```
Expand Down

0 comments on commit f93b309

Please sign in to comment.