Commit 73df63ab authored by mercury233's avatar mercury233 Committed by GitHub

update phase buttons (#1998)

parent 94f7e54b
...@@ -290,6 +290,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -290,6 +290,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnChainAlways->setVisible(false); mainGame->btnChainAlways->setVisible(false);
mainGame->btnChainWhenAvail->setVisible(false); mainGame->btnChainWhenAvail->setVisible(false);
mainGame->btnCancelOrFinish->setVisible(false); mainGame->btnCancelOrFinish->setVisible(false);
mainGame->btnShuffle->setVisible(false);
mainGame->deckBuilder.result_string[0] = L'0'; mainGame->deckBuilder.result_string[0] = L'0';
mainGame->deckBuilder.result_string[1] = 0; mainGame->deckBuilder.result_string[1] = 0;
mainGame->deckBuilder.results.clear(); mainGame->deckBuilder.results.clear();
...@@ -460,9 +461,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -460,9 +461,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->wInfos->setVisible(true); mainGame->wInfos->setVisible(true);
mainGame->wPhase->setVisible(true); mainGame->wPhase->setVisible(true);
mainGame->btnSideOK->setVisible(false); mainGame->btnSideOK->setVisible(false);
mainGame->btnDP->setVisible(false); mainGame->btnPhaseStatus->setVisible(false);
mainGame->btnSP->setVisible(false);
mainGame->btnM1->setVisible(false);
mainGame->btnBP->setVisible(false); mainGame->btnBP->setVisible(false);
mainGame->btnM2->setVisible(false); mainGame->btnM2->setVisible(false);
mainGame->btnEP->setVisible(false); mainGame->btnEP->setVisible(false);
...@@ -550,6 +549,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -550,6 +549,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnChainAlways->setVisible(false); mainGame->btnChainAlways->setVisible(false);
mainGame->btnChainWhenAvail->setVisible(false); mainGame->btnChainWhenAvail->setVisible(false);
mainGame->btnCancelOrFinish->setVisible(false); mainGame->btnCancelOrFinish->setVisible(false);
mainGame->btnShuffle->setVisible(false);
time_t nowtime = time(NULL); time_t nowtime = time(NULL);
struct tm *localedtime = localtime(&nowtime); struct tm *localedtime = localtime(&nowtime);
char timebuf[40]; char timebuf[40];
...@@ -1941,9 +1941,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1941,9 +1941,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case MSG_NEW_PHASE: { case MSG_NEW_PHASE: {
unsigned short phase = BufferIO::ReadInt16(pbuf); unsigned short phase = BufferIO::ReadInt16(pbuf);
mainGame->btnDP->setVisible(false); mainGame->btnPhaseStatus->setVisible(false);
mainGame->btnSP->setVisible(false);
mainGame->btnM1->setVisible(false);
mainGame->btnBP->setVisible(false); mainGame->btnBP->setVisible(false);
mainGame->btnM2->setVisible(false); mainGame->btnM2->setVisible(false);
mainGame->btnEP->setVisible(false); mainGame->btnEP->setVisible(false);
...@@ -1952,36 +1950,32 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1952,36 +1950,32 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->showcardp = 0; mainGame->showcardp = 0;
switch (phase) { switch (phase) {
case PHASE_DRAW: case PHASE_DRAW:
mainGame->btnDP->setVisible(true); mainGame->btnPhaseStatus->setText(L"\xff24\xff30");
mainGame->showcardcode = 4; mainGame->showcardcode = 4;
break; break;
case PHASE_STANDBY: case PHASE_STANDBY:
mainGame->btnSP->setVisible(true); mainGame->btnPhaseStatus->setText(L"\xff33\xff30");
mainGame->showcardcode = 5; mainGame->showcardcode = 5;
break; break;
case PHASE_MAIN1: case PHASE_MAIN1:
mainGame->btnM1->setVisible(true); mainGame->btnPhaseStatus->setText(L"\xff2d\xff11");
mainGame->showcardcode = 6; mainGame->showcardcode = 6;
break; break;
case PHASE_BATTLE_START: case PHASE_BATTLE_START:
mainGame->btnBP->setVisible(true); mainGame->btnPhaseStatus->setText(L"\xff22\xff30");
mainGame->btnBP->setPressed(true);
mainGame->btnBP->setEnabled(false);
mainGame->showcardcode = 7; mainGame->showcardcode = 7;
break; break;
case PHASE_MAIN2: case PHASE_MAIN2:
mainGame->btnM2->setVisible(true); mainGame->btnPhaseStatus->setText(L"\xff2d\xff12");
mainGame->btnM2->setPressed(true);
mainGame->btnM2->setEnabled(false);
mainGame->showcardcode = 8; mainGame->showcardcode = 8;
break; break;
case PHASE_END: case PHASE_END:
mainGame->btnEP->setVisible(true); mainGame->btnPhaseStatus->setText(L"\xff25\xff30");
mainGame->btnEP->setPressed(true);
mainGame->btnEP->setEnabled(false);
mainGame->showcardcode = 9; mainGame->showcardcode = 9;
break; break;
} }
mainGame->btnPhaseStatus->setPressed(true);
mainGame->btnPhaseStatus->setVisible(true);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) { if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->showcard = 101; mainGame->showcard = 101;
mainGame->WaitFrameSignal(40); mainGame->WaitFrameSignal(40);
......
...@@ -665,6 +665,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -665,6 +665,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
ShowSelectCard(true); ShowSelectCard(true);
break; break;
} }
case BUTTON_PHASE: {
mainGame->btnPhaseStatus->setPressed(true);
break;
}
case BUTTON_BP: { case BUTTON_BP: {
if(mainGame->dInfo.curMsg == MSG_SELECT_IDLECMD) { if(mainGame->dInfo.curMsg == MSG_SELECT_IDLECMD) {
DuelClient::SetResponseI(6); DuelClient::SetResponseI(6);
......
...@@ -202,26 +202,16 @@ bool Game::Initialize() { ...@@ -202,26 +202,16 @@ bool Game::Initialize() {
//phase //phase
wPhase = env->addStaticText(L"", rect<s32>(480, 310, 855, 330)); wPhase = env->addStaticText(L"", rect<s32>(480, 310, 855, 330));
wPhase->setVisible(false); wPhase->setVisible(false);
btnDP = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, -1, L"\xff24\xff30"); btnPhaseStatus = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, BUTTON_PHASE, L"");
btnDP->setEnabled(false); btnPhaseStatus->setIsPushButton(true);
btnDP->setPressed(true); btnPhaseStatus->setPressed(true);
btnDP->setVisible(false); btnPhaseStatus->setVisible(false);
btnSP = env->addButton(rect<s32>(65, 0, 115, 20), wPhase, -1, L"\xff33\xff30"); btnBP = env->addButton(rect<s32>(160, 0, 210, 20), wPhase, BUTTON_BP, L"\xff22\xff30");
btnSP->setEnabled(false);
btnSP->setPressed(true);
btnSP->setVisible(false);
btnM1 = env->addButton(rect<s32>(130, 0, 180, 20), wPhase, -1, L"\xff2d\xff11");
btnM1->setEnabled(false);
btnM1->setPressed(true);
btnM1->setVisible(false);
btnBP = env->addButton(rect<s32>(195, 0, 245, 20), wPhase, BUTTON_BP, L"\xff22\xff30");
btnBP->setVisible(false); btnBP->setVisible(false);
btnM2 = env->addButton(rect<s32>(260, 0, 310, 20), wPhase, BUTTON_M2, L"\xff2d\xff12"); btnM2 = env->addButton(rect<s32>(160, 0, 210, 20), wPhase, BUTTON_M2, L"\xff2d\xff12");
btnM2->setVisible(false); btnM2->setVisible(false);
btnEP = env->addButton(rect<s32>(325, 0, 375, 20), wPhase, BUTTON_EP, L"\xff25\xff30"); btnEP = env->addButton(rect<s32>(320, 0, 370, 20), wPhase, BUTTON_EP, L"\xff25\xff30");
btnEP->setVisible(false); btnEP->setVisible(false);
btnShuffle = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1307));
btnShuffle->setVisible(false);
//tab //tab
wInfos = env->addTabControl(rect<s32>(1, 275, 301, 639), 0, true); wInfos = env->addTabControl(rect<s32>(1, 275, 301, 639), 0, true);
wInfos->setVisible(false); wInfos->setVisible(false);
...@@ -582,6 +572,9 @@ bool Game::Initialize() { ...@@ -582,6 +572,9 @@ bool Game::Initialize() {
//cancel or finish //cancel or finish
btnCancelOrFinish = env->addButton(rect<s32>(205, 230, 295, 265), 0, BUTTON_CANCEL_OR_FINISH, dataManager.GetSysString(1295)); btnCancelOrFinish = env->addButton(rect<s32>(205, 230, 295, 265), 0, BUTTON_CANCEL_OR_FINISH, dataManager.GetSysString(1295));
btnCancelOrFinish->setVisible(false); btnCancelOrFinish->setVisible(false);
//shuffle
btnShuffle = env->addButton(rect<s32>(205, 230, 295, 265), 0, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1297));
btnShuffle->setVisible(false);
//leave/surrender/exit //leave/surrender/exit
btnLeaveGame = env->addButton(rect<s32>(205, 5, 295, 80), 0, BUTTON_LEAVE_GAME, L""); btnLeaveGame = env->addButton(rect<s32>(205, 5, 295, 80), 0, BUTTON_LEAVE_GAME, L"");
btnLeaveGame->setVisible(false); btnLeaveGame->setVisible(false);
......
...@@ -351,9 +351,7 @@ public: ...@@ -351,9 +351,7 @@ public:
irr::gui::IGUICheckBox* chkIgnore2; irr::gui::IGUICheckBox* chkIgnore2;
//phase button //phase button
irr::gui::IGUIStaticText* wPhase; irr::gui::IGUIStaticText* wPhase;
irr::gui::IGUIButton* btnDP; irr::gui::IGUIButton* btnPhaseStatus;
irr::gui::IGUIButton* btnSP;
irr::gui::IGUIButton* btnM1;
irr::gui::IGUIButton* btnBP; irr::gui::IGUIButton* btnBP;
irr::gui::IGUIButton* btnM2; irr::gui::IGUIButton* btnM2;
irr::gui::IGUIButton* btnEP; irr::gui::IGUIButton* btnEP;
...@@ -509,6 +507,7 @@ extern Game* mainGame; ...@@ -509,6 +507,7 @@ extern Game* mainGame;
#define BUTTON_CHAIN_ALWAYS 265 #define BUTTON_CHAIN_ALWAYS 265
#define BUTTON_CHAIN_WHENAVAIL 266 #define BUTTON_CHAIN_WHENAVAIL 266
#define BUTTON_CANCEL_OR_FINISH 267 #define BUTTON_CANCEL_OR_FINISH 267
#define BUTTON_PHASE 268
#define BUTTON_CLEAR_LOG 270 #define BUTTON_CLEAR_LOG 270
#define LISTBOX_LOG 271 #define LISTBOX_LOG 271
#define SCROLL_CARDTEXT 280 #define SCROLL_CARDTEXT 280
......
...@@ -302,6 +302,7 @@ ...@@ -302,6 +302,7 @@
!system 1294 可用时点 !system 1294 可用时点
!system 1295 取消操作 !system 1295 取消操作
!system 1296 完成选择 !system 1296 完成选择
!system 1297 切洗手卡
!system 1300 禁限卡表: !system 1300 禁限卡表:
!system 1301 卡组列表: !system 1301 卡组列表:
!system 1302 保存 !system 1302 保存
......
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