Commit ddf273c6 authored by mercury233's avatar mercury233

Merge branch 'fh' into test

parents 0451160d 99e8cff7
......@@ -1729,6 +1729,16 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
case irr::EET_GUI_EVENT: {
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_HOVERED: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(ECI_IBEAM);
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: {
switch(id) {
case BUTTON_CLEAR_LOG: {
......
......@@ -1435,5 +1435,11 @@ void Game::FlashWindow() {
FlashWindowEx(&fi);
#endif
}
void Game::SetCursor(ECURSOR_ICON icon) {
ICursorControl* cursor = mainGame->device->getCursorControl();
if(cursor->getActiveIcon() != icon) {
cursor->setActiveIcon(icon);
}
}
}
......@@ -144,6 +144,7 @@ public:
void SetWindowsIcon();
void FlashWindow();
void SetCursor(ECURSOR_ICON icon);
Mutex gMutex;
Mutex gBuffer;
......
......@@ -40,6 +40,16 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break;
}
switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_HOVERED: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(ECI_IBEAM);
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: {
if(id < 110)
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