2022-04-16 03:28:10 +02:00
|
|
|
sOverrideCameraModes = {
|
|
|
|
[CAMERA_MODE_RADIAL] = true,
|
|
|
|
[CAMERA_MODE_OUTWARD_RADIAL] = true,
|
|
|
|
[CAMERA_MODE_CLOSE] = true,
|
|
|
|
[CAMERA_MODE_SLIDE_HOOT] = true,
|
|
|
|
[CAMERA_MODE_PARALLEL_TRACKING] = true,
|
|
|
|
[CAMERA_MODE_FIXED] = true,
|
|
|
|
[CAMERA_MODE_8_DIRECTIONS] = true,
|
|
|
|
[CAMERA_MODE_FREE_ROAM] = true,
|
|
|
|
[CAMERA_MODE_SPIRAL_STAIRS] = true,
|
|
|
|
}
|
|
|
|
|
2022-09-13 05:00:51 +02:00
|
|
|
local m = gMarioStates[0]
|
|
|
|
|
2022-04-16 03:28:10 +02:00
|
|
|
function override_camera()
|
|
|
|
local np = gNetworkPlayers[0]
|
|
|
|
|
2022-10-19 00:34:46 +02:00
|
|
|
if sOverrideCameraModes[m.area.camera.mode] == nil or np.currLevelNum == LEVEL_BOWSER_1 or np.currLevelNum == LEVEL_BOWSER_2 or np.currLevelNum == LEVEL_BOWSER_3 then
|
2022-04-16 03:28:10 +02:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
set_camera_mode(m.area.camera, CAMERA_MODE_ROM_HACK, 0)
|
|
|
|
end
|
|
|
|
|
|
|
|
function on_set_camera_mode(c, mode, frames)
|
2022-10-19 00:34:46 +02:00
|
|
|
if sOverrideCameraModes[mode] ~= nil and mode ~= CAMERA_MODE_ROM_HACK then
|
2022-04-16 03:28:10 +02:00
|
|
|
-- do not allow change
|
2022-10-19 00:34:46 +02:00
|
|
|
set_camera_mode(c, CAMERA_MODE_ROM_HACK, frames)
|
2022-04-16 03:28:10 +02:00
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
hook_event(HOOK_ON_SET_CAMERA_MODE, on_set_camera_mode)
|
2022-09-13 05:00:51 +02:00
|
|
|
hook_event(HOOK_UPDATE, function()
|
|
|
|
if (m.controller.buttonPressed & L_TRIG) ~= 0 then
|
|
|
|
center_rom_hack_camera()
|
|
|
|
end
|
|
|
|
end)
|