From 23280316787fd3162b05b3c95a0f7c7509d2c718 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Tue, 27 Jun 2023 12:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20CutIn=20=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E4=BA=BA=E7=A7=B0=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/config.json | 1 + resources/config.schema.json | 5 +++++ resources/config_en.schema.json | 5 +++++ resources/config_zh_tw.schema.json | 5 +++++ src/camera/camera.cpp | 6 ++++-- src/hook.cpp | 2 +- src/main.cpp | 5 +++++ src/stdinclude.hpp | 1 + 8 files changed, 27 insertions(+), 3 deletions(-) diff --git a/resources/config.json b/resources/config.json index e2022f1a..2ac431a9 100644 --- a/resources/config.json +++ b/resources/config.json @@ -48,6 +48,7 @@ "z": 0 } }, + "cutin_first_persion": false, "externalPlugin": { "hotkey": "u", "path": "legend_g_plugin.exe", diff --git a/resources/config.schema.json b/resources/config.schema.json index 7f7a5266..8605bb0e 100644 --- a/resources/config.schema.json +++ b/resources/config.schema.json @@ -229,6 +229,11 @@ }, "additionalProperties": false }, + "cutin_first_persion": { + "description": "CutIn 第一人称(使用 F 键切换)", + "type": "boolean", + "default": false + }, "externalPlugin": { "description": "外部插件配置", "type": "object", diff --git a/resources/config_en.schema.json b/resources/config_en.schema.json index cc733e85..8ba19f4e 100644 --- a/resources/config_en.schema.json +++ b/resources/config_en.schema.json @@ -229,6 +229,11 @@ }, "additionalProperties": false }, + "cutin_first_persion": { + "description": "CutIn first persion (perss F to switch).", + "type": "boolean", + "default": false + }, "externalPlugin": { "description": "Set external plugin.", "type": "object", diff --git a/resources/config_zh_tw.schema.json b/resources/config_zh_tw.schema.json index 58e562d0..1183c106 100644 --- a/resources/config_zh_tw.schema.json +++ b/resources/config_zh_tw.schema.json @@ -229,6 +229,11 @@ }, "additionalProperties": false }, + "cutin_first_persion": { + "description": "CutIn 第一人稱(F 鍵切換)", + "type": "boolean", + "default": false + }, "externalPlugin": { "description": "外部插件配置", "type": "object", diff --git a/src/camera/camera.cpp b/src/camera/camera.cpp index 1ac9307e..2af143c8 100644 --- a/src/camera/camera.cpp +++ b/src/camera/camera.cpp @@ -1119,8 +1119,10 @@ namespace UmaCamera { } } else if (cameraType == CAMERA_CUTIN) { - g_cutin_first_persion = !g_cutin_first_persion; - printf("CutIn camera first person %s.\n", g_cutin_first_persion ? "enabled" : "disabled"); + if (g_enable_cutin_first_persion) { + g_cutin_first_persion = !g_cutin_first_persion; + printf("CutIn camera first person %s.\n", g_cutin_first_persion ? "enabled" : "disabled"); + } } } diff --git a/src/hook.cpp b/src/hook.cpp index 78b3b1d0..c316e674 100644 --- a/src/hook.cpp +++ b/src/hook.cpp @@ -3397,7 +3397,7 @@ namespace bool CutInTimelineController_AlterLateUpdate_hook(void* _this) { UmaCamera::setUmaCameraType(CAMERA_CUTIN); auto ret = reinterpret_cast(CutInTimelineController_AlterLateUpdate_orig)(_this); - if (!g_cutin_first_persion) { + if (!(g_cutin_first_persion && g_enable_cutin_first_persion)) { return ret; } init_cutin(); diff --git a/src/main.cpp b/src/main.cpp index f687839e..0ced7c99 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -83,6 +83,7 @@ std::wstring g_convert_url; bool g_enable_self_server = false; std::wstring g_self_server_url; +bool g_enable_cutin_first_persion = false; bool g_cutin_first_persion = false; std::string g_text_data_dict_path; @@ -592,6 +593,10 @@ namespace UmaCamera::loadGlobalData(); } + if (document.HasMember("cutin_first_persion")) { + g_enable_cutin_first_persion = document["cutin_first_persion"].GetBool(); + } + if (document.HasMember("aspect_ratio_new")) { auto& asp = document["aspect_ratio_new"]; auto asp_w = asp["w"].GetFloat(); diff --git a/src/stdinclude.hpp b/src/stdinclude.hpp index 4905c173..9a533dee 100644 --- a/src/stdinclude.hpp +++ b/src/stdinclude.hpp @@ -187,4 +187,5 @@ extern std::string dumpGameAssemblyPath; extern bool g_enable_live_dof_controller; extern bool guiStarting; extern bool g_cutin_first_persion; +extern bool g_enable_cutin_first_persion; extern bool g_enable_better60fps;