netpanzer-cvs
[Top][All Lists]
Advanced

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

[netPanzer-CVS] netpanzer/src/NetPanzer Classes/WorldInputCmdPr...


From: Hankin Chick
Subject: [netPanzer-CVS] netpanzer/src/NetPanzer Classes/WorldInputCmdPr...
Date: Sun, 09 Nov 2003 02:54:17 -0500

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Hankin Chick <address@hidden>   03/11/09 02:54:17

Modified files:
        src/NetPanzer/Classes: WorldInputCmdProcessor.cpp 
                               WorldInputCmdProcessor.hpp 
        src/NetPanzer/Views/MainMenu: MenuTemplateView.cpp 

Log message:
        the lobby won't go missing when changing back from option button to 
multiplayer
        hold right mouse to scroll the map

Patches:
Index: netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp
diff -u netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp:1.23 
netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp:1.24
--- netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp:1.23     Fri Nov 
 7 19:13:18 2003
+++ netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp  Sun Nov  9 
02:54:17 2003
@@ -80,6 +80,7 @@
     manual_fire_state = false;
 
     left_button_hold_action_complete = false;
+    right_mouse_scroll = false;
 }
 
 void WorldInputCmdProcessor::initializeSelectionLists( void )
@@ -129,6 +130,29 @@
 
     scroll_increment = (long) ( scroll_rate * time_slice );
 
+    if(right_mouse_scroll) {
+        int x,y;
+        int buttons=SDL_GetMouseState(&x,&y);
+        if(!(buttons&SDL_BUTTON(SDL_BUTTON_RIGHT))) {
+            // sometimes the winning page or something comes up
+            //  as you're holding down the right mouse button
+            //  and the UP message doesn't come through
+            right_mouse_scroll=false;
+        }
+        else if(mouse_pos.x!=right_mouse_scroll_pos.x || 
mouse_pos.y!=right_mouse_scroll_pos.y) {
+            // we're holding down the right mouse button, and mouse has moved
+            int x_move=mouse_pos.x-right_mouse_scroll_pos.x;
+            int y_move=mouse_pos.y-right_mouse_scroll_pos.y;
+            SDL_WarpMouse(right_mouse_scroll_pos.x,right_mouse_scroll_pos.y);
+
+            WorldViewInterface::scroll_right(x_move*4);
+            WorldViewInterface::scroll_down(y_move*4);
+            right_mouse_scrolled_pos.x+=x_move;
+            right_mouse_scrolled_pos.y+=y_move;
+        }
+        return;
+    }
+
     if(mouse_pos.x >= (screen_size.x - 1)) {
         WorldViewInterface::scroll_right(scroll_increment);
     }
@@ -661,6 +685,19 @@
     Objective *objective;
     PlayerID player_id;
 
+    if (event.event == MouseEvent::EVENT_DOWN ) {
+        right_mouse_scroll=true;
+        right_mouse_scroll_pos=event.down_pos;
+        right_mouse_scrolled_pos.x=right_mouse_scrolled_pos.y=0;
+    }
+    if (right_mouse_scroll && event.event == MouseEvent::EVENT_UP ) {
+        right_mouse_scroll=false;
+        if(right_mouse_scrolled_pos.x==0 && right_mouse_scrolled_pos.y==0) {
+            // simple right click on the same position
+            working_list.unGroup();
+        }
+        return;
+    }
 
     if (event.event == MouseEvent::EVENT_CLICK ) {
 
@@ -679,9 +716,7 @@
                    ) {
                 }
         }
-        else {
-            working_list.unGroup();
-        }
+//        else { working_list.unGroup(); }
     }  // ** _event_mbutton_click
 
 
Index: netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.hpp
diff -u netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.hpp:1.6 
netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.hpp:1.7
--- netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.hpp:1.6      Tue Sep 
16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.hpp  Sun Nov  9 
02:54:17 2003
@@ -31,6 +31,9 @@
 
     bool selection_box_active;
     iXY box_press, box_release;
+    iXY right_mouse_scroll_pos;
+    iXY right_mouse_scrolled_pos;
+    bool right_mouse_scroll;
     bool selectBoundBoxUnits( void );
 
     bool local_key_table[256];
Index: netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp:1.22 
netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp:1.23
--- netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp:1.22    Fri Nov 
 7 04:38:40 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp Sun Nov  9 
02:54:17 2003
@@ -72,6 +72,7 @@
         Desktop::setVisibility("FlagSelectionView", true);
         Desktop::setVisibility("PlayerNameView", true);
         Desktop::setVisibility("IPAddressView", true);
+        Desktop::setVisibility("IRCLobbyView", true);
     } else {
         assert(false);
     }




reply via email to

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