mirror of
https://git.chinosk6.cn/chinosk/gkms-local.git
synced 2026-02-04 17:13:59 +00:00
增加 fps 设置
This commit is contained in:
@@ -130,6 +130,11 @@ namespace GakumasLocal::HookMain {
|
||||
return Unity_set_rotation_Injected_Orig(_this, value);
|
||||
}
|
||||
|
||||
DEFINE_HOOK(void, Unity_set_targetFrameRate, (int value)) {
|
||||
const auto configFps = Config::targetFrameRate;
|
||||
return Unity_set_targetFrameRate_Orig(configFps == 0 ? value: configFps);
|
||||
}
|
||||
|
||||
std::unordered_map<void*, std::string> loadHistory{};
|
||||
|
||||
DEFINE_HOOK(void*, AssetBundle_LoadAssetAsync, (void* _this, Il2cppString* name, void* type)) {
|
||||
@@ -365,6 +370,8 @@ namespace GakumasLocal::HookMain {
|
||||
"UnityEngine.Transform::set_position_Injected(UnityEngine.Vector3&)"));
|
||||
ADD_HOOK(Unity_set_rotation_Injected, Il2cppUtils::il2cpp_resolve_icall(
|
||||
"UnityEngine.Transform::set_rotation_Injected(UnityEngine.Quaternion&)"));
|
||||
ADD_HOOK(Unity_set_targetFrameRate, Il2cppUtils::il2cpp_resolve_icall(
|
||||
"UnityEngine.Application::set_targetFrameRate(System.Int32)"));
|
||||
}
|
||||
// 77 2640 5000
|
||||
|
||||
|
||||
@@ -7,12 +7,14 @@ namespace GakumasLocal::Config {
|
||||
|
||||
bool enabled = true;
|
||||
bool enableFreeCamera = false;
|
||||
int targetFrameRate = 0;
|
||||
|
||||
void LoadConfig(const std::string& configStr) {
|
||||
try {
|
||||
const auto config = nlohmann::json::parse(configStr);
|
||||
|
||||
enabled = config["enabled"];
|
||||
targetFrameRate = config["targetFrameRate"];
|
||||
enableFreeCamera = config["enableFreeCamera"];
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace GakumasLocal::Config {
|
||||
|
||||
extern bool enabled;
|
||||
extern bool enableFreeCamera;
|
||||
extern int targetFrameRate;
|
||||
|
||||
void LoadConfig(const std::string& configStr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user