diff options
| author | Tannin <sherb@gmx.net> | 2016-03-02 21:20:38 +0100 |
|---|---|---|
| committer | Tannin <sherb@gmx.net> | 2016-03-02 21:20:38 +0100 |
| commit | 53d978974040c34f6818e03e6dbf0d8d6f8acb3f (patch) | |
| tree | d7d2a9d77778c939f05c7e0644817518f6092510 | |
| parent | 4f8c71d62626aa61fb4d13f80bc043d5e6492c3e (diff) | |
updated icon and splash screen. MO can now use custom instance specific splash screens and splashes stored in game plugins
| -rw-r--r-- | src/main.cpp | 24 | ||||
| -rw-r--r-- | src/mo_icon.ico | bin | 96367 -> 45874 bytes | |||
| -rw-r--r-- | src/mo_icon.psd | bin | 979131 -> 0 bytes | |||
| -rw-r--r-- | src/splash.png | bin | 273418 -> 74041 bytes |
4 files changed, 20 insertions, 4 deletions
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 Binary files differindex 59da6c2d..ba54d4dc 100644 --- a/src/mo_icon.ico +++ b/src/mo_icon.ico diff --git a/src/mo_icon.psd b/src/mo_icon.psd Binary files differdeleted file mode 100644 index 1f7b40c9..00000000 --- a/src/mo_icon.psd +++ /dev/null diff --git a/src/splash.png b/src/splash.png Binary files differindex 4f1f1a3d..d29a6711 100644 --- a/src/splash.png +++ b/src/splash.png |
