From: <tz...@us...> - 2010-03-10 05:08:55
|
Revision: 3383 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=3383&view=rev Author: tzlaine Date: 2010-03-10 05:08:49 +0000 (Wed, 10 Mar 2010) Log Message: ----------- Changed the mouse handling logic in CombatSetupWnd slightly to more closely resemble that in CombatWnd. This fixes the bug in which a left button drag and release would act as a click on an object. Modified Paths: -------------- trunk/FreeOrion/UI/CombatSetupWnd.cpp trunk/FreeOrion/UI/CombatSetupWnd.h Modified: trunk/FreeOrion/UI/CombatSetupWnd.cpp =================================================================== --- trunk/FreeOrion/UI/CombatSetupWnd.cpp 2010-03-10 04:46:25 UTC (rev 3382) +++ trunk/FreeOrion/UI/CombatSetupWnd.cpp 2010-03-10 05:08:49 UTC (rev 3383) @@ -285,6 +285,7 @@ m_dragging_placed_ship(false), m_button_press_on_placed_ship(INVALID_PRESS_POS), m_button_press_placed_ship_node(0), + m_mouse_dragged(false), m_listbox(new CUIListBox(GG::X0, GG::Y0, GG::X1, GG::Y1)), m_done_button(new CUIButton(GG::X0, GG::Y1, GG::X1, UserString("DONE"))), m_selected_placeable_ship(0), @@ -349,6 +350,7 @@ retval = true; } m_dragging_placed_ship = false; + m_mouse_dragged = false; } else if (event.Type() == GG::WndEvent::LDrag) { HandleMouseMoves(event.Point()); if (m_button_press_placed_ship_node) { @@ -369,13 +371,17 @@ } } retval = true; + m_mouse_dragged = true; } else if (event.Type() == GG::WndEvent::LButtonUp) { m_button_press_placed_ship_node = 0; + m_mouse_dragged = false; } else if (event.Type() == GG::WndEvent::LClick) { Ogre::SceneNode* placement_node = 0; if ((placement_node = PlaceableShipNode()) && IsVisible(*placement_node)) { PlaceCurrentShip(); retval = true; + } else if (m_mouse_dragged) { + retval = true; } m_button_press_placed_ship_node = 0; } else if (event.Type() == GG::WndEvent::RClick) { Modified: trunk/FreeOrion/UI/CombatSetupWnd.h =================================================================== --- trunk/FreeOrion/UI/CombatSetupWnd.h 2010-03-10 04:46:25 UTC (rev 3382) +++ trunk/FreeOrion/UI/CombatSetupWnd.h 2010-03-10 05:08:49 UTC (rev 3383) @@ -62,6 +62,7 @@ bool m_dragging_placed_ship; GG::Pt m_button_press_on_placed_ship; Ogre::SceneNode* m_button_press_placed_ship_node; + bool m_mouse_dragged; CUIListBox* m_listbox; CUIButton* m_done_button; |