33 lines
841 B
Lua
33 lines
841 B
Lua
-- states/worldmap.lua — travel destinations.
|
|||
|
|
--
|
||
|
|
-- Entries are areas, sorted by the screen's own comparator. `visitedMessage`
|
||
|
|
-- ("Visited 3 days ago") is the game's own string and worth speaking: on a map of
|
||
|
|
-- similar-sounding place names it is the main way to tell where you have been.
|
||
|
|
|
||
|
|
return {
|
||
|
|
probe = {
|
||
|
|
fn = "keypressed",
|
||
|
|
focus = "selectedOption",
|
||
|
|
list = "options",
|
||
|
|
focusMayBeNil = true,
|
||
|
|
},
|
||
|
|
|
||
|
|
render = function(entry, index, total)
|
||
|
|
local parts = {entry.name or "Unknown area"}
|
||
|
|
|
||
|
|
if entry.isCompleted then
|
||
|
|
parts[#parts + 1] = "completed"
|
||
|
|
end
|
||
|
|
if entry.isFavourite then
|
||
|
|
parts[#parts + 1] = "favourite"
|
||
|
|
end
|
||
|
|
if entry.visitedMessage and entry.visitedMessage ~= "" then
|
||
|
|
parts[#parts + 1] = entry.visitedMessage
|
||
|
|
end
|
||
|
|
|
||
|
|
parts[#parts + 1] = index .. " of " .. total
|
||
|
|
|
||
|
|
return table.concat(parts, ", ")
|
||
|
|
end,
|
||
|
|
}
|