generated from Distance-Modding/Template.CSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Option to make compass constantly active - Option to make headlights on by default
- Loading branch information
Showing
8 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
Distance.LittleThings/Harmony/Assembly-CSharp/CarScreenLogic/OnEventGo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using HarmonyLib; | ||
|
||
namespace Distance.LittleThings.Harmony | ||
{ | ||
[HarmonyPatch(typeof(CarScreenLogic), "OnEventGo")] | ||
internal class CarScreenLogic__OnEventGo | ||
{ | ||
[HarmonyPrefix] | ||
internal static bool DisablePlacementText(CarScreenLogic __instance) | ||
{ | ||
if (Mod.Instance.Config.ActiveCompass) | ||
{ | ||
//Literally just skip the method if active compass is on | ||
__instance.ModeWidgetVisible_ = true; | ||
return false; | ||
} | ||
else | ||
return true; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Distance.LittleThings/Harmony/Assembly-CSharp/CarScreenLogic/UpdateBeforeRender.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using HarmonyLib; | ||
|
||
namespace Distance.LittleThings.Harmony | ||
{ | ||
[HarmonyPatch(typeof(CarScreenLogic), "UpdateBeforeRender")] | ||
internal class CarScreenLogic__UpdateBeforeRender | ||
{ | ||
[HarmonyPostfix] | ||
internal static void KeepCompassActive(CarScreenLogic __instance) | ||
{ | ||
if(Mod.Instance.Config.ActiveCompass) | ||
{ | ||
__instance.SetCurrentModeVisual(__instance.compass_); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Distance.LittleThings/Harmony/Assembly-CSharp/LocalPlayerControlledCar/Start.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using HarmonyLib; | ||
|
||
namespace Distance.LittleThings.Harmony | ||
{ | ||
[HarmonyPatch(typeof(LocalPlayerControlledCar), "Start")] | ||
internal class LocalPlayerControlledCar__Start | ||
{ | ||
[HarmonyPostfix] | ||
internal static void HeadlightsCheck(LocalPlayerControlledCar __instance) | ||
{ | ||
if (Mod.Instance.Config.EnableHeadLights) | ||
{ | ||
//Hardcoded cause I'm cringe. Didn't feel like building menu values to manipulate | ||
__instance.carLogic_.carVisuals_.SetHeadlightsValues(1f, 100f, 150f, .5f, false); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters