Skip to content

Commit

Permalink
GPS: show exact planet tier (e.g. 2.7) instead of Roman numerals
Browse files Browse the repository at this point in the history
Previously GPS was showing the same as vanilla nagivation interface,
e.g. "Threat: Moderate (III)" for any tier between 2 and 2.99,
which was confusing.

Sometimes player needs to know the exact tier, without rounding.
  • Loading branch information
edwardspec committed May 11, 2024
1 parent 49a5de5 commit f30145c
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions interface/kukagps/kukagps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ function populateMaterialsList()
addText("^green;Width:^reset; "..worldSize[1].." ^green;Height:^reset; "..worldSize[2])

-- print planet threat and gravity
addText("^green;Threat:^reset; "..ThreatToString(parameters.threatLevel).." ^green;Gravity:^reset; "..parameters.gravity or 0)
addText(string.format("^green;Planet tier / Threat:^reset; %.2f", parameters.threatLevel))
addText("^green;Gravity:^reset; "..(parameters.gravity or 0))

-- print planet ores names
addText("^green;Ores:^reset; ")
Expand Down Expand Up @@ -338,26 +339,6 @@ function populateMaterialsList()
end

-- contribution of zimberzimber
strs = {
"Harmless (I)",
"Low (II)",
"Moderate (III)",
"Risky (IV)",
"Dangerous (V)",
"Extreme (VI)",
"Lethal (VII)",
"Impossible (VIII)",
"Immeasurable (IX)",
"Just No (X)",
"No (XI)",
}

function ThreatToString(threat)
local floored = math.max(math.floor(threat) + 1, 1)
return strs[floored] or strs[#strs]
end
-- contribution of zimberzimber

function string_split(str, pat)
local t = {} -- NOTE: use {n = 0} in Lua-5.0
local fpat = "(.-)" .. pat
Expand Down

0 comments on commit f30145c

Please sign in to comment.