fix(gui): dont draw two gui separators at the top for lua only tab. (#1677)

This commit is contained in:
Quentin 2023-07-10 20:37:28 +02:00 committed by GitHub
parent 0c050d82c9
commit a2609bbdc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -46,14 +46,23 @@ namespace big
{
std::lock_guard guard(m_module_lock);
bool add_separator = false;
for (const auto& module : m_modules)
{
if (const auto it = module->m_gui.find(tab_hash); it != module->m_gui.end())
{
ImGui::Separator();
if (add_separator)
{
ImGui::Separator();
add_separator = false;
}
for (const auto& element : it->second)
{
element->draw();
add_separator = true;
}
}
}
}

View File

@ -36,8 +36,14 @@ namespace big
ImGui::Separator();
if (selected->func)
{
selected->func();
const auto has_lua_gui_to_draw = g_lua_manager && g_lua_manager->has_gui_to_draw(selected->hash);
if (has_lua_gui_to_draw)
ImGui::Separator();
}
if (g_lua_manager)
g_lua_manager->draw_gui(selected->hash);