- if(event.type == SDL_MOUSEBUTTONDOWN)
- {
- if(event.button.button == SDL_BUTTON_LEFT)
- {
- state = BUTTON_PRESSED;
- }
- else
- {
- show_info = true;
- }
- }
- else if(event.type == SDL_MOUSEBUTTONUP)
- {
- if(event.button.button == SDL_BUTTON_LEFT && state == BUTTON_PRESSED)
- {
- state = BUTTON_CLICKED;
- }
- else if(event.button.button != SDL_BUTTON_LEFT && state != BUTTON_PRESSED)
- {
- show_info = true;
- }
- }
-
- if(state != BUTTON_PRESSED && state != BUTTON_CLICKED)
- {
- state = BUTTON_HOVER;
- mouse_cursor->set_state(MC_LINK);
- }