minetest-mods / stamina

Adds hunger (stamina) to minetest.
17 stars 19 forks source link

Add hidden background texture #35

Closed OgelGames closed 3 years ago

OgelGames commented 3 years ago

This adds a blank background texture to the statbar, so that texture packs can be used to override it, in the same way that the built-in health statbar works.

SmallJoker commented 3 years ago

Textures are now added recursively. Moving it to old does not change anything.

OgelGames commented 3 years ago

Oh, I didn't know that, thanks for informing me 👍

Should the old texture just be deleted then? Or...?

SmallJoker commented 3 years ago

Why not keep it where it was? Texture packs can override that anyway.

OgelGames commented 3 years ago

My intention was to add support for changing the background texture, without actually adding a background, so as not to change what players are already used to.

Why not keep it where it was?

Because there can't be two textures with the same name...

SmallJoker commented 3 years ago

https://github.com/minetest/minetest/blob/025035db5c87e9eaa9f83859f860539fc4fb4dc0/src/client/hud.cpp#L613-L616

Seems like Minetest would generate a dummy texture if none is provided.

OgelGames commented 3 years ago

But there needs to be a texture for overriding to be possible... Right?

This adds a blank background texture ... in the same way that the built-in health statbar works.

https://github.com/minetest/minetest/blob/025035db5c87e9eaa9f83859f860539fc4fb4dc0/builtin/game/statbars.lua#L4-L26

SmallJoker commented 3 years ago

Sorry. I was once again bamboozled by the way how GitHub shows binary file modifications. I thought it was removed, rather than changed to a transparent texture.

OgelGames commented 3 years ago

@SmallJoker