Version change, minor optimizations in wrinker tooltip/reset bonus income tooltip, move wrinkler tooltip a little right to minor game

This commit is contained in:
Aktanusa
2014-07-11 21:17:49 -04:00
parent f429888727
commit 267b40bfa1
3 changed files with 36 additions and 26 deletions

View File

@@ -645,6 +645,18 @@ CM.Disp.UpdateTitle = function() {
}
}
CM.Disp.CreateResetTooltip = function() {
CM.Disp.ResetTooltipPlaceholder = document.createElement('div');
var resetTitleDesc = document.createElement('div');
resetTitleDesc.style.minWidth = '260px';
resetTitleDesc.style.marginBottom = '4px';
var div = document.createElement('div');
div.style.textAlign = 'left';
div.textContent = 'The bonus income you would get from new heavenly chips/reset achievements if you have the same buildings/upgrades after reset';
resetTitleDesc.appendChild(div);
CM.Disp.ResetTooltipPlaceholder.appendChild(resetTitleDesc);
}
CM.Disp.AddMenuPref = function(title) {
var header = function(text) {
var div = document.createElement('div');
@@ -881,16 +893,7 @@ CM.Disp.AddMenuStats = function(title) {
resetTitleFrag.appendChild(document.createTextNode('Reset Bonus Income '))
var resetTitleSpan = document.createElement('span');
resetTitleSpan.onmouseout = function() { Game.tooltip.hide(); };
var resetTitlePlaceholder = document.createElement('div');
var resetTitleDesc = document.createElement('div');
resetTitleDesc.style.minWidth = '260px';
resetTitleDesc.style.marginBottom = '4px';
var resetTitleDiv = document.createElement('div');
resetTitleDiv.style.textAlign = 'left';
resetTitleDiv.textContent = 'The bonus income you would get from new heavenly chips/reset achievements if you have the same buildings/upgrades after reset';
resetTitleDesc.appendChild(resetTitleDiv);
resetTitlePlaceholder.appendChild(resetTitleDesc);
resetTitleSpan.onmouseover = function() {Game.tooltip.draw(this, escape(resetTitlePlaceholder.innerHTML));};
resetTitleSpan.onmouseover = function() {Game.tooltip.draw(this, escape(CM.Disp.ResetTooltipPlaceholder.innerHTML));};
resetTitleSpan.style.cursor = 'default';
resetTitleSpan.style.display = 'inline-block';
resetTitleSpan.style.height = '10px';
@@ -1320,6 +1323,7 @@ CM.Disp.CheckWrinklerTooltip = function() {
var me = Game.wrinklers[i];
var rect = {w: 100, h: 200, r: (-me.r) * Math.PI / 180, o: 10};
if (me.phase > 0 && Game.LeftBackground && Game.mouseX < Game.LeftBackground.canvas.width && mouseInWrinkler(Game.mouseX - me.x, Game.mouseY - me.y, rect)) {
showingTooltip = true;
if (CM.Disp.TooltipWrinklerCache[i] == 0) {
var placeholder = document.createElement('div');
var wrinkler = document.createElement('div');
@@ -1334,7 +1338,7 @@ CM.Disp.CheckWrinklerTooltip = function() {
CM.Disp.TooltipWrinkler = i;
CM.Disp.TooltipWrinklerCache[i] = 1;
}
showingTooltip = true;
else break;
}
else {
CM.Disp.TooltipWrinklerCache[i] = 0;
@@ -1357,7 +1361,7 @@ CM.Disp.UpdateWrinklerTooltip = function() {
CM.Disp.UpdateTooltipWrinklerLocation = function() {
if (Game.tooltip.origin == 'wrink') {
Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 20) + 'px';
Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 25) + 'px';
Game.tooltip.tta.style.right = 'auto';
}
}

View File

@@ -109,6 +109,7 @@ CM.Init = function() {
CM.Disp.CreateUpgradeBar();
CM.Disp.CreateWhiteScreen();
CM.Disp.CreateGCTimer();
CM.Disp.CreateResetTooltip();
CM.Disp.CreateTooltipWarnCaut();
CM.Disp.AddTooltipBuild();
CM.Disp.AddTooltipBuild10();
@@ -128,5 +129,5 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, BuildColor: 1, UpBarColor: 1, Flash:
CM.ConfigPrefix = 'CMConfig';
CM.VersionMajor = '1.0465';
CM.VersionMinor = '8';
CM.VersionMinor = '9';