Skip to content

Commit 3dc0092

Browse files
committed
Changes for None-type plugin sorting
* Display checkboxes for all plugins * Disable checkboxes for force enabled/disabled plugins * Display tooltip data for all plugins regardless of force status
1 parent d586bb2 commit 3dc0092

File tree

1 file changed

+61
-52
lines changed

1 file changed

+61
-52
lines changed

src/pluginlist.cpp

Lines changed: 61 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,9 @@ QVariant PluginList::checkstateData(const QModelIndex& modelIndex) const
11781178
const int index = modelIndex.row();
11791179

11801180
if (m_ESPs[index].forceEnabled || m_ESPs[index].forceDisabled) {
1181-
return {};
1181+
return Qt::Checked;
1182+
} else if (m_ESPs[index].forceDisabled) {
1183+
return Qt::Unchecked;
11821184
}
11831185

11841186
return m_ESPs[index].enabled ? Qt::Checked : Qt::Unchecked;
@@ -1246,61 +1248,68 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const
12461248
if (esp.forceEnabled) {
12471249
toolTip += "<br><b><i>" +
12481250
tr("This plugin can't be disabled (enforced by the game).") + "</i></b>";
1249-
} else {
1250-
if (!esp.author.isEmpty()) {
1251-
toolTip += "<br><b>" + tr("Author") + "</b>: " + TruncateString(esp.author);
1252-
}
1253-
1254-
if (esp.description.size() > 0) {
1255-
toolTip +=
1256-
"<br><b>" + tr("Description") + "</b>: " + TruncateString(esp.description);
1257-
}
1251+
}
12581252

1259-
if (esp.masterUnset.size() > 0) {
1260-
toolTip +=
1261-
"<br><b>" + tr("Missing Masters") + "</b>: " + "<b>" +
1262-
TruncateString(
1263-
QStringList(esp.masterUnset.begin(), esp.masterUnset.end()).join(", ")) +
1264-
"</b>";
1265-
}
1253+
if (!esp.author.isEmpty()) {
1254+
toolTip += "<br><b>" + tr("Author") + "</b>: " + TruncateString(esp.author);
1255+
}
12661256

1267-
std::set<QString> enabledMasters;
1268-
std::set_difference(esp.masters.begin(), esp.masters.end(), esp.masterUnset.begin(),
1269-
esp.masterUnset.end(),
1270-
std::inserter(enabledMasters, enabledMasters.end()));
1257+
if (esp.description.size() > 0) {
1258+
toolTip +=
1259+
"<br><b>" + tr("Description") + "</b>: " + TruncateString(esp.description);
1260+
}
12711261

1272-
if (!enabledMasters.empty()) {
1273-
toolTip += "<br><b>" + tr("Enabled Masters") +
1274-
"</b>: " + TruncateString(SetJoin(enabledMasters, ", "));
1275-
}
1262+
if (esp.masterUnset.size() > 0) {
1263+
toolTip +=
1264+
"<br><b>" + tr("Missing Masters") + "</b>: " + "<b>" +
1265+
TruncateString(
1266+
QStringList(esp.masterUnset.begin(), esp.masterUnset.end()).join(", ")) +
1267+
"</b>";
1268+
}
1269+
1270+
std::set<QString> enabledMasters;
1271+
std::set_difference(esp.masters.begin(), esp.masters.end(), esp.masterUnset.begin(),
1272+
esp.masterUnset.end(),
1273+
std::inserter(enabledMasters, enabledMasters.end()));
1274+
1275+
if (!enabledMasters.empty()) {
1276+
toolTip += "<br><b>" + tr("Enabled Masters") +
1277+
"</b>: " + TruncateString(SetJoin(enabledMasters, ", "));
1278+
}
1279+
1280+
if (!esp.archives.empty() && esp.archives.size() < 6) {
1281+
QString archiveString =
1282+
esp.archives.size() < 6
1283+
? TruncateString(
1284+
QStringList(esp.archives.begin(), esp.archives.end()).join(", ")) +
1285+
"<br>"
1286+
: "";
1287+
toolTip += "<br><b>" + tr("Loads Archives") + "</b>: " +
1288+
archiveString +
1289+
tr("There are Archives connected to this plugin. Their assets will be "
1290+
"added to your game, overwriting in case of conflicts following the "
1291+
"plugin order. Loose files will always overwrite assets from "
1292+
"Archives. (This flag only checks for Archives from the same mod as "
1293+
"the plugin)");
1294+
}
12761295

1277-
if (!esp.archives.empty()) {
1278-
toolTip +=
1279-
"<br><b>" + tr("Loads Archives") + "</b>: " +
1280-
TruncateString(
1281-
QStringList(esp.archives.begin(), esp.archives.end()).join(", ")) +
1282-
"<br>" +
1283-
tr("There are Archives connected to this plugin. Their assets will be "
1284-
"added to your game, overwriting in case of conflicts following the "
1285-
"plugin order. Loose files will always overwrite assets from "
1286-
"Archives. (This flag only checks for Archives from the same mod as "
1287-
"the plugin)");
1288-
}
1296+
if (esp.hasIni) {
1297+
toolTip += "<br><b>" + tr("Loads INI settings") +
1298+
"</b>: "
1299+
"<br>" +
1300+
tr("There is an ini file connected to this plugin. Its settings will "
1301+
"be added to your game settings, overwriting in case of conflicts.");
1302+
}
12891303

1290-
if (esp.hasIni) {
1291-
toolTip +=
1292-
"<br><b>" + tr("Loads INI settings") +
1293-
"</b>: "
1294-
"<br>" +
1295-
tr("There is an ini file connected to this plugin. Its settings will "
1296-
"be added to your game settings, overwriting in case of conflicts.");
1297-
}
1304+
if (esp.isLightFlagged && !esp.hasLightExtension) {
1305+
toolTip +=
1306+
"<br><br>" + tr("This ESP is flagged as an ESL. It will adhere to the ESP load "
1307+
"order but the records will be loaded in ESL space.");
1308+
}
12981309

1299-
if (esp.isLightFlagged && !esp.hasLightExtension) {
1300-
toolTip += "<br><br>" +
1301-
tr("This ESP is flagged as an ESL. It will adhere to the ESP load "
1302-
"order but the records will be loaded in ESL space.");
1303-
}
1310+
if (esp.forceDisabled) {
1311+
toolTip += "<br><br>" + tr("This game does not currently permit custom plugin "
1312+
"loading. There may be manual workarounds.");
13041313

13051314
if (esp.forceDisabled) {
13061315
toolTip += "<br><br>" + tr("This game does not currently permit custom plugin "
@@ -1530,8 +1539,8 @@ Qt::ItemFlags PluginList::flags(const QModelIndex& modelIndex) const
15301539
Qt::ItemFlags result = QAbstractItemModel::flags(modelIndex);
15311540

15321541
if (modelIndex.isValid()) {
1533-
if (!m_ESPs[index].forceEnabled) {
1534-
result |= Qt::ItemIsUserCheckable | Qt::ItemIsDragEnabled;
1542+
if (!m_ESPs[index].forceEnabled && !m_ESPs[index].forceDisabled) {
1543+
result |= Qt::ItemIsDragEnabled;
15351544
}
15361545
if (modelIndex.column() == COL_PRIORITY) {
15371546
result |= Qt::ItemIsEditable;

0 commit comments

Comments
 (0)