include zone and act in findmap

This commit is contained in:
Not 2022-05-27 15:07:57 +02:00
parent 1305fa2979
commit 22aa4ecd2f
1 changed files with 24 additions and 9 deletions

View File

@ -370,10 +370,6 @@ COM_AddCommand("exit", exitlevel)
local function findMap(player, ...)
local search = ...
if search == nil then
return
end
local hell = "\x85HELL"
local tol = {
@ -382,7 +378,22 @@ local function findMap(player, ...)
[TOL_RACE] = "\x88Race\x80",
[TOL_MATCH] = "\x87\Battle\x80"
}
local lvltype, map
local lvltype, map, lvlttl
local zoneAct = function(zone, act, levelflags)
local z = ""
if zone != "" then
z = " " + zone
elseif not(levelflags & LF_NOZONE) then
z = " Zone"
end
if act != "" then
z = $ + " " + act
end
return z
end
for i = 1, #mapheaderinfo do
map = mapheaderinfo[i]
@ -390,20 +401,24 @@ local function findMap(player, ...)
continue
end
if map.lvlttl:lower():find(search:lower()) then
lvlttl = map.lvlttl + zoneAct(map.zonttl, map.actnum, map.levelflags)
if not search or lvlttl:lower():find(search:lower()) then
-- Only care for up to TOL_MATCH (0x10)
lvltype = tol[map.typeoflevel & 0x1F] or map.typeoflevel
-- If not battle print numlaps
lvltype = (map.typeoflevel & (TOL_MATCH | TOL_COOP) and lvltype) or string.format("%s \x82%-2d\x80", lvltype, map.numlaps)
lvltype = (map.typeoflevel & (TOL_MATCH | TOL_COOP) and lvltype)
or string.format("%s \x82%-2d\x80", lvltype, map.numlaps)
CONS_Printf(
player,
string.format(
"%s %-9s %-25s - %s\t%s",
"%s %-9s %-30s - %s\t%s",
G_BuildMapName(i),
lvltype,
map.lvlttl,
lvlttl,
map.subttl,
(map.menuflags & LF2_HIDEINMENU and hell) or ""
)