feat(renderer): add UI scaling (#674)

Closes #587
This commit is contained in:
Yimura
2022-12-09 20:43:01 +01:00
committed by GitHub
parent 173d01145d
commit 2ae76e0b14
3 changed files with 22 additions and 0 deletions

View File

@ -1,9 +1,19 @@
#include "views/view.hpp"
#include "renderer.hpp"
namespace big
{
void view::gui_settings()
{
components::sub_title("UI Scale");
ImGui::SliderFloat("##gui-scale", &g->window.gui_scale, 1.f, 1.5f, "%.2f");
ImGui::SameLine();
if (ImGui::Button("Apply##gui-scale"))
g_renderer->rescale(g->window.gui_scale);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Changing the UI scale may break rendering and require you to unload and inject YimMenu again.");
components::sub_title("Colors");
static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g->window.color);
if (ImGui::ColorEdit4("Gui Color##gui_picker", (float*)&col_gui, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{