QTfrontend/gamecfgwidget.cpp
changeset 4551 05c32ee166b6
parent 4537 f95f7218531a
child 4557 4004bef2aa9d
--- a/QTfrontend/gamecfgwidget.cpp	Fri Dec 17 09:26:02 2010 +0100
+++ b/QTfrontend/gamecfgwidget.cpp	Fri Dec 17 19:27:02 2010 +0100
@@ -58,6 +58,7 @@
     for (int i = 0; i < scriptList->size(); ++i) {
         QString script = (*scriptList)[i].remove(".lua", Qt::CaseInsensitive);
         QList<QVariant> scriptInfo;
+        scriptInfo.push_back(script);
         QFile scriptCfgFile(QString("%1/Scripts/Multiplayer/%2.cfg").arg(datadir->absolutePath()).arg(script));
         if (scriptCfgFile.exists() && scriptCfgFile.open(QFile::ReadOnly)) {
             QString scheme;
@@ -80,7 +81,7 @@
             scriptInfo.push_back("locked");
             scriptInfo.push_back("locked");
         }
-        Scripts->addItem(script, scriptInfo);
+        Scripts->addItem(script.replace("_", " "), scriptInfo);
     }
 
     connect(Scripts, SIGNAL(currentIndexChanged(int)), this, SLOT(scriptChanged(int)));
@@ -271,7 +272,7 @@
 
     if (Scripts->currentIndex() > 0)
     {
-        bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->currentText()).toUtf8();
+        bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->itemData(Scripts->currentIndex()).toList()[0].toString()).toUtf8();
     }
 
     QByteArray result;
@@ -473,8 +474,8 @@
 {
     if(index > 0)
     {
-        QString scheme = Scripts->itemData(Scripts->currentIndex()).toList()[0].toString();
-        QString weapons = Scripts->itemData(Scripts->currentIndex()).toList()[1].toString();
+        QString scheme = Scripts->itemData(Scripts->currentIndex()).toList()[1].toString();
+        QString weapons = Scripts->itemData(Scripts->currentIndex()).toList()[2].toString();
 
         if (scheme == "locked")
         {