Reload wheel-adjusted batchsize immediately

Commented by: elexis
Differential Revision: https://code.wildfiregames.com/D1742
This was SVN commit r22227.
This commit is contained in:
Imarok 2019-04-25 17:19:47 +00:00
parent bc93f51a1c
commit 06fae58904

View File

@ -1333,10 +1333,14 @@ var g_BatchSize = getDefaultBatchTrainingSize();
function OnTrainMouseWheel(dir)
{
if (Engine.HotkeyIsPressed("session.batchtrain"))
g_BatchSize += dir / Engine.ConfigDB_GetValue("user", "gui.session.scrollbatchratio");
if (!Engine.HotkeyIsPressed("session.batchtrain"))
return;
g_BatchSize += dir / Engine.ConfigDB_GetValue("user", "gui.session.scrollbatchratio");
if (g_BatchSize < 1 || !Number.isFinite(g_BatchSize))
g_BatchSize = 1;
updateSelectionDetails();
}
function getBuildingsWhichCanTrainEntity(entitiesToCheck, trainEntType)