styyx-util 1.0
Utility Header for SKSE Plugin development
Loading...
Searching...
No Matches
st-menu.h
Go to the documentation of this file.
1#pragma once
2
3namespace StyyxUtil {
4 struct MenuUtil {
7 static void CloseMenu(const RE::BSFixedString& a_menuName)
8 {
9 if (const auto UIMsgQueue = RE::UIMessageQueue::GetSingleton(); UIMsgQueue) {
10 UIMsgQueue->AddMessage(a_menuName, RE::UI_MESSAGE_TYPE::kHide, nullptr);
11 }
12 }
13
17 [[nodiscard]] static bool IsAnyOfMenuOpen(const std::vector<std::string> &a_menuNames)
18 {
19 const auto ui = RE::UI::GetSingleton();
20 if (!ui)
21 return true;
22 for (auto &menuName : a_menuNames)
23 {
24 if (const auto menu = ui->GetMenu(menuName); menu && menu->OnStack())
25 return true;
26 }
27 return false;
28 }
29
30 };
31}
Definition st-actor.h:7
Definition st-menu.h:4
static void CloseMenu(const RE::BSFixedString &a_menuName)
Closes the specified menu.
Definition st-menu.h:7
static bool IsAnyOfMenuOpen(const std::vector< std::string > &a_menuNames)
Check if any menu from a vector with menu names is open.
Definition st-menu.h:17