Commit 543b72e2 authored by Matteo Serva's avatar Matteo Serva

support for more chat colors

parent 11720abd
...@@ -667,7 +667,10 @@ void Game::DrawSpec() { ...@@ -667,7 +667,10 @@ void Game::DrawSpec() {
attack_sv = 0; attack_sv = 0;
} }
for(int i = 0; i < 5; ++i) { for(int i = 0; i < 5; ++i) {
static unsigned int chatColor[11] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff8080ff, 0xffff4040, 0xffff4040}; static unsigned int chatColor[] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff8080ff, 0xffff4040, 0xffff4040,
0xffff4040,0xff40ff40,0xff4040ff,0xff40ffff,0xffff40ff,0xffffff40,0xffffffff,0xff808080,0xff404040};
if(chatTiming[i]) { if(chatTiming[i]) {
chatTiming[i]--; chatTiming[i]--;
int w = textFont->getDimension(chatMsg[i].c_str()).Width; int w = textFont->getDimension(chatMsg[i].c_str()).Width;
......
...@@ -588,6 +588,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -588,6 +588,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->AddChatMsg(msg, 8); mainGame->AddChatMsg(msg, 8);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} else if(pkt->player >= 11 && pkt->player<=19) { //system custom message.
BufferIO::CopyWStr(pkt->msg, msg, 256);
msg[(len - 3) / 2] = 0;
mainGame->gMutex.Lock();
mainGame->AddChatMsg(msg, pkt->player);
mainGame->gMutex.Unlock();
} else { } else {
if(mainGame->chkIgnore2->isChecked()) if(mainGame->chkIgnore2->isChecked())
break; break;
......
...@@ -222,7 +222,7 @@ bool Game::Initialize() { ...@@ -222,7 +222,7 @@ bool Game::Initialize() {
chkWaitChain = env->addCheckBox(false, rect<s32>(20, 110, 280, 135), tabSystem, -1, dataManager.GetSysString(1277)); chkWaitChain = env->addCheckBox(false, rect<s32>(20, 110, 280, 135), tabSystem, -1, dataManager.GetSysString(1277));
chkIgnore1 = env->addCheckBox(false, rect<s32>(20, 170, 280, 195), tabSystem, -1, dataManager.GetSysString(1290)); chkIgnore1 = env->addCheckBox(false, rect<s32>(20, 170, 280, 195), tabSystem, -1, dataManager.GetSysString(1290));
chkIgnore2 = env->addCheckBox(false, rect<s32>(20, 200, 280, 225), tabSystem, -1, dataManager.GetSysString(1291)); chkIgnore2 = env->addCheckBox(false, rect<s32>(20, 200, 280, 225), tabSystem, -1, dataManager.GetSysString(1291));
chkIgnore2->setChecked(true); chkIgnore2->setChecked(false);
// //
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L""); wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
wHand->getCloseButton()->setVisible(false); wHand->getCloseButton()->setVisible(false);
...@@ -829,7 +829,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) { ...@@ -829,7 +829,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
chatMsg[0].clear(); chatMsg[0].clear();
chatTiming[0] = 1200; chatTiming[0] = 1200;
chatType[0] = player; chatType[0] = player;
switch(player) { if (player<11 || player > 19) switch(player) {
case 0: //from host case 0: //from host
chatMsg[0].append(dInfo.hostname); chatMsg[0].append(dInfo.hostname);
chatMsg[0].append(L": "); chatMsg[0].append(L": ");
......
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