Skip to content

Commit

Permalink
Update README and make PB get cleared automatically when triggers change
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurihaia committed Mar 2, 2021
1 parent 05383a3 commit 7cf0935
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -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.
4 changes: 4 additions & 0 deletions src/TargetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -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))
{
Expand Down

0 comments on commit 7cf0935

Please sign in to comment.