From d9e526bcc8f7bbdf97f9c3e6d1a03bc10633b7cc Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 2 Sep 2013 18:03:04 +0000 Subject: [PATCH] Added 'Ctrl' hotkey to add/remove 5 militia when assigning militia (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6347 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Map Screen Interface Map.cpp | 46 ++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp index 4281feb9..1df73a78 100644 --- a/Strategic/Map Screen Interface Map.cpp +++ b/Strategic/Map Screen Interface Map.cpp @@ -5392,8 +5392,12 @@ BOOLEAN PickUpATownPersonFromSector( UINT8 ubType, INT16 sX, INT16 sY ) // the number of units transferred INT16 countMovedCivs = 1; + // all units in sector if (_KeyDown(SHIFT)) countMovedCivs = SectorInfo[ SECTOR( sX, sY )].ubNumberOfCivsAtLevel[ ubType ]; + // 5 units in sector + else if (_KeyDown(CTRL)) + countMovedCivs = min(5, SectorInfo[ SECTOR( sX, sY )].ubNumberOfCivsAtLevel[ ubType ]); // otherwise pick this guy up switch( ubType ) @@ -5458,7 +5462,8 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2"); { return( FALSE ); } - + + // drop max allowable units if (_KeyDown(SHIFT)) { if (countFreeCivPlace <= sGreensOnCursor) @@ -5466,7 +5471,14 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2"); else countMovedCivs = sGreensOnCursor; } - + // drop 5 units + else if (_KeyDown(CTRL)) + { + if (countFreeCivPlace <= 5) + countMovedCivs = min(countFreeCivPlace, sGreensOnCursor); + else + countMovedCivs = min(5, sGreensOnCursor); + } sGreensOnCursor -= countMovedCivs; break; case( REGULAR_MILITIA ): @@ -5475,10 +5487,21 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2"); return( FALSE ); } + // drop max allowable units if (_KeyDown(SHIFT)) { - if (countFreeCivPlace <= sRegularsOnCursor) countMovedCivs = countFreeCivPlace; - else countMovedCivs = sRegularsOnCursor; + if (countFreeCivPlace <= sRegularsOnCursor) + countMovedCivs = countFreeCivPlace; + else + countMovedCivs = sRegularsOnCursor; + } + // drop 5 units + else if (_KeyDown(CTRL)) + { + if (countFreeCivPlace <= 5) + countMovedCivs = min(countFreeCivPlace, sRegularsOnCursor); + else + countMovedCivs = min(5, sRegularsOnCursor); } sRegularsOnCursor -= countMovedCivs; @@ -5489,10 +5512,21 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2"); return( FALSE ); } + // drop max allowable units if (_KeyDown(SHIFT)) { - if (countFreeCivPlace <= sElitesOnCursor) countMovedCivs = countFreeCivPlace; - else countMovedCivs = sElitesOnCursor; + if (countFreeCivPlace <= sElitesOnCursor) + countMovedCivs = countFreeCivPlace; + else + countMovedCivs = sElitesOnCursor; + } + // drop 5 units + else if (_KeyDown(CTRL)) + { + if (countFreeCivPlace <= 5) + countMovedCivs = min(countFreeCivPlace, sElitesOnCursor); + else + countMovedCivs = min(5, sElitesOnCursor); } sElitesOnCursor -= countMovedCivs;