- std::ostringstream title;
- title << world->get_title() << " (" << world->get_num_solved_levels() << "/" << world->get_num_levels() << ")";
- add_entry(i++, title.str());
- m_contrib_worlds.push_back(std::move(world));
+ if (world->is_levelset())
+ {
+ int level_count = 0;
+ int solved_count = 0;
+
+ const auto& state = savegame.get_levelset_state(world->get_basedir());
+ for(const auto& level_state : state.level_states)
+ {
+ if (level_state.solved)
+ {
+ solved_count += 1;
+ }
+ level_count += 1;
+ }
+
+ std::ostringstream title;
+ title << "[" << world->get_title() << "]";
+ if (level_count == 0)
+ {
+ title << " *NEW*";
+ }
+ else
+ {
+ title << " (" << solved_count << "/" << level_count << ")";
+ }
+ add_entry(i++, title.str());
+ m_contrib_worlds.push_back(std::move(world));
+ }
+ else if (world->is_worldmap())
+ {
+ int level_count = 0;
+ int solved_count = 0;
+
+ const auto& state = savegame.get_worldmap_state(world->get_worldmap_filename());
+ for(const auto& level_state : state.level_states)
+ {
+ if (level_state.solved)
+ {
+ solved_count += 1;
+ }
+ level_count += 1;
+ }
+
+ std::ostringstream title;
+ title << world->get_title();
+ if (level_count == 0)
+ {
+ title << " *NEW*";
+ }
+ else
+ {
+ title << " (" << solved_count << "/" << level_count << ")";
+ }
+ add_entry(i++, title.str());
+ m_contrib_worlds.push_back(std::move(world));
+ }
+ else
+ {
+ log_warning << "unknown World type" << std::endl;
+ }