-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Voxelibre #109
base: master
Are you sure you want to change the base?
Conversation
Please add |
Got it, thanks! |
f499d54
to
c3fdc07
Compare
This allows skinsdb to replace or supplement Voxelibre’s skin system, using its mcl_skins. Downgrades player_api to an optional dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not work with .
-separated skins. That notation was introduced to get rid of ambiguous skin names.
ERROR[Main]: ModError: Failed to load and run script from MT/games/VoxeLibre/mods/ITEMS/mcl_maps/init.lua:
ERROR[Main]: MT/builtin/game/register.lua:75: Name mcl_maps:filled_map_character.6_male_crea does not follow naming conventions: contains unallowed characters
ERROR[Main]: stack traceback:
ERROR[Main]: [C]: in function 'error'
ERROR[Main]: MT/builtin/game/register.lua:75: in function 'check_modname_prefix'
ERROR[Main]: MT/builtin/game/register.lua:133: in function 'register_item'
ERROR[Main]: MT/builtin/game/register.lua:226: in function 'register_node'
ERROR[Main]: MT/games/VoxeLibre/mods/ITEMS/mcl_maps/init.lua:269: in main chunk
@@ -8,6 +8,9 @@ skins = {} | |||
skins.modpath = minetest.get_modpath(minetest.get_current_modname()) | |||
skins.default = "character" | |||
|
|||
skins.use_voxelibre_compat = minetest.global_exists("mcl_skins") | |||
assert(minetest.global_exists("player_api") or minetest.global_exists("mcl_skins"), "One of player_api or mcl_skins is required.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applying general Minetest code style rules here.
assert(minetest.global_exists("player_api") or minetest.global_exists("mcl_skins"), "One of player_api or mcl_skins is required.") | |
assert(minetest.global_exists("player_api") or minetest.global_exists("mcl_skins"), | |
"One of player_api or mcl_skins is required.") |
@@ -60,6 +78,9 @@ function skins.update_player_skin(player) | |||
if minetest.global_exists("sfinv") and sfinv.enabled then | |||
sfinv.set_player_inventory_formspec(player) | |||
end | |||
if skins.use_voxelibre_compat then | |||
mcl_skins.update_player_skin(player); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mcl_skins.update_player_skin(player); | |
mcl_skins.update_player_skin(player) |
All skins from skinsdb are registered as “simple skins” with mcl_skins, and can be selected using either skindb’s interface or Voxelibre’s own.
Not sure if this is the most elegant way of getting mcl_skins and skinsdb to get along, but it seems to work well enough! ^^