mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
hud.open_permanent semantics update
This commit is contained in:
parent
d9dc974685
commit
33d14be71c
2 changed files with 16 additions and 7 deletions
|
|
@ -441,7 +441,16 @@ void Hud::openInventory(glm::ivec3 block, UiDocument* doc, std::shared_ptr<Inven
|
|||
* @param doc element layout document
|
||||
*/
|
||||
void Hud::openPermanent(UiDocument* doc) {
|
||||
remove(doc->getRoot());
|
||||
auto root = doc->getRoot();
|
||||
remove(root);
|
||||
|
||||
auto invview = std::dynamic_pointer_cast<InventoryView>(root);
|
||||
if (invview) {
|
||||
auto level = frontend->getLevel();
|
||||
auto player = level->player;
|
||||
auto inventory = player->getInventory();
|
||||
invview->bind(inventory, frontend, interaction.get());
|
||||
}
|
||||
add(HudElement(hud_element_mode::permanent, doc, doc->getRoot(), false));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue