Просмотр исходного кода

feat: add bootflow texture toggle

zeex64 3 недель назад
Родитель
Сommit
114f97f880

+ 1 - 0
Sunrise/resources/default_settings.json

@@ -36,6 +36,7 @@
       "config_guid": "d2legacy-0000-0000-0000-000000000001"
     },
     "suppress_peer_relay": true,
+    "custom_bootflow_textures": true,
     "fade_release": true,
     "region_private": false,
     "pin_replicated_record": true,

+ 7 - 0
Sunrise/src/client/hooks/bootflow/bootflow_texture_override.cpp

@@ -13,6 +13,7 @@
 
 #include "../../../../resources/resource.h"
 #include "../../../core/logging/log.h"
+#include "../../../core/settings/settings.h"
 #include "../../hooking/detour.h"
 #include "../../patterns/image_scan.h"
 
@@ -416,6 +417,12 @@ bool install(void* module) noexcept {
     if (g_handle.attached) {
         return true;
     }
+    if (!core::settings::get().client.customBootflowTextures) {
+        core::log::write(core::log::Channel::client,
+                         core::log::Level::info,
+                         "ev=bootflow_texture stage=setting enabled=0 result=skip");
+        return true;
+    }
     if (!load_assets(static_cast<HMODULE>(module))) {
         clear_assets();
         core::log::write(core::log::Channel::client,

+ 6 - 0
Sunrise/src/core/settings/client/client_settings_parser.cpp

@@ -10,6 +10,7 @@ bool Parser::client_settings(client::Settings& output) noexcept {
     client::Settings candidate = output;
     bool hasUserInterface = false;
     bool hasExternalServer = false;
+    bool hasCustomBootflowTextures = false;
     bool hasFadeRelease = false;
     bool hasRegionPrivate = false;
     bool hasSkipOrbitCinematicWait = false;
@@ -38,6 +39,11 @@ bool Parser::client_settings(client::Settings& output) noexcept {
                 return false;
             }
             hasExternalServer = true;
+        } else if (key == "custom_bootflow_textures") {
+            if (hasCustomBootflowTextures || !boolean(candidate.customBootflowTextures)) {
+                return false;
+            }
+            hasCustomBootflowTextures = true;
         } else if (key == "fade_release") {
             if (hasFadeRelease || !boolean(candidate.fadeRelease)) {
                 return false;

+ 2 - 0
Sunrise/src/core/settings/client/definition.h

@@ -18,6 +18,8 @@ struct Settings {
     ui::runtime::Settings userInterface;
     /** Points the Client at a server outside this process. Off answers everything in process. */
     external::Settings externalServer;
+    /** Replaces stock bootflow textures that have matching DDS assets embedded in Sunrise. */
+    bool customBootflowTextures{true};
     /**
      * Releases the world-transition fade channel at the in-world step.
      * The client only releases it on the player spawn, so this covers a spawn that never runs