feat(translations): add support for GUI tabs (#1039)

* fix(translation service): formatting of download
* fix(views): debug window not popping up
This commit is contained in:
Andreas Maerten
2023-03-04 12:13:13 +01:00
committed by GitHub
parent 9ccb77e8eb
commit 64106cb6a0
5 changed files with 98 additions and 48 deletions

View File

@ -2,6 +2,7 @@
#include "pointers.hpp"
#include "services/gui/gui_service.hpp"
#include "services/translation_service/translation_service.hpp"
namespace big
{
@ -18,8 +19,12 @@ namespace big
{(float)*g_pointers->m_resolution_x - 270.f, (float)*g_pointers->m_resolution_y - 110.f});
if (ImGui::Begin("main", nullptr, window_flags))
{
const char* key = nullptr;
if (key = g_translation_service.get_translation(g_gui_service->get_selected()->name).data(); !key)
key = g_gui_service->get_selected()->name;
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
components::title(g_gui_service->get_selected()->name);
components::title(key);
ImGui::Separator();
g_gui_service->get_selected()->func();
ImGui::PopStyleVar();

View File

@ -6,7 +6,7 @@ namespace big
{
void debug::main()
{
if (strcmp(g_gui_service->get_selected()->name, "Debug"))
if (strcmp(g_gui_service->get_selected()->name, "GUI_TAB_DEBUG"))
return;
if (ImGui::Begin("DEBUG_WINDOW"_T.data()))