void CEventSelect::Mouse(int button, int state, int x, int y) { if (state == 1) { TWidget* clicked = ClickGUI(x, y); if (textbuttons[0] == clicked) { if (Events.IsUnlocked(event->GetValue(), cup->GetValue())) EnterEvent(); } else if (textbuttons[1] == clicked) State::manager.RequestEnterState(GameTypeSelect); } }
void EventSelectMouseFunc (int button, int state, int x, int y ) { int foc, dir; if (state == 1) { GetFocus (x, y, &foc, &dir); switch (foc) { case 0: ChangeEventSelection (foc, dir); break; case 1: ChangeCupSelection (foc, dir); break; case 2: if (Events.IsUnlocked (curr_event, curr_cup)) EnterEvent(); break; case 3: Winsys.SetMode (GAME_TYPE_SELECT); break; } } }
void CEventSelect::Keyb (unsigned int key, bool special, bool release, int x, int y) { if (release) return; switch (key) { case SDLK_ESCAPE: State::manager.RequestEnterState (GameTypeSelect); break; case SDLK_q: State::manager.RequestQuit(); break; case SDLK_RETURN: if (textbuttons[1]->focussed()) State::manager.RequestEnterState (GameTypeSelect); else if (Events.IsUnlocked (event->GetValue(), cup->GetValue())) EnterEvent(); break; case SDLK_u: param.ui_snow = !param.ui_snow; break; default: KeyGUI(key, 0, release); } }
void EventSelectKeys (unsigned int key, bool special, bool release, int x, int y) { if (release) return; switch (key) { case 27: Winsys.SetMode (GAME_TYPE_SELECT); break; case SDLK_TAB: if (curr_focus < 3) curr_focus++; else curr_focus = 0; if (Events.IsUnlocked (curr_event, curr_cup) == false && curr_focus == 2) curr_focus = 3; break; case SDLK_q: Winsys.Quit (); break; case 13: if (curr_focus == 3) Winsys.SetMode (GAME_TYPE_SELECT); else if (Events.IsUnlocked (curr_event, curr_cup)) EnterEvent(); break; case SDLK_DOWN: if (curr_focus == 0) ChangeEventSelection (curr_focus, 1); else ChangeCupSelection (curr_focus, 1); break; case SDLK_UP: if (curr_focus == 0) ChangeEventSelection (curr_focus, 0); else ChangeCupSelection (curr_focus, 0); break; case SDLK_u: param.ui_snow = !param.ui_snow; break; } }
void CEventSelect::Keyb(sf::Keyboard::Key key, bool release, int x, int y) { if (release) return; switch (key) { case sf::Keyboard::Escape: State::manager.RequestEnterState(GameTypeSelect); break; case sf::Keyboard::Q: State::manager.RequestQuit(); break; case sf::Keyboard::Return: if (textbuttons[1]->focussed()) State::manager.RequestEnterState(GameTypeSelect); else if (Events.IsUnlocked(event->GetValue(), cup->GetValue())) EnterEvent(); break; case sf::Keyboard::U: param.ui_snow = !param.ui_snow; break; default: KeyGUI(key, release); } }