pre cw with probe and a bunch script to read game behavior

This commit is contained in:
CAtlas0784 committed 2026-10-21 20:40:13 +07:00
1 parent 5120219ae2
commit da8a32f60d
310 files changed
+219693 -872

No files matched your search

+25 -24
View File
@@ -41,33 +41,28 @@ local function get_active_cam()
return nil
end
-- Detach only the active camera brain and restore its recorded state. Virtual
-- cameras continue updating animation/effect state; do not scan/disable every
-- virtual camera on each render frame.
_G.__FC_BRAINS = _G.__FC_BRAINS or {}
local function set_cinemachine_enabled(cam, enabled)
if enabled then
for id, state in pairs(_G.__FC_BRAINS) do
pcall(function() if state.brain then state.brain.enabled = state.enabled end end)
_G.__FC_BRAINS[id] = nil
end
return
end
pcall(function()
if not cam then return end
local brain = cam:GetComponent(typeof(CS.Cinemachine.CinemachineBrain))
if brain then brain.enabled = enabled end
local brain2 = cam:GetComponent("CinemachineBrain")
if brain2 then brain2.enabled = enabled end
if not brain then return end
local id = brain:GetInstanceID()
if not _G.__FC_BRAINS[id] then
_G.__FC_BRAINS[id] = {brain=brain, enabled=brain.enabled}
end
brain.enabled = false
end)
if not enabled then
pcall(function()
local vcs = GameObject.FindObjectsOfType(typeof(CS.Cinemachine.CinemachineVirtualCamera))
if vcs and vcs.Length > 0 then
for i = 0, vcs.Length - 1 do
vcs[i].enabled = false
end
end
end)
else
pcall(function()
local vcs = GameObject.FindObjectsOfType(typeof(CS.Cinemachine.CinemachineVirtualCamera))
if vcs and vcs.Length > 0 then
for i = 0, vcs.Length - 1 do
vcs[i].enabled = true
end
end
end)
end
end
-- Client inspection: InControlInputModule.allowMouseInput controls UI
@@ -94,8 +89,14 @@ end
local function update_mouse_gate()
local gate = _G.__FC_MOUSE_GATE
local battleHUD = GameObject.Find("UIRoot/Page/BattleGamePhaseUI(Clone)")
local wanted = _G.__FREECAM_ENABLED and battleHUD ~= nil
if not gate.phaseField then
local flags = CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags), 60)
gate.phaseField = typeof(CS.RPG.Client.GamePhaseManager):GetField("_CurrentPhase", flags)
end
local manager = CS.RPG.Client.GlobalVars.s_GamePhaseManager
local phase = manager and gate.phaseField:GetValue(manager)
local inBattle = phase and typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase)
local wanted = _G.__FREECAM_ENABLED and inBattle
-- Releasing Freecam while holding RMB must not become a battle click.
if not wanted then
if gate.active and not Input.GetMouseButton(0) and not Input.GetMouseButton(1) then