Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
fix fonts change crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnut committed May 11, 2024
1 parent eb54adf commit 503c91a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"gd": {
"win": "2.204"
},
"version": "v2.11.0",
"version": "v2.11.1",
"id": "maxnu.gd_mega_overlay",
"name": "GD Mega Overlay",
"developers": ["maxnu", "SpaghettDev"],
Expand Down
1 change: 1 addition & 0 deletions src/GUI/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ void GUI::setFont(const ghc::filesystem::path& font)
{
ImFont* fnt = ImGui::GetIO().Fonts->AddFontFromFileTTF(string::wideToUtf8(font.wstring()).c_str(), fontScale * uiSizeFactor);
ImGui::GetIO().FontDefault = fnt;
ImGuiCocos::get().reloadFontTexture();
}

void GUI::setStyle()
Expand Down
1 change: 0 additions & 1 deletion src/GUI/StyleEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ void GUI::drawStyleEditor()
if(ImGui::IsItemDeactivatedAfterEdit())
{
GUI::setFont(GUI::fontCombo.getSelectedFilePath());
ImGuiCocos::get().reloadFontTexture();
}

ImGui::Text("Borders");
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ void initGUI()
{
GUI::loadStyle(GUI::styleCombo.getSelectedFilePath());
GUI::setFont(GUI::fontCombo.getSelectedFilePath());
ImGuiCocos::get().reloadFontTexture();
}

if(GUI::fontCombo.draw())
Expand Down

0 comments on commit 503c91a

Please sign in to comment.