Skip to content

Commit 4f07750

Browse files
committed
release: 1.3.6
1 parent 54f2a15 commit 4f07750

5 files changed

Lines changed: 99 additions & 32 deletions

File tree

src/config.h

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <QFileInfo>
88

99
namespace Config {
10-
const QString APP_VERSION = "1.3.5";
10+
const QString APP_VERSION = "1.3.6";
1111
const QString WEBSERVER_BASE_URL = "https://webserver-ecru.vercel.app";
1212

1313
// Server access token - check local file first, then macro
@@ -62,11 +62,7 @@ namespace Config {
6262
return paths;
6363
}
6464

65-
inline QString getSteamPluginDir() {
66-
QStringList paths = getAllSteamPluginDirs();
67-
return paths.isEmpty() ? "C:/Program Files (x86)/Steam/config/stplug-in" : paths.first();
68-
}
69-
65+
7066
inline QStringList getAllSteamExePaths() {
7167
QStringList paths;
7268

@@ -90,6 +86,21 @@ namespace Config {
9086

9187
return paths;
9288
}
89+
90+
inline QString getSteamPluginDir() {
91+
QStringList paths = getAllSteamPluginDirs();
92+
if (!paths.isEmpty()) return paths.first();
93+
94+
// Fallback: try to find generic Steam dir
95+
QStringList exePaths = getAllSteamExePaths();
96+
if (!exePaths.isEmpty()) {
97+
QFileInfo fi(exePaths.first());
98+
QString configDir = fi.absoluteDir().filePath("config");
99+
QDir(configDir).mkpath("stplug-in");
100+
return configDir + "/stplug-in";
101+
}
102+
return "C:/Program Files (x86)/Steam/config/stplug-in";
103+
}
93104

94105
inline QString getSteamExePath() {
95106
QStringList paths = getAllSteamExePaths();

src/gamecard.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ void GameCard::paintEvent(QPaintEvent* event) {
121121
QLinearGradient infoGrad(infoRect.topLeft(), infoRect.bottomLeft());
122122
if (m_hasThumbnail) {
123123
infoGrad.setColorAt(0, QColor(0, 0, 0, 0));
124-
infoGrad.setColorAt(0.3, QColor(28, 27, 31, 180));
125-
infoGrad.setColorAt(1, QColor(28, 27, 31, 240));
124+
infoGrad.setColorAt(0.3, QColor(0, 0, 0, 180));
125+
infoGrad.setColorAt(1, QColor(0, 0, 0, 240));
126126
} else {
127127
infoGrad.setColorAt(0, QColor(0, 0, 0, 0));
128-
infoGrad.setColorAt(0.3, QColor(20, 18, 24, 120));
129-
infoGrad.setColorAt(1, QColor(20, 18, 24, 180));
128+
infoGrad.setColorAt(0.3, QColor(0, 0, 0, 120));
129+
infoGrad.setColorAt(1, QColor(0, 0, 0, 180));
130130
}
131131
painter.fillRect(infoRect.toRect(), infoGrad);
132132

src/mainwindow.cpp

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include <QScrollBar>
3131
#include <QRandomGenerator>
3232
#include <algorithm>
33+
#include <QDragEnterEvent>
34+
#include <QDropEvent>
35+
#include <QMimeData>
3336

3437
// ── Inline helper: a QWidget that paints a single Material icon ──
3538
class MaterialIconWidget : public QWidget {
@@ -95,6 +98,7 @@ MainWindow::MainWindow(QWidget* parent)
9598
setWindowTitle("Steam Lua Patcher");
9699
setMinimumSize(900, 600);
97100
resize(900, 600);
101+
setAcceptDrops(true);
98102

99103
QString iconPath = Paths::getResourcePath("logo.ico");
100104
if (QFile::exists(iconPath)) {
@@ -125,10 +129,60 @@ MainWindow::~MainWindow() {
125129
void MainWindow::paintEvent(QPaintEvent* event) {
126130
Q_UNUSED(event);
127131
QPainter painter(this);
128-
// Material Design 3: Solid surface color (no gradient)
129132
painter.fillRect(rect(), Colors::toQColor(Colors::SURFACE));
130133
}
131134

135+
void MainWindow::dragEnterEvent(QDragEnterEvent* event) {
136+
if (event->mimeData()->hasUrls()) {
137+
QList<QUrl> urls = event->mimeData()->urls();
138+
for (const QUrl& url : urls) {
139+
if (url.isLocalFile() && url.toLocalFile().endsWith(".lua", Qt::CaseInsensitive)) {
140+
event->acceptProposedAction();
141+
return;
142+
}
143+
}
144+
}
145+
}
146+
147+
void MainWindow::dropEvent(QDropEvent* event) {
148+
QList<QUrl> urls = event->mimeData()->urls();
149+
if (urls.isEmpty()) return;
150+
151+
QString pluginDir = Config::getSteamPluginDir();
152+
QDir dir(pluginDir);
153+
if (!dir.exists()) dir.mkpath(".");
154+
155+
int count = 0;
156+
QString lastFile;
157+
158+
for (const QUrl& url : urls) {
159+
if (url.isLocalFile()) {
160+
QString srcPath = url.toLocalFile();
161+
if (srcPath.endsWith(".lua", Qt::CaseInsensitive)) {
162+
QString fileName = QFileInfo(srcPath).fileName();
163+
QString destPath = dir.filePath(fileName);
164+
165+
QFile::remove(destPath); // Overwrite
166+
if (QFile::copy(srcPath, destPath)) {
167+
count++;
168+
lastFile = fileName;
169+
}
170+
}
171+
}
172+
}
173+
174+
if (count > 0) {
175+
m_statusLabel->setText(QString("Installed %1 patch%2").arg(count).arg(count > 1 ? "es" : ""));
176+
if (m_currentMode == AppMode::Library) {
177+
displayLibrary();
178+
} else {
179+
// Switch to library to show the new patch
180+
m_tabLibrary->animateClick();
181+
}
182+
event->acceptProposedAction();
183+
}
184+
}
185+
132186
void MainWindow::initUI() {
133187
QWidget* central = new QWidget(this);
134188
setCentralWidget(central);

src/mainwindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class MainWindow : public QMainWindow {
4545

4646
protected:
4747
void paintEvent(QPaintEvent* event) override;
48+
void dragEnterEvent(QDragEnterEvent* event) override;
49+
void dropEvent(QDropEvent* event) override;
4850

4951
private slots:
5052
void onSyncDone(QList<GameInfo> games);

src/utils/colors.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
#include "colors.h"
22

3-
// Material Design 3 Dark Theme - Surface
4-
const QString Colors::SURFACE = "#1C1B1F";
5-
const QString Colors::SURFACE_DIM = "#141218";
6-
const QString Colors::SURFACE_BRIGHT = "#3B383E";
7-
const QString Colors::SURFACE_CONTAINER = "#211F26";
8-
const QString Colors::SURFACE_CONTAINER_HIGH = "#2B2930";
9-
const QString Colors::SURFACE_CONTAINER_HIGHEST = "#36343B";
10-
const QString Colors::SURFACE_VARIANT = "#49454F";
3+
// Pure Black Theme - Surface colors
4+
const QString Colors::SURFACE = "#000000";
5+
const QString Colors::SURFACE_DIM = "#000000";
6+
const QString Colors::SURFACE_BRIGHT = "#1A1A1A";
7+
const QString Colors::SURFACE_CONTAINER = "#0A0A0A";
8+
const QString Colors::SURFACE_CONTAINER_HIGH = "#141414";
9+
const QString Colors::SURFACE_CONTAINER_HIGHEST = "#1E1E1E";
10+
const QString Colors::SURFACE_VARIANT = "#2A2A2A";
1111
const QString Colors::ON_SURFACE = "#E6E1E5";
1212
const QString Colors::ON_SURFACE_VARIANT = "#CAC4D0";
13-
const QString Colors::OUTLINE = "#938F99";
14-
const QString Colors::OUTLINE_VARIANT = "#49454F";
13+
const QString Colors::OUTLINE = "#6E6E6E";
14+
const QString Colors::OUTLINE_VARIANT = "#2A2A2A";
1515

16-
// Primary (Purple)
16+
// Primary (Purple) - unchanged
1717
const QString Colors::PRIMARY = "#D0BCFF";
1818
const QString Colors::ON_PRIMARY = "#381E72";
1919
const QString Colors::PRIMARY_CONTAINER = "#4F378B";
2020
const QString Colors::ON_PRIMARY_CONTAINER = "#EADDFF";
2121

22-
// Secondary
22+
// Secondary - unchanged
2323
const QString Colors::SECONDARY = "#CCC2DC";
2424
const QString Colors::ON_SECONDARY = "#332D41";
2525
const QString Colors::SECONDARY_CONTAINER = "#4A4458";
2626

27-
// Tertiary
27+
// Tertiary - unchanged
2828
const QString Colors::TERTIARY = "#EFB8C8";
2929
const QString Colors::ON_TERTIARY = "#492532";
3030
const QString Colors::TERTIARY_CONTAINER = "#633B48";
3131

32-
// Error
32+
// Error - unchanged
3333
const QString Colors::ERROR = "#F2B8B5";
3434
const QString Colors::ON_ERROR = "#601410";
3535
const QString Colors::ERROR_CONTAINER = "#8C1D18";
3636

37-
// Accent aliases (mapped to Material tokens)
37+
// Accent aliases - unchanged
3838
const QString Colors::ACCENT_BLUE = "#D0BCFF"; // Maps to PRIMARY
3939
const QString Colors::ACCENT_PURPLE = "#CCC2DC"; // Maps to SECONDARY
4040
const QString Colors::ACCENT_GREEN = "#A8DB8F"; // Material green tone
4141
const QString Colors::ACCENT_RED = "#F2B8B5"; // Maps to ERROR
4242

43-
// Legacy aliases (mapped to Material surface system)
44-
const QString Colors::BG_GRADIENT_START = "#1C1B1F"; // SURFACE
45-
const QString Colors::BG_GRADIENT_END = "#141218"; // SURFACE_DIM
46-
const QString Colors::GLASS_BG = "rgba(33, 31, 38, 200)"; // SURFACE_CONTAINER
47-
const QString Colors::GLASS_HOVER = "rgba(43, 41, 48, 220)"; // SURFACE_CONTAINER_HIGH
48-
const QString Colors::GLASS_BORDER = "rgba(147, 143, 153, 80)"; // OUTLINE
43+
// Legacy aliases (mapped to black surface system)
44+
const QString Colors::BG_GRADIENT_START = "#000000"; // SURFACE
45+
const QString Colors::BG_GRADIENT_END = "#000000"; // SURFACE_DIM
46+
const QString Colors::GLASS_BG = "rgba(10, 10, 10, 220)"; // SURFACE_CONTAINER
47+
const QString Colors::GLASS_HOVER = "rgba(20, 20, 20, 230)"; // SURFACE_CONTAINER_HIGH
48+
const QString Colors::GLASS_BORDER = "rgba(110, 110, 110, 80)"; // OUTLINE
4949
const QString Colors::TEXT_PRIMARY = "#E6E1E5"; // ON_SURFACE
5050
const QString Colors::TEXT_SECONDARY = "#CAC4D0"; // ON_SURFACE_VARIANT
5151

0 commit comments

Comments
 (0)