Bläddra i källkod

Finished implementing secure game start

Ivan Arkhipov 5 år sedan
förälder
incheckning
0acfe57589

+ 2 - 1
Legacy_v2.pro

@@ -16,7 +16,8 @@ TEMPLATE = subdirs
 SUBDIRS += \
     src/Launcher \
     src/Legacy \ 
-    src/Legacy-advanced
+    src/Legacy-advanced \
+    src/LegacyLauncher
 
 RESOURCES += \
     src/Legacy/common.qrc

+ 0 - 7
src/Launcher/Launcher.pro

@@ -20,16 +20,9 @@ SOURCES += \
 
 RESOURCES +=
 
-# Additional import path used to resolve QML modules in Qt Creator's code model
-QML_IMPORT_PATH =
-
-# Additional import path used to resolve QML modules just for Qt Quick Designer
-QML_DESIGNER_IMPORT_PATH =
-
 # Default rules for deployment.
 qnx: target.path = /tmp/$${TARGET}/bin
 else: unix:!android: target.path = /opt/$${TARGET}/bin
 !isEmpty(target.path): INSTALLS += target
 
-
 win32:RC_ICONS = $${PROJECT_ROOT_PATH}/resources/icon.ico

+ 0 - 8
src/Launcher/launcher_qml_plugin_import.cpp

@@ -1,8 +0,0 @@
-// This file is autogenerated by qmake. It imports static plugin classes for
-// static plugins used by QML imports.
-#include <QtPlugin>
-Q_IMPORT_PLUGIN(QtQuick2Plugin)
-Q_IMPORT_PLUGIN(QtQuick2WindowPlugin)
-Q_IMPORT_PLUGIN(QtQuickControls1Plugin)
-Q_IMPORT_PLUGIN(QtQuickExtrasPlugin)
-Q_IMPORT_PLUGIN(QtQuickLayoutsPlugin)

+ 12 - 4
src/Launcher/main.cpp

@@ -4,6 +4,7 @@
 #include <QDebug>
 #include <QMessageBox>
 #include <QApplication>
+#include <QFileInfo>
 
 int main(int argc, char *argv[]) {
     QApplication app(argc, argv);
@@ -12,11 +13,18 @@ int main(int argc, char *argv[]) {
     if (args.contains("gamelaunch")) {
         QProcess process;
         process.setProgram("lotro_ru.exe");
-        process.setArguments({{"-skiprawdownload", "-disablePatch"}});
-        if (!process.startDetached())
+
+        QFileInfo check_file("lotro_ru.exe");
+        if (!(check_file.exists() && check_file.isFile())) {
             QMessageBox::critical(nullptr, "Ошибка запуска!", "Не удалось запустить русифицированную версию игры! Ошибка 0x0!");
-        else
-            QMessageBox::information(nullptr, "Успех!", "Добро пожаловать в русифицированную версию Властелин Колец Онлайн!");
+        } else {
+            QMessageBox::information(nullptr, "Запуск ВКО:Наследие!", "Добро пожаловать в русифицированную версию Властелин Колец Онлайн!");
+        }
+
+        process.setArguments({{"-skiprawdownload", "-disablePatch"}});
+        if (!process.startDetached()) {
+            QMessageBox::critical(nullptr, "Ошибка запуска!", "Не удалось запустить русифицированную версию игры! Ошибка 0x2!");
+        }
     } else {
         QFile file("legacy_path.txt");
         file.open(QIODevice::ReadOnly);

+ 0 - 31
src/Launcher/main.qml

@@ -1,31 +0,0 @@
-import QtQuick 2.10
-import QtQuick.Window 2.10
-import QtQuick.Controls 1.6
-import QtQuick.Extras 1.4
-import QtGraphicalEffects 1.0
-import QtQuick.Layouts 1.3
-
-Window {
-    width: 640
-    height: 480
-    flags: Qt.FramelessWindowHint
-    color: "transparent"
-
-    Timer {
-        interval: 500; running: true; repeat: true
-        onTriggered: background.change()
-    }
-
-    Image {
-        id: background
-        source: "qrc:/backgrounds/bg1.png"
-        anchors.fill: parent
-    }
-
-    DelayButton {
-        id: delayButton
-        x: 256
-        y: 176
-        text: qsTr("Button")
-    }
-}

+ 0 - 5
src/Launcher/qml.qrc

@@ -1,5 +0,0 @@
-<RCC>
-    <qresource prefix="/">
-        <file>main.qml</file>
-    </qresource>
-</RCC>

+ 6 - 3
src/Legacy/Legacy.pro

@@ -31,7 +31,8 @@ SOURCES += \
     widgets/statusflagwidget.cpp \
     widgets/serverstatuswidget.cpp \
     models/selfupdater.cpp \
-    widgets/eventslistwidget.cpp
+    widgets/eventslistwidget.cpp \
+    widgets/chooseversiondialog.cpp
 
 HEADERS += \
     models/downloader.h \
@@ -50,7 +51,8 @@ HEADERS += \
     widgets/statusflagwidget.h \
     widgets/serverstatuswidget.h \
     models/selfupdater.h \
-    widgets/eventslistwidget.h
+    widgets/eventslistwidget.h \
+    widgets/chooseversiondialog.h
 
 FORMS += \
     widgets/helpwidget.ui \
@@ -59,7 +61,8 @@ FORMS += \
     widgets/settingswidget.ui \
     widgets/statuswidget.ui \
     widgets/newspiece.ui \
-    widgets/serverstatuswidget.ui
+    widgets/serverstatuswidget.ui \
+    widgets/chooseversiondialog.ui
 
 win32:RC_ICONS = $${PROJECT_ROOT_PATH}/resources/appicon.ico
 

+ 21 - 0
src/Legacy/models/lotrodatmanager.cpp

@@ -46,6 +46,26 @@ void LotroDatManager::InitialiseManager()
         return;
     }
 
+    // Updating file permissions to be sure, that they're not in read-only mode
+
+    if (!QFile::setPermissions((game_folder + "/client_local_" + locale_prefix + ".dat"), QFileDevice::Permission(0x6666))) {
+        qDebug() << "Unable to update permissions on client_local_* file!";
+
+        emit caughtError(QString("InitialiseManager"), {"PermissionsError"});
+        emit processFinished();
+        return;
+    }
+
+    if (!QFile::setPermissions((game_folder + "/client_general.dat"), QFileDevice::Permission(0x6666))) {
+        qDebug() << "Unable to update permissions on client_general* file!";
+
+        emit caughtError(QString("InitialiseManager"), {"PermissionsError"});
+        emit processFinished();
+        return;
+    }
+
+    // Initialising client_local_*.dat file and client_general.dat
+
     auto client_local_init_res = client_local_file.Initialise((game_folder + "/client_local_" + locale_prefix + ".dat").toStdString(), 0);
     auto client_general_init_res = client_general_file.Initialise((game_folder + "/client_general.dat").toStdString(), 1);
 
@@ -399,6 +419,7 @@ bool LotroDatManager::startLotroLauncherWithParameters(LOTRO_DAT::DatLocaleManag
         if(f.fileName().contains(" ")) f.setFileName("\"" + f.fileName() + "\"");
         process.startDetached(f.fileName(), args);
         process.waitForFinished(-1);
+        QApplication::quit();
         return true;
     } else {
         emit caughtError("startLotroLauncherWithParameters", {"LotroLauncherNotFound"});

+ 2 - 0
src/Legacy/object_script.Legacy.Debug

@@ -19,6 +19,7 @@ INPUT(
 ./..\..\build\debug\Legacy\obj\serverstatuswidget.o
 ./..\..\build\debug\Legacy\obj\selfupdater.o
 ./..\..\build\debug\Legacy\obj\eventslistwidget.o
+./..\..\build\debug\Legacy\obj\chooseversiondialog.o
 ./..\..\build\debug\Legacy\obj\legacy_plugin_import.o
 ./..\..\build\debug\Legacy\obj\moc_downloader.o
 ./..\..\build\debug\Legacy\obj\moc_filesystem.o
@@ -37,4 +38,5 @@ INPUT(
 ./..\..\build\debug\Legacy\obj\moc_serverstatuswidget.o
 ./..\..\build\debug\Legacy\obj\moc_selfupdater.o
 ./..\..\build\debug\Legacy\obj\moc_eventslistwidget.o
+./..\..\build\debug\Legacy\obj\moc_chooseversiondialog.o
 );

+ 2 - 0
src/Legacy/object_script.Legacy.Release

@@ -17,6 +17,7 @@ INPUT(
 ./..\..\build\release\Legacy\obj\serverstatuswidget.o
 ./..\..\build\release\Legacy\obj\selfupdater.o
 ./..\..\build\release\Legacy\obj\eventslistwidget.o
+./..\..\build\release\Legacy\obj\chooseversiondialog.o
 ./..\..\build\release\Legacy\obj\legacy_plugin_import.o
 ./..\..\build\release\Legacy\obj\moc_downloader.o
 ./..\..\build\release\Legacy\obj\moc_filesystem.o
@@ -35,4 +36,5 @@ INPUT(
 ./..\..\build\release\Legacy\obj\moc_serverstatuswidget.o
 ./..\..\build\release\Legacy\obj\moc_selfupdater.o
 ./..\..\build\release\Legacy\obj\moc_eventslistwidget.o
+./..\..\build\release\Legacy\obj\moc_chooseversiondialog.o
 );

+ 48 - 0
src/Legacy/widgets/chooseversiondialog.cpp

@@ -0,0 +1,48 @@
+#include "chooseversiondialog.h"
+#include "ui_chooseversiondialog.h"
+
+#include "models/lotrodatmanager.h"
+#include "models/patchdownloader.h"
+#include "widgets/mainwindow.h"
+
+ChooseVersionDialog::ChooseVersionDialog(QSettings *settings, PatchDownloader *patch_downloader, LotroDatManager *lotro_dat_manager, QWidget *parent) :
+    QWidget(parent), app_settings(settings), lotro_manager(lotro_dat_manager),
+    ui(new Ui::ChooseVersionDialog)
+{
+//    setWindowModality(Qt::WindowModal);
+    ui->setupUi(this);
+    ui->wait_widget->hide();
+    ui->cancel_widget->show();
+}
+
+ChooseVersionDialog::~ChooseVersionDialog()
+{
+    delete ui;
+}
+
+void ChooseVersionDialog::show()
+{
+    QString locale_prefix = app_settings->value("General/original_locale", "English").toString();
+    ui->start_original->setStyleSheet("QWidget#start_original{\n	border: 0;\n	border-image: url(:/buttons/run_" + locale_prefix + ".png);\n}\n\nQWidget#start_original:hover{\n	border: 3px;\n	border-image: url(:/buttons/run_" + locale_prefix + ".png);\n}");
+    QWidget::show();
+}
+
+void ChooseVersionDialog::on_start_patched_clicked()
+{
+    ui->wait_widget->show();
+    ui->cancel_widget->hide();
+    QMetaObject::invokeMethod(lotro_manager, "StartGame", Qt::QueuedConnection, Q_ARG(LOTRO_DAT::DatLocaleManager::LOCALE, LOTRO_DAT::DatLocaleManager::PATCHED));
+}
+
+void ChooseVersionDialog::on_start_original_clicked()
+{
+    ui->wait_widget->show();
+    ui->cancel_widget->hide();
+    QMetaObject::invokeMethod(lotro_manager, "StartGame", Qt::QueuedConnection, Q_ARG(LOTRO_DAT::DatLocaleManager::LOCALE, LOTRO_DAT::DatLocaleManager::ORIGINAL));
+}
+
+void ChooseVersionDialog::on_cancel_clicked()
+{
+    hide();
+    emit cancelled();
+}

+ 46 - 0
src/Legacy/widgets/chooseversiondialog.h

@@ -0,0 +1,46 @@
+#ifndef CHOOSEVERSIONDIALOG_H
+#define CHOOSEVERSIONDIALOG_H
+
+#include <QDialog>
+#include <QMouseEvent>
+#include <QSettings>
+
+class PatchDownloader;
+class LotroDatManager;
+
+namespace Ui {
+class ChooseVersionDialog;
+}
+
+class ChooseVersionDialog : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit ChooseVersionDialog(QSettings* settings, PatchDownloader* patch_downloader, LotroDatManager* lotro_dat_manager, QWidget *parent = 0);
+    ~ChooseVersionDialog();
+
+public slots:
+    void show();
+
+private slots:
+
+    void on_start_patched_clicked();
+
+    void on_start_original_clicked();
+
+    void on_cancel_clicked();
+
+signals:
+    void cancelled();
+
+private:
+    QSettings* app_settings;
+    PatchDownloader* patch_updater;
+    LotroDatManager* lotro_manager;
+
+    Ui::ChooseVersionDialog *ui;
+    QPoint dragPosition;
+};
+
+#endif // CHOOSEVERSIONDIALOG_H

+ 396 - 0
src/Legacy/widgets/chooseversiondialog.ui

@@ -0,0 +1,396 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ChooseVersionDialog</class>
+ <widget class="QWidget" name="ChooseVersionDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>991</width>
+    <height>607</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>380</width>
+    <height>200</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Выбор версии игры</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_3">
+   <item row="0" column="0">
+    <widget class="QWidget" name="contents" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <property name="leftMargin">
+       <number>0</number>
+      </property>
+      <property name="topMargin">
+       <number>0</number>
+      </property>
+      <property name="rightMargin">
+       <number>0</number>
+      </property>
+      <property name="bottomMargin">
+       <number>0</number>
+      </property>
+      <property name="spacing">
+       <number>0</number>
+      </property>
+      <item row="0" column="0">
+       <widget class="QWidget" name="widget_2" native="true">
+        <property name="minimumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-topleft.png);</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QWidget" name="widget_7" native="true">
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-top.png);</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <widget class="QWidget" name="widget_9" native="true">
+        <property name="minimumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-topright.png);</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QWidget" name="widget_4" native="true">
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-left.png);</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QWidget" name="content_area" native="true">
+        <property name="styleSheet">
+         <string notr="true">QWidget#content_area{
+	border-image: url(:/backgrounds/strong_translucent-background.png);
+}</string>
+        </property>
+        <layout class="QGridLayout" name="gridLayout_2">
+         <property name="leftMargin">
+          <number>11</number>
+         </property>
+         <property name="topMargin">
+          <number>11</number>
+         </property>
+         <property name="rightMargin">
+          <number>11</number>
+         </property>
+         <item row="0" column="0" colspan="2">
+          <widget class="QLabel" name="label_title">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="font">
+            <font>
+             <family>Aniron</family>
+             <weight>75</weight>
+             <bold>true</bold>
+            </font>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">color: white; </string>
+           </property>
+           <property name="text">
+            <string>Выберите версию игры</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="0" colspan="2">
+          <widget class="QWidget" name="cancel_widget" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <layout class="QHBoxLayout" name="horizontalLayout_2">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QPushButton" name="cancel">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>Вернуться</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+         <item row="1" column="0" colspan="2">
+          <widget class="QWidget" name="widget" native="true">
+           <layout class="QHBoxLayout" name="horizontalLayout">
+            <property name="spacing">
+             <number>7</number>
+            </property>
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QPushButton" name="start_original">
+              <property name="minimumSize">
+               <size>
+                <width>120</width>
+                <height>70</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>129</width>
+                <height>70</height>
+               </size>
+              </property>
+              <property name="cursor">
+               <cursorShape>PointingHandCursor</cursorShape>
+              </property>
+              <property name="toolTip">
+               <string>Запустить оригинальную версию</string>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">QWidget#start_original{
+	border: 0;
+	border-image: url(:/buttons/run_English.png);
+}
+
+QWidget#start_original:hover{
+	border: 3px;
+	border-image: url(:/buttons/run_English.png);
+}</string>
+              </property>
+              <property name="text">
+               <string/>
+              </property>
+              <property name="flat">
+               <bool>true</bool>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="start_patched">
+              <property name="minimumSize">
+               <size>
+                <width>120</width>
+                <height>70</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>120</width>
+                <height>70</height>
+               </size>
+              </property>
+              <property name="cursor">
+               <cursorShape>PointingHandCursor</cursorShape>
+              </property>
+              <property name="toolTip">
+               <string>Запустить русифицированную версию</string>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">QWidget#start_patched{
+	border: 0;
+	border-image: url(:/buttons/run_RU.png);
+}
+
+QWidget#start_patched:hover{
+	border: 3px;
+	border-image: url(:/buttons/run_RU.png);
+}</string>
+              </property>
+              <property name="text">
+               <string/>
+              </property>
+              <property name="flat">
+               <bool>true</bool>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+         <item row="4" column="0">
+          <widget class="QWidget" name="wait_widget" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QLabel" name="label">
+              <property name="styleSheet">
+               <string notr="true">color:white</string>
+              </property>
+              <property name="text">
+               <string>Подоготовка к запуску, пожалуйста, подождите...</string>
+              </property>
+              <property name="alignment">
+               <set>Qt::AlignCenter</set>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QProgressBar" name="progressBar">
+              <property name="maximum">
+               <number>0</number>
+              </property>
+              <property name="value">
+               <number>-1</number>
+              </property>
+              <property name="textVisible">
+               <bool>false</bool>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item row="1" column="2">
+       <widget class="QWidget" name="widget_10" native="true">
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-right.png);</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QWidget" name="widget_3" native="true">
+        <property name="minimumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-botleft.png);</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="QWidget" name="widget_6" native="true">
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-bottom.png);</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="2">
+       <widget class="QWidget" name="widget_8" native="true">
+        <property name="minimumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>26</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">border-image: url(:/backgrounds/strong_translucent-border-botright.png);</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 29 - 0
src/Legacy/widgets/mainwindow.cpp

@@ -4,6 +4,8 @@
 #include "models/patchdownloader.h"
 #include "models/lotrodatmanager.h"
 
+#include "widgets/chooseversiondialog.h"
+
 #include <QBitmap>
 #include <QPainter>
 #include <QPixmap>
@@ -13,6 +15,7 @@
 #include <QMessageBox>
 #include <QDesktopWidget>
 #include <QtConcurrent/QtConcurrent>
+#include <QGraphicsBlurEffect>
 
 MainWindow::MainWindow(QWidget *parent) :
     QMainWindow(parent, Qt::Window | Qt::FramelessWindowHint),
@@ -46,6 +49,13 @@ MainWindow::MainWindow(QWidget *parent) :
     settings_widget = new SettingsWidget(settings, patch_updater, lotro_manager, this);
     help_widget = new HelpWidget(settings, patch_updater, lotro_manager, this);
 
+    choose_locale_dialog = new ChooseVersionDialog(settings, patch_updater, lotro_manager, this);
+//    choose_locale_dialog->move(this->rect().center() - choose_locale_dialog->rect().center());
+    choose_locale_dialog->resize(size());
+    choose_locale_dialog->hide();
+    choose_locale_blur_effect = new QGraphicsBlurEffect(this);
+    connect(choose_locale_dialog, &ChooseVersionDialog::cancelled, this, &MainWindow::hideChooseVersionDialog);
+
     ui->content_layout->addWidget(status_widget);
     ui->content_layout->addWidget(rusification_widget);
     ui->content_layout->addWidget(settings_widget);
@@ -97,6 +107,7 @@ void MainWindow::mouseMoveEvent(QMouseEvent *event)
 {
     if (event->buttons() & Qt::LeftButton) {
         move(event->globalPos() - dragPosition);
+//        choose_locale_dialog->move(this->rect().center() - choose_locale_dialog->rect().center());
         event->accept();
     }
 }
@@ -112,6 +123,8 @@ void MainWindow::resizeEvent(QResizeEvent * event)
     ui->content_area->move(0, height * 110 / 650);
     ui->content_area->resize(width * 900 / 900, height * 515 / 650);
     setupWindowBackgroundAndMask(current_bg);
+//    choose_locale_dialog->move(this->rect().center() - choose_locale_dialog->rect().center());
+    choose_locale_dialog->resize(size());
 }
 
 void MainWindow::randomChangeBackground()
@@ -293,6 +306,22 @@ void MainWindow::changeFontSizeRecursive(size_t percent, QWidget *widget)
         }
 }
 
+void MainWindow::showChooseVersionDialog()
+{
+    choose_locale_blur_effect->setBlurRadius(10);
+    choose_locale_blur_effect->setBlurHints(QGraphicsBlurEffect::QualityHint);
+    ui->content_area->setGraphicsEffect(choose_locale_blur_effect);
+    choose_locale_dialog->show();
+}
+
+void MainWindow::hideChooseVersionDialog()
+{
+    choose_locale_blur_effect->setBlurRadius(0);
+    choose_locale_blur_effect->setBlurHints(QGraphicsBlurEffect::QualityHint);
+    ui->content_area->setGraphicsEffect(choose_locale_blur_effect);
+    choose_locale_dialog->hide();
+}
+
 void MainWindow::on_closeButton_clicked()
 {
     hide();

+ 8 - 0
src/Legacy/widgets/mainwindow.h

@@ -6,11 +6,13 @@
 #include <QTimer>
 #include <QPixmap>
 #include <QBitmap>
+#include <QGraphicsBlurEffect>
 
 #include "statuswidget.h"
 #include "rusificationwidget.h"
 #include "settingswidget.h"
 #include "helpwidget.h"
+#include "chooseversiondialog.h"
 
 namespace Ui {
 class MainWindow;
@@ -30,6 +32,10 @@ public:
     void changeFontSizeRecursive(size_t percent, QWidget* widget);
     ~MainWindow();
 
+public slots:
+    void showChooseVersionDialog();
+    void hideChooseVersionDialog();
+
 protected:
     void mouseMoveEvent(QMouseEvent *event) override;
     void mousePressEvent(QMouseEvent *event) override;
@@ -80,6 +86,8 @@ private:
     RusificationWidget *rusification_widget;
     SettingsWidget *settings_widget;
     HelpWidget *help_widget;
+    ChooseVersionDialog *choose_locale_dialog;
+    QGraphicsBlurEffect *choose_locale_blur_effect;
 
     QWidget* menuHoverWidget;
     QPropertyAnimation* menuHoverWidgetAnimation;

+ 1 - 1
src/Legacy/widgets/statusflagwidget.cpp

@@ -3,6 +3,7 @@
 #include <QtConcurrent/QtConcurrent>
 #include <QPainter>
 #include <QPaintEvent>
+#include <QToolTip>
 
 StatusFlagWidget::StatusFlagWidget(QWidget *parent) : QWidget(parent)
 {
@@ -86,7 +87,6 @@ void StatusFlagWidget::leaveEvent(QEvent * event)
     event->ignore();
 }
 
-
 void StatusFlagWidget::mousePressEvent(QMouseEvent *ev)
 {
     if (flag_id == 2) {

+ 2 - 1
src/Legacy/widgets/statuswidget.cpp

@@ -106,5 +106,6 @@ void StatusWidget::on_donate_link_button_clicked()
 
 void StatusWidget::on_game_button_clicked()
 {
-    QMetaObject::invokeMethod(lotro_manager, "StartGame", Qt::QueuedConnection, Q_ARG(LOTRO_DAT::DatLocaleManager::LOCALE, LOTRO_DAT::DatLocaleManager::PATCHED));
+    MainWindow* window = qobject_cast<MainWindow*>(parentWidget()->parentWidget()->parentWidget());
+    window->showChooseVersionDialog();
 }