(cherry picked from commit e7fe202)
This commit is contained in:
Johannes Mockenhaupt 2017-08-31 01:58:00 +02:00
parent 17dd6df527
commit 4aac46f2bc
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -110,13 +110,9 @@ public class SetTbrCommand extends BaseCommand {
log.debug("Current TBR %: " + currentPercent); log.debug("Current TBR %: " + currentPercent);
long percentageChange = percentage - currentPercent; long percentageChange = percentage - currentPercent;
long percentageSteps = percentageChange / 10; long percentageSteps = percentageChange / 10;
boolean increasePercentage = true; boolean increasePercentage = percentageSteps > 0;
if (percentageSteps < 0) {
increasePercentage = false;
percentageSteps = Math.abs(percentageSteps);
}
log.debug("Pressing " + (increasePercentage ? "up" : "down") + " " + percentageSteps + " times"); log.debug("Pressing " + (increasePercentage ? "up" : "down") + " " + percentageSteps + " times");
for (int i = 0; i < percentageSteps; i++) { for (int i = 0; i < Math.abs(percentageSteps); i++) {
scripter.verifyMenuIsDisplayed(MenuType.TBR_SET); scripter.verifyMenuIsDisplayed(MenuType.TBR_SET);
log.debug("Push #" + (i + 1)); log.debug("Push #" + (i + 1));
if (increasePercentage) scripter.pressUpKey(); if (increasePercentage) scripter.pressUpKey();