# HG changeset patch # User Wuzzy # Date 1507668348 -7200 # Node ID ad1fd7ae479df0d1959ef1533d1703e40bd66bdb # Parent 5f68b259305c8a649ff8d39bdf9cf74d5de5c7e6 Mark custom maps/forts/scripts with circle icon instead of icon diff -r 5f68b259305c -r ad1fd7ae479d ChangeLog.txt --- a/ChangeLog.txt Tue Oct 10 21:00:11 2017 +0200 +++ b/ChangeLog.txt Tue Oct 10 22:45:48 2017 +0200 @@ -273,7 +273,8 @@ + Allow to randomize hog names, hats, team name, flag, grave, voice and fort separately + “Random team” button is now able to randomly select from all available hats + Creating new game/weapon schemes guarantees unique names - + Mark custom forts with asterisk in team editor + + Custom maps and styles are now marked with a circle instead of an asterisk symbol + + Mark custom forts in team editor * Fix flag being selectable for computer players although it had no effect * Campaign screen does no longer show AI-controlled teams * Campaign names and campaign mission names can now be translated diff -r 5f68b259305c -r ad1fd7ae479d QTfrontend/hedgewars.qrc --- a/QTfrontend/hedgewars.qrc Tue Oct 10 21:00:11 2017 +0200 +++ b/QTfrontend/hedgewars.qrc Tue Oct 10 22:45:48 2017 +0200 @@ -87,6 +87,7 @@ res/unchecked.png res/missionFinished.png res/missionFinishedSelected.png + res/dlcMarker.png res/graphicsicon.png res/frontendicon.png res/folder.png diff -r 5f68b259305c -r ad1fd7ae479d QTfrontend/model/GameStyleModel.cpp --- a/QTfrontend/model/GameStyleModel.cpp Tue Oct 10 21:00:11 2017 +0200 +++ b/QTfrontend/model/GameStyleModel.cpp Tue Oct 10 22:45:48 2017 +0200 @@ -32,11 +32,17 @@ { beginResetModel(); + QIcon dlcIcon; + dlcIcon.addFile(":/res/dlcMarker.png", QSize(), QIcon::Normal, QIcon::On); + QPixmap emptySpace = QPixmap(7, 15); + emptySpace.fill(QColor(0, 0, 0, 0)); + QIcon notDlcIcon = QIcon(emptySpace); + // empty list, so that we can (re)fill it QStandardItemModel::clear(); QList items; - items.append(new QStandardItem("Normal")); + items.append(new QStandardItem(notDlcIcon, "Normal")); // define a separator item QStandardItem * separator = new QStandardItem("---"); @@ -82,7 +88,11 @@ QString scriptPath = PHYSFS_getRealDir(QString("Scripts/Multiplayer/%1.lua").arg(script).toLocal8Bit().data()); bool isDLC = !scriptPath.startsWith(datadir->absolutePath()); - QStandardItem * item = new QStandardItem((isDLC ? "*" : "") + name); + QStandardItem * item; + if (isDLC) + item = new QStandardItem(dlcIcon, name); + else + item = new QStandardItem(notDlcIcon, name); item->setData(script, ScriptRole); item->setData(scheme, SchemeRole); diff -r 5f68b259305c -r ad1fd7ae479d QTfrontend/model/MapModel.cpp --- a/QTfrontend/model/MapModel.cpp Tue Oct 10 21:00:11 2017 +0200 +++ b/QTfrontend/model/MapModel.cpp Tue Oct 10 22:45:48 2017 +0200 @@ -80,6 +80,13 @@ //QList missionMaps; QList mapList; + + QIcon dlcIcon; + dlcIcon.addFile(":/res/dlcMarker.png", QSize(), QIcon::Normal, QIcon::On); + QPixmap emptySpace = QPixmap(7, 15); + emptySpace.fill(QColor(0, 0, 0, 0)); + QIcon notDlcIcon = QIcon(emptySpace); + // add mission/static maps to lists foreach (QString map, maps) { @@ -163,9 +170,15 @@ // caption caption = map; + QIcon icon; + if (dlc) + icon = dlcIcon; + else + icon = notDlcIcon; + // we know everything there is about the map, let's get am item for it QStandardItem * item = MapModel::infoToItem( - QIcon(), caption, type, map, theme, limit, scheme, weapons, desc, dlc); + icon, caption, type, map, theme, limit, scheme, weapons, desc, dlc); // append item to the list mapList.append(item); @@ -225,7 +238,7 @@ QString desc, bool dlc) { - QStandardItem * item = new QStandardItem(icon, (dlc ? "*" : "") + caption); + QStandardItem * item = new QStandardItem(icon, caption); MapInfo mapInfo; QVariant qvar(QVariant::UserType); diff -r 5f68b259305c -r ad1fd7ae479d QTfrontend/res/dlcMarker.png Binary file QTfrontend/res/dlcMarker.png has changed diff -r 5f68b259305c -r ad1fd7ae479d QTfrontend/ui/page/pageeditteam.cpp --- a/QTfrontend/ui/page/pageeditteam.cpp Tue Oct 10 21:00:11 2017 +0200 +++ b/QTfrontend/ui/page/pageeditteam.cpp Tue Oct 10 22:45:48 2017 +0200 @@ -312,6 +312,11 @@ CBVoicepack->addItems(list); + QIcon dlcIcon; + dlcIcon.addFile(":/res/dlcMarker.png", QSize(), QIcon::Normal, QIcon::On); + QPixmap emptySpace = QPixmap(7, 15); + emptySpace.fill(QColor(0, 0, 0, 0)); + QIcon notDlcIcon = QIcon(emptySpace); // forts list = dataMgr.entryList("Forts", QDir::Files, QStringList("*L.png")); @@ -320,15 +325,17 @@ QString fortPath = PHYSFS_getRealDir(QString("Forts/%1").arg(file).toLocal8Bit().data()); QString fort = file.replace(QRegExp("L\\.png$"), ""); - QString fortDisplay; bool isDLC = !fortPath.startsWith(datadir->absolutePath()); if (isDLC) - fortDisplay = "*" + fort; + { + CBFort->addItem(dlcIcon, fort, fort); + } else - fortDisplay = fort; + { + CBFort->addItem(notDlcIcon, fort, fort); + } - CBFort->addItem(fortDisplay, fort); }