From 7cf0935fd24141cfab72831f6ce5330584890303 Mon Sep 17 00:00:00 2001 From: Yurihaia <17830663+Yurihaia@users.noreply.github.com> Date: Tue, 2 Mar 2021 00:12:04 -0500 Subject: [PATCH] Update README and make PB get cleared automatically when triggers change --- README.md | 20 +++++++++++++++----- src/TargetManager.cs | 4 ++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 99a4f9e..a91c5a2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # HKTimer Hollow Knight in-game timer mod -## Keybinds -The keybinds can be edited in the `hktimer.json` in the same directory as your save files. They follow -the unity keybind naming system. +## Settings +The keybinds and various other settings can be edited in the `hktimer.json` in the same directory as your save files. They follow the unity keybind naming system. the defaults are ```json { @@ -13,14 +12,25 @@ the defaults are "set_start": "[7]", "set_end": "[8]", "load_triggers": "[9]", - "save_triggers": "[6]" + "save_triggers": "[6]", + "timerAnchorX": 0.15, + "timerAnchorY": 0.1 } ``` +### timerAchorX/Y +The settings `timerAnchorX` and `timerAnchorY` can be used to change the position of the timer text. +The point specified should be the lower right corner of the text probably idk test it for yourself. +Values are % of the screen I think. ## Triggers -Current, you are able to place a start and an end trigger that can start and pause the timer respectively. +Currently, you are able to place a start and an end trigger that can start and pause the timer respectively. They are marked by a green (start) or red (end) square floating in the air. Saving them (default keybind `num6`) creates a file `hktimer_triggers.json` in your save folder that contains the positions. You can copy this file to save different trigger presets. Loading the file (default keybind `num9`) will read that same file. This is done automatically on game start as well +### Personal Best Display +The timer also shows a personal best that is tied to a set of waypoints. +These are saved in `hktimer_triggers.json` and measured in microseconds (1000 per millisecond). +The PB is loaded when you load the triggers, so if you need to edit/reset it just edit the file. +The PB will be wiped when you change the trigger positioning, and has to be saved using the save triggers button. \ No newline at end of file diff --git a/src/TargetManager.cs b/src/TargetManager.cs index 4265529..0993274 100644 --- a/src/TargetManager.cs +++ b/src/TargetManager.cs @@ -120,6 +120,8 @@ public void Update() x = HeroController.instance.transform.position.x, y = HeroController.instance.transform.position.y, }; + this.pb = TimeSpan.Zero; + this.pbDisplay.text = this.PbText(); } if (Input.GetKeyDown(HKTimer.instance.settings.set_end)) { @@ -130,6 +132,8 @@ public void Update() x = HeroController.instance.transform.position.x, y = HeroController.instance.transform.position.y, }; + this.pb = TimeSpan.Zero; + this.pbDisplay.text = this.PbText(); } if (Input.GetKeyDown(HKTimer.instance.settings.load_triggers)) {