Skip to content

Commit

Permalink
Add stroke counter
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMathGeek314 committed Aug 25, 2024
1 parent 8a94a1b commit 76f5d70
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions MilliGolf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class MilliGolf: Mod, ILocalSettings<LocalGolfSettings> {
public static PlayMakerFSM areaTitleRef;

new public string GetName() => "MilliGolf";
public override string GetVersion() => "1.1.0.1";
public override string GetVersion() => "1.1.1.0";

public static LocalGolfSettings golfData { get; set; } = new();
public void OnLoadLocal(LocalGolfSettings g) => golfData = g;
Expand Down Expand Up @@ -228,6 +228,8 @@ private void lateSceneChange(On.GameManager.orig_OnNextLevelReady orig, GameMana
wasInCustomRoom = true;
if(golfScene.courseList.Contains(self.sceneName)) {
isInGolfRoom = true;
currentScore = 0;
GameCameras.instance.geoCounter.geoTextMesh.text = currentScore.ToString();
HeroController.instance.gameObject.FindGameObjectInChildren("Vignette").SetActive(false);
currentHoleTarget = golfScene.courseDict[self.sceneName].holeTarget;
if(golfScene.courseDict[self.sceneName].millibelleSpawn != null) {
Expand Down Expand Up @@ -321,7 +323,6 @@ private void lateSceneChange(On.GameManager.orig_OnNextLevelReady orig, GameMana
}
}
doCustomLoad = false;
currentScore = 0;
}

public static void createCourseData() {
Expand Down Expand Up @@ -958,6 +959,7 @@ public override void OnEnter() {
MilliGolf.tinkDamager = damager;
if(new List<string> { "Slash", "AltSlash", "UpSlash", "DownSlash", "Great Slash", "Dash Slash", "Hit L", "Hit R" }.Contains(damager)) {
MilliGolf.currentScore++;
GameCameras.instance.geoCounter.geoTextMesh.text = MilliGolf.currentScore.ToString();
}
}
Finish();
Expand Down Expand Up @@ -1210,6 +1212,7 @@ public override void OnEnter() {
MilliGolf.millibelleRef.SetActive(true);
MilliGolf.millibelleRef.GetComponent<MeshRenderer>().sortingOrder = 1;
MilliGolf.currentScore = 0;
GameCameras.instance.geoCounter.geoTextMesh.text = MilliGolf.currentScore.ToString();
if(MilliGolf.ballCam == 1) {
typeof(CameraTarget).GetField("heroTransform", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(GameCameras.instance.cameraTarget, MilliGolf.millibelleRef.transform);
}
Expand Down

0 comments on commit 76f5d70

Please sign in to comment.