mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Allow texture modifiers in hotbar textures. (#9271)
This commit is contained in:
parent
8ddb6718e3
commit
244121b964
@ -221,19 +221,13 @@ void Hud::drawItems(v2s32 upperleftpos, v2s32 screen_offset, s32 itemcount,
|
|||||||
// Store hotbar_image in member variable, used by drawItem()
|
// Store hotbar_image in member variable, used by drawItem()
|
||||||
if (hotbar_image != player->hotbar_image) {
|
if (hotbar_image != player->hotbar_image) {
|
||||||
hotbar_image = player->hotbar_image;
|
hotbar_image = player->hotbar_image;
|
||||||
if (!hotbar_image.empty())
|
use_hotbar_image = !hotbar_image.empty();
|
||||||
use_hotbar_image = tsrc->isKnownSourceImage(hotbar_image);
|
|
||||||
else
|
|
||||||
use_hotbar_image = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store hotbar_selected_image in member variable, used by drawItem()
|
// Store hotbar_selected_image in member variable, used by drawItem()
|
||||||
if (hotbar_selected_image != player->hotbar_selected_image) {
|
if (hotbar_selected_image != player->hotbar_selected_image) {
|
||||||
hotbar_selected_image = player->hotbar_selected_image;
|
hotbar_selected_image = player->hotbar_selected_image;
|
||||||
if (!hotbar_selected_image.empty())
|
use_hotbar_selected_image = !hotbar_selected_image.empty();
|
||||||
use_hotbar_selected_image = tsrc->isKnownSourceImage(hotbar_selected_image);
|
|
||||||
else
|
|
||||||
use_hotbar_selected_image = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw customized item background
|
// draw customized item background
|
||||||
|
@ -1224,21 +1224,9 @@ void Client::handleCommand_HudSetParam(NetworkPacket* pkt)
|
|||||||
player->hud_hotbar_itemcount = hotbar_itemcount;
|
player->hud_hotbar_itemcount = hotbar_itemcount;
|
||||||
}
|
}
|
||||||
else if (param == HUD_PARAM_HOTBAR_IMAGE) {
|
else if (param == HUD_PARAM_HOTBAR_IMAGE) {
|
||||||
// If value not empty verify image exists in texture source
|
|
||||||
if (!value.empty() && !getTextureSource()->isKnownSourceImage(value)) {
|
|
||||||
errorstream << "Server sent wrong Hud hotbar image (sent value: '"
|
|
||||||
<< value << "')" << std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player->hotbar_image = value;
|
player->hotbar_image = value;
|
||||||
}
|
}
|
||||||
else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) {
|
else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) {
|
||||||
// If value not empty verify image exists in texture source
|
|
||||||
if (!value.empty() && !getTextureSource()->isKnownSourceImage(value)) {
|
|
||||||
errorstream << "Server sent wrong Hud hotbar selected image (sent value: '"
|
|
||||||
<< value << "')" << std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player->hotbar_selected_image = value;
|
player->hotbar_selected_image = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user