Skip to content

Commit

Permalink
Use yard calculations for meters
Browse files Browse the repository at this point in the history
Non-English locales use meters instead of yards for game units.
  • Loading branch information
Lombra committed Oct 19, 2024
1 parent 5700b39 commit 00d11d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ Displays your current or maximum movement speed in a small standalone frame or v
### **Usage**
- /speedy - Opens configuration window

Absolute units are based on the following assumptions:

- Base running speed is 7 yards per second.
- 1 yard = 0.9144 meters.
- 1 mile = 1760 yards.
Absolute units are based on the assumption that base running speed is 7 meters or yards per second. Meters and yards are used interchangibly across different locales, and so are treated as the same distance for purposes of the calculations in this addon.
6 changes: 3 additions & 3 deletions SpeedyGonzales.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local unitData = {
{
key = "kilometers",
label = "Kilometers per hour",
func = function(n) return floor(n * 9.144 * 3.6 + 0.01) / 10 end,
func = function(n) return floor(n * 10 * 3.6 + 0.01) / 10 end,
display = " km/h",
extraWidth = 8,
},
Expand All @@ -38,7 +38,7 @@ local unitData = {
{
key = "meters",
label = "Meters per second",
func = function(n) return floor(n * 9.144 + 0.01) / 10 end,
func = function(n) return floor(n * 10 + 0.01) / 10 end,
display = " m/s",
},
{
Expand Down Expand Up @@ -202,7 +202,7 @@ local options = {
type = Settings.VarType.String,
defaultValue = defaults.units,
label = "Units",
tooltip = "Selects the unit by which to represent speed.",
tooltip = "Selects the unit by which to represent speed. Meters and yards are treated as the same unit.",
options = function()
local container = Settings.CreateControlTextContainer()
for i, option in ipairs(unitData) do
Expand Down

0 comments on commit 00d11d3

Please sign in to comment.