mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
added hud.is_player_inventory_open
This commit is contained in:
parent
cb1b113181
commit
9ad21460a2
4 changed files with 14 additions and 0 deletions
|
|
@ -73,6 +73,9 @@ hud.is_paused() -> boolean
|
||||||
-- Возвращает true если открыт инвентарь или оверлей.
|
-- Возвращает true если открыт инвентарь или оверлей.
|
||||||
hud.is_inventory_open() -> boolean
|
hud.is_inventory_open() -> boolean
|
||||||
|
|
||||||
|
-- Возвращает true если открыт инвентарь игрока.
|
||||||
|
hud.is_player_inventory_open() -> boolean
|
||||||
|
|
||||||
-- Устанавливает разрешение на паузу. При значении false меню паузы не приостанавливает игру.
|
-- Устанавливает разрешение на паузу. При значении false меню паузы не приостанавливает игру.
|
||||||
hud.set_allow_pause(flag: boolean)
|
hud.set_allow_pause(flag: boolean)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -688,6 +688,10 @@ bool Hud::isInventoryOpen() const {
|
||||||
return inventoryOpen;
|
return inventoryOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Hud::isPlayerInventoryOpen() const {
|
||||||
|
return inventoryView != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool Hud::isPause() const {
|
bool Hud::isPause() const {
|
||||||
return pause;
|
return pause;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,8 @@ public:
|
||||||
/// @brief Check if inventory mode on
|
/// @brief Check if inventory mode on
|
||||||
bool isInventoryOpen() const;
|
bool isInventoryOpen() const;
|
||||||
|
|
||||||
|
bool isPlayerInventoryOpen() const;
|
||||||
|
|
||||||
/// @brief Check if pause mode on
|
/// @brief Check if pause mode on
|
||||||
bool isPause() const;
|
bool isPause() const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,10 @@ static int l_is_inventory_open(lua::State* L) {
|
||||||
return lua::pushboolean(L, hud->isInventoryOpen());
|
return lua::pushboolean(L, hud->isInventoryOpen());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int l_is_player_inventory_open(lua::State* L) {
|
||||||
|
return lua::pushboolean(L, hud->isPlayerInventoryOpen());
|
||||||
|
}
|
||||||
|
|
||||||
static int l_is_content_access(lua::State* L) {
|
static int l_is_content_access(lua::State* L) {
|
||||||
return lua::pushboolean(L, hud->isContentAccess());
|
return lua::pushboolean(L, hud->isContentAccess());
|
||||||
}
|
}
|
||||||
|
|
@ -217,6 +221,7 @@ const luaL_Reg hudlib[] = {
|
||||||
{"resume", wrap_hud<l_resume>},
|
{"resume", wrap_hud<l_resume>},
|
||||||
{"is_paused", wrap_hud<l_is_paused>},
|
{"is_paused", wrap_hud<l_is_paused>},
|
||||||
{"is_inventory_open", wrap_hud<l_is_inventory_open>},
|
{"is_inventory_open", wrap_hud<l_is_inventory_open>},
|
||||||
|
{"is_player_inventory_open", wrap_hud<l_is_player_inventory_open>},
|
||||||
{"get_player", wrap_hud<l_get_player>},
|
{"get_player", wrap_hud<l_get_player>},
|
||||||
{"_is_content_access", wrap_hud<l_is_content_access>},
|
{"_is_content_access", wrap_hud<l_is_content_access>},
|
||||||
{"_set_content_access", wrap_hud<l_set_content_access>},
|
{"_set_content_access", wrap_hud<l_set_content_access>},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue