2022-05-04 19:16:40 +02:00
|
|
|
#include "views/view.hpp"
|
2023-03-01 21:27:15 +00:00
|
|
|
|
2022-06-30 00:11:54 +02:00
|
|
|
#include "pointers.hpp"
|
|
|
|
#include "services/gui/gui_service.hpp"
|
2023-03-04 12:13:13 +01:00
|
|
|
#include "services/translation_service/translation_service.hpp"
|
2022-05-04 19:16:40 +02:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
void view::active_view()
|
|
|
|
{
|
|
|
|
if (g_gui_service->get_selected()->func == nullptr)
|
|
|
|
return;
|
2022-05-04 19:16:40 +02:00
|
|
|
|
|
|
|
static float alpha = 1.f;
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
ImGui::SetNextWindowPos({(300.f + 20.f) * g.window.gui_scale, 100.f * g.window.gui_scale}, ImGuiCond_Always);
|
|
|
|
ImGui::SetNextWindowSize({0.f, 0.f});
|
|
|
|
ImGui::SetNextWindowSizeConstraints({300.f, 100.f},
|
|
|
|
{(float)*g_pointers->m_resolution_x - 270.f, (float)*g_pointers->m_resolution_y - 110.f});
|
2022-05-04 19:16:40 +02:00
|
|
|
if (ImGui::Begin("main", nullptr, window_flags))
|
|
|
|
{
|
2023-03-04 12:13:13 +01:00
|
|
|
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;
|
|
|
|
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
|
2023-03-04 12:13:13 +01:00
|
|
|
components::title(key);
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::Separator();
|
2022-05-04 19:16:40 +02:00
|
|
|
g_gui_service->get_selected()->func();
|
|
|
|
ImGui::PopStyleVar();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|