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
13 changes: 10 additions & 3 deletions src/DevTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ DevTools* DevTools::get() {
return inst;
}

void DevTools::loadSettings() { m_settings = Mod::get()->getSavedValue<Settings>("settings"); }
void DevTools::saveSettings() { Mod::get()->setSavedValue("settings", m_settings); }
// i wish i didnt have to do this but none of the lead devs have 4k monitors apparently!?!?!?
void DevTools::loadSettings() {
m_settings = Mod::get()->getSavedValue<Settings>("settings");
m_settings.fontScale = Mod::get()->getSavedValue<float>("font-scale", m_settings.fontScale);
}
void DevTools::saveSettings() {
Mod::get()->setSavedValue("settings", m_settings);
Mod::get()->setSavedValue("font-scale", m_settings.fontScale);
}
Settings DevTools::getSettings() { return m_settings; }
void DevTools::setBallPosition(CCPoint pos) { m_settings.buttonPos = std::move(pos); }

Expand Down Expand Up @@ -321,6 +328,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 +339,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
9 changes: 8 additions & 1 deletion src/pages/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ 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;
DevTools::get()->saveSettings();
}
if (ImGui::IsItemActive()) {
ImGui::GetIO().FontGlobalScale = m_settings.fontScale;
}

#ifdef GEODE_IS_DESKTOP

Expand Down Expand Up @@ -272,3 +278,4 @@ void DevTools::drawSettings() {
}
};*/