# HG changeset patch # User unc0rr # Date 1168799564 0 # Node ID 6bfc326e4976159f3a663438e21c692430e46966 # Parent 09cfe028a6297b308daae8b2d3b1703d4dc271fb Selecting map works in net game diff -r 09cfe028a629 -r 6bfc326e4976 QTfrontend/mapContainer.cpp --- a/QTfrontend/mapContainer.cpp Sun Jan 14 15:58:18 2007 +0000 +++ b/QTfrontend/mapContainer.cpp Sun Jan 14 18:32:44 2007 +0000 @@ -81,6 +81,13 @@ return; } + loadMap(index); + + emit mapChanged(chooseMap->currentText()); +} + +void HWMapContainer::loadMap(int index) +{ QPixmap mapImage; if(!mapImage.load(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/map.png")) { changeImage(); @@ -94,7 +101,6 @@ input >> theme; mapCfgFile.close(); } - emit mapChanged(chooseMap->currentText()); } void HWMapContainer::changeImage() @@ -134,7 +140,11 @@ void HWMapContainer::setMap(const QString & map) { - + int id = chooseMap->findText(map); + if(id >= 0) { + chooseMap->setCurrentIndex(id); + loadMap(id); + } } void HWMapContainer::setTheme(const QString & theme) diff -r 09cfe028a629 -r 6bfc326e4976 QTfrontend/mapContainer.h --- a/QTfrontend/mapContainer.h Sun Jan 14 15:58:18 2007 +0000 +++ b/QTfrontend/mapContainer.h Sun Jan 14 18:32:44 2007 +0000 @@ -68,6 +68,8 @@ HWMap* pMap; QString m_seed; QString theme; + + void loadMap(int index); }; #endif // _HWMAP_CONTAINER_INCLUDED