mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Use a proper mouse position for notplayer
This commit is contained in:
parent
7b0a2a5cd5
commit
c13502d4bb
3 changed files with 5 additions and 10 deletions
|
@ -12,6 +12,7 @@ static LUA: LazyLock<Lua51> = LazyLock::new(|| unsafe {
|
|||
// const EWEXT: [(&'static str, Function); 1] = [("testfn", None)];
|
||||
|
||||
extern "C" fn test_fn(lua: *mut lua_State) -> c_int {
|
||||
println!("test fn called");
|
||||
0
|
||||
}
|
||||
|
||||
|
|
|
@ -16,15 +16,7 @@ local function aim_at(world_x, world_y)
|
|||
local dx, dy = world_x - ch_x, world_y - ch_y
|
||||
ComponentSetValue2(state.control_component, "mAimingVector", dx, dy)
|
||||
|
||||
-- No idea what coordinate system that field uses.
|
||||
-- Writing a big positive/negative value to turn to the right side seems to work.
|
||||
local mouse_x
|
||||
if dx > 0 then
|
||||
mouse_x = 100000
|
||||
else
|
||||
mouse_x = -100000
|
||||
end
|
||||
ComponentSetValue2(state.control_component, "mMousePosition", mouse_x, 0)
|
||||
ComponentSetValue2(state.control_component, "mMousePosition", world_x, world_y)
|
||||
|
||||
local dist = math.sqrt(dx * dx + dy * dy)
|
||||
if dist > 0 then
|
||||
|
|
|
@ -4,7 +4,9 @@ np = require("noitapatcher")
|
|||
package.cpath = package.cpath .. ";./mods/quant.ew/?.dll"
|
||||
package.path = package.path .. ";./mods/quant.ew/?.lua"
|
||||
print(package.cpath)
|
||||
require("ewext")
|
||||
|
||||
ewext = require("ewext")
|
||||
print(ewext)
|
||||
|
||||
dofile_once( "data/scripts/lib/utilities.lua" )
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue