Commit 073b5e07 authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/Fluorohydride/ygopro into server

parents d2d39811 8494f1b0
......@@ -984,6 +984,8 @@ void DeckBuilder::ClearSearch() {
mainGame->ebStar->setEnabled(false);
mainGame->ebScale->setEnabled(false);
mainGame->ebCardName->setText(L"");
mainGame->scrFilter->setVisible(false);
mainGame->scrFilter->setPos(0);
ClearFilter();
results.clear();
myswprintf(result_string, L"%d", 0);
......
......@@ -641,6 +641,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnChainAlways->setVisible(false);
mainGame->btnChainWhenAvail->setVisible(false);
mainGame->btnCancelOrFinish->setVisible(false);
mainGame->wSurrender->setVisible(false);
mainGame->stMessage->setText(dataManager.GetSysString(1500));
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
......@@ -674,6 +675,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
case STOC_REPLAY: {
mainGame->gMutex.Lock();
mainGame->wPhase->setVisible(false);
mainGame->wSurrender->setVisible(false);
if(mainGame->dInfo.player_type < 7)
mainGame->btnLeaveGame->setVisible(false);
mainGame->btnChainIgnore->setVisible(false);
......@@ -2272,6 +2274,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1351));
mainGame->btnLeaveGame->setVisible(true);
}
if(mainGame->wSurrender->isVisible())
mainGame->HideElement(mainGame->wSurrender);
if(!mainGame->dInfo.isReplay && mainGame->dInfo.player_type < 7) {
if(mainGame->gameConf.control_mode == 0) {
mainGame->btnChainIgnore->setVisible(true);
......
......@@ -147,10 +147,21 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if(exit_on_return)
mainGame->device->closeDevice();
} else {
DuelClient::SendPacketToServer(CTOS_SURRENDER);
mainGame->PopupElement(mainGame->wSurrender);
}
break;
}
case BUTTON_SURRENDER_YES: {
soundManager.PlaySoundEffect(SOUND_BUTTON);
DuelClient::SendPacketToServer(CTOS_SURRENDER);
mainGame->HideElement(mainGame->wSurrender);
break;
}
case BUTTON_SURRENDER_NO: {
soundManager.PlaySoundEffect(SOUND_BUTTON);
mainGame->HideElement(mainGame->wSurrender);
break;
}
case BUTTON_CHAIN_IGNORE: {
soundManager.PlaySoundEffect(SOUND_BUTTON);
mainGame->ignore_chain = mainGame->btnChainIgnore->isPressed();
......@@ -1422,6 +1433,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->chain_when_avail = false;
UpdateChainButtons();
}
if(mainGame->wSurrender->isVisible())
mainGame->HideElement(mainGame->wSurrender);
mainGame->wCmdMenu->setVisible(false);
if(mainGame->fadingList.size())
break;
......
......@@ -415,6 +415,14 @@ bool Game::Initialize() {
stQMessage->setTextAlignment(irr::gui::EGUIA_UPPERLEFT, irr::gui::EGUIA_CENTER);
btnYes = env->addButton(rect<s32>(100, 105, 150, 130), wQuery, BUTTON_YES, dataManager.GetSysString(1213));
btnNo = env->addButton(rect<s32>(200, 105, 250, 130), wQuery, BUTTON_NO, dataManager.GetSysString(1214));
//surrender yes/no (310)
wSurrender = env->addWindow(rect<s32>(490, 200, 840, 340), false, dataManager.GetSysString(560));
wSurrender->getCloseButton()->setVisible(false);
wSurrender->setVisible(false);
stSurrenderMessage = env->addStaticText(dataManager.GetSysString(1359), rect<s32>(20, 20, 350, 100), false, true, wSurrender, -1, false);
stSurrenderMessage->setTextAlignment(irr::gui::EGUIA_UPPERLEFT, irr::gui::EGUIA_CENTER);
btnSurrenderYes = env->addButton(rect<s32>(100, 105, 150, 130), wSurrender, BUTTON_SURRENDER_YES, dataManager.GetSysString(1213));
btnSurrenderNo = env->addButton(rect<s32>(200, 105, 250, 130), wSurrender, BUTTON_SURRENDER_NO, dataManager.GetSysString(1214));
//options (310)
wOptions = env->addWindow(rect<s32>(490, 200, 840, 340), false, L"");
wOptions->getCloseButton()->setVisible(false);
......@@ -774,6 +782,13 @@ bool Game::Initialize() {
col.setAlpha(224);
env->getSkin()->setColor((EGUI_DEFAULT_COLOR)i, col);
}
dimension2du size = driver->getScreenSize();
if(window_size != size) {
window_size = size;
xScale = window_size.Width / 1024.0;
yScale = window_size.Height / 640.0;
OnResize();
}
hideChat = false;
hideChatTimer = 0;
return true;
......@@ -1500,6 +1515,7 @@ void Game::CloseDuelWindow() {
wPhase->setVisible(false);
wPosSelect->setVisible(false);
wQuery->setVisible(false);
wSurrender->setVisible(false);
wReplayControl->setVisible(false);
wReplaySave->setVisible(false);
stHintMsg->setVisible(false);
......@@ -1623,6 +1639,7 @@ void Game::OnResize() {
wMessage->setRelativePosition(ResizeWin(490, 200, 840, 340));
wACMessage->setRelativePosition(ResizeWin(490, 240, 840, 300));
wQuery->setRelativePosition(ResizeWin(490, 200, 840, 340));
wSurrender->setRelativePosition(ResizeWin(490, 200, 840, 340));
wOptions->setRelativePosition(ResizeWin(490, 200, 840, 340));
wPosSelect->setRelativePosition(ResizeWin(340, 200, 935, 410));
wCardSelect->setRelativePosition(ResizeWin(320, 100, 1000, 400));
......
......@@ -394,6 +394,11 @@ public:
irr::gui::IGUIStaticText* stQMessage;
irr::gui::IGUIButton* btnYes;
irr::gui::IGUIButton* btnNo;
//surrender yes/no
irr::gui::IGUIWindow* wSurrender;
irr::gui::IGUIStaticText* stSurrenderMessage;
irr::gui::IGUIButton* btnSurrenderYes;
irr::gui::IGUIButton* btnSurrenderNo;
//options
irr::gui::IGUIWindow* wOptions;
irr::gui::IGUIStaticText* stOptions;
......@@ -594,7 +599,22 @@ extern HostInfo game_info;
#define BUTTON_CANCEL_REPLAY 132
#define BUTTON_DELETE_REPLAY 133
#define BUTTON_RENAME_REPLAY 134
#define EDITBOX_CHAT 140
#define BUTTON_REPLAY_START 140
#define BUTTON_REPLAY_PAUSE 141
#define BUTTON_REPLAY_STEP 142
#define BUTTON_REPLAY_UNDO 143
#define BUTTON_REPLAY_EXIT 144
#define BUTTON_REPLAY_SWAP 145
#define BUTTON_REPLAY_SAVE 146
#define BUTTON_REPLAY_CANCEL 147
#define LISTBOX_SINGLEPLAY_LIST 150
#define BUTTON_LOAD_SINGLEPLAY 151
#define BUTTON_CANCEL_SINGLEPLAY 152
#define LISTBOX_BOT_LIST 153
#define BUTTON_BOT_START 154
#define CHECKBOX_BOT_OLD_RULE 155
#define EDITBOX_CHAT 199
#define BUTTON_MSG_OK 200
#define BUTTON_YES 201
#define BUTTON_NO 202
......@@ -659,7 +679,9 @@ extern HostInfo game_info;
#define BUTTON_DISPLAY_4 294
#define SCROLL_CARD_DISPLAY 295
#define BUTTON_CARD_DISP_OK 296
#define BUTTON_CATEGORY_OK 300
#define BUTTON_SURRENDER_YES 297
#define BUTTON_SURRENDER_NO 298
#define COMBOBOX_DBLFLIST 301
#define COMBOBOX_DBDECKS 302
#define BUTTON_CLEAR_DECK 303
......@@ -679,25 +701,12 @@ extern HostInfo game_info;
#define BUTTON_CLEAR_FILTER 317
#define COMBOBOX_ATTRIBUTE 318
#define COMBOBOX_RACE 319
#define BUTTON_REPLAY_START 320
#define BUTTON_REPLAY_PAUSE 321
#define BUTTON_REPLAY_STEP 322
#define BUTTON_REPLAY_UNDO 323
#define BUTTON_REPLAY_EXIT 324
#define BUTTON_REPLAY_SWAP 325
#define BUTTON_REPLAY_SAVE 330
#define BUTTON_REPLAY_CANCEL 331
#define BUTTON_BOT_START 340
#define LISTBOX_BOT_LIST 341
#define CHECKBOX_BOT_OLD_RULE 342
#define LISTBOX_SINGLEPLAY_LIST 343
#define BUTTON_LOAD_SINGLEPLAY 344
#define BUTTON_CANCEL_SINGLEPLAY 345
#define SCROLL_TAB_HELPER 350
#define SCROLL_TAB_SYSTEM 351
#define COMBOBOX_LIMIT 320
#define BUTTON_CATEGORY_OK 321
#define BUTTON_MARKS_FILTER 322
#define BUTTON_MARKERS_OK 323
#define COMBOBOX_SORTTYPE 324
#define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_PREFER_EXPANSION 373
#define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363
......@@ -707,12 +716,10 @@ extern HostInfo game_info;
#define BUTTON_WINDOW_RESIZE_L 367
#define BUTTON_WINDOW_RESIZE_XL 368
#define CHECKBOX_QUICK_ANIMATION 369
#define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371
#define BUTTON_MARKS_FILTER 380
#define BUTTON_MARKERS_OK 381
#define SCROLL_TAB_HELPER 370
#define SCROLL_TAB_SYSTEM 371
#define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_PREFER_EXPANSION 373
#define DEFAULT_DUEL_RULE 4
......
......@@ -285,7 +285,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
NetServer::StopServer();
break;
}
STARTUPINFO si;
STARTUPINFOW si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
......
......@@ -181,6 +181,8 @@ void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
PlaySoundEffect(SOUND_INFO);
} else if(element == mainGame->wQuery) {
PlaySoundEffect(SOUND_QUESTION);
} else if(element == mainGame->wSurrender) {
PlaySoundEffect(SOUND_QUESTION);
} else if(element == mainGame->wOptions) {
PlaySoundEffect(SOUND_QUESTION);
} else if(element == mainGame->wANAttribute) {
......
......@@ -392,6 +392,7 @@
!system 1356 是否要放弃对卡组的修改?
!system 1357 不提示保留对卡组的修改
!system 1358 键入关键字后自动进行搜索
!system 1359 是否确定投降?
!system 1360 上一步
!system 1361 删除录像
!system 1362 重命名
......
......@@ -3,7 +3,7 @@
use_d3d = 0
use_image_scale = 1
antialias = 2
errorlog = 1
errorlog = 3
nickname = Player
gamename = Game
lastdeck = new
......
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