- implemented zoom by mouse wheel for the automap.

Fixes #121
This commit is contained in:
Christoph Oelckers 2020-09-05 09:10:24 +02:00
parent adbedd30c4
commit 80cea90854
2 changed files with 21 additions and 0 deletions

View file

@ -1201,6 +1201,7 @@ void GameInterface::FreeLevelData()
//
//
//---------------------------------------------------------------------------
static float am_zoomdir;
int GetAutomapZoom(int gZoom)
{
@ -1222,6 +1223,16 @@ int GetAutomapZoom(int gZoom)
if (automapMode != am_off)
{
if (am_zoomdir > 0)
{
gZoom = xs_CRoundToInt(gZoom * am_zoomdir);
}
else if (am_zoomdir < 0)
{
gZoom = xs_CRoundToInt(gZoom / -am_zoomdir);
}
am_zoomdir = 0;
double j = interval * (120. / 1000);
if (buttonMap.ButtonDown(gamefunc_Enlarge_Screen))
@ -1234,3 +1245,11 @@ int GetAutomapZoom(int gZoom)
}
return gZoom;
}
CCMD(am_zoom)
{
if (argv.argc() >= 2)
{
am_zoomdir = (float)atof(argv[1]);
}
}

View file

@ -39,6 +39,8 @@ Tab "togglemap"
mapbind F "togglefollow"
mapbind - "+Shrink_Screen"
mapbind = "+Enlarge_Screen"
mapbind mwheelup "am_zoom 1.2"
mapbind mwheeldown "am_zoom -1.2"
- "sizedown"
= "sizeup"
K "coop_view"