[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netPanzer-CVS] non-lobby patch
From: |
hankin |
Subject: |
[netPanzer-CVS] non-lobby patch |
Date: |
Sun, 09 Nov 2003 13:22:13 +1100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030917 |
is it ok for me to commit this patch?
it's mostly not-related t the lobby, it implements right mouse button
scrolling. useful if you run in windowed mode.
Index: NetPanzer/Classes/WorldInputCmdProcessor.cpp
===================================================================
RCS file:
/cvsroot/netpanzer/netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp,v
retrieving revision 1.23
diff -r1.23 WorldInputCmdProcessor.cpp
82a83
> right_mouse_scroll = false;
131a133,155
> 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;
> }
>
663a688,700
> 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;
> }
682,684c719
< else {
< working_list.unGroup();
< }
---
> // else { working_list.unGroup(); }
Index: NetPanzer/Classes/WorldInputCmdProcessor.hpp
===================================================================
RCS file:
/cvsroot/netpanzer/netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.hpp,v
retrieving revision 1.6
diff -r1.6 WorldInputCmdProcessor.hpp
33a34,36
> iXY right_mouse_scroll_pos;
> iXY right_mouse_scrolled_pos;
> bool right_mouse_scroll;
Index: NetPanzer/Views/MainMenu/MenuTemplateView.cpp
===================================================================
RCS file:
/cvsroot/netpanzer/netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp,v
retrieving revision 1.22
diff -r1.22 MenuTemplateView.cpp
74a75
> Desktop::setVisibility("IRCLobbyView", true);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [netPanzer-CVS] non-lobby patch,
hankin <=