UBOAT
45 ratings
Dynamic Distance Labels
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
896.521 KB
11 Jan @ 7:07am
30 Jan @ 10:54pm
7 Change Notes ( view )

Subscribe to download
Dynamic Distance Labels

Description
Dynamic switching between nautical and metric on the press of a button and additional decimal points for increased accuracy!

Hold down the ALT key to switch between both unit systems. Placed lines will retain their label!

It also adds additional decimal places where appropriate:
  • Nautical miles will be shown with one decimal place for distances below 20 nmi.
  • Cables now also have an additional decimal place.
  • Kilometers will be shown with two decimal places for distances below 5 km.
  • Distances below 20 km will be shown with one decimal place.
  • Below 1 km, distances are shown in meters.

Since it's just a simple string replacement, no new save is required.


Please leave a comment if you have suggestions, or you're unhappy with something!
11 Comments
JazzMano 29 Apr @ 4:25pm 
I went to Steam\steamapps\workshop\content\494840\3405289645\Source,
opened the file KilometersToPreferredUnitsPatch.cs,
and changed this line:

bool isAltPressed = Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt);

to this line:

bool isAltPressed = Input.GetKey(KeyCode.End);

Now I can use the End key instead of LeftAlt, works perfectly, thanks a lot !
Drexack  [author] 29 Apr @ 2:37pm 
Hey JazzMano. Thank you and I'm glad you like it. There is no easy way to change the keybind, apart from going into the script and changing it there yourself. To do that navigate to

<Steam Library path>\SteamApps\workshop\content\494840\3405289645\Source

where you'll find the C# scripts. I'm not 100% on what the file was called, but it should be something like "KilometersToPreferedUnitsPatcher.cs", but it could also be in the helper. Just look for "KeyCode.Alt" and change it to whatever Unity KeyCode [docs.unity3d.com] you want to use.

Feel free to report back if something is unclear. Though I can't really get much more specific until this Sunday, since I'm currently nowhere near my workstation. ;)
JazzMano 29 Apr @ 1:46pm 
Hi, great mod, is there a way to change the keybing ALT for something else ? I'm using autohotkey to do it but was wondering if there is another way (not a big deal)
Bart 'Nazibal' Smit 31 Mar @ 11:09pm 
omg yes
DECAFBAD 19 Feb @ 5:40pm 
A great mod, I love it.
Mikhail_Filitov 25 Jan @ 11:40pm 
Excellent QOL mod.
DARKNESS 16 Jan @ 6:14pm 
Nice job. :upvoted:
darthloup 15 Jan @ 11:31am 
I love this, thank you :)
Rockstar 13 Jan @ 1:12pm 
thank you for this mod! Boat speeds in Knots, ranges in km... blarf
Drexack  [author] 13 Jan @ 3:56am 
Hey walamejik, I made it so the default now depends on your settings. Thanks again for pointing that out.