From ec982d10c350e3d08fecbf0d67c01248dffa9c71 Mon Sep 17 00:00:00 2001 From: Not Date: Fri, 20 May 2022 19:09:27 +0200 Subject: [PATCH] display more map info on findmap --- leaderboard.lua | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/leaderboard.lua b/leaderboard.lua index bb49758..7c488fe 100644 --- a/leaderboard.lua +++ b/leaderboard.lua @@ -371,19 +371,36 @@ local function findMap(player, ...) return end + local hell = "\x85HELL" + local tol = { + [TOL_SP] = "\x81Nuked\x80", -- Single player + [TOL_RACE] = "\x88Race\x80", + [TOL_MATCH] = "\x87\Battle\x80" + } + local lvltype, map + for i = 1, #mapheaderinfo do - local map = mapheaderinfo[i] + map = mapheaderinfo[i] if map == nil then continue end if map.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 and lvltype) or string.format("%-7s \x82%-2d\x80", lvltype, map.numlaps) + CONS_Printf( player, string.format( - "%s - %s", + "%s %-10s %-25s - %s\t%s", G_BuildMapName(i), - map.lvlttl + lvltype, + map.lvlttl, + map.subttl, + (map.menuflags & LF2_HIDEINMENU and hell) or "" ) ) end