diff --git a/Gunz/NewChat.cpp b/Gunz/NewChat.cpp index c76d5453..40019159 100644 --- a/Gunz/NewChat.cpp +++ b/Gunz/NewChat.cpp @@ -57,9 +57,11 @@ void Chat::Create(const std::string &strFont, int nFontSize){ Cursor.y = RGetScreenHeight() / 2; pFont = std::make_unique(); - pFont->Create("NewChatFont", strFont.c_str(), int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true); + pFont->Create("NewChatFont", strFont.c_str(), + int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true); pItalicFont = std::make_unique(); - pItalicFont->Create("NewChatItalicFont", strFont.c_str(), int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true, true); + pItalicFont->Create("NewChatItalicFont", strFont.c_str(), + int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true, true); nFontHeight = pFont->GetHeight(); @@ -245,12 +247,17 @@ void Chat::Scale(double fWidthRatio, double fHeightRatio){ Border.y1 *= fHeightRatio; Border.y2 *= fHeightRatio; - nFontSize *= fHeightRatio; + //nFontSize *= fHeightRatio; ResetFonts(); } void Chat::Resize(int nWidth, int nHeight) { + Border.x1 = 10; + Border.y1 = double(1080 - 300) / 1080 * RGetScreenHeight(); + Border.x2 = (double)500 / 1920 * RGetScreenWidth(); + Border.y2 = double(1080 - 100) / 1080 * RGetScreenHeight(); + ResetFonts(); } @@ -1229,6 +1236,13 @@ void Chat::ResetFonts(){ SafeDestroy(pFont.get()); SafeDestroy(pItalicFont.get()); - pFont->Create("NewChatFont", strFont.c_str(), int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true); - pItalicFont->Create("NewChatItalicFont", strFont.c_str(), int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true, true); + char buf[64]; + sprintf_safe(buf, "Font size: %d\n", int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5)); + OutputDebugString(buf); + pFont->Create("NewChatFont", strFont.c_str(), + int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true); + pItalicFont->Create("NewChatItalicFont", strFont.c_str(), + int(float(nFontSize) / 1080 * RGetScreenHeight() + 0.5), 1, true, true); + + nFontHeight = pFont->GetHeight(); } \ No newline at end of file diff --git a/Gunz/ZOptionInterface.cpp b/Gunz/ZOptionInterface.cpp index 4a6cfc43..b31ea9e1 100644 --- a/Gunz/ZOptionInterface.cpp +++ b/Gunz/ZOptionInterface.cpp @@ -1373,7 +1373,8 @@ void ZOptionInterface::Resize(int w, int h) ResizeWidget("MonsterBook", w, h); ResizeWidget("CombatTDMInfo", w, h); - if (ZGetCombatInterface()) ZGetCombatInterface()->Resize(w, h); + if (ZGetCombatInterface()) + ZGetCombatInterface()->Resize(w, h); g_Chat.Resize(w, h); } @@ -1394,7 +1395,6 @@ void ZOptionInterface::GetOldScreenResolution() Mint::GetInstance()->SetWorkspaceSize(ModeParams.nWidth, ModeParams.nHeight); Mint::GetInstance()->GetMainFrame()->SetSize(ModeParams.nWidth, ModeParams.nHeight); Resize(ModeParams.nWidth, ModeParams.nHeight); - g_Chat.Scale(double(RGetScreenWidth()) / mOldScreenWidth, double(RGetScreenHeight()) / mOldScreenHeight); D3DDISPLAYMODE ddm; ddm.Width = ModeParams.nWidth; @@ -1460,7 +1460,6 @@ bool ZOptionInterface::TestScreenResolution() Mint::GetInstance()->SetWorkspaceSize(ModeParams.nWidth, ModeParams.nHeight); Mint::GetInstance()->GetMainFrame()->SetSize(ModeParams.nWidth, ModeParams.nHeight); Resize(ModeParams.nWidth, ModeParams.nHeight); - g_Chat.Scale(double(RGetScreenWidth()) / mOldScreenWidth, double(RGetScreenHeight()) / mOldScreenHeight); } return true; }