QTfrontend/mapContainer.cpp
changeset 4513 1dd97c710f5a
parent 4511 df827e70ae63
child 4519 aee36896d46b
equal deleted inserted replaced
4512:c6aff8ceada0 4513:1dd97c710f5a
    92                 .arg(map));
    92                 .arg(map));
    93 
    93 
    94         if (mapCfgFile.open(QFile::ReadOnly)) {
    94         if (mapCfgFile.open(QFile::ReadOnly)) {
    95             QString theme;
    95             QString theme;
    96             quint32 limit = 0;
    96             quint32 limit = 0;
       
    97             QString scheme;
       
    98             QString weapons;
    97             QList<QVariant> mapInfo;
    99             QList<QVariant> mapInfo;
    98             QTextStream input(&mapCfgFile);
   100             QTextStream input(&mapCfgFile);
    99             input >> theme;
   101             input >> theme;
   100             input >> limit;
   102             input >> limit;
       
   103             input >> scheme;
       
   104             input >> weapons;
   101             mapInfo.push_back(map);
   105             mapInfo.push_back(map);
   102             mapInfo.push_back(theme);
   106             mapInfo.push_back(theme);
   103             if (limit)
   107             if (limit)
   104                 mapInfo.push_back(limit);
   108                 mapInfo.push_back(limit);
   105             else
   109             else
   106                 mapInfo.push_back(18);
   110                 mapInfo.push_back(18);
   107             mapInfo.push_back(mapLuaFile.exists());
   111             mapInfo.push_back(mapLuaFile.exists());
       
   112             if (scheme.isEmpty())
       
   113                 scheme = "locked";
       
   114             scheme.replace("_", " ");
       
   115             if (weapons.isEmpty())
       
   116                 weapons = "locked";
       
   117             weapons.replace("_", " ");
       
   118             mapInfo.push_back(scheme);
       
   119             mapInfo.push_back(weapons);
   108             if(mapLuaFile.exists())
   120             if(mapLuaFile.exists())
   109             {
   121             {
   110                 chooseMap->insertItem(missionindex++, 
   122                 chooseMap->insertItem(missionindex++, 
   111 // FIXME - need real icons. Disabling until then
   123 // FIXME - need real icons. Disabling until then
   112 //QIcon(":/res/mapMission.png"), 
   124 //QIcon(":/res/mapMission.png"), 
   371 int HWMapContainer::getCurrentHHLimit() const
   383 int HWMapContainer::getCurrentHHLimit() const
   372 {
   384 {
   373     return hhLimit;
   385     return hhLimit;
   374 }
   386 }
   375 
   387 
       
   388 QString HWMapContainer::getCurrentScheme() const
       
   389 {
       
   390     return chooseMap->itemData(chooseMap->currentIndex()).toList()[4].toString();
       
   391 }
       
   392 
       
   393 QString HWMapContainer::getCurrentWeapons() const
       
   394 {
       
   395     return chooseMap->itemData(chooseMap->currentIndex()).toList()[5].toString();
       
   396 }
       
   397 
   376 quint32 HWMapContainer::getTemplateFilter() const
   398 quint32 HWMapContainer::getTemplateFilter() const
   377 {
   399 {
   378     return CB_TemplateFilter->itemData(CB_TemplateFilter->currentIndex()).toInt();
   400     return CB_TemplateFilter->itemData(CB_TemplateFilter->currentIndex()).toInt();
   379 }
   401 }
   380 
   402