Skip to content

Commit

Permalink
Merge pull request #143 from chinosk6/main
Browse files Browse the repository at this point in the history
增加 CutIn 第一人称开关
  • Loading branch information
ChihyuenWang authored Jun 30, 2023
2 parents e47f81e + 2328031 commit 8b9dce3
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions resources/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"z": 0
}
},
"cutin_first_persion": false,
"externalPlugin": {
"hotkey": "u",
"path": "legend_g_plugin.exe",
Expand Down
5 changes: 5 additions & 0 deletions resources/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@
},
"additionalProperties": false
},
"cutin_first_persion": {
"description": "CutIn 第一人称(使用 F 键切换)",
"type": "boolean",
"default": false
},
"externalPlugin": {
"description": "外部插件配置",
"type": "object",
Expand Down
5 changes: 5 additions & 0 deletions resources/config_en.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions resources/config_zh_tw.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@
},
"additionalProperties": false
},
"cutin_first_persion": {
"description": "CutIn 第一人稱(F 鍵切換)",
"type": "boolean",
"default": false
},
"externalPlugin": {
"description": "外部插件配置",
"type": "object",
Expand Down
6 changes: 4 additions & 2 deletions src/camera/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3397,7 +3397,7 @@ namespace
bool CutInTimelineController_AlterLateUpdate_hook(void* _this) {
UmaCamera::setUmaCameraType(CAMERA_CUTIN);
auto ret = reinterpret_cast<decltype(CutInTimelineController_AlterLateUpdate_hook)*>(CutInTimelineController_AlterLateUpdate_orig)(_this);
if (!g_cutin_first_persion) {
if (!(g_cutin_first_persion && g_enable_cutin_first_persion)) {
return ret;
}
init_cutin();
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/stdinclude.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 8b9dce3

Please sign in to comment.