mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
add ' button to spectate closest player to cursor, adjust spectate camera speed to be less jarring
This commit is contained in:
parent
4c6abf6424
commit
91c3f20747
2 changed files with 18 additions and 2 deletions
|
@ -161,11 +161,11 @@ local function target()
|
|||
end
|
||||
if GameGetIsGamepadConnected() then
|
||||
mx, my = InputGetJoystickAnalogStick(0, 1)
|
||||
mx, my = mx * 256 + to_x, my * 256 + to_y
|
||||
mx, my = mx * 200 + to_x, my * 200 + to_y
|
||||
else
|
||||
mx, my = DEBUG_GetMouseWorld()
|
||||
end
|
||||
local t_x, t_y = to_x + (mx - to_x) / 3 , to_y + (my - to_y) / 3
|
||||
local t_x, t_y = to_x + (mx - to_x) / 5 , to_y + (my - to_y) / 5
|
||||
local dx, dy = t_x - my_x, t_y - my_y
|
||||
local di = dx * dx + dy * dy
|
||||
if di > 512 * 512 then
|
||||
|
@ -337,6 +337,13 @@ function spectate.on_world_update()
|
|||
elseif InputIsKeyJustDown(tonumber(ModSettingGet("quant.ew.rebind_sspectate"))) then
|
||||
camera_player_id, camera_player = get_me()
|
||||
re_cam = true
|
||||
elseif InputIsKeyJustDown(tonumber(ModSettingGet("quant.ew.rebind_mspectate"))) then
|
||||
local mx, my = DEBUG_GetMouseWorld()
|
||||
local ent = EntityGetClosestWithTag(mx, my, "ew_peer")
|
||||
camera_player = player_fns.get_player_data_by_local_entity_id(ent)
|
||||
camera_player_id = camera_player.peer_id
|
||||
update_i()
|
||||
re_cam = true
|
||||
end
|
||||
set_camera_pos()
|
||||
ctx.spectating_over_peer_id = camera_player_id
|
||||
|
|
|
@ -135,6 +135,15 @@ local function build_settings()
|
|||
is_waiting_for_input = false,
|
||||
scope = MOD_SETTING_SCOPE_RUNTIME,
|
||||
},
|
||||
{
|
||||
id = "rebind_mspectate",
|
||||
ui_name = "spectate near Button",
|
||||
ui_description = "self.",
|
||||
value_default = "52",
|
||||
ui_fn = ui_get_input,
|
||||
is_waiting_for_input = false,
|
||||
scope = MOD_SETTING_SCOPE_RUNTIME,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue