mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add ObjectRef.hud_set_hotbar_itemcount and add TOCLIENT_HUD_SET_PARAM
This commit is contained in:
parent
730d316efe
commit
96fe1de832
12 changed files with 89 additions and 4 deletions
|
@ -43,7 +43,6 @@ Hud::Hud(video::IVideoDriver *driver, gui::IGUIEnvironment* guienv,
|
|||
screensize = v2u32(0, 0);
|
||||
displaycenter = v2s32(0, 0);
|
||||
hotbar_imagesize = 48;
|
||||
hotbar_itemcount = 8;
|
||||
|
||||
tsrc = gamedef->getTextureSource();
|
||||
|
||||
|
@ -286,6 +285,7 @@ void Hud::drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem) {
|
|||
return;
|
||||
}
|
||||
|
||||
s32 hotbar_itemcount = player->hud_hotbar_itemcount;
|
||||
s32 padding = hotbar_imagesize / 12;
|
||||
s32 width = hotbar_itemcount * (hotbar_imagesize + padding * 2);
|
||||
v2s32 pos = centerlowerpos - v2s32(width / 2, hotbar_imagesize + padding * 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue