1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-11-30 08:08:18 +00:00

make lua function casing match docs

This commit is contained in:
Alula 2021-05-02 04:05:21 +02:00
parent d83f58fe1b
commit ad6a330ae0
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA
3 changed files with 11 additions and 11 deletions

View file

@ -16,7 +16,7 @@ doukutsu._handlers = setmetatable({
end,
})
doukutsu._initialize_script = function(script)
doukutsu._initializeScript = function(script)
-- for compatibility with Lua 5.2+, copy-pasted from Lua mailing list
-- http://lua-users.org/lists/lua-l/2010-06/msg00313.html
local _setfenv = setfenv or function(f, t)
@ -45,12 +45,12 @@ doukutsu._initialize_script = function(script)
script()
end
doukutsu.play_sfx = function(id)
__doukutsu:play_sfx(id)
doukutsu.playSfx = function(id)
__doukutsu:playSfx(id)
end
doukutsu.play_song = function(id)
__doukutsu:play_song(id)
doukutsu.playSong = function(id)
__doukutsu:playSong(id)
end
doukutsu.on = function(event, handler)
@ -66,7 +66,7 @@ doukutsu.on = function(event, handler)
return handler
end
doukutsu.remove_handler = function(event, handler)
doukutsu.removeHandler = function(event, handler)
assert(type(event) == "string", "event type must be a string.")
assert(type(handler) == "function", "event handler must be a function.")

View file

@ -87,7 +87,7 @@ impl LuaScriptingState {
}
state.get_global("doukutsu");
state.get_field(-1, "_initialize_script");
state.get_field(-1, "_initializeScript");
state.push_value(-3);
let res = state.pcall(1, 0, 0);

View file

@ -126,10 +126,10 @@ impl LuaObject for LuaPlayer {
vec![
lua_method!("x", LuaPlayer, LuaPlayer::lua_get_x),
lua_method!("y", LuaPlayer, LuaPlayer::lua_get_y),
lua_method!("vel_x", LuaPlayer, LuaPlayer::lua_get_vel_x),
lua_method!("vel_y", LuaPlayer, LuaPlayer::lua_get_vel_y),
lua_method!("set_vel_x", LuaPlayer, LuaPlayer::lua_set_vel_x),
lua_method!("set_vel_y", LuaPlayer, LuaPlayer::lua_set_vel_y),
lua_method!("velX", LuaPlayer, LuaPlayer::lua_get_vel_x),
lua_method!("velX", LuaPlayer, LuaPlayer::lua_get_vel_y),
lua_method!("setVelX", LuaPlayer, LuaPlayer::lua_set_vel_x),
lua_method!("setVelY", LuaPlayer, LuaPlayer::lua_set_vel_y),
]
}
}