QTfrontend/model/GameStyleModel.cpp
changeset 8419 d99f46b676b5
parent 8049 133e22b5c410
child 8466 29b891dbf2a0
--- a/QTfrontend/model/GameStyleModel.cpp	Mon Jan 21 13:04:57 2013 -0500
+++ b/QTfrontend/model/GameStyleModel.cpp	Mon Jan 21 14:07:39 2013 -0500
@@ -23,14 +23,16 @@
 
 #include <QTextStream>
 
+#include "physfs.h"
 #include "GameStyleModel.h"
 
 
 void GameStyleModel::loadGameStyles()
 {
+    const QString appDir = QString(PHYSFS_getBaseDir());
+
     beginResetModel();
 
-
     // empty list, so that we can (re)fill it
     QStandardItemModel::clear();
 
@@ -77,11 +79,16 @@
                 weapons.replace("_", " ");
         }
 
-        QStandardItem * item = new QStandardItem(name);
+        // detect if script is dlc
+        QString scriptPath = PHYSFS_getRealDir(QString("Scripts/Multiplayer/%1.lua").arg(script).toLocal8Bit().data());
+        bool isDLC = !scriptPath.startsWith(appDir);
+
+        QStandardItem * item = new QStandardItem((isDLC ? "*" : "") + name);
 
         item->setData(script, ScriptRole);
         item->setData(scheme, SchemeRole);
         item->setData(weapons, WeaponsRole);
+        item->setData(isDLC, IsDlcRole);
 
         items.append(item);
     }