Applied a slightly modified version of krom's patch 3465.

This commit is contained in:
Guillaume Melquiond 2004-10-21 18:16:08 +00:00
parent 56091176ef
commit 7f45b7b9b8
2 changed files with 20 additions and 0 deletions

View file

@ -416,6 +416,7 @@ void turn_info::mouse_press(const SDL_MouseButtonEvent& event)
cursor::set(cursor::NORMAL);
} else {
gui_.draw(); // redraw highlight (and maybe some more)
const theme::menu* const m = gui_.get_theme().context_menu();
if (m != NULL)
show_menu(m->items(),event.x,event.y,true);

View file

@ -57,6 +57,25 @@ dialog_manager::dialog_manager() : cursor::setter(cursor::NORMAL), reset_to(is_i
dialog_manager::~dialog_manager()
{
is_in_dialog = reset_to;
int mousex, mousey;
int mouse_flags = SDL_GetMouseState(&mousex, &mousey);
SDL_Event pb_event;
pb_event.type = SDL_MOUSEMOTION;
pb_event.motion.state = 0;
pb_event.motion.x = mousex;
pb_event.motion.y = mousey;
pb_event.motion.xrel = 0;
pb_event.motion.yrel = 0;
SDL_PushEvent(&pb_event);
if (!(mouse_flags & SDL_BUTTON_RMASK) || is_in_dialog)
return;
// based on krom's idea; remove if you don't like the "responsiveness"
pb_event.type = SDL_MOUSEBUTTONDOWN;
pb_event.button.button = SDL_BUTTON_RIGHT;
pb_event.button.state = SDL_PRESSED;
pb_event.button.x = mousex;
pb_event.button.y = mousey;
SDL_PushEvent(&pb_event);
}
void draw_dialog_frame(int x, int y, int w, int h, display& disp, const std::string* dialog_style, surface_restorer* restorer)