W1: choose a worldlet (New World and Host Game pages, kept once an island exists), worldlet shown in the Load list; Godot .uid files
This commit is contained in:
@@ -169,9 +169,20 @@ static func worldlets() -> Array:
|
||||
if f.ends_with(".json"):
|
||||
var d := load_worldlet(f.get_basename())
|
||||
if not d.is_empty():
|
||||
out.append({"id": String(d.id), "name": String(d.get("name", d.id)), "description": String(d.get("description", ""))})
|
||||
out.append({"id": String(d.id), "name": String(d.get("name", d.id)), "description": String(d.get("description", "")),
|
||||
"start": bool(d.get("start", false))})
|
||||
out.sort_custom(func(a, b): return a.id == "valley" or (b.id != "valley" and a.name < b.name))
|
||||
return out
|
||||
|
||||
## The worldlets a new world can start in (the rest are reached on the journey).
|
||||
static func starting_worldlets() -> Array:
|
||||
return worldlets().filter(func(w): return w.start)
|
||||
|
||||
## A worldlet's display name ("Valley"), or its id if there's no such worldlet.
|
||||
static func worldlet_name(id: String) -> String:
|
||||
var d := load_worldlet(id)
|
||||
return String(d.get("name", id)) if not d.is_empty() else id
|
||||
|
||||
## Takes on worldlet `id`: its size and every block's numbers. Returns ""
|
||||
## on success, else what's wrong (an unknown worldlet or block keeps the old
|
||||
## settings, so the game still has an island).
|
||||
|
||||
Reference in New Issue
Block a user