From: Ricardo Cruz Date: Fri, 9 Jul 2004 18:18:11 +0000 (+0000) Subject: Shows map's title, not filename, in menu. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=30c642ca7f628aae93ef8aeee6212376d749632f;p=supertux.git Shows map's title, not filename, in menu. SVN-Revision: 1556 --- diff --git a/src/title.cpp b/src/title.cpp index 8be58de8b..7ef9ff4c3 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -257,7 +257,11 @@ void title(void) contrib_worldmap_menu->additem(MN_LABEL, _("Contrib Worlds"), 0,0); contrib_worldmap_menu->additem(MN_HL, "", 0,0); for(int i = 0; i < worldmap_list.num_items; i++) - contrib_worldmap_menu->additem(MN_ACTION, worldmap_list.item[i],0,0,i); + { + WorldMapNS::WorldMap worldmap; + worldmap.loadmap(worldmap_list.item[i]); + contrib_worldmap_menu->additem(MN_ACTION, worldmap.get_world_title(),0,0,i); + } contrib_worldmap_menu->additem(MN_HL,"",0,0); contrib_worldmap_menu->additem(MN_BACK,"Back",0,0); diff --git a/src/worldmap.h b/src/worldmap.h index 2186c495f..797160250 100644 --- a/src/worldmap.h +++ b/src/worldmap.h @@ -199,6 +199,9 @@ public: /* Load map directly from file */ void loadmap(const std::string& filename); + const std::string& get_world_title() const + { return name; } + private: void on_escape_press(); };