wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src show_dialog.cpp playturn.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src show_dialog.cpp playturn.cpp
Date: Thu, 21 Oct 2004 14:21:20 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/10/21 18:16:09

Modified files:
        src            : show_dialog.cpp playturn.cpp 

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

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/show_dialog.cpp.diff?tr1=1.97&tr2=1.98&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.277&tr2=1.278&r1=text&r2=text

Patches:
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.277 wesnoth/src/playturn.cpp:1.278
--- wesnoth/src/playturn.cpp:1.277      Sat Oct  9 21:14:47 2004
+++ wesnoth/src/playturn.cpp    Thu Oct 21 18:16:08 2004
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.277 2004/10/09 21:14:47 Sirp Exp $ */
+/* $Id: playturn.cpp,v 1.278 2004/10/21 18:16:08 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -416,6 +416,7 @@
 
                        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);
Index: wesnoth/src/show_dialog.cpp
diff -u wesnoth/src/show_dialog.cpp:1.97 wesnoth/src/show_dialog.cpp:1.98
--- wesnoth/src/show_dialog.cpp:1.97    Mon Oct 11 23:46:40 2004
+++ wesnoth/src/show_dialog.cpp Thu Oct 21 18:16:08 2004
@@ -1,4 +1,4 @@
-/* $Id: show_dialog.cpp,v 1.97 2004/10/11 23:46:40 Sirp Exp $ */
+/* $Id: show_dialog.cpp,v 1.98 2004/10/21 18:16:08 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -57,6 +57,25 @@
 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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]