Skip to content

Commit 4caf2d1

Browse files
committed
update\
1 parent 57dabe2 commit 4caf2d1

3 files changed

Lines changed: 18 additions & 34 deletions

File tree

src/gamecard.cpp

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -322,36 +322,8 @@ void GameCard::paintEvent(QPaintEvent* event) {
322322
painter.drawRoundedRect(cardRect, radius, radius);
323323
}
324324

325-
// ── Supported badge ──
326-
if (supported) {
327-
painter.setClipPath(clipPath);
328-
329-
QRectF badgeRect(cardRect.right() - 30, cardRect.top() + 6, 24, 24);
330-
331-
// Material container background
332-
QColor badgeColor = Colors::toQColor(Colors::ACCENT_GREEN);
333-
QPainterPath badgePath;
334-
badgePath.addRoundedRect(badgeRect, 6, 6); // Reduced from 12 for sharper corners
335-
painter.fillPath(badgePath, badgeColor);
336-
337-
// Check icon
338-
QRectF checkRect = badgeRect.adjusted(4, 4, -4, -4);
339-
painter.setPen(Qt::NoPen);
340-
painter.setBrush(Qt::NoBrush);
341-
342-
QPen checkPen(QColor("#FFFFFF"), 2.2);
343-
checkPen.setCapStyle(Qt::RoundCap);
344-
checkPen.setJoinStyle(Qt::RoundJoin);
345-
painter.setPen(checkPen);
346-
347-
QPainterPath check;
348-
check.moveTo(checkRect.left() + 1, checkRect.center().y());
349-
check.lineTo(checkRect.center().x() - 1, checkRect.bottom() - 2);
350-
check.lineTo(checkRect.right() - 1, checkRect.top() + 2);
351-
painter.drawPath(check);
352-
353-
painter.setClipRect(rect());
354-
}
325+
// Reset clip for border drawing
326+
painter.setClipRect(rect());
355327
}
356328

357329
void GameCard::mousePressEvent(QMouseEvent* event) {

src/mainwindow.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,11 +1436,12 @@ void MainWindow::onCardClicked(GameCard* card) {
14361436
QMap<QString, QString> data = card->gameData();
14371437
m_selectedGame = data;
14381438
bool isSupported = (data["supported"] == "true");
1439+
bool hasFix = (data["hasFix"] == "true");
14391440

14401441
if (m_currentMode == AppMode::LuaPatcher) {
14411442
m_btnAddToLibrary->setEnabled(true);
1442-
if (isSupported) {
1443-
m_btnAddToLibrary->setDescription(QString("Install patch for %1").arg(data["name"]));
1443+
if (hasFix) {
1444+
m_btnAddToLibrary->setDescription(QString("Download patch for %1").arg(data["name"]));
14441445
m_btnAddToLibrary->setAccentColor(Colors::ACCENT_GREEN);
14451446
} else {
14461447
m_btnAddToLibrary->setDescription(QString("Generate patch for %1").arg(data["name"]));
@@ -1459,8 +1460,14 @@ void MainWindow::onCardClicked(GameCard* card) {
14591460
// ---- Patch / Generate / Restart / Fix / Remove ----
14601461
void MainWindow::doAddGame() {
14611462
if (m_selectedGame.isEmpty()) return;
1462-
bool isSupported = (m_selectedGame["supported"] == "true");
1463-
if (isSupported) runPatchLogic(); else runGenerateLogic();
1463+
bool hasFix = (m_selectedGame["hasFix"] == "true");
1464+
1465+
// Favor generation if remote system is removed/unavailable
1466+
if (hasFix) {
1467+
runPatchLogic();
1468+
} else {
1469+
runGenerateLogic();
1470+
}
14641471
}
14651472

14661473
void MainWindow::doRemoveGame() {

src/workers/luadownloadworker.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ void LuaDownloadWorker::run() {
8383
}
8484

8585
if (reply->error() != QNetworkReply::NoError) {
86+
int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
87+
if (statusCode == 404 || statusCode == 401) {
88+
emit log("Remote patch not found or unauthorized (Fix system may be removed).", "WARN");
89+
emit log("Falling back to local generation is recommended.", "INFO");
90+
}
8691
emit log(QString("Network error: %1").arg(reply->errorString()), "ERROR");
8792
throw std::runtime_error(reply->errorString().toStdString());
8893
}

0 commit comments

Comments
 (0)