Commit 8761314a authored by mercury233's avatar mercury233

Merge branch 'fh' into sound

parents 04609dc6 7cf1125a
...@@ -646,6 +646,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -646,6 +646,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case irr::EMIE_MOUSE_WHEEL: { case irr::EMIE_MOUSE_WHEEL: {
if(!mainGame->scrFilter->isVisible()) if(!mainGame->scrFilter->isVisible())
break; break;
if(mainGame->env->hasFocus(mainGame->scrFilter))
break;
irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement();
if(root->getElementFromPoint(mouse_pos) != root)
break;
if(event.MouseInput.Wheel < 0) { if(event.MouseInput.Wheel < 0) {
if(mainGame->scrFilter->getPos() < mainGame->scrFilter->getMax()) if(mainGame->scrFilter->getPos() < mainGame->scrFilter->getMax())
mainGame->scrFilter->setPos(mainGame->scrFilter->getPos() + 1); mainGame->scrFilter->setPos(mainGame->scrFilter->getPos() + 1);
......
...@@ -199,6 +199,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) { ...@@ -199,6 +199,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->btnStartBot->setEnabled(true); mainGame->btnStartBot->setEnabled(true);
mainGame->btnBotCancel->setEnabled(true); mainGame->btnBotCancel->setEnabled(true);
mainGame->stTip->setVisible(false);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->closeDoneSignal.Reset(); mainGame->closeDoneSignal.Reset();
mainGame->closeSignal.Set(); mainGame->closeSignal.Set();
......
...@@ -1729,6 +1729,16 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -1729,6 +1729,16 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
case irr::EET_GUI_EVENT: { case irr::EET_GUI_EVENT: {
s32 id = event.GUIEvent.Caller->getID(); s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType) { switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_HOVERED: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(event.GUIEvent.Caller->isEnabled() ? ECI_IBEAM : ECI_NORMAL);
break;
}
case irr::gui::EGET_ELEMENT_LEFT: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(ECI_NORMAL);
break;
}
case irr::gui::EGET_BUTTON_CLICKED: { case irr::gui::EGET_BUTTON_CLICKED: {
switch(id) { switch(id) {
case BUTTON_CLEAR_LOG: { case BUTTON_CLEAR_LOG: {
...@@ -1786,6 +1796,10 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -1786,6 +1796,10 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
case irr::gui::EGET_SCROLL_BAR_CHANGED: { case irr::gui::EGET_SCROLL_BAR_CHANGED: {
switch(id) { switch(id) {
case SCROLL_CARDTEXT: { case SCROLL_CARDTEXT: {
if(!mainGame->scrCardText->isVisible()) {
return true;
break;
}
u32 pos = mainGame->scrCardText->getPos(); u32 pos = mainGame->scrCardText->getPos();
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 25, mainGame->textFont, mainGame->showingtext, pos); mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 25, mainGame->textFont, mainGame->showingtext, pos);
return true; return true;
......
...@@ -708,7 +708,7 @@ void Game::MainLoop() { ...@@ -708,7 +708,7 @@ void Game::MainLoop() {
atkdy = (float)sin(atkframe); atkdy = (float)sin(atkframe);
driver->beginScene(true, true, SColor(0, 0, 0, 0)); driver->beginScene(true, true, SColor(0, 0, 0, 0));
gMutex.Lock(); gMutex.Lock();
if(dInfo.isStarted) { if(dInfo.isStarted || dInfo.isReplaySkiping) {
if(dInfo.isFinished && showcardcode == 1) if(dInfo.isFinished && showcardcode == 1)
soundManager.PlayBGM(BGM_WIN); soundManager.PlayBGM(BGM_WIN);
else if(dInfo.isFinished && (showcardcode == 2 || showcardcode == 3)) else if(dInfo.isFinished && (showcardcode == 2 || showcardcode == 3))
...@@ -800,6 +800,8 @@ void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cH ...@@ -800,6 +800,8 @@ void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cH
SetStaticText(pControl, cWidth, font, text); SetStaticText(pControl, cWidth, font, text);
if(font->getDimension(dataManager.strBuffer).Height <= cHeight) { if(font->getDimension(dataManager.strBuffer).Height <= cHeight) {
scrCardText->setVisible(false); scrCardText->setVisible(false);
if(env->hasFocus(scrCardText))
env->removeFocus(scrCardText);
return; return;
} }
SetStaticText(pControl, cWidth-25, font, text); SetStaticText(pControl, cWidth-25, font, text);
...@@ -1416,5 +1418,11 @@ void Game::FlashWindow() { ...@@ -1416,5 +1418,11 @@ void Game::FlashWindow() {
FlashWindowEx(&fi); FlashWindowEx(&fi);
#endif #endif
} }
void Game::SetCursor(ECURSOR_ICON icon) {
ICursorControl* cursor = mainGame->device->getCursorControl();
if(cursor->getActiveIcon() != icon) {
cursor->setActiveIcon(icon);
}
}
} }
...@@ -144,6 +144,7 @@ public: ...@@ -144,6 +144,7 @@ public:
void SetWindowsIcon(); void SetWindowsIcon();
void FlashWindow(); void FlashWindow();
void SetCursor(ECURSOR_ICON icon);
Mutex gMutex; Mutex gMutex;
Mutex gBuffer; Mutex gBuffer;
......
...@@ -40,6 +40,16 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -40,6 +40,16 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break; break;
} }
switch(event.GUIEvent.EventType) { switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_HOVERED: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(event.GUIEvent.Caller->isEnabled() ? ECI_IBEAM : ECI_NORMAL);
break;
}
case irr::gui::EGET_ELEMENT_LEFT: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(ECI_NORMAL);
break;
}
case irr::gui::EGET_BUTTON_CLICKED: { case irr::gui::EGET_BUTTON_CLICKED: {
if(id < 110) if(id < 110)
soundManager.PlaySoundEffect(SOUND_MENU); soundManager.PlaySoundEffect(SOUND_MENU);
......
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