Commit 7d61b6f5 authored by nanahira's avatar nanahira

merge

parents bf25ed66 f9e269c3
......@@ -929,7 +929,6 @@ void Game::DrawSpec() {
break;
}
auto pos = lpcFont->getDimension(lstr);
//int offset = pos.Width / 2;
if(showcardp < 10) {
int alpha = (showcardp * 25) << 24;
DrawShadowText(lpcFont, lstr, ResizeElem(650 - pos.Width / 2 - (9 - showcardp) * 40, 290, 950, 370), Resize(-1, -1, 0, 0), alpha | 0xffffff, alpha);
......
......@@ -1789,6 +1789,26 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true;
break;
}
case BUTTON_WINDOW_RESIZE_S: {
mainGame->SetWindowsScale(0.8);
return true;
break;
}
case BUTTON_WINDOW_RESIZE_M: {
mainGame->SetWindowsScale(1);
return true;
break;
}
case BUTTON_WINDOW_RESIZE_L: {
mainGame->SetWindowsScale(1.25);
return true;
break;
}
case BUTTON_WINDOW_RESIZE_XL: {
mainGame->SetWindowsScale(1.5);
return true;
break;
}
}
break;
}
......
......@@ -106,12 +106,6 @@ bool Game::Initialize() {
hWnd = reinterpret_cast<HWND>(exposedData.D3D9.HWnd);
else
hWnd = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd);
/*if(hWnd) {
LONG style = GetWindowLong(hWnd, GWL_STYLE);
style |= WS_MINIMIZEBOX;
SetWindowLong(hWnd, GWL_STYLE, style);
SendMessage(hWnd, WM_NCPAINT, 1, 0);
}*/
#endif
SetWindowsIcon();
//main menu
......@@ -315,6 +309,12 @@ bool Game::Initialize() {
chkAutoSearch = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, CHECKBOX_AUTO_SEARCH, dataManager.GetSysString(1358));
chkAutoSearch->setChecked(gameConf.auto_search_limit >= 0);
posY += 30;
env->addStaticText(dataManager.GetSysString(1282), rect<s32>(posX + 23, posY + 3, posX + 120, posY + 28), false, false, tabSystem);
btnWinResizeS = env->addButton(rect<s32>(posX + 125, posY, posX + 155, posY + 25), tabSystem, BUTTON_WINDOW_RESIZE_S, dataManager.GetSysString(1283));
btnWinResizeM = env->addButton(rect<s32>(posX + 160, posY, posX + 190, posY + 25), tabSystem, BUTTON_WINDOW_RESIZE_M, dataManager.GetSysString(1284));
btnWinResizeL = env->addButton(rect<s32>(posX + 195, posY, posX + 225, posY + 25), tabSystem, BUTTON_WINDOW_RESIZE_L, dataManager.GetSysString(1285));
btnWinResizeXL = env->addButton(rect<s32>(posX + 230, posY, posX + 260, posY + 25), tabSystem, BUTTON_WINDOW_RESIZE_XL, dataManager.GetSysString(1286));
posY += 30;
chkEnableSound = env->addCheckBox(gameConf.enable_sound, rect<s32>(posX, posY, posX + 120, posY + 25), tabSystem, CHECKBOX_ENABLE_SOUND, dataManager.GetSysString(1279));
chkEnableSound->setChecked(gameConf.enable_sound);
scrSoundVolume = env->addScrollBar(true, rect<s32>(posX + 126, posY + 4, posX + 260, posY + 21), tabSystem, SCROLL_VOLUME);
......@@ -336,7 +336,7 @@ bool Game::Initialize() {
chkMusicMode = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1281));
chkMusicMode->setChecked(gameConf.music_mode != 0);
posY += 30;
chkEnablePScale = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1282));
chkEnablePScale = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1287));
chkEnablePScale->setChecked(gameConf.chkEnablePScale != 0);
//
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
......@@ -1495,10 +1495,7 @@ void Game::ShowCardInfo(int code, bool resize) {
} else {
myswprintf(formatBuffer, L"[%ls]", dataManager.FormatType(cd.type));
stInfo->setText(formatBuffer);
stDataInfo->setRelativePosition(recti(15, 60, 300 * xScale - 13, 83));
stDataInfo->setText(L"");
//stSetName->setRelativePosition(rect<s32>(15, 60 * yScale, 296 * xScale, 60 * yScale + offset));
//stText->setRelativePosition(rect<s32>(15, 60 * yScale + offset, 287 * xScale, 324 * yScale));
stSetName->setRelativePosition(rect<s32>(15, 60, 296 * xScale, 60 + offset));
stText->setRelativePosition(rect<s32>(15, 60 + offset, 287 * xScale, 324 * yScale));
scrCardText->setRelativePosition(rect<s32>(287 * xScale - 20, 60 + offset, 287 * xScale, 324 * yScale));
......@@ -1721,18 +1718,14 @@ 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_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);
textFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, (yScale > 0.642 ? gameConf.textfontsize * yScale : 9));
old_numFont->drop();
old_adFont->drop();
old_lpcFont->drop();
//old_guiFont->drop();
old_textFont->drop();
imageManager.ClearTexture();
......@@ -1811,8 +1804,8 @@ void Game::OnResize() {
stHintMsg->setRelativePosition(ResizeWin(500, 60, 820, 90));
//sound / music volume bar
scrSoundVolume->setRelativePosition(recti(20 + 126, 200 + 4, 20 + (300 * xScale) - 40, 200 + 21));
scrMusicVolume->setRelativePosition(recti(20 + 126, 230 + 4, 20 + (300 * xScale) - 40, 230 + 21));
scrSoundVolume->setRelativePosition(recti(20 + 126, 230 + 4, 20 + (300 * xScale) - 40, 230 + 21));
scrMusicVolume->setRelativePosition(recti(20 + 126, 260 + 4, 20 + (300 * xScale) - 40, 260 + 21));
if(gameConf.resize_popup_menu) {
int width = 100 * mainGame->xScale;
......@@ -1835,11 +1828,7 @@ void Game::OnResize() {
imgCard->setRelativePosition(ResizeCard(10, 9, 0, 0));
wInfos->setRelativePosition(Resize(1, 275, 301, 639));
stName->setRelativePosition(recti(10, 10, 300 * xScale - 13, 10 + 22));
//stName->setRelativePosition(recti(10, 10, 300 * xScale - 13, 10 + 22 * yScale));
//stInfo->setRelativePosition(recti(15, 37 * yScale, 300 * xScale - 13, 60 * yScale));
//stDataInfo->setRelativePosition(recti(15, 60 * yScale, 300 * xScale - 13, 83 * yScale));
lstLog->setRelativePosition(Resize(10, 10, 290, 290));
//const auto& tsize = stText->getRelativePosition();
if(showingcode)
ShowCardInfo(showingcode, true);
btnClearLog->setRelativePosition(Resize(160, 300, 260, 325));
......@@ -1976,6 +1965,21 @@ void Game::SetWindowsIcon() {
SendMessageW(hWnd, WM_SETICON, ICON_BIG, (long)hBigIcon);
#endif
}
void Game::SetWindowsScale(float scale) {
#ifdef _WIN32
WINDOWPLACEMENT plc;
plc.length = sizeof(WINDOWPLACEMENT);
if(GetWindowPlacement(hWnd, &plc) && (plc.showCmd == SW_SHOWMAXIMIZED))
ShowWindow(hWnd, SW_RESTORE);
RECT rcWindow, rcClient;
GetWindowRect(hWnd, &rcWindow);
GetClientRect(hWnd, &rcClient);
MoveWindow(hWnd, rcWindow.left, rcWindow.top,
(rcWindow.right - rcWindow.left) - rcClient.right + 1024 * scale,
(rcWindow.bottom - rcWindow.top) - rcClient.bottom + 640 * scale,
true);
#endif
}
void Game::FlashWindow() {
#ifdef _WIN32
FLASHWINFO fi;
......
......@@ -177,6 +177,7 @@ public:
recti ResizeFit(s32 x, s32 y, s32 x2, s32 y2);
void SetWindowsIcon();
void SetWindowsScale(float scale);
void FlashWindow();
void takeScreenshot();
void SetCursor(ECURSOR_ICON icon);
......@@ -286,6 +287,10 @@ public:
irr::gui::IGUIScrollBar* scrSoundVolume;
irr::gui::IGUIScrollBar* scrMusicVolume;
irr::gui::IGUICheckBox* chkMusicMode;
irr::gui::IGUIButton* btnWinResizeS;
irr::gui::IGUIButton* btnWinResizeM;
irr::gui::IGUIButton* btnWinResizeL;
irr::gui::IGUIButton* btnWinResizeXL;
irr::gui::IGUICheckBox* chkEnablePScale;
//main menu
irr::gui::IGUIWindow* wMainMenu;
......@@ -673,6 +678,10 @@ extern Game* mainGame;
#define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363
#define CHECKBOX_DISABLE_CHAT 364
#define BUTTON_WINDOW_RESIZE_S 365
#define BUTTON_WINDOW_RESIZE_M 366
#define BUTTON_WINDOW_RESIZE_L 367
#define BUTTON_WINDOW_RESIZE_XL 368
#define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371
......
......@@ -308,7 +308,12 @@
!system 1279 开启音效
!system 1280 开启音乐
!system 1281 按场景切换音乐
!system 1282 数字灵摆图片
!system 1282 窗口大小
!system 1283
!system 1284
!system 1285
!system 1286 特大
!system 1287 数字灵摆图片
!system 1290 忽略对方发言
!system 1291 忽略观战者发言
!system 1292 忽略时点
......
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