Fixed tooltip bugs, Upgrades display bug, and timer bar bug

This commit is contained in:
Aktanusa
2015-12-27 17:07:40 -05:00
parent da3200612b
commit f36869d528
3 changed files with 38 additions and 30 deletions

View File

@@ -236,7 +236,7 @@ CM.Disp.CreateTimerBar = function() {
var type = document.createElement('span');
type.style.display = 'inline-block';
type.style.textAlign = 'right';
type.style.width = '71px';
type.style.width = '78px';
type.style.marginRight = '5px';
type.style.verticalAlign = 'text-top';
type.textContent = name;
@@ -328,8 +328,8 @@ CM.Disp.ToggleTimerBarPos = function() {
CM.Disp.UpdateTimerBar = function() {
if (CM.Config.TimerBar == 1) {
// label width: 76 timer width: 26 div margin: 20
var maxWidth = CM.Disp.TimerBar.offsetWidth - 122;
// label width: 83 timer width: 26 div margin: 20
var maxWidth = CM.Disp.TimerBar.offsetWidth - 129;
var count = 0;
if (Game.goldenCookie.life <= 0 && Game.goldenCookie.toDie == 0) {
@@ -1216,10 +1216,13 @@ CM.Disp.RefreshMenu = function() {
}
CM.Disp.UpdateTooltipLocation = function() {
Game.tooltip.tta.style.top = Math.max(0, Math.min((l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - CM.Disp.TooltipWarnCaut.clientHeight - 38, Game.mouseY - 48)) + 'px';
if (Game.tooltip.origin == 'wrink') {
Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 25) + 'px';
Game.tooltip.tta.style.right = 'auto';
if (Game.tooltip.origin == 'store') {
var warnCautOffset = 0;
if (CM.Config.ToolWarnCaut == 1 && CM.Config.ToolWarnCautPos == 1) warnCautOffset = CM.Disp.TooltipWarnCaut.clientHeight - 4;
Game.tooltip.tta.style.top = Math.min(parseInt(Game.tooltip.tta.style.top), (l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - warnCautOffset - 46) + 'px';
}
else if (!Game.onCrate && !Game.OnAscend && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) {
Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px';
}
}
@@ -1276,11 +1279,13 @@ CM.Disp.ToggleToolWarnCaut = function() {
CM.Disp.ToggleToolWarnCautPos = function() {
if (CM.Config.ToolWarnCautPos == 0) {
CM.Disp.TooltipWarnCaut.style.top = '12px';
CM.Disp.TooltipWarnCaut.style.top = 'auto';
CM.Disp.TooltipWarnCaut.style.margin = '4px -4px';
CM.Disp.TooltipWarnCaut.style.padding = '3px 4px';
}
else {
CM.Disp.TooltipWarnCaut.style.right = '12px';
CM.Disp.TooltipWarnCaut.style.right = 'auto';
CM.Disp.TooltipWarnCaut.style.margin = '4px';
CM.Disp.TooltipWarnCaut.style.padding = '4px 3px';
}
}
@@ -1386,9 +1391,7 @@ CM.Disp.Tooltip = function(type, name) {
CM.Disp.UpdateTooltip();
// if (type == 'b') {
return l('tooltip').innerHTML;
// }
return l('tooltip').innerHTML;
}
CM.Disp.UpdateTooltip = function() {
@@ -1450,10 +1453,10 @@ CM.Disp.UpdateTooltip = function() {
var amount = Game.cookies - price;
if (amount < warn || amount < caut) {
if (CM.Config.ToolWarnCautPos == 0) {
CM.Disp.TooltipWarnCaut.style.right = (l('tooltip').offsetWidth + 12) + 'px';
CM.Disp.TooltipWarnCaut.style.right = '0px';
}
else {
CM.Disp.TooltipWarnCaut.style.top = (l('tooltip').offsetHeight + 12) + 'px';
CM.Disp.TooltipWarnCaut.style.top = (l('tooltip').offsetHeight) + 'px';
}
CM.Disp.TooltipWarnCaut.style.width = (l('tooltip').offsetWidth - 6) + 'px';
@@ -1534,7 +1537,7 @@ CM.Disp.CheckWrinklerTooltip = function() {
div.id = 'CMTooltipWrinkler';
wrinkler.appendChild(div);
placeholder.appendChild(wrinkler);
Game.tooltip.draw(this, escape(placeholder.innerHTML), 'wrink');
Game.tooltip.draw(this, escape(placeholder.innerHTML));
CM.Disp.TooltipWrinkler = i;
CM.Disp.TooltipWrinklerCache[i] = 1;
}