export functions
This commit is contained in:
parent
6afb884e59
commit
4165639282
26
browser.lua
26
browser.lua
@ -6,6 +6,10 @@ local modes = nil
|
||||
local mode = 1
|
||||
local prefMode = nil
|
||||
|
||||
-- imported funcs
|
||||
local ZoneAct
|
||||
local TicsToTime
|
||||
|
||||
local function mapIndexOffset(n)
|
||||
return (mapIndex + n + #maps - 1) % #maps + 1
|
||||
end
|
||||
@ -80,20 +84,6 @@ local function drawMapBorder(v)
|
||||
)
|
||||
end
|
||||
|
||||
local function zoneAct(map)
|
||||
local z = ""
|
||||
if map.zonttl != "" then
|
||||
z = " " + map.zonttl
|
||||
elseif not(map.levelflags & LF_NOZONE) then
|
||||
z = " Zone"
|
||||
end
|
||||
if map.actnum != "" then
|
||||
z = $ + " " + map.actnum
|
||||
end
|
||||
|
||||
return z
|
||||
end
|
||||
|
||||
local function drawMapStrings(v)
|
||||
local map = mapheaderinfo[getMap()]
|
||||
local titleWidth = v.stringWidth(map.lvlttl)
|
||||
@ -108,7 +98,7 @@ local function drawMapStrings(v)
|
||||
)
|
||||
|
||||
-- zone/act
|
||||
local zone = zoneAct(map)
|
||||
local zone = ZoneAct(map)
|
||||
local zoneWidth = v.stringWidth(zone)
|
||||
v.drawString(
|
||||
hlfScrnWdth + titleWidth / 2,
|
||||
@ -295,7 +285,7 @@ local function drawScore(v, i, pos, score)
|
||||
-- name
|
||||
v.drawString(column[2], y, score["name"], V_ALLOWLOWERCASE | textFlag)
|
||||
-- time
|
||||
v.drawString(column[3], y, rawget(_G, "TicsToTime")(score["time"]), textFlag)
|
||||
v.drawString(column[3], y, TicsToTime(score["time"]), textFlag)
|
||||
-- flags
|
||||
drawFlags(v, column[4], y, score["flags"])
|
||||
end
|
||||
@ -303,6 +293,9 @@ end
|
||||
local function drawBrowser(v)
|
||||
if not leaderboard then return end
|
||||
|
||||
TicsToTime = $ or rawget(_G, "TicsToTime")
|
||||
ZoneAct = $ or rawget(_G, "ZoneAct")
|
||||
|
||||
v.fadeScreen(0xFF00, 16)
|
||||
|
||||
-- previous, next maps
|
||||
@ -423,7 +416,6 @@ local function controller(player)
|
||||
end
|
||||
rawset(_G, "BrowserController", controller)
|
||||
|
||||
|
||||
local function netvars(net)
|
||||
maps = net($)
|
||||
mapIndex = net($)
|
||||
|
@ -434,6 +434,7 @@ local function zoneAct(map)
|
||||
|
||||
return z
|
||||
end
|
||||
rawset(_G, "ZoneAct", zoneAct)
|
||||
|
||||
local function findMap(player, ...)
|
||||
local search = ...
|
||||
|
Loading…
Reference in New Issue
Block a user