From 53d978974040c34f6818e03e6dbf0d8d6f8acb3f Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 2 Mar 2016 21:20:38 +0100 Subject: updated icon and splash screen. MO can now use custom instance specific splash screens and splashes stored in game plugins --- src/main.cpp | 24 ++++++++++++++++++++---- src/mo_icon.ico | Bin 96367 -> 45874 bytes src/mo_icon.psd | Bin 979131 -> 0 bytes src/splash.png | Bin 273418 -> 74041 bytes 4 files changed, 20 insertions(+), 4 deletions(-) delete mode 100644 src/mo_icon.psd (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index a262d031..eb3a7248 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -434,11 +434,11 @@ void setupPath() ::SetEnvironmentVariableW(L"PATH", newPath.c_str()); } - -int runApplication(MOApplication &application, SingleInstance &instance) +int runApplication(MOApplication &application, SingleInstance &instance, + const QString &splashPath) { qDebug("start main application"); - QPixmap pixmap(":/MO/gui/splash"); + QPixmap pixmap(splashPath); QSplashScreen splash(pixmap); QString dataPath = application.property("dataPath").toString(); @@ -474,6 +474,17 @@ int runApplication(MOApplication &application, SingleInstance &instance) if (game == nullptr) { return 1; } + if (splashPath.startsWith(':')) { + // currently using MO splash, see if the plugin contains one + QString pluginSplash + = QString(":/%1/splash").arg(game->gameShortName()); + QImage image(pluginSplash); + if (!image.isNull()) { + image.save(dataPath + "/splash.png"); + } else { + qDebug("no plugin splash"); + } + } organizer.setManagedGame(game); organizer.createDefaultProfile(); @@ -630,7 +641,12 @@ int main(int argc, char *argv[]) LogBuffer::init(100, QtDebugMsg, qApp->property("dataPath").toString() + "/logs/mo_interface.log"); - int result = runApplication(application, instance); + QString splash = dataPath + "/splash.png"; + if (!QFile::exists(dataPath + "/splash.png")) { + splash = ":/MO/gui/splash"; + } + + int result = runApplication(application, instance, splash); if (result != INT_MAX) { return result; diff --git a/src/mo_icon.ico b/src/mo_icon.ico index 59da6c2d..ba54d4dc 100644 Binary files a/src/mo_icon.ico and b/src/mo_icon.ico differ diff --git a/src/mo_icon.psd b/src/mo_icon.psd deleted file mode 100644 index 1f7b40c9..00000000 Binary files a/src/mo_icon.psd and /dev/null differ diff --git a/src/splash.png b/src/splash.png index 4f1f1a3d..d29a6711 100644 Binary files a/src/splash.png and b/src/splash.png differ -- cgit v1.3.1