Commit b4fb656f authored by mercury233's avatar mercury233

fix & revert guifont

parent bf8648af
......@@ -898,7 +898,7 @@ void Game::DrawSpec() {
DrawShadowText(lpcFont, lstr, ResizeElem(650 - pos.Width / 2, 290, 950, 370), Resize(-1, -1, 0, 0), 0xffffffff);
if(dInfo.vic_string && (showcardcode == 1 || showcardcode == 2)) {
driver->draw2DRectangle(0xa0000000, ResizeElem(540, 320, 800, 340));
DrawShadowText(textFont, dInfo.vic_string, ResizeElem(500, 320, 840, 340), Resize(-2, -1, 0, 0), 0xffffffff, 0xff000000, true, true, 0);
DrawShadowText(guiFont, dInfo.vic_string, ResizeElem(500, 320, 840, 340), Resize(-2, -1, 0, 0), 0xffffffff, 0xff000000, true, true, 0);
}
} else if(showcardp < showcarddif + 10) {
int alpha = ((showcarddif + 10 - showcardp) * 25) << 24;
......@@ -937,7 +937,7 @@ void Game::DrawSpec() {
continue;
if(!showChat && i > 2)
continue;
int w = textFont->getDimension(chatMsg[i].c_str()).Width;
int w = guiFont->getDimension(chatMsg[i].c_str()).Width;
recti rectloc(mainGame->wChat->getRelativePosition().UpperLeftCorner.X, mainGame->window_size.Height - 45, mainGame->wChat->getRelativePosition().UpperLeftCorner.X + 2 + w, mainGame->window_size.Height - 25);
rectloc -= position2di(0, i * 20);
......@@ -946,8 +946,8 @@ void Game::DrawSpec() {
recti shadowloc = msgloc + position2di(1, 1);
driver->draw2DRectangle(rectloc, 0xa0000000, 0xa0000000, 0xa0000000, 0xa0000000);
textFont->draw(chatMsg[i].c_str(), msgloc, 0xff000000, false, false);
textFont->draw(chatMsg[i].c_str(), shadowloc, chatColor[chatType[i]], false, false);
guiFont->draw(chatMsg[i].c_str(), msgloc, 0xff000000, false, false);
guiFont->draw(chatMsg[i].c_str(), shadowloc, chatColor[chatType[i]], false, false);
}
}
}
......
......@@ -1436,7 +1436,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
should_show_tip = true;
myswprintf(formatBuffer, dataManager.GetSysString(1700), mainGame->btnCancelOrFinish->getText());
mainGame->stTip->setText(formatBuffer);
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(formatBuffer) + irr::core::dimension2d<unsigned int>(10, 10);
irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(formatBuffer) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(mainGame->Resize(x - 10 - dtip.Width, y - 10 - dtip.Height, x - 10, y - 10));
}
mainGame->stTip->setVisible(should_show_tip);
......@@ -1560,7 +1560,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str.append(formatBuffer);
}
should_show_tip = true;
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(recti(mousepos.X - 10 - dtip.Width, mousepos.Y - 10 - dtip.Height, mousepos.X - 10, mousepos.Y - 10));
mainGame->stTip->setText(str.c_str());
}
......
......@@ -1308,7 +1308,7 @@ void Game::ShowCardInfo(int code, bool resize) {
showingcode = code;
showingtext = dataManager.GetText(code);
const auto& tsize = stText->getRelativePosition();
InitStaticText(stText, tsize.getWidth(), tsize.getHeight(), textFont, showingtext);
InitStaticText(stText, tsize.getWidth(), tsize.getHeight(), guiFont, showingtext);
}
void Game::AddChatMsg(wchar_t* msg, int player) {
for(int i = 7; i > 0; --i) {
......@@ -1501,18 +1501,18 @@ void Game::OnResize() {
irr::gui::CGUITTFont* old_numFont = numFont;
irr::gui::CGUITTFont* old_adFont = adFont;
irr::gui::CGUITTFont* old_lpcFont = lpcFont;
irr::gui::CGUITTFont* old_guiFont = guiFont;
//irr::gui::CGUITTFont* old_guiFont = guiFont;
irr::gui::CGUITTFont* old_textFont = textFont;
numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, (yScale > 0.5 ? 16 * yScale : 8));
adFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, (yScale > 0.75 ? 12 * yScale : 9));
lpcFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 48 * yScale);
guiFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, gameConf.textfontsize * yScale);
env->getSkin()->setFont(guiFont);
//guiFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, gameConf.textfontsize * yScale);
//env->getSkin()->setFont(guiFont);
textFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, gameConf.textfontsize * yScale);
old_numFont->drop();
old_adFont->drop();
old_lpcFont->drop();
old_guiFont->drop();
//old_guiFont->drop();
old_textFont->drop();
wMainMenu->setRelativePosition(ResizeWin(370, 200, 650, 415));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment