make hotbar size and layout configurable

Add hotbar-size, hotbar-layout and inventory-layout to config/defaults.toml,
player.get_hotbar_size / player.set_hotbar_size and
hud.is_hotbar_visible / hud.set_hotbar_visible.
This commit is contained in:
ostermine 2026-10-15 15:52:22 +03:00
parent 2e2233a489
commit aa670f3c9d
16 changed files with 188 additions and 20 deletions

View file

@ -89,6 +89,10 @@ class Hud : public util::ObjectsKeeper {
std::shared_ptr<gui::InventoryView> contentAccess;
/// @brief Player inventory hotbar
std::shared_ptr<gui::InventoryView> hotbarView;
/// @brief Hotbar layout set by 'hotbar-layout', nullptr for built-in
UiDocument* hotbarDocument = nullptr;
/// @brief Hotbar is not hidden by scripts
bool hotbarVisible = true;
/// @brief Debug info and control panel (F3 key)
std::shared_ptr<gui::UINode> debugPanel;
/// @brief Overlay used in pause mode
@ -219,6 +223,10 @@ public:
void setAllowPause(bool flag);
void setHotbarVisible(bool flag);
bool isHotbarVisible() const;
bool isOpen(const std::string& layoutid) const;
static bool showGeneratorMinimap;