From 617273e1e62eff955b2f465be25a54053ea3305f Mon Sep 17 00:00:00 2001 From: GabsPuNs Date: Thu, 11 Jun 2026 18:20:45 -0400 Subject: [PATCH] Update RmlManager.cpp --- Minecraft.Client/RmlManager.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Minecraft.Client/RmlManager.cpp b/Minecraft.Client/RmlManager.cpp index 8f5afa15..8558a7a5 100644 --- a/Minecraft.Client/RmlManager.cpp +++ b/Minecraft.Client/RmlManager.cpp @@ -37,12 +37,7 @@ bool RmlManager::Init(int viewport_width, int viewport_height) } // Set asset path for RmlUi files (relative to exe directory) - char exePath[MAX_PATH]; - GetModuleFileNameA(nullptr, exePath, MAX_PATH); - char* lastSlash = strrchr(exePath, '\\'); - if (lastSlash) - *(lastSlash + 1) = '\0'; - Rml::String assetPath = Rml::String(exePath) + "Assets/UI"; + Rml::String assetPath = utils.GetExeDir().string() + "/Assets/UI"; m_file_interface->SetAssetPath(assetPath); Rml::SetRenderInterface(m_renderer.get()); @@ -55,11 +50,14 @@ bool RmlManager::Init(int viewport_width, int viewport_height) return false; } +// GabsPuN: Hardcoded. Is this really needed? +/* // Load default fonts Rml::LoadFontFace("C:/Windows/Fonts/segoeui.ttf", false); Rml::LoadFontFace("C:/Windows/Fonts/segoeuib.ttf", false); Rml::LoadFontFace("C:/Windows/Fonts/segoeuii.ttf", false); Rml::LoadFontFace("C:/Windows/Fonts/segoeuiz.ttf", false); +*/ // Minecraft's UI fonts (from tryashtar/minecraft-ttf) if (!Rml::LoadFontFace(assetPath + "/fonts/Mojangles.ttf", "Minecraft Default", Rml::Style::FontStyle::Normal, Rml::Style::FontWeight::Normal, false)) @@ -132,6 +130,8 @@ void RmlManager::Render() m_renderer->BeginFrame(); +//GabsPuN: This DebugPrintf is called each frame when RMLUI is not used. +/* int docCount = 0; for (int i = 0; i < m_context->GetNumDocuments(); i++) { @@ -141,6 +141,7 @@ void RmlManager::Render() } if (docCount == 0) app.DebugPrintf("[RmlManager] WARNING: No visible documents in context\n"); +*/ m_context->Render(); m_renderer->EndFrame();