-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
local papi = {} | ||
|
||
local models = {} | ||
function papi.register_model(name, def) | ||
--todo: handle | ||
models[name] = def | ||
end | ||
|
||
function papi.set_model(player, model) | ||
--todo: handle | ||
function papi.set_model(player, model_name) | ||
local model = models[model_name] | ||
|
||
if not model then return end | ||
|
||
player:set_properties({ | ||
mesh = model_name, | ||
textures = model.textures, | ||
visual = "mesh", | ||
visual_size = model.visual_size, | ||
stepheight = model.stepheight | ||
}) | ||
end | ||
|
||
function papi.get_animation(player) | ||
--todo: handle | ||
function papi.get_animation(_) | ||
--stub to keep from crashing | ||
end | ||
|
||
function papi.get_textures(player, textures) | ||
--todo: handle | ||
function papi.get_textures(player) | ||
return player:get_properties().textures | ||
end | ||
|
||
function papi.set_textures(player, index, texture) | ||
--todo: handle | ||
function papi.set_textures(player, textures) | ||
player:set_properties({textures = textures}) | ||
end | ||
|
||
function papi.set_animation(player, anim_name, speed, loop) | ||
--todo: handle | ||
function papi.set_animation(_, _, _, _) | ||
--stub to keep from crashing | ||
end | ||
|
||
--todo: handle ignoring animations (maybe metatables?) | ||
--nothing to do here as we have no globalstep .....that we know about anyways | ||
papi.player_attached = {} | ||
|
||
return papi |