From: Laszlo T. <ave...@us...> - 2004-11-21 12:23:48
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27193 Modified Files: MapControl.cpp Log Message: MapControl got a third mode: MAP_SET_NOTE (instead of a right click, in PST you can put a mapnote on the screen by pushing the 'add note' button) Index: MapControl.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/MapControl.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MapControl.cpp 20 Nov 2004 10:58:15 -0000 1.21 --- MapControl.cpp 21 Nov 2004 12:23:36 -0000 1.22 *************** *** 23,26 **** --- 23,30 ---- #include "Interface.h" + #define MAP_NO_NOTES 0 + #define MAP_VIEW_NOTES 1 + #define MAP_SET_NOTE 2 + // Ratio between pixel sizes of an Area (Big map) and a Small map *************** *** 165,169 **** // we use the common control value to handle it, because then we // don't need another interface ! if (Value&1) { i = MyMap -> GetMapNoteCount(); while (i--) { --- 169,173 ---- // we use the common control value to handle it, because then we // don't need another interface ! if (Value!=MAP_NO_NOTES) { i = MyMap -> GetMapNoteCount(); while (i--) { *************** *** 245,249 **** lastMouseY = y; ! if (Value&1) { Point mp; unsigned int dist; --- 249,253 ---- lastMouseY = y; ! if (Value==MAP_VIEW_NOTES) { Point mp; unsigned int dist; *************** *** 277,281 **** LinkedLabel->SetText( "" ); //this will erase the label (no idea why is it needed) ! //( ( Window * ) Owner )->Invalidate(); } } --- 281,290 ---- LinkedLabel->SetText( "" ); //this will erase the label (no idea why is it needed) ! //( ( Window * ) Owner )->Invalidate(); ! } ! if (Value==MAP_SET_NOTE) { ! ( ( Window * ) Owner )->Cursor = 44; ! } else { ! ( ( Window * ) Owner )->Cursor = 0; } } *************** *** 285,296 **** unsigned char Button, unsigned short /*Mod*/) { ! // FIXME: it would be better if the var names were user-settable ! core->GetDictionary()->SetAt( "MapControlX", NotePosX ); ! core->GetDictionary()->SetAt( "MapControlY", NotePosY ); ! RunEventHandler( MapControlOnPress ); ! ! if ((Button != GEM_MB_ACTION) ) { ! return; } MouseIsDown = true; lastMouseX = x; --- 294,313 ---- unsigned char Button, unsigned short /*Mod*/) { ! switch(Value) { ! case MAP_NO_NOTES: ! break; ! case MAP_VIEW_NOTES: ! //left click allows setting only when in MAP_SET_NOTE mode ! if ((Button == GEM_MB_ACTION) ) { ! break; ! } ! default: ! // FIXME: play mapnote pin sound here (if any) ! core->GetDictionary()->SetAt( "MapControlX", NotePosX ); ! core->GetDictionary()->SetAt( "MapControlY", NotePosY ); ! RunEventHandler( MapControlOnPress ); ! return; } + MouseIsDown = true; lastMouseX = x; *************** *** 306,310 **** core->GetVideoDriver()->SetViewport( xp * MAP_MULT / MAP_DIV, yp * MAP_MULT / MAP_DIV ); - // FIXME: play button sound here } --- 323,326 ---- |