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

Allow resetting celestial vault elements by leaving its arguments empty #11922

Merged
merged 17 commits into from
Jan 22, 2022

Conversation

Zughy
Copy link
Member

@Zughy Zughy commented Jan 2, 2022

To do

This PR is Ready for Review.

How to test

minetest.register_on_joinplayer(function(player)
    
    local sky = {
        sky_color = {
            day_sky = "#ffffff"    
        }
    }
    
    local sun = {
        texture = "cdb_queued.png",
        size = 2
    }
    
    local moon = {
        texture = "bubble.png",
        size = 2
    }
    
    local stars = {
        count = 3000,
        scale = 0.5
    }
    
    local clouds = {
        thickness = 50,
        height = 30,
        speed = { x = 0.1, z = 5 }
    }
    
    player:set_sky(sky)
    player:set_sun(sun)
    player:set_moon(moon)
    player:set_stars(stars)
    player:set_clouds(clouds)
    
    minetest.after(3, function()
        player:set_sky()
        player:set_sun()
        player:set_moon()
        player:set_stars()
        player:set_clouds()
    end)
end)

@sfan5 sfan5 added @ Script API Feature ✨ PRs that add or enhance a feature labels Jan 2, 2022
@Zughy Zughy marked this pull request as ready for review January 2, 2022 23:10
@Zughy
Copy link
Member Author

Zughy commented Jan 2, 2022

Done. Reviewing commit by commit should make your life easier. Also, I got rid of cloudparams.h because it was only a file with a struct that could have been declared in skyparams.h

@Zughy
Copy link
Member Author

Zughy commented Jan 4, 2022

In order to work 100%, this PR needs what has been highlighted in #11930 first. The PR does the job is expected to, just, there is another problem in the way that causes the dummy image error in here

src/skyparams.h Outdated Show resolved Hide resolved
@Zughy
Copy link
Member Author

Zughy commented Jan 15, 2022

@SmallJoker done

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.

Looks good.

@sfan5
Copy link
Member

sfan5 commented Jan 15, 2022

In order to work 100%, this PR needs what has been highlighted in #11930 first.

^ Is this the case now or ...?

@Zughy
Copy link
Member Author

Zughy commented Jan 15, 2022

@sfan5 poor wording, my bad. I meant that the snippet throws in chat the missing image error I pointed out in the other issue (when it resets moon and sun), but it's not something related to this PR, it's not something I've altered

@sfan5 sfan5 changed the title Reset celestial vault elements by leaving its functions empty Allow resetting celestial vault elements by leaving its arguments empty Jan 16, 2022
src/script/lua_api/l_object.cpp Show resolved Hide resolved
src/remoteplayer.cpp Outdated Show resolved Hide resolved
@Zughy
Copy link
Member Author

Zughy commented Jan 16, 2022

@sfan5 done

@sfan5
Copy link
Member

sfan5 commented Jan 16, 2022

You accidentally committed client/mod_storage.sqlite, please remove.

@sfan5 sfan5 added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jan 16, 2022
@Zughy
Copy link
Member Author

Zughy commented Jan 16, 2022

Wait what how-
@sfan5 done

@sfan5 sfan5 added Action / change needed Code still needs changes (PR) / more information requested (Issues) and removed Action / change needed Code still needs changes (PR) / more information requested (Issues) labels Jan 16, 2022
@Zughy
Copy link
Member Author

Zughy commented Jan 21, 2022

@sfan5 the PR still stays "action / change needed", I guess you misclicked?

@sfan5
Copy link
Member

sfan5 commented Jan 21, 2022

I'm suggesting you put the fix from #11930 into this PR.

@Zughy
Copy link
Member Author

Zughy commented Jan 21, 2022

That's not related to this PR nor I know where to put my hands (I tried last week). It's a free PR that does what's intended already :\

@sfan5 sfan5 removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jan 21, 2022
@sfan5
Copy link
Member

sfan5 commented Jan 21, 2022

I literally provided a diff of the fix, but okay, I did it myself.

@sfan5 sfan5 added this to the 5.5.0 milestone Jan 22, 2022
@Zughy
Copy link
Member Author

Zughy commented Jan 22, 2022

...I didn't see the notification about the other issue, I'm sorry

@Zughy
Copy link
Member Author

Zughy commented Jan 22, 2022

Wait, so this won't cause any problems with texture packs shipping sun.png and moon.png by default such as RPG16? https://gitlab.com/Df458/rpg16/-/tree/master/misc

@sfan5
Copy link
Member

sfan5 commented Jan 22, 2022

You're right. The reason is that at startup the sky picks sun.png if it exists and else uses the mesh sun. If you ever change the texture it is impossible to return to this state.
Whatever, I'll fix it in a separate PR.

@sfan5 sfan5 merged commit 37d8078 into minetest:master Jan 22, 2022
LoneWolfBT pushed a commit to MT-CTF/minetest that referenced this pull request Feb 13, 2022
@Zughy Zughy deleted the reset_sky branch June 3, 2022 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Leave set_sky() etc. with no arguments to reset a player's celestial vault
4 participants