Commit 30d746bf authored by fallenstardust's avatar fallenstardust

update adding log

parent 2cb905be
...@@ -939,8 +939,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -939,8 +939,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case HINT_OPSELECTED: { case HINT_OPSELECTED: {
myswprintf(textBuffer, dataManager.GetSysString(1510), dataManager.GetDesc(data)); myswprintf(textBuffer, dataManager.GetSysString(1510), dataManager.GetDesc(data));
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer);
mainGame->logParam.push_back(0);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
...@@ -957,8 +956,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -957,8 +956,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case HINT_RACE: { case HINT_RACE: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatRace(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatRace(data));
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer);
mainGame->logParam.push_back(0);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
...@@ -968,8 +966,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -968,8 +966,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case HINT_ATTRIB: { case HINT_ATTRIB: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatAttribute(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatAttribute(data));
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer);
mainGame->logParam.push_back(0);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
...@@ -979,8 +976,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -979,8 +976,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
case HINT_CODE: { case HINT_CODE: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.GetName(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.GetName(data));
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer, data);
mainGame->logParam.push_back(data);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
...@@ -1910,14 +1906,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1910,14 +1906,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
myswprintf(textBuffer, dataManager.GetSysString(207), count); myswprintf(textBuffer, dataManager.GetSysString(207), count);
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer);
mainGame->logParam.push_back(0);
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
pcard = *(mainGame->dField.extra[player].rbegin() + i + mainGame->dField.extra_p_count[player]); pcard = *(mainGame->dField.extra[player].rbegin() + i + mainGame->dField.extra_p_count[player]);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(pcard->code)); myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(pcard->code));
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer, pcard->code);
mainGame->logParam.push_back(pcard->code);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
if (player == 0) if (player == 0)
pcard->dPos = irr::core::vector3df(0, -0.20f, 0); pcard->dPos = irr::core::vector3df(0, -0.20f, 0);
...@@ -1944,8 +1938,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1944,8 +1938,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
myswprintf(textBuffer, dataManager.GetSysString(208), count); myswprintf(textBuffer, dataManager.GetSysString(208), count);
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer);
mainGame->logParam.push_back(0);
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
code = BufferIO::ReadInt32(pbuf); code = BufferIO::ReadInt32(pbuf);
c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
...@@ -1956,8 +1949,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1956,8 +1949,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->SetCode(code); pcard->SetCode(code);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(code)); myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(code));
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer, code);
mainGame->logParam.push_back(code);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
if (l & 0x41) { if (l & 0x41) {
if(count == 1) { if(count == 1) {
...@@ -2878,8 +2870,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2878,8 +2870,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} else } else
mainGame->WaitFrameSignal(30); mainGame->WaitFrameSignal(30);
myswprintf(textBuffer, dataManager.GetSysString(1610), dataManager.GetName(pcard->code), dataManager.FormatLocation(l, s), s + 1); myswprintf(textBuffer, dataManager.GetSysString(1610), dataManager.GetName(pcard->code), dataManager.FormatLocation(l, s), s + 1);
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer, pcard->code);
mainGame->logParam.push_back(pcard->code);
pcard->is_highlighting = false; pcard->is_highlighting = false;
} }
return true; return true;
...@@ -3281,8 +3272,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3281,8 +3272,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO::ReadInt32(pbuf); BufferIO::ReadInt32(pbuf);
unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf); unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf);
myswprintf(textBuffer, dataManager.GetSysString(1622), dataManager.GetName(code)); myswprintf(textBuffer, dataManager.GetSysString(1622), dataManager.GetName(code));
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer, code);
mainGame->logParam.push_back(code);
return true; return true;
} }
case MSG_TOSS_COIN: { case MSG_TOSS_COIN: {
...@@ -3301,8 +3291,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3301,8 +3291,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer);
mainGame->logParam.push_back(0);
mainGame->stACMessage->setText(textBuffer); mainGame->stACMessage->setText(textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
...@@ -3325,8 +3314,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3325,8 +3314,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->lstLog->addItem(textBuffer); mainGame->AddLog(textBuffer);
mainGame->logParam.push_back(0);
mainGame->stACMessage->setText(textBuffer); mainGame->stACMessage->setText(textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
......
...@@ -1547,6 +1547,13 @@ void Game::ClearCardInfo(int player) { ...@@ -1547,6 +1547,13 @@ void Game::ClearCardInfo(int player) {
stText->setText(L""); stText->setText(L"");
scrCardText->setVisible(false); scrCardText->setVisible(false);
} }
void Game::AddLog(const wchar_t* msg, int param) {
logParam.push_back(param);
lstLog->addItem(msg);
if(!env->hasFocus(lstLog)) {
lstLog->setSelected(-1);
}
}
void Game::AddChatMsg(const wchar_t* msg, int player) { void Game::AddChatMsg(const wchar_t* msg, int player) {
for(int i = 7; i > 0; --i) { for(int i = 7; i > 0; --i) {
chatMsg[i] = chatMsg[i - 1]; chatMsg[i] = chatMsg[i - 1];
......
...@@ -146,6 +146,7 @@ public: ...@@ -146,6 +146,7 @@ public:
void SaveConfig(); void SaveConfig();
void ShowCardInfo(int code); void ShowCardInfo(int code);
void ClearCardInfo(int player = 0); void ClearCardInfo(int player = 0);
void AddLog(const wchar_t* msg, int param = 0);
void AddChatMsg(const wchar_t* msg, int player); void AddChatMsg(const wchar_t* msg, int player);
void ClearChatMsg(); void ClearChatMsg();
void AddDebugMsg(const char* msgbuf); void AddDebugMsg(const char* msgbuf);
......
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