Browse Source

Minor fixes, added videos & added class for storing original databases

Ivan Arkhipov 3 years ago
parent
commit
212b4357ac

+ 2 - 0
src/Legacy/Legacy.pro

@@ -15,6 +15,7 @@ CONFIG += resources_big
 
 SOURCES += \
     main.cpp \
+    models/datoriginalfilesdatabase.cpp \
     models/downloader.cpp \
     models/patchdownloader.cpp \
     models/patchinstaller.cpp \
@@ -41,6 +42,7 @@ SOURCES += \
     models/filesystem.cpp
 
 HEADERS += \
+    models/datoriginalfilesdatabase.h \
     models/downloader.h \
     models/filesystem.h \
     models/patchdownloader.h \

+ 4 - 0
src/Legacy/legacyapplication.cpp

@@ -92,3 +92,7 @@ void LegacyApplication::InitModules() {
         modules_init_timer_.start();
     }
 }
+
+void LegacyApplication::close() {
+    gui->close();
+}

+ 1 - 0
src/Legacy/legacyapplication.h

@@ -31,6 +31,7 @@ signals:
 
 public slots:
     void InitModules();
+    void close();
 
 private:
     MainWindow *gui = nullptr;

+ 73 - 0
src/Legacy/models/datoriginalfilesdatabase.cpp

@@ -0,0 +1,73 @@
+#include "datoriginalfilesdatabase.h"
+#include <QSqlError>
+#include <string>
+
+
+DatOriginalFilesDatabase::DatOriginalFilesDatabase(QString database_path) :
+    orig_files_db(QSqlDatabase::addDatabase("QSQLITE", database_path)),
+    _add_file_prepared_query(orig_files_db)
+{
+    orig_files_db.setDatabaseName(database_path);
+    orig_files_db.open();
+    orig_files_db.exec(_create_database_query);
+    orig_files_db.exec("PRAGMA synchronous = OFF");
+    orig_files_db.exec("PRAGMA count_changes = OFF");
+    orig_files_db.exec("PRAGMA journal_mode = MEMORY");
+    orig_files_db.exec("PRAGMA temp_store = MEMORY");
+    orig_files_db.exec("PRAGMA encoding = \"UTF-8\";");
+
+    _add_file_prepared_query.prepare(_add_file_query);
+}
+
+DatOriginalFilesDatabase::~DatOriginalFilesDatabase() {
+    closeDatabase();
+}
+
+void DatOriginalFilesDatabase::addFile(int file_id, int dat_id, int version, int iteration, const LOTRO_DAT::SubfileData &data) {
+    std::stringstream options_stream;
+    options_stream << data.options;
+    const QString options = QString::fromStdString(options_stream.str());
+    qDebug() << "AAAAAAdding file " << file_id << dat_id << version << iteration;
+    _add_file_prepared_query.bindValue(":file_id", file_id);
+    _add_file_prepared_query.bindValue(":dat_id", dat_id);
+    _add_file_prepared_query.bindValue(":version", version);
+    _add_file_prepared_query.bindValue(":iteration", iteration);
+    _add_file_prepared_query.bindValue(":options", options);
+    _add_file_prepared_query.bindValue(":binary_data", QByteArray(reinterpret_cast<char*>(data.binary_data.data()), data.binary_data.size()));
+    _add_file_prepared_query.bindValue(":text_data", QString::fromStdU16String(data.text_data));
+    if (!_add_file_prepared_query.exec()) {
+        qWarning() << _add_file_prepared_query.lastError();
+    }
+}
+
+bool DatOriginalFilesDatabase::getFile(int file_id, int &dat_id, int &version, int &iteration, LOTRO_DAT::SubfileData &data) {
+    QSqlQuery get_file_query;
+    get_file_query.exec(_get_file_query.arg(file_id));
+    if (!get_file_query.next()) {
+        return false;
+    }
+    dat_id = get_file_query.value(1).toInt();
+    version = get_file_query.value(2).toInt();
+    iteration = get_file_query.value(3).toInt();
+    const QString options = QString::fromUtf8(get_file_query.value(4).toByteArray());
+    data.options = YAML::Load(options.toStdString());
+    const QByteArray binary_data = get_file_query.value(5).toByteArray();
+    data.binary_data = LOTRO_DAT::BinaryData(binary_data.data(), binary_data.size());
+    data.text_data = QString::fromUtf8(get_file_query.value(6).toByteArray()).toStdU16String();
+    return true;
+}
+
+bool DatOriginalFilesDatabase::fileExists(int file_id) {
+    QSqlQuery get_file_query;
+    get_file_query.exec(_get_file_query.arg(file_id));
+    return get_file_query.next();
+}
+
+void DatOriginalFilesDatabase::removeDatabase() {
+    orig_files_db.close();
+    QFile::remove(orig_files_db.databaseName());
+}
+
+void DatOriginalFilesDatabase::closeDatabase() {
+    orig_files_db.close();
+}

+ 55 - 0
src/Legacy/models/datoriginalfilesdatabase.h

@@ -0,0 +1,55 @@
+#ifndef DATORIGINALFILESDATABASE_H
+#define DATORIGINALFILESDATABASE_H
+
+#include <QSqlDatabase>
+#include <QSqlQuery>
+
+#include "models/patchinstaller.h"
+
+class DatOriginalFilesDatabase {
+public:
+    explicit DatOriginalFilesDatabase(QString database_path);
+
+    ~DatOriginalFilesDatabase();
+
+    void addFile(int file_id, int dat_id, int version, int iteration, const LOTRO_DAT::SubfileData& data);
+
+    bool getFile(int file_id, int& dat_id, int& version, int& iteration, LOTRO_DAT::SubfileData& data);
+
+    bool fileExists(int file_id);
+
+    void removeDatabase();
+
+    void closeDatabase();
+
+private:
+    QSqlDatabase orig_files_db;
+    QSqlQuery _add_file_prepared_query;
+
+    const QString _create_database_query = "CREATE TABLE IF NOT EXISTS patch_data ("
+                                                "file_id INTEGER PRIMARY KEY,"
+                                                "dat_id INTEGER NOT NULL,"
+                                                "version INTEGER NOT NULL,"
+                                                "iteration INTEGER NOT NULL,"
+                                                "options TEXT,"
+                                                "binary_data BLOB,"
+                                                "text_data TEXT"
+                                            ");";
+    const QString _add_file_query = "INSERT INTO patch_data "
+                                        "(file_id, dat_id, version, iteration, options, binary_data, text_data) "
+                                    "VALUES"
+                                        "(:file_id, :dat_id, :version, :iteration, :options, :binary_data, :text_data)"
+                                    "ON CONFLICT(`file_id`) DO UPDATE SET "
+                                        "dat_id=:dat_id,"
+                                        "version=:version,"
+                                        "iteration=:iteration,"
+                                        "options=:options,"
+                                        "binary_data=:binary_data,"
+                                        "text_data=:text_data"
+                                    ";";
+
+    const QString _get_file_query = "SELECT * FROM patch_data WHERE `file_id`=%1;";
+
+};
+
+#endif // DATORIGINALFILESDATABASE_H

+ 44 - 83
src/Legacy/models/patchinstaller.cpp

@@ -1,7 +1,9 @@
 #include "patchinstaller.h"
+#include "legacyapplication.h"
 #include "models/patchdownloader.h"
 #include "models/filesystem.h"
 #include "models/settings.h"
+#include "models/datoriginalfilesdatabase.h"
 
 #include <QDebug>
 #include <QProcess>
@@ -23,9 +25,7 @@ QString getComponentNameFromId(int id) {
     return "none";
 }
 
-PatchInstaller::PatchInstaller(QObject *parent)
-    : QObject(parent)
-    , orig_files_db(QSqlDatabase::addDatabase("QSQLITE")) {
+PatchInstaller::PatchInstaller(QObject *parent) : QObject(parent) {
         client_local_file_ = new LOTRO_DAT::DatFile(100);
         client_general_file_ = new LOTRO_DAT::DatFile(101);
         connect(&PatchDownloader::instance(), &PatchDownloader::finished, this, &PatchInstaller::startPatchInstallationChain);
@@ -58,7 +58,6 @@ bool PatchInstaller::datPathIsRelevant() {
 }
 
 void PatchInstaller::deinit() {
-    orig_files_db.close();
     client_local_file_->Deinit();
     client_general_file_->Deinit();
     emit deinitialized();
@@ -79,11 +78,7 @@ void PatchInstaller::installPatch(QString patch_name, LOTRO_DAT::Database* datab
         return;
     }
 
-    if (patch_name == "micro" && !Settings::getValue("Components/micropatch").toBool()) {
-        Settings::setValue("DatabaseNeedInstall/micropatch", false);
-        return;
-    }
-
+    DatOriginalFilesDatabase orig_files_db(QApplication::applicationDirPath() + "/data/" + patch_name + "_orig.db");
     LOTRO_DAT::SubfileData file;
     qDebug() << "Total files in database " << database->CountRows();
     qDebug() << "Patching all files from database..." << database;
@@ -108,20 +103,25 @@ void PatchInstaller::installPatch(QString patch_name, LOTRO_DAT::Database* datab
 
         const int file_id = file.options["fid"].as<int>();
         int file_version = -1;
-
+        int file_iteration = -1; // TODO: FILE ITERATION
 
         if (dat_id == E_CLIENT_LOCAL) {
             file_version = client_local_file_->GetFileVersion(file_id);
         } else if (dat_id == E_CLIENT_GENERAL) {
-            file_version = client_local_file_->GetFileVersion(file_id);
+            file_version = client_general_file_->GetFileVersion(file_id);
         }
 
-//        if (file_version != _patch_files_versions) {
-//            const QString query = "INSERT INTO `patch_data` (`file_id`, `options`) VALUES ('"
-//                    + QString::number(file_id) + "', '" + QString::number(file_version)
-//                    + "') ON CONFLICT(`file_id`) DO UPDATE SET `options`='" + QString::number(file_version) + "';";
-//            orig_files_db.exec(query);
-//        }
+
+        if (file_version != _patch_files_versions && file_version != 0) {
+            LOTRO_DAT::SubfileData data;
+            if (dat_id == E_CLIENT_LOCAL) {
+                data = client_local_file_->GetFile(file_id);
+            } else if (dat_id == E_CLIENT_GENERAL) {
+                data = client_general_file_->GetFile(file_id);
+            }
+
+            orig_files_db.addFile(file_id, dat_id, file_version, file_iteration, data);
+        }
 
         if (dat_id == E_CLIENT_LOCAL) {
             client_local_file_->PatchFile(file, _patch_files_versions);
@@ -142,19 +142,12 @@ void PatchInstaller::installPatch(QString patch_name, LOTRO_DAT::Database* datab
     } else if (patch_name == "font") {
         _current_applied_patches_info.fonts_patch_hashsum = hashsum;
     }
+    orig_files_db.closeDatabase();
     insertPatchesInfoInDatFile(_current_applied_patches_info);
-    Settings::setValue("DatabaseNeedInstall/" + patch_name, false);
     return;
 }
 
 void PatchInstaller::installLoadscreens(LOTRO_DAT::Database* database) {
-    if (!Settings::getValue("Components/loadscreens").toBool()) {
-        current_status.finished_parts += database->CountRows();
-        emit progressChanged(current_status);
-        Settings::setValue("DatabaseNeedInstall/loadscreen", false);
-        return;
-    }
-
     QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
 
     const QStringList loadscreens_filenames = {
@@ -191,7 +184,6 @@ void PatchInstaller::installLoadscreens(LOTRO_DAT::Database* database) {
         }
     }
 
-    Settings::setValue("DatabaseNeedInstall/loadscreen", false);
     _current_applied_patches_info.has_no_patch_mark = false;
     _current_applied_patches_info.loadscreens_patch_hashsum = Settings::getValue("PatchDatabases/loadscreen/hashsum").toString();
     insertPatchesInfoInDatFile(_current_applied_patches_info);
@@ -205,11 +197,6 @@ void PatchInstaller::installVideos(LOTRO_DAT::Database* database) {
     download_video_total_videos = database->CountRows();
     download_video_finished_videos = 0;
 
-    if (!Settings::getValue("Components/videos").toBool()) {
-        Settings::setValue("DatabaseNeedInstall/video", false);
-        return;
-    }
-
     LOTRO_DAT::SubfileData file;
     while (!(file = database->GetNextFile()).Empty()) {
         if (!file.options["name"] || !file.options["url"] || !file.options["hash"] || !file.options["folder"]) {
@@ -250,7 +237,6 @@ void PatchInstaller::installVideos(LOTRO_DAT::Database* database) {
     _current_applied_patches_info.has_no_patch_mark = false;
     _current_applied_patches_info.videos_patch_hashsum = Settings::getValue("PatchDatabases/video/hashsum").toString();
     insertPatchesInfoInDatFile(_current_applied_patches_info);
-    Settings::setValue("DatabaseNeedInstall/video", false);
 }
 
 PatchInstaller::AppliedPatchesInfo PatchInstaller::getAppliedPatchesInfoFromDatFile() {
@@ -342,16 +328,6 @@ void PatchInstaller::init()
     if (!FileSystem::fileExists(database_path)) {
         FileSystem::createFilePath(database_path);
     }
-    orig_files_db.setDatabaseName(database_path);
-    if (!orig_files_db.open()) {
-        qCritical() << "Initializing PatchInstaller - Cannot open backup database!!!!!!! " << database_path;
-    }
-    orig_files_db.exec(create_table_query);
-    orig_files_db.exec("PRAGMA synchronous = OFF");
-    orig_files_db.exec("PRAGMA count_changes = OFF");
-    orig_files_db.exec("PRAGMA journal_mode = MEMORY");
-    orig_files_db.exec("PRAGMA temp_store = MEMORY");
-    orig_files_db.exec("PRAGMA encoding = \"UTF-8\";");
 
     qDebug() << "LotroDatManager initialisation successfull! Dat files: "
              << QString::fromStdString(client_general_file_->GetFilename())
@@ -361,10 +337,7 @@ void PatchInstaller::init()
     emit successfullyInitialized();
 }
 
-void PatchInstaller::startGame(bool freeze_updates) {
-    // if freeze_updates is set to True, original game
-    // launcher will be replaced with special program,
-    // which controls lotro startup and prevents from updates
+void PatchInstaller::startGame() {
     QString game_folder = Settings::getValue("Lotro/game_path").toString();
 
     if (game_folder == "none") {
@@ -377,45 +350,12 @@ void PatchInstaller::startGame(bool freeze_updates) {
         return;
     }
 
-    if (freeze_updates) {
-        QFile::remove(game_folder + "/lotro_ru.exe");
-        if (!QFile::copy(QApplication::applicationDirPath() + "/LotroLauncher.exe", game_folder + "/lotro_ru.exe")) {
-            qCritical() << __FUNCTION__ << "Starting game FAILED - cannot copy LotroLauncher to lotro_ru.exe!!";
-            return;
-        }
-
-        QFile::remove(game_folder + "/LotroLauncher.exe");
-        if (!QFile::copy(QApplication::applicationDirPath() + "/Launcher.exe", game_folder + "/LotroLauncher.exe")) {
-            qCritical() << __FUNCTION__ << "Starting game FAILED - cannot copy GameLauncher to LotroLauncher!!";
-            return;
-        }
-
-        QFile file(game_folder + "/legacy_path.txt");
-        file.open(QIODevice::WriteOnly);
-        QTextStream out(&file);
-        out << QApplication::applicationDirPath() + "/LegacyLauncher.exe";
-        file.close();
-    } else {
-        QFile::remove(game_folder + "/LotroLauncher.exe");
-        if (!QFile::copy(QApplication::applicationDirPath() + "/LotroLauncher.exe", game_folder + "/LotroLauncher.exe")) {
-            qCritical() << __FUNCTION__ << "Starting game FAILED - cannot copy LotroLauncher from working dir to LotroLauncher in lotro dir!!";
-            return;
-        }
-    }
-
     QStringList args;
-    if (freeze_updates) {
-        args << "gamelaunch" << "-disablePatch";
-    }
-
-    if (Settings::getValue("Lotro/skip_raw_download").toBool()) {
+    args << "-nosplashscreen";
+    if (_current_applied_patches_info.loadscreens_patch_hashsum != "") {
         args << "-skiprawdownload";
     }
 
-    if (Settings::getValue("Lotro/no_splash_screen").toBool()) {
-        args << "-nosplashscreen";
-    }
-
     client_general_file_->Deinit();
     client_local_file_->Deinit();
 
@@ -434,10 +374,10 @@ void PatchInstaller::startGame(bool freeze_updates) {
         if (f.fileName().contains(" ")) {
             f.setFileName("\"" + f.fileName() + "\"");
         }
-
+        deinit();
         process.startDetached(f.fileName(), args);
         process.waitForFinished(-1);
-        QApplication::quit();
+        QMetaObject::invokeMethod(&LegacyApplication::instance(), &LegacyApplication::close, Qt::QueuedConnection);
     }
 }
 
@@ -452,6 +392,22 @@ void PatchInstaller::startPatchInstallationChain() {
 
     for (const QString& patch: patches) {
         if (!Settings::getValue("DatabaseDownload/" + patch).toBool()) {
+            if (patch == "text") {
+                _current_applied_patches_info.texts_patch_hashsum = "";
+            } else if (patch == "image") {
+                _current_applied_patches_info.images_patch_hashsum = "";
+            } else if (patch == "sound") {
+                _current_applied_patches_info.sounds_patch_hashsum = "";
+            } else if (patch == "texture") {
+                _current_applied_patches_info.textures_patch_hashsum = "";
+            } else if (patch == "font") {
+                _current_applied_patches_info.fonts_patch_hashsum = "";
+            } else if (patch == "video") {
+                _current_applied_patches_info.videos_patch_hashsum = "";
+            } else if (patch == "loadscreen") {
+                _current_applied_patches_info.loadscreens_patch_hashsum = "";
+            }
+
             qDebug() << "Skipping patch " << patch << " because its disabled";
             continue;
         }
@@ -470,6 +426,10 @@ void PatchInstaller::startPatchInstallationChain() {
             hashsum_in_dat_file = _current_applied_patches_info.textures_patch_hashsum;
         } else if (patch == "font") {
             hashsum_in_dat_file = _current_applied_patches_info.fonts_patch_hashsum;
+        } else if (patch == "video") {
+            hashsum_in_dat_file = _current_applied_patches_info.videos_patch_hashsum;
+        } else if (patch == "loadscreen") {
+            hashsum_in_dat_file = _current_applied_patches_info.loadscreens_patch_hashsum;
         }
 
         if (patch_hashsum == hashsum_in_dat_file) {
@@ -500,6 +460,7 @@ void PatchInstaller::startPatchInstallationChain() {
         delete patch_databases[patch_name];
     }
 
+    insertPatchesInfoInDatFile(_current_applied_patches_info);
     qInfo() << "PatchInstaller: Finished installation chain...";
     emit finished();
 }

+ 1 - 11
src/Legacy/models/patchinstaller.h

@@ -53,7 +53,6 @@ private:
     bool datPathIsRelevant();
 
     void installPatch(QString patch_name, LOTRO_DAT::Database* database);
-
     void installLoadscreens(LOTRO_DAT::Database* database);
 
     void installVideos(LOTRO_DAT::Database* database);
@@ -65,7 +64,7 @@ private:
 public slots:
     void deinit();
     void init();
-    void startGame(bool freeze_updates);
+    void startGame();
     void startPatchInstallationChain();
 
 private slots:
@@ -83,14 +82,6 @@ private:
     LOTRO_DAT::DatFile* client_local_file_;
     LOTRO_DAT::DatFile* client_general_file_;
 
-    QSqlDatabase orig_files_db;
-    const QString create_table_query = "CREATE TABLE IF NOT EXISTS `patch_data` "
-                                       "(`file_id` INTEGER PRIMARY KEY,"
-                                       "`binary_data` BLOB, "
-                                       "`text_data` TEXT, "
-                                       "`options` TEXT NOT NULL)";
-
-//    const QString upset_table_value_query = "INSERT INTO `patch_data` (`file_id`, ``) VALUES (?);";
     AppliedPatchesInfo _current_applied_patches_info;
     Status current_status;
     const QString _patch_mark_header = "HI_FROM_ENDEVIR_V2.0";
@@ -98,7 +89,6 @@ private:
     const int _patch_files_versions = 6;
     int download_video_finished_videos = 0;
     int download_video_total_videos = 0;
-
 };
 
 Q_DECLARE_METATYPE(PatchInstaller::Status)

+ 0 - 11
src/Legacy/models/settings.cpp

@@ -34,17 +34,6 @@ QMap<QString, QVariant> defaults = {
     {"DatabaseDownload/video", false},         // VideosPatch
     {"DatabaseDownload/micro", false},         // MicroPatch
 
-    // Flags, meaning that database is fresh and needs to be installed
-
-    {"DatabaseNeedInstall/text", false},           // TextsPatch
-    {"DatabaseNeedInstall/font", false},           // TextsPatch
-    {"DatabaseNeedInstall/image", false},          // GraphicsPatch
-    {"DatabaseNeedInstall/loadscreen", false},     // GraphicsPatch
-    {"DatabaseNeedInstall/texture", false},        // GraphicsPatch
-    {"DatabaseNeedInstall/sound", false},          // SoundsPatch
-    {"DatabaseNeedInstall/video", false},          // VideosPatch
-    {"DatabaseNeedInstall/micro", false},          // MircoPatch
-
     // Network settings
 
     {"Network/site_url", "http://translate.lotros.ru/"},

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

@@ -299,6 +299,8 @@ void StatusWidget::on_game_button_clicked()
         QMetaObject::invokeMethod(&PatchDownloader::instance(), &PatchDownloader::startPatchDownloaderChain, Qt::QueuedConnection);
         return;
     }
+
+    QMetaObject::invokeMethod(&PatchInstaller::instance(), &PatchInstaller::startGame, Qt::QueuedConnection);
 }
 
 void StatusWidget::createTooltipMessageWidget(QString tooltip_id)

+ 18 - 24
src/Legacy/widgets/translationcomponents.ui

@@ -189,14 +189,8 @@
     </widget>
    </item>
    <item>
-    <widget class="QWidget" name="c_video_block" native="true">
-     <property name="maximumSize">
-      <size>
-       <width>16777215</width>
-       <height>0</height>
-      </size>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_5">
+    <widget class="QWidget" name="d_audio_block" native="true">
+     <layout class="QHBoxLayout" name="horizontalLayout_6">
       <property name="spacing">
        <number>3</number>
       </property>
@@ -210,7 +204,7 @@
        <number>0</number>
       </property>
       <item>
-       <widget class="TooltipButton" name="video_block_label">
+       <widget class="TooltipButton" name="audio_block_label">
         <property name="font">
          <font>
           <family>Crimson Text</family>
@@ -228,7 +222,7 @@
          <enum>QFrame::NoFrame</enum>
         </property>
         <property name="text">
-         <string>Видеоролики</string>
+         <string>Озвучка персонажей</string>
         </property>
         <property name="alignment">
          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -236,7 +230,7 @@
        </widget>
       </item>
       <item>
-       <spacer name="horizontalSpacer_3">
+       <spacer name="horizontalSpacer_5">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
@@ -249,7 +243,7 @@
        </spacer>
       </item>
       <item>
-       <widget class="SwitchButton" name="video_block_switch" native="true">
+       <widget class="SwitchButton" name="audio_block_switch" native="true">
         <property name="minimumSize">
          <size>
           <width>110</width>
@@ -268,8 +262,8 @@
     </widget>
    </item>
    <item>
-    <widget class="QWidget" name="d_audio_block" native="true">
-     <layout class="QHBoxLayout" name="horizontalLayout_6">
+    <widget class="QWidget" name="d_loadscreens_block" native="true">
+     <layout class="QHBoxLayout" name="horizontalLayout_7">
       <property name="spacing">
        <number>3</number>
       </property>
@@ -283,7 +277,7 @@
        <number>0</number>
       </property>
       <item>
-       <widget class="TooltipButton" name="audio_block_label">
+       <widget class="TooltipButton" name="loadscreens_block_label">
         <property name="font">
          <font>
           <family>Crimson Text</family>
@@ -301,7 +295,7 @@
          <enum>QFrame::NoFrame</enum>
         </property>
         <property name="text">
-         <string>Озвучка персонажей</string>
+         <string>Загрузочные экраны</string>
         </property>
         <property name="alignment">
          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -309,7 +303,7 @@
        </widget>
       </item>
       <item>
-       <spacer name="horizontalSpacer_5">
+       <spacer name="horizontalSpacer_4">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
@@ -322,7 +316,7 @@
        </spacer>
       </item>
       <item>
-       <widget class="SwitchButton" name="audio_block_switch" native="true">
+       <widget class="SwitchButton" name="loadscreens_block_switch" native="true">
         <property name="minimumSize">
          <size>
           <width>110</width>
@@ -341,8 +335,8 @@
     </widget>
    </item>
    <item>
-    <widget class="QWidget" name="d_loadscreens_block" native="true">
-     <layout class="QHBoxLayout" name="horizontalLayout_7">
+    <widget class="QWidget" name="c_video_block" native="true">
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
       <property name="spacing">
        <number>3</number>
       </property>
@@ -356,7 +350,7 @@
        <number>0</number>
       </property>
       <item>
-       <widget class="TooltipButton" name="loadscreens_block_label">
+       <widget class="TooltipButton" name="video_block_label">
         <property name="font">
          <font>
           <family>Crimson Text</family>
@@ -374,7 +368,7 @@
          <enum>QFrame::NoFrame</enum>
         </property>
         <property name="text">
-         <string>Загрузочные экраны</string>
+         <string>Видеоролики</string>
         </property>
         <property name="alignment">
          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -382,7 +376,7 @@
        </widget>
       </item>
       <item>
-       <spacer name="horizontalSpacer_4">
+       <spacer name="horizontalSpacer_3">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
@@ -395,7 +389,7 @@
        </spacer>
       </item>
       <item>
-       <widget class="SwitchButton" name="loadscreens_block_switch" native="true">
+       <widget class="SwitchButton" name="video_block_switch" native="true">
         <property name="minimumSize">
          <size>
           <width>110</width>