--- 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);
}