Last active
July 20, 2022 06:16
-
-
Save carupota/5f1f8cdc5abb63ba9e4192ecb1ae9ab7 to your computer and use it in GitHub Desktop.
https://www.nexusmods.com/monsterhunterrise/mods/26 の改変 テントの中とか変になるからFOV変更されるとこを制限したやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local fov = 100.0 | |
local enabled = true | |
local allManagersRetrieved = false | |
local gm = {} | |
gm.QuestManager = {} | |
gm.QuestManager.n = "snow.QuestManager" | |
gm.CameraManager = {} | |
gm.CameraManager.n = "snow.CameraManager" | |
re.on_frame(function() | |
if allManagersRetrieved == false then | |
local success = true | |
for i,v in pairs(gm) do | |
v.d = sdk.get_managed_singleton(v.n) | |
if v.d == nil then success = false end | |
end | |
allManagersRetrieved = success | |
end | |
end) | |
re.on_draw_ui(function() | |
local changed = false | |
if imgui.tree_node("FOV Changer") then | |
changed, enabled = imgui.checkbox("Enabled", enabled) | |
changed, fov = imgui.slider_float("FOV", fov, 1.0, 180.0) | |
imgui.tree_pop() | |
end | |
end) | |
re.on_pre_application_entry("BeginRendering", function() | |
if allManagersRetrieved then | |
local camera = sdk.get_primary_camera() | |
if not camera then return end | |
-- 0:village 2:Quest 3:QuestClear | |
local questStatus = gm.QuestManager.d:get_field("_QuestStatus") | |
-- 1:PlayerCamera 2:FixedCamera 3:DemoCamera 4:PhotoCamera | |
local nowCameraType = gm.CameraManager.d:get_field("_NowCameraType") | |
if enabled and 2 <= questStatus and nowCameraType == 1 then | |
camera:call("set_FOV", fov) | |
fov = camera:call("get_FOV") | |
end | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment