Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/DevTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct matjson::Serialize<Settings> {
assign(value["advanced_settings"], s.advancedSettings);
assign(value["show_memory_viewer"], s.showMemoryViewer);
assign(value["show_mod_graph"], s.showModGraph);
assign(value["font_scale"], s.fontScale);
assign(value["theme"], s.theme);
assign(value["theme_color"], s.themeColor);
assign(value["button_x"], s.buttonPos.x);
Expand All @@ -51,6 +52,7 @@ struct matjson::Serialize<Settings> {
{ "advanced_settings", settings.advancedSettings },
{ "show_memory_viewer", settings.showMemoryViewer },
{ "show_mod_graph", settings.showModGraph },
{ "font_scale", settings.fontScale },
{ "theme", settings.theme },
{ "theme_color", settings.themeColor },
{ "button_x", settings.buttonPos.x },
Expand Down Expand Up @@ -321,6 +323,7 @@ void DevTools::setup() {
ImGui::CreateContext();

auto& io = ImGui::GetIO();
io.FontGlobalScale = m_settings.fontScale;
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
// if this is true then it just doesnt work :( why
io.ConfigDockingWithShift = false;
Expand All @@ -331,7 +334,6 @@ void DevTools::setup() {
this->setupPlatform();

#ifdef GEODE_IS_MOBILE
ImGui::GetIO().FontGlobalScale = 2.f;
ImGui::GetStyle().ScrollbarSize = 60.f;
// ImGui::GetStyle().TabBarBorderSize = 60.f;
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/DevTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ struct Settings {
bool buttonInGame = false;
bool buttonEnabled = false;
bool treeDragReorder = false;
#ifdef GEODE_IS_MOBILE
float fontScale = 2.f;
#else
float fontScale = 1.f;
#endif
};

class DevTools {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ void DevTools::drawSettings() {

ImGui::Separator();

ImGui::DragFloat("Font Size", &ImGui::GetIO().FontGlobalScale, 0.01f, 1.0f, 3.0f);
if (ImGui::DragFloat("Font Size", &m_settings.fontScale, 0.01f, 1.0f, 3.0f)) {
ImGui::GetIO().FontGlobalScale = m_settings.fontScale;
}

#ifdef GEODE_IS_DESKTOP

Expand Down