Fix bug with timer bar displacing wrinkler detection area (Issue #213) and use game detection instead of copying code plus a minor code formatting change

This commit is contained in:
Aktanusa
2018-08-17 15:50:31 -04:00
parent 6895719759
commit 2f862ac687
4 changed files with 40 additions and 44 deletions

View File

@@ -29,17 +29,14 @@ CM.ReplaceNative = function() {
CM.Disp.UpdateTooltipLocation();
}
CM.Backup.UpdateWrinklers = Game.UpdateWrinklers;
Game.UpdateWrinklers = function() {
CM.Disp.FixMouseY(CM.Backup.UpdateWrinklers);
}
CM.Backup.UpdateSpecial = Game.UpdateSpecial;
Game.UpdateSpecial = function() {
if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) {
var timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
Game.mouseY -= timerBarHeight;
CM.Backup.UpdateSpecial();
Game.mouseY += timerBarHeight;
}
else {
CM.Backup.UpdateSpecial();
}
CM.Disp.FixMouseY(CM.Backup.UpdateSpecial);
}
// Probably better to load per minigame