sm64coopdx/mods/sm74/camera.lua
Isaac0-dev 89afa8181e
just a few more improvements (#207)
Add get_dialog_box_state
    Prevent some attacks from registering as pvp attacks.
    Clean up all cases of camera.lua
    Put gLastCollectedStarOrKey in a better spot.
    Clean up my moderator code a bit, changing gIsModerator to boolean.
    Brang back kicked, banned and full party messages.
    Fixed a warning on older compilers like raspberry pi's and use configAmountofPlayers instead of MAX_PLAYERS
    Fixed compiling with the flag DISCORD_SDK off.
    Added "Fixed Collisions" to the debug menu.
    Added HMC, CCM, RR, BITDW, PSS and TTC to the main menu options.
    Fix my own oversight; Prevent the port from being duplicated in the join menu. (temporary fix)
    Hopefully bring back the crash handler on windows by not checking for termination signals on windows
2022-10-18 15:34:46 -07:00

38 lines
1.2 KiB
Lua

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,
}
local m = gMarioStates[0]
function override_camera()
local np = gNetworkPlayers[0]
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
return
end
set_camera_mode(m.area.camera, CAMERA_MODE_ROM_HACK, 0)
end
function on_set_camera_mode(c, mode, frames)
if sOverrideCameraModes[mode] ~= nil and mode ~= CAMERA_MODE_ROM_HACK then
-- do not allow change
set_camera_mode(c, CAMERA_MODE_ROM_HACK, frames)
return false
end
end
hook_event(HOOK_ON_SET_CAMERA_MODE, on_set_camera_mode)
hook_event(HOOK_UPDATE, function()
if (m.controller.buttonPressed & L_TRIG) ~= 0 then
center_rom_hack_camera()
end
end)