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

Lua API: allow smooth 'hud_elem_type' transition phase #14839

Conversation

SmallJoker
Copy link
Member

Migrating this field name is annoying (need protocol version checks), hence silently accepting exact duplicates allow a convenient transition phase.

Opened because PRs like minetest-mods/areas#78 are bound to happen sooner or later, thus making the transition phase easier seems like a good idea.

To do

This PR is Ready for Review.

How to test

  1. deprecated_lua_api_handling = log
  2. use https://github.com/minetest-mods/areas
  3. get the warning.
  4. insert type = "text", before hud.lua L69
  5. No more warning

Migrating this field name is annoying (need protocol version checks),
hence silently accepting exact duplicates allow a convenient transition phase.
@SmallJoker SmallJoker force-pushed the pr_14839_transition_phase_HUD_type branch from 26299e5 to ee7282c Compare July 10, 2024 17:49
@grorp
Copy link
Member

grorp commented Jul 10, 2024

need protocol version checks

... no? The network format wasn't changed by #14065.

Mods only have to do a server-side feature check (minetest.features.hud_def_type_field)

@cx384
Copy link
Contributor

cx384 commented Jul 10, 2024

Ugh, I don't think this is a good idea.
As grorp wrote, you can always check for the features flag.
And this may hide deprecation problems, i.e. if an old mod accidentally used both type and hud_elem_type.
e.g. if it used the result of player:hud_get(id) which always returned a table with type and not hud_elem_type.

@SmallJoker
Copy link
Member Author

... no? The network format wasn't changed by

Oh right. I wonder why I thought that the client version would matter here. Obviously, there is no such need for a transition phase when it's a simple server-side feature check
Sorry for the fuss.

@SmallJoker SmallJoker closed this Jul 11, 2024
@SmallJoker SmallJoker deleted the pr_14839_transition_phase_HUD_type branch August 26, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants