Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void my_module::on_show_map_list_request(game::player player)
- {
- player->gameserver->get_map_list_async(0, 300,
- [this, player](const game::map_list &map_list)
- {
- // Start output
- game::manialink::controls::document ml;
- game::manialink::controls::list ml_map_list;
- ml_map_list.columns.add("ID");
- ml_map_list.columns.add("Name");
- ml_map_list.columns.add("Author");
- ml_map_list.columns.add("Record");
- ml.add(ml_map_list);
- for (const auto &map : map_list) {
- auto record = record_db->get_record_for_map(map);
- // Add map, record, record->player
- game::manialink::controls::list_item li;
- li.data.add(map.id());
- li.data.add(map.name());
- li.data.add(map.author().nickname());
- li.data.add(record.time());
- ml_map_list.items.add(li);
- }
- // End compose output
- game::manialink::controls::button close_button("Close");
- ml.add(close_button);
- player->gameserver->send_manialink_page_async(player, ml);
- });
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement