Skip to content

Commit

Permalink
Sort maps by number of players available, closes lampe-games#48
Browse files Browse the repository at this point in the history
  • Loading branch information
Scony committed Jun 14, 2023
1 parent ce9a099 commit 7087c27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/main-menu/Play.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ func _ready():


func _setup_map_list():
_map_paths = Constants.Match.MAPS.keys()
_map_paths.sort()
var maps = Utils.Dict.items(Constants.Match.MAPS)
maps.sort_custom(func(map_a, map_b): return map_a[1]["players"] < map_b[1]["players"])
_map_paths = maps.map(func(map): return map[0])
_map_list.clear()
for map_path in _map_paths:
_map_list.add_item(Constants.Match.MAPS[map_path]["name"])
Expand Down

0 comments on commit 7087c27

Please sign in to comment.