Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JadedCtrl
Copy link
Contributor

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! ^^

@Niklp09
Copy link
Member

Niklp09 commented Jul 21, 2024

Please add mcl_skins to the read_globals/globals table in .luacheckrc to fix luacheck warnings.

@JadedCtrl
Copy link
Contributor Author

Got it, thanks!

api.lua Outdated Show resolved Hide resolved
@JadedCtrl JadedCtrl force-pushed the master branch 2 times, most recently from f499d54 to c3fdc07 Compare July 21, 2024 14:42
This allows skinsdb to replace or supplement
Voxelibre’s skin system, using its mcl_skins.

Downgrades player_api to an optional dependency.
@SmallJoker SmallJoker self-requested a review July 23, 2024 17:44
Copy link
Member

@SmallJoker SmallJoker left a 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.")
Copy link
Member

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.

Suggested change
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mcl_skins.update_player_skin(player);
mcl_skins.update_player_skin(player)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants