Shows map's title, not filename, in menu.
authorRicardo Cruz <rick2@aeiou.pt>
Fri, 9 Jul 2004 18:18:11 +0000 (18:18 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Fri, 9 Jul 2004 18:18:11 +0000 (18:18 +0000)
SVN-Revision: 1556

src/title.cpp
src/worldmap.h

index 8be58de..7ef9ff4 100644 (file)
@@ -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);
 
index 2186c49..7971602 100644 (file)
@@ -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();
 };