mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add rules & add 'show-content-access' rule
This commit is contained in:
parent
a50cb109c8
commit
2e24d60404
7 changed files with 156 additions and 28 deletions
|
|
@ -348,7 +348,7 @@ void Hud::update(bool visible) {
|
|||
}
|
||||
|
||||
glm::vec2 invSize = contentAccessPanel->getSize();
|
||||
contentAccessPanel->setVisible(inventoryView != nullptr);
|
||||
contentAccessPanel->setVisible(inventoryView != nullptr && showContentPanel);
|
||||
contentAccessPanel->setSize(glm::vec2(invSize.x, Window::height));
|
||||
contentAccess->setMinSize(glm::vec2(1, Window::height));
|
||||
hotbarView->setVisible(visible && !(secondUI && !inventoryView));
|
||||
|
|
@ -553,7 +553,9 @@ void Hud::updateElementsPosition(const Viewport& viewport) {
|
|||
const uint height = viewport.getHeight();
|
||||
|
||||
if (inventoryOpen) {
|
||||
float caWidth = inventoryView ? contentAccess->getSize().x : 0.0f;
|
||||
float caWidth = inventoryView && showContentPanel
|
||||
? contentAccess->getSize().x
|
||||
: 0.0f;
|
||||
contentAccessPanel->setPos(glm::vec2(width-caWidth, 0));
|
||||
|
||||
glm::vec2 invSize = inventoryView ? inventoryView->getSize() : glm::vec2();
|
||||
|
|
@ -628,3 +630,11 @@ std::shared_ptr<Inventory> Hud::getBlockInventory() {
|
|||
}
|
||||
return blockUI->getInventory();
|
||||
}
|
||||
|
||||
bool Hud::isContentAccess() const {
|
||||
return showContentPanel;
|
||||
}
|
||||
|
||||
void Hud::setContentAccess(bool flag) {
|
||||
showContentPanel = flag;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue