Commit 1ef3256a authored by nanahira's avatar nanahira

merge fh

parents 4e5c6a0c 78772f2d
...@@ -1088,7 +1088,7 @@ bool ClientField::ShowSelectSum(bool panelmode) { ...@@ -1088,7 +1088,7 @@ bool ClientField::ShowSelectSum(bool panelmode) {
select_ready = false; select_ready = false;
} }
if (select_ready) { if (select_ready) {
ShowCancelOrFinishButton(1); ShowCancelOrFinishButton(2);
} else { } else {
ShowCancelOrFinishButton(0); ShowCancelOrFinishButton(0);
} }
......
...@@ -55,8 +55,8 @@ public: ...@@ -55,8 +55,8 @@ public:
int select_max; int select_max;
int must_select_count; int must_select_count;
int select_sumval; int select_sumval;
int select_cancelable;
int select_mode; int select_mode;
bool select_cancelable;
bool select_panalmode; bool select_panalmode;
bool select_ready; bool select_ready;
int announce_count; int announce_count;
......
...@@ -500,6 +500,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -500,6 +500,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
else if(mainGame->wSinglePlay->isVisible()) else if(mainGame->wSinglePlay->isVisible())
mainGame->HideElement(mainGame->wSinglePlay); mainGame->HideElement(mainGame->wSinglePlay);
mainGame->ShowElement(mainGame->wHostPrepare); mainGame->ShowElement(mainGame->wHostPrepare);
if(!mainGame->chkIgnore1->isChecked())
mainGame->wChat->setVisible(true); mainGame->wChat->setVisible(true);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->dInfo.duel_rule = pkt->info.duel_rule; mainGame->dInfo.duel_rule = pkt->info.duel_rule;
...@@ -612,6 +613,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -612,6 +613,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnM2->setVisible(false); mainGame->btnM2->setVisible(false);
mainGame->btnEP->setVisible(false); mainGame->btnEP->setVisible(false);
mainGame->btnShuffle->setVisible(false); mainGame->btnShuffle->setVisible(false);
if(!mainGame->chkIgnore1->isChecked())
mainGame->wChat->setVisible(true); mainGame->wChat->setVisible(true);
mainGame->device->setEventReceiver(&mainGame->dField); mainGame->device->setEventReceiver(&mainGame->dField);
if(!mainGame->dInfo.isTag) { if(!mainGame->dInfo.isTag) {
...@@ -1412,7 +1414,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1412,7 +1414,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case MSG_SELECT_CARD: { case MSG_SELECT_CARD: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf); /*int selecting_player = */BufferIO::ReadInt8(pbuf);
mainGame->dField.select_cancelable = BufferIO::ReadInt8(pbuf); mainGame->dField.select_cancelable = BufferIO::ReadInt8(pbuf) != 0;
mainGame->dField.select_min = BufferIO::ReadInt8(pbuf); mainGame->dField.select_min = BufferIO::ReadInt8(pbuf);
mainGame->dField.select_max = BufferIO::ReadInt8(pbuf); mainGame->dField.select_max = BufferIO::ReadInt8(pbuf);
int count = BufferIO::ReadInt8(pbuf); int count = BufferIO::ReadInt8(pbuf);
...@@ -1473,8 +1475,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1473,8 +1475,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case MSG_SELECT_UNSELECT_CARD: { case MSG_SELECT_UNSELECT_CARD: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf); /*int selecting_player = */BufferIO::ReadInt8(pbuf);
bool buttonok = !!BufferIO::ReadInt8(pbuf); bool finishable = BufferIO::ReadInt8(pbuf) != 0;
mainGame->dField.select_cancelable = BufferIO::ReadInt8(pbuf); bool cancelable = BufferIO::ReadInt8(pbuf) != 0;
mainGame->dField.select_cancelable = finishable || cancelable;
mainGame->dField.select_min = BufferIO::ReadInt8(pbuf); mainGame->dField.select_min = BufferIO::ReadInt8(pbuf);
mainGame->dField.select_max = BufferIO::ReadInt8(pbuf); mainGame->dField.select_max = BufferIO::ReadInt8(pbuf);
int count1 = BufferIO::ReadInt8(pbuf); int count1 = BufferIO::ReadInt8(pbuf);
...@@ -1541,19 +1544,20 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1541,19 +1544,20 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if (panelmode) { if (panelmode) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->wCardSelect->setText(textBuffer); mainGame->wCardSelect->setText(textBuffer);
mainGame->dField.ShowSelectCard(buttonok); mainGame->dField.ShowSelectCard(mainGame->dField.select_cancelable);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} else { } else {
mainGame->stHintMsg->setText(textBuffer); mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true); mainGame->stHintMsg->setVisible(true);
} }
if (mainGame->dField.select_cancelable) { if (mainGame->dField.select_cancelable) {
if (count2 == 0) if(finishable) {
mainGame->dField.ShowCancelOrFinishButton(1);
else {
mainGame->dField.select_ready = true; mainGame->dField.select_ready = true;
mainGame->dField.ShowCancelOrFinishButton(2); mainGame->dField.ShowCancelOrFinishButton(2);
} }
else {
mainGame->dField.ShowCancelOrFinishButton(1);
}
} }
else else
mainGame->dField.ShowCancelOrFinishButton(0); mainGame->dField.ShowCancelOrFinishButton(0);
...@@ -1771,7 +1775,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1771,7 +1775,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case MSG_SELECT_TRIBUTE: { case MSG_SELECT_TRIBUTE: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf); /*int selecting_player = */BufferIO::ReadInt8(pbuf);
mainGame->dField.select_cancelable = BufferIO::ReadInt8(pbuf) ? true : false; mainGame->dField.select_cancelable = BufferIO::ReadInt8(pbuf) != 0;
mainGame->dField.select_min = BufferIO::ReadInt8(pbuf); mainGame->dField.select_min = BufferIO::ReadInt8(pbuf);
mainGame->dField.select_max = BufferIO::ReadInt8(pbuf); mainGame->dField.select_max = BufferIO::ReadInt8(pbuf);
int count = BufferIO::ReadInt8(pbuf); int count = BufferIO::ReadInt8(pbuf);
......
...@@ -464,6 +464,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -464,6 +464,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
list_command = COMMAND_SPSUMMON; list_command = COMMAND_SPSUMMON;
mainGame->wCardSelect->setText(dataManager.GetSysString(509)); mainGame->wCardSelect->setText(dataManager.GetSysString(509));
ShowSelectCard(); ShowSelectCard();
select_ready = false;
ShowCancelOrFinishButton(1); ShowCancelOrFinishButton(1);
} }
break; break;
...@@ -1810,6 +1811,14 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -1810,6 +1811,14 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break; break;
} }
#endif #endif
case CHECKBOX_DISABLE_CHAT: {
bool show = mainGame->is_building ? false : !mainGame->chkIgnore1->isChecked();
mainGame->wChat->setVisible(show);
if(!show)
mainGame->ClearChatMsg();
return true;
break;
}
} }
break; break;
} }
......
...@@ -289,7 +289,7 @@ bool Game::Initialize() { ...@@ -289,7 +289,7 @@ bool Game::Initialize() {
//system //system
irr::gui::IGUITab* tabSystem = wInfos->addTab(dataManager.GetSysString(1273)); irr::gui::IGUITab* tabSystem = wInfos->addTab(dataManager.GetSysString(1273));
posY = 20; posY = 20;
chkIgnore1 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1290)); chkIgnore1 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, CHECKBOX_DISABLE_CHAT, dataManager.GetSysString(1290));
chkIgnore1->setChecked(gameConf.chkIgnore1 != 0); chkIgnore1->setChecked(gameConf.chkIgnore1 != 0);
posY += 30; posY += 30;
chkIgnore2 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1291)); chkIgnore2 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1291));
...@@ -1540,6 +1540,11 @@ void Game::AddChatMsg(wchar_t* msg, int player) { ...@@ -1540,6 +1540,11 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
} }
chatMsg[0].append(msg); chatMsg[0].append(msg);
} }
void Game::ClearChatMsg() {
for(int i = 7; i >= 0; --i) {
chatTiming[i] = 0;
}
}
void Game::AddDebugMsg(char* msg) void Game::AddDebugMsg(char* msg)
{ {
if (enable_log & 0x1) { if (enable_log & 0x1) {
......
...@@ -145,6 +145,7 @@ public: ...@@ -145,6 +145,7 @@ public:
void SaveConfig(); void SaveConfig();
void ShowCardInfo(int code, bool resize = false); void ShowCardInfo(int code, bool resize = false);
void AddChatMsg(wchar_t* msg, int player); void AddChatMsg(wchar_t* msg, int player);
void ClearChatMsg();
void AddDebugMsg(char* msgbuf); void AddDebugMsg(char* msgbuf);
void ClearTextures(); void ClearTextures();
void CloseDuelWindow(); void CloseDuelWindow();
...@@ -661,6 +662,7 @@ extern Game* mainGame; ...@@ -661,6 +662,7 @@ extern Game* mainGame;
#define CHECKBOX_ENABLE_SOUND 361 #define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_MUSIC 362 #define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363 #define SCROLL_VOLUME 363
#define CHECKBOX_DISABLE_CHAT 364
#define COMBOBOX_SORTTYPE 370 #define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371 #define COMBOBOX_LIMIT 371
......
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
!system 1280 开启音乐 !system 1280 开启音乐
!system 1281 按场景切换音乐 !system 1281 按场景切换音乐
!system 1282 数字灵摆图片 !system 1282 数字灵摆图片
!system 1290 忽略对方发言 !system 1290 禁用聊天功能
!system 1291 忽略观战者发言 !system 1291 忽略观战者发言
!system 1292 忽略时点 !system 1292 忽略时点
!system 1293 显示时点 !system 1293 显示时点
......
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