Commit fd6ac022 authored by fallenstardust's avatar fallenstardust

添加直接开关聊天按钮

微调部分图标贴图
parent bb5353b0
...@@ -135,6 +135,7 @@ void DeckBuilder::Initialize() { ...@@ -135,6 +135,7 @@ void DeckBuilder::Initialize() {
mainGame->btnLeaveGame->setVisible(true); mainGame->btnLeaveGame->setVisible(true);
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1306)); mainGame->btnLeaveGame->setText(dataManager.GetSysString(1306));
mainGame->wPallet->setVisible(true); mainGame->wPallet->setVisible(true);
mainGame->imgChat->setVisible(false);
mainGame->btnSideOK->setVisible(false); mainGame->btnSideOK->setVisible(false);
mainGame->btnSideShuffle->setVisible(false); mainGame->btnSideShuffle->setVisible(false);
mainGame->btnSideSort->setVisible(false); mainGame->btnSideSort->setVisible(false);
...@@ -170,6 +171,7 @@ void DeckBuilder::Terminate() { ...@@ -170,6 +171,7 @@ void DeckBuilder::Terminate() {
mainGame->wInfos->setVisible(false); mainGame->wInfos->setVisible(false);
mainGame->btnLeaveGame->setVisible(false); mainGame->btnLeaveGame->setVisible(false);
mainGame->wPallet->setVisible(false); mainGame->wPallet->setVisible(false);
mainGame->imgChat->setVisible(true);
mainGame->wSettings->setVisible(false); mainGame->wSettings->setVisible(false);
mainGame->wLogs->setVisible(false); mainGame->wLogs->setVisible(false);
mainGame->PopupElement(mainGame->wMainMenu); mainGame->PopupElement(mainGame->wMainMenu);
...@@ -765,6 +767,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -765,6 +767,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break; break;
} }
mainGame->ClearCardInfo(); mainGame->ClearCardInfo();
mainGame->imgChat->setVisible(true);
char deckbuf[1024]; char deckbuf[1024];
char* pdeck = deckbuf; char* pdeck = deckbuf;
BufferIO::WriteInt32(pdeck, deckManager.current_deck.main.size() + deckManager.current_deck.extra.size()); BufferIO::WriteInt32(pdeck, deckManager.current_deck.main.size() + deckManager.current_deck.extra.size());
......
...@@ -374,6 +374,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -374,6 +374,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->is_siding = true; mainGame->is_siding = true;
mainGame->CloseGameWindow(); mainGame->CloseGameWindow();
mainGame->wChat->setVisible(false); mainGame->wChat->setVisible(false);
mainGame->imgChat->setVisible(false);
mainGame->wDeckEdit->setVisible(false); mainGame->wDeckEdit->setVisible(false);
mainGame->wFilter->setVisible(false); mainGame->wFilter->setVisible(false);
mainGame->wSort->setVisible(false); mainGame->wSort->setVisible(false);
......
...@@ -209,6 +209,22 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -209,6 +209,22 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->soundManager->EnableMusic(mainGame->chkEnableMusic->isChecked()); mainGame->soundManager->EnableMusic(mainGame->chkEnableMusic->isChecked());
break; break;
} }
case BUTTON_CHATTING: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if (mainGame->gameConf.chkIgnore1) {
mainGame->gameConf.chkIgnore1 = false;
mainGame->imgChat->setImage(imageManager.tTalk);
} else {
mainGame->gameConf.chkIgnore1 = true;
mainGame->imgChat->setImage(imageManager.tShut);
}
mainGame->chkIgnore1->setChecked(mainGame->gameConf.chkIgnore1);
bool show = mainGame->is_building ? false : !mainGame->chkIgnore1->isChecked();
mainGame->wChat->setVisible(show);
if(!show)
mainGame->ClearChatMsg();
break;
}
case BUTTON_CHAIN_IGNORE: { case BUTTON_CHAIN_IGNORE: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON); mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->ignore_chain = mainGame->btnChainIgnore->isPressed(); mainGame->ignore_chain = mainGame->btnChainIgnore->isPressed();
......
...@@ -446,7 +446,6 @@ bool Game::Initialize() { ...@@ -446,7 +446,6 @@ bool Game::Initialize() {
posY += 40 * yScale; posY += 40 * yScale;
chkMusicMode = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260 * xScale, posY + 30 * yScale), wSettings, -1, dataManager.GetSysString(1281)); chkMusicMode = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260 * xScale, posY + 30 * yScale), wSettings, -1, dataManager.GetSysString(1281));
chkMusicMode->setChecked(gameConf.music_mode != 0); chkMusicMode->setChecked(gameConf.music_mode != 0);
elmTabHelperLast = chkMusicMode;
posY += 40 * yScale; posY += 40 * yScale;
chkEnableSound = env->addCheckBox(gameConf.enable_sound, rect<s32>(posX, posY, posX + 260 * xScale, posY + 30 * yScale), wSettings, CHECKBOX_ENABLE_SOUND, dataManager.GetSysString(1279)); chkEnableSound = env->addCheckBox(gameConf.enable_sound, rect<s32>(posX, posY, posX + 260 * xScale, posY + 30 * yScale), wSettings, CHECKBOX_ENABLE_SOUND, dataManager.GetSysString(1279));
chkEnableSound->setChecked(gameConf.enable_sound); chkEnableSound->setChecked(gameConf.enable_sound);
...@@ -925,12 +924,19 @@ bool Game::Initialize() { ...@@ -925,12 +924,19 @@ bool Game::Initialize() {
btnReplaySwap = env->addButton(rect<s32>(5 * xScale, 140 * yScale, 85 * xScale, 180 * yScale), wReplayControl, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346)); btnReplaySwap = env->addButton(rect<s32>(5 * xScale, 140 * yScale, 85 * xScale, 180 * yScale), wReplayControl, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnReplayExit = env->addButton(rect<s32>(5 * xScale, 185 * yScale, 85 * xScale, 225 * yScale), wReplayControl, BUTTON_REPLAY_EXIT, dataManager.GetSysString(1347)); btnReplayExit = env->addButton(rect<s32>(5 * xScale, 185 * yScale, 85 * xScale, 225 * yScale), wReplayControl, BUTTON_REPLAY_EXIT, dataManager.GetSysString(1347));
//chat //chat
imgChat = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(0 * yScale, 319 * yScale, 45 * yScale, 364 * yScale), wPallet, BUTTON_CHATTING);
imgChat->setImageSize(core::dimension2di(28 * yScale, 28 * yScale));
if (gameConf.chkIgnore1) {
imgChat->setImage(imageManager.tShut);
} else {
imgChat->setImage(imageManager.tTalk);
}
wChat = env->addWindow(rect<s32>(305 * xScale, 610 * yScale, 1020 * xScale, 640 * yScale), false, L""); wChat = env->addWindow(rect<s32>(305 * xScale, 610 * yScale, 1020 * xScale, 640 * yScale), false, L"");
wChat->getCloseButton()->setVisible(false); wChat->getCloseButton()->setVisible(false);
wChat->setDraggable(false); wChat->setDraggable(false);
wChat->setDrawTitlebar(false); wChat->setDrawTitlebar(false);
wChat->setVisible(false); wChat->setVisible(false);
ebChatInput = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(3 * xScale, 2 * yScale, 710 * xScale, 22 * yScale), wChat, EDITBOX_CHAT); ebChatInput = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(3 * xScale, 2 * yScale, 710 * xScale, 28 * yScale), wChat, EDITBOX_CHAT);
//swap //swap
btnSpectatorSwap = env->addButton(rect<s32>(180 * xScale, 100 * yScale, 260 * xScale, 135 * yScale), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346)); btnSpectatorSwap = env->addButton(rect<s32>(180 * xScale, 100 * yScale, 260 * xScale, 135 * yScale), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnSpectatorSwap->setVisible(false); btnSpectatorSwap->setVisible(false);
...@@ -1761,6 +1767,7 @@ void Game::CloseDuelWindow() { ...@@ -1761,6 +1767,7 @@ void Game::CloseDuelWindow() {
wInfos->setVisible(false); wInfos->setVisible(false);
wChat->setVisible(false); wChat->setVisible(false);
wPallet->setVisible(false); wPallet->setVisible(false);
imgChat->setVisible(true);
wSettings->setVisible(false); wSettings->setVisible(false);
wLogs->setVisible(false); wLogs->setVisible(false);
btnSideOK->setVisible(false); btnSideOK->setVisible(false);
......
...@@ -265,6 +265,8 @@ public: ...@@ -265,6 +265,8 @@ public:
irr::gui::IGUIButton* btnCloseLog; irr::gui::IGUIButton* btnCloseLog;
//imageButton BGM //imageButton BGM
irr::gui::CGUIImageButton* imgVol; irr::gui::CGUIImageButton* imgVol;
//imageButton Chatting
irr::gui::CGUIImageButton* imgChat;
//Settings //Settings
irr::gui::CGUIImageButton* imgSettings; irr::gui::CGUIImageButton* imgSettings;
irr::gui::IGUIWindow* wSettings; irr::gui::IGUIWindow* wSettings;
...@@ -282,7 +284,6 @@ public: ...@@ -282,7 +284,6 @@ public:
irr::gui::IGUIStaticText* stText; irr::gui::IGUIStaticText* stText;
irr::gui::IGUIScrollBar* scrCardText; irr::gui::IGUIScrollBar* scrCardText;
irr::gui::IGUIWindow* tabHelper; irr::gui::IGUIWindow* tabHelper;
irr::gui::IGUIElement* elmTabHelperLast;
irr::gui::IGUIScrollBar* scrTabHelper; irr::gui::IGUIScrollBar* scrTabHelper;
irr::gui::IGUICheckBox* chkMAutoPos; irr::gui::IGUICheckBox* chkMAutoPos;
irr::gui::IGUICheckBox* chkSTAutoPos; irr::gui::IGUICheckBox* chkSTAutoPos;
...@@ -821,6 +822,7 @@ private: ...@@ -821,6 +822,7 @@ private:
#define BUTTON_SHOW_LOG 367 #define BUTTON_SHOW_LOG 367
#define CHECKBOX_DRAW_FIELD_SPELL 368 #define CHECKBOX_DRAW_FIELD_SPELL 368
#define CHECKBOX_QUICK_ANIMATION 369 #define CHECKBOX_QUICK_ANIMATION 369
#define BUTTON_CHATTING 370
#define SCROLL_SETTINGS 371 #define SCROLL_SETTINGS 371
#define CHECKBOX_MULTI_KEYWORDS 372 #define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_PREFER_EXPANSION 373 #define CHECKBOX_PREFER_EXPANSION 373
......
...@@ -38,6 +38,8 @@ bool ImageManager::Initial(const path dir) { ...@@ -38,6 +38,8 @@ bool ImageManager::Initial(const path dir) {
tLogs = driver->getTexture((dir + path("/textures/extra/tlogs.png")).c_str()); tLogs = driver->getTexture((dir + path("/textures/extra/tlogs.png")).c_str());
tMute = driver->getTexture((dir + path("/textures/extra/tmute.png")).c_str()); tMute = driver->getTexture((dir + path("/textures/extra/tmute.png")).c_str());
tPlay = driver->getTexture((dir + path("/textures/extra/tplay.png")).c_str()); tPlay = driver->getTexture((dir + path("/textures/extra/tplay.png")).c_str());
tTalk = driver->getTexture((dir + path("/textures/extra/ttalk.png")).c_str());
tShut = driver->getTexture((dir + path("/textures/extra/tshut.png")).c_str());
if(!tBackGround_menu) if(!tBackGround_menu)
tBackGround_menu = tBackGround; tBackGround_menu = tBackGround;
tBackGround_deck = driver->getTexture((dir + path("/textures/bg_deck.jpg")).c_str()); tBackGround_deck = driver->getTexture((dir + path("/textures/bg_deck.jpg")).c_str());
......
...@@ -59,6 +59,8 @@ public: ...@@ -59,6 +59,8 @@ public:
irr::video::ITexture* tLogs; irr::video::ITexture* tLogs;
irr::video::ITexture* tMute; irr::video::ITexture* tMute;
irr::video::ITexture* tPlay; irr::video::ITexture* tPlay;
irr::video::ITexture* tTalk;
irr::video::ITexture* tShut;
std::list<std::string> support_types; std::list<std::string> support_types;
}; };
......
...@@ -241,6 +241,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -241,6 +241,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->wCardImg->setVisible(true); mainGame->wCardImg->setVisible(true);
mainGame->wInfos->setVisible(true); mainGame->wInfos->setVisible(true);
mainGame->wPallet->setVisible(true); mainGame->wPallet->setVisible(true);
mainGame->imgChat->setVisible(false);
mainGame->wReplay->setVisible(true); mainGame->wReplay->setVisible(true);
mainGame->wReplayControl->setVisible(true); mainGame->wReplayControl->setVisible(true);
mainGame->btnReplayStart->setVisible(false); mainGame->btnReplayStart->setVisible(false);
...@@ -397,6 +398,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -397,6 +398,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_LOAD_SINGLEPLAY: { case BUTTON_LOAD_SINGLEPLAY: {
mainGame->imgChat->setVisible(false);
if(mainGame->lstSinglePlayList->getSelected() == -1) if(mainGame->lstSinglePlayList->getSelected() == -1)
break; break;
mainGame->singleSignal.SetNoWait(false); mainGame->singleSignal.SetNoWait(false);
......
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