mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-11-30 00:03:33 +00:00
make lua function casing match docs
This commit is contained in:
parent
d83f58fe1b
commit
ad6a330ae0
|
|
@ -16,7 +16,7 @@ doukutsu._handlers = setmetatable({
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
doukutsu._initialize_script = function(script)
|
doukutsu._initializeScript = function(script)
|
||||||
-- for compatibility with Lua 5.2+, copy-pasted from Lua mailing list
|
-- for compatibility with Lua 5.2+, copy-pasted from Lua mailing list
|
||||||
-- http://lua-users.org/lists/lua-l/2010-06/msg00313.html
|
-- http://lua-users.org/lists/lua-l/2010-06/msg00313.html
|
||||||
local _setfenv = setfenv or function(f, t)
|
local _setfenv = setfenv or function(f, t)
|
||||||
|
|
@ -45,12 +45,12 @@ doukutsu._initialize_script = function(script)
|
||||||
script()
|
script()
|
||||||
end
|
end
|
||||||
|
|
||||||
doukutsu.play_sfx = function(id)
|
doukutsu.playSfx = function(id)
|
||||||
__doukutsu:play_sfx(id)
|
__doukutsu:playSfx(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
doukutsu.play_song = function(id)
|
doukutsu.playSong = function(id)
|
||||||
__doukutsu:play_song(id)
|
__doukutsu:playSong(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
doukutsu.on = function(event, handler)
|
doukutsu.on = function(event, handler)
|
||||||
|
|
@ -66,7 +66,7 @@ doukutsu.on = function(event, handler)
|
||||||
return handler
|
return handler
|
||||||
end
|
end
|
||||||
|
|
||||||
doukutsu.remove_handler = function(event, handler)
|
doukutsu.removeHandler = function(event, handler)
|
||||||
assert(type(event) == "string", "event type must be a string.")
|
assert(type(event) == "string", "event type must be a string.")
|
||||||
assert(type(handler) == "function", "event handler must be a function.")
|
assert(type(handler) == "function", "event handler must be a function.")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ impl LuaScriptingState {
|
||||||
}
|
}
|
||||||
|
|
||||||
state.get_global("doukutsu");
|
state.get_global("doukutsu");
|
||||||
state.get_field(-1, "_initialize_script");
|
state.get_field(-1, "_initializeScript");
|
||||||
state.push_value(-3);
|
state.push_value(-3);
|
||||||
|
|
||||||
let res = state.pcall(1, 0, 0);
|
let res = state.pcall(1, 0, 0);
|
||||||
|
|
|
||||||
|
|
@ -126,10 +126,10 @@ impl LuaObject for LuaPlayer {
|
||||||
vec![
|
vec![
|
||||||
lua_method!("x", LuaPlayer, LuaPlayer::lua_get_x),
|
lua_method!("x", LuaPlayer, LuaPlayer::lua_get_x),
|
||||||
lua_method!("y", LuaPlayer, LuaPlayer::lua_get_y),
|
lua_method!("y", LuaPlayer, LuaPlayer::lua_get_y),
|
||||||
lua_method!("vel_x", LuaPlayer, LuaPlayer::lua_get_vel_x),
|
lua_method!("velX", LuaPlayer, LuaPlayer::lua_get_vel_x),
|
||||||
lua_method!("vel_y", LuaPlayer, LuaPlayer::lua_get_vel_y),
|
lua_method!("velX", LuaPlayer, LuaPlayer::lua_get_vel_y),
|
||||||
lua_method!("set_vel_x", LuaPlayer, LuaPlayer::lua_set_vel_x),
|
lua_method!("setVelX", LuaPlayer, LuaPlayer::lua_set_vel_x),
|
||||||
lua_method!("set_vel_y", LuaPlayer, LuaPlayer::lua_set_vel_y),
|
lua_method!("setVelY", LuaPlayer, LuaPlayer::lua_set_vel_y),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue