Compare commits

..

10 Commits

5 changed files with 158 additions and 61 deletions

View File

@@ -202,9 +202,17 @@ CM.LoadConfig = function() {
var mod = false;
for (var i in CM.ConfigDefault) {
if (i != 'StatsPref') {
if (CM.Config[i] == undefined || !(CM.Config[i] > -1 && CM.Config[i] < CM.ConfigData[i].label.length)) {
mod = true;
CM.Config[i] = CM.ConfigDefault[i];
if (i.indexOf('SoundURL') == -1) {
if (CM.Config[i] == undefined || !(CM.Config[i] > -1 && CM.Config[i] < CM.ConfigData[i].label.length)) {
mod = true;
CM.Config[i] = CM.ConfigDefault[i];
}
}
else { // Sound URLs
if (CM.Config[i] == undefined || typeof CM.Config[i] != 'string') {
mod = true;
CM.Config[i] = CM.ConfigDefault[i];
}
}
}
else { // Statistics Preferences
@@ -286,11 +294,14 @@ CM.ConfigData.Volume = {label: [], desc: 'Volume of the sound'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.Volume.label[i] = i + '%';
}
CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when has been spawned', func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.GCSoundURL = {label: 'Golden Cookie Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns'};
CM.ConfigData.SeaSoundURL = {label: 'Season Special Sound URL:', desc: 'URL of the sound to be played when a Season Special spawns', func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.Title = {label: ['Title OFF', 'Title ON'], desc: 'Update title with Golden Cookie/Season Popup timers'};
CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades'};
CM.ConfigData.ToolWarnCaut = {label: ['Tooltip Warning/Caution OFF', 'Tooltip Warning/Caution ON'], desc: 'A warning/caution when buying if it will put the bank under the amount needed for max "Lucky!"/"Lucky!" (Frenzy) rewards', func: function() {CM.Disp.ToggleToolWarnCaut();}};
CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', func: function() {CM.Disp.ToggleToolWarnCautPos();}};
CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it'};
CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!'};
CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 3 seconds'};
CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', func: function() {CM.Disp.ToggleSayTime();}};
@@ -901,7 +912,7 @@ CM.Disp.CheckGoldenCookie = function() {
}
CM.Disp.Flash(3);
CM.Disp.PlaySound('http://cookie-monster.autopergamene.eu/mp3/bell.mp3');
CM.Disp.PlaySound(CM.Config.GCSoundURL);
}
else if (CM.Config.GCTimer == 1) CM.Disp.GCTimer.style.display = 'none';
}
@@ -915,7 +926,7 @@ CM.Disp.CheckGoldenCookie = function() {
CM.Disp.EmphSeasonPopup = function() {
if (Game.season=='christmas') {
CM.Disp.Flash(3);
CM.Disp.PlaySound('http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3');
CM.Disp.PlaySound(CM.Config.SeaSoundURL);
}
}
@@ -951,6 +962,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');
@@ -981,6 +1004,32 @@ CM.Disp.AddMenuPref = function(title) {
div.appendChild(label);
return div;
}
var url = function(config) {
var div = document.createElement('div');
div.className = 'listing';
var span = document.createElement('span');
span.className = 'option';
span.textContent = CM.ConfigData[config].label + ' ';
div.appendChild(span);
var input = document.createElement('input');
input.id = CM.ConfigPrefix + config;
input.className = 'option';
input.type = 'text';
input.value = CM.Config[config];
input.style.width = '300px';
div.appendChild(input);
div.appendChild(document.createTextNode(' '));
var a = document.createElement('a');
a.className = 'option';
a.onclick = function() {CM.Config[config] = l(CM.ConfigPrefix + config).value;CM.SaveConfig(CM.Config);};
a.textContent = 'Save';
div.appendChild(a);
var label = document.createElement('label');
label.textContent = CM.ConfigData[config].desc;
div.appendChild(label);
return div;
}
frag.appendChild(header('Bars/Colors'));
frag.appendChild(listing('BotBar'));
@@ -1012,6 +1061,8 @@ CM.Disp.AddMenuPref = function(title) {
volLabel.textContent = CM.ConfigData[volConfig].desc;
volume.appendChild(volLabel);
frag.appendChild(volume);
frag.appendChild(url('GCSoundURL'));
frag.appendChild(url('SeaSoundURL'));
frag.appendChild(listing('GCTimer'));
frag.appendChild(listing('Title'));
@@ -1019,6 +1070,7 @@ CM.Disp.AddMenuPref = function(title) {
frag.appendChild(listing('Tooltip'));
frag.appendChild(listing('ToolWarnCaut'));
frag.appendChild(listing('ToolWarnCautPos'));
frag.appendChild(listing('ToolWrink'));
frag.appendChild(header('Statistics'));
frag.appendChild(listing('Stats'));
@@ -1187,16 +1239,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';
@@ -1346,6 +1389,14 @@ CM.Disp.RefreshMenu = function() {
if (CM.Config.UpStats && Game.onMenu == 'stats' && Game.drawT % (Game.fps * 3) != 0 && Game.drawT % Game.fps == 0) Game.UpdateMenu();
}
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 - 64, 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';
}
}
CM.Disp.CreateTooltipWarnCaut = function() {
CM.Disp.TooltipWarnCaut = document.createElement('div');
CM.Disp.TooltipWarnCaut.style.position = 'absolute';
@@ -1610,7 +1661,7 @@ CM.Disp.AddWrinklerAreaDetect = function() {
}
CM.Disp.CheckWrinklerTooltip = function() {
if (CM.Disp.TooltipWrinklerArea == 1) {
if (CM.Config.ToolWrink == 1 && CM.Disp.TooltipWrinklerArea == 1) {
var showingTooltip = false;
var mouseInWrinkler = function (x, y, rect) {
var dx = x + Math.sin(-rect.r) * (-(rect.h / 2 - rect.o)), dy = y + Math.cos(-rect.r) * (-(rect.h / 2 - rect.o));
@@ -1626,6 +1677,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');
@@ -1640,7 +1692,7 @@ CM.Disp.CheckWrinklerTooltip = function() {
CM.Disp.TooltipWrinkler = i;
CM.Disp.TooltipWrinklerCache[i] = 1;
}
showingTooltip = true;
else break;
}
else {
CM.Disp.TooltipWrinklerCache[i] = 0;
@@ -1653,7 +1705,7 @@ CM.Disp.CheckWrinklerTooltip = function() {
}
CM.Disp.UpdateWrinklerTooltip = function() {
if (l('CMTooltipWrinkler') != null) {
if (CM.Config.ToolWrink == 1 && l('CMTooltipWrinkler') != null) {
var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked;
sucked *= 1.1;
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
@@ -1661,13 +1713,6 @@ 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.right = 'auto';
}
}
CM.Disp.ToggleSayTime = function() {
if (CM.Config.SayTime == 1) {
Game.sayTime = CM.Disp.sayTime;
@@ -1746,8 +1791,8 @@ CM.ReplaceNative = function() {
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this').join('Game.tooltip'));
Game.tooltip.update = function() {
CM.Backup.tooltip.updateMod();
CM.Disp.UpdateTooltipWrinklerLocation();
CM.Disp.UpdateTooltipWarnCaut();
CM.Disp.UpdateTooltipLocation();
}
CM.Backup.RebuildUpgrades = Game.RebuildUpgrades;
@@ -1822,6 +1867,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();
@@ -1837,11 +1883,11 @@ CM.Init = function() {
}
}
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCTimer: 1, Title: 1, Tooltip: 1, ToolWarnCaut: 1, ToolWarnCautPos: 0, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}};
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}};
CM.ConfigPrefix = 'CMConfig';
CM.VersionMajor = '1.0465';
CM.VersionMinor = '8';
CM.VersionMinor = '9';
/*******
* Sim *

View File

@@ -26,7 +26,7 @@ This index is computed for buildings and upgrades. If the relevant option is ena
* Purple : (upgrades) This item has a worse BCI than any building
* Gray : (upgrades) This item has not been calculated and/or cannot be calculated due to no definitive worth.
Note : For this index, **lower is better**, meaning a building with a BCI of 1 is more interesting that one with a BCI of 3.
Note : For this index, **lower is better**, meaning a building with a BCI of 1 is more interesting than one with a BCI of 3.
## What it doesn't do
@@ -73,8 +73,13 @@ If you'd rather use the addon as a script via per example *Greasemonkey* or *Tam
// @grant none
// ==/UserScript==
(function () {
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js');
javascript:(function() {
var checkReady = setInterval(function() {
if (Game.ready != undefined && Game.ready) {
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js');
clearInterval(checkReady);
}
}, 1000);
}());
```

View File

@@ -14,9 +14,17 @@ CM.LoadConfig = function() {
var mod = false;
for (var i in CM.ConfigDefault) {
if (i != 'StatsPref') {
if (CM.Config[i] == undefined || !(CM.Config[i] > -1 && CM.Config[i] < CM.ConfigData[i].label.length)) {
mod = true;
CM.Config[i] = CM.ConfigDefault[i];
if (i.indexOf('SoundURL') == -1) {
if (CM.Config[i] == undefined || !(CM.Config[i] > -1 && CM.Config[i] < CM.ConfigData[i].label.length)) {
mod = true;
CM.Config[i] = CM.ConfigDefault[i];
}
}
else { // Sound URLs
if (CM.Config[i] == undefined || typeof CM.Config[i] != 'string') {
mod = true;
CM.Config[i] = CM.ConfigDefault[i];
}
}
}
else { // Statistics Preferences
@@ -98,11 +106,14 @@ CM.ConfigData.Volume = {label: [], desc: 'Volume of the sound'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.Volume.label[i] = i + '%';
}
CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when has been spawned', func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.GCSoundURL = {label: 'Golden Cookie Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns'};
CM.ConfigData.SeaSoundURL = {label: 'Season Special Sound URL:', desc: 'URL of the sound to be played when a Season Special spawns', func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.Title = {label: ['Title OFF', 'Title ON'], desc: 'Update title with Golden Cookie/Season Popup timers'};
CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades'};
CM.ConfigData.ToolWarnCaut = {label: ['Tooltip Warning/Caution OFF', 'Tooltip Warning/Caution ON'], desc: 'A warning/caution when buying if it will put the bank under the amount needed for max "Lucky!"/"Lucky!" (Frenzy) rewards', func: function() {CM.Disp.ToggleToolWarnCaut();}};
CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', func: function() {CM.Disp.ToggleToolWarnCautPos();}};
CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it'};
CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!'};
CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 3 seconds'};
CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', func: function() {CM.Disp.ToggleSayTime();}};

View File

@@ -595,7 +595,7 @@ CM.Disp.CheckGoldenCookie = function() {
}
CM.Disp.Flash(3);
CM.Disp.PlaySound('http://cookie-monster.autopergamene.eu/mp3/bell.mp3');
CM.Disp.PlaySound(CM.Config.GCSoundURL);
}
else if (CM.Config.GCTimer == 1) CM.Disp.GCTimer.style.display = 'none';
}
@@ -609,7 +609,7 @@ CM.Disp.CheckGoldenCookie = function() {
CM.Disp.EmphSeasonPopup = function() {
if (Game.season=='christmas') {
CM.Disp.Flash(3);
CM.Disp.PlaySound('http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3');
CM.Disp.PlaySound(CM.Config.SeaSoundURL);
}
}
@@ -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');
@@ -675,6 +687,32 @@ CM.Disp.AddMenuPref = function(title) {
div.appendChild(label);
return div;
}
var url = function(config) {
var div = document.createElement('div');
div.className = 'listing';
var span = document.createElement('span');
span.className = 'option';
span.textContent = CM.ConfigData[config].label + ' ';
div.appendChild(span);
var input = document.createElement('input');
input.id = CM.ConfigPrefix + config;
input.className = 'option';
input.type = 'text';
input.value = CM.Config[config];
input.style.width = '300px';
div.appendChild(input);
div.appendChild(document.createTextNode(' '));
var a = document.createElement('a');
a.className = 'option';
a.onclick = function() {CM.Config[config] = l(CM.ConfigPrefix + config).value;CM.SaveConfig(CM.Config);};
a.textContent = 'Save';
div.appendChild(a);
var label = document.createElement('label');
label.textContent = CM.ConfigData[config].desc;
div.appendChild(label);
return div;
}
frag.appendChild(header('Bars/Colors'));
frag.appendChild(listing('BotBar'));
@@ -706,6 +744,8 @@ CM.Disp.AddMenuPref = function(title) {
volLabel.textContent = CM.ConfigData[volConfig].desc;
volume.appendChild(volLabel);
frag.appendChild(volume);
frag.appendChild(url('GCSoundURL'));
frag.appendChild(url('SeaSoundURL'));
frag.appendChild(listing('GCTimer'));
frag.appendChild(listing('Title'));
@@ -713,6 +753,7 @@ CM.Disp.AddMenuPref = function(title) {
frag.appendChild(listing('Tooltip'));
frag.appendChild(listing('ToolWarnCaut'));
frag.appendChild(listing('ToolWarnCautPos'));
frag.appendChild(listing('ToolWrink'));
frag.appendChild(header('Statistics'));
frag.appendChild(listing('Stats'));
@@ -881,16 +922,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';
@@ -1040,6 +1072,14 @@ CM.Disp.RefreshMenu = function() {
if (CM.Config.UpStats && Game.onMenu == 'stats' && Game.drawT % (Game.fps * 3) != 0 && Game.drawT % Game.fps == 0) Game.UpdateMenu();
}
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 - 64, 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';
}
}
CM.Disp.CreateTooltipWarnCaut = function() {
CM.Disp.TooltipWarnCaut = document.createElement('div');
CM.Disp.TooltipWarnCaut.style.position = 'absolute';
@@ -1304,7 +1344,7 @@ CM.Disp.AddWrinklerAreaDetect = function() {
}
CM.Disp.CheckWrinklerTooltip = function() {
if (CM.Disp.TooltipWrinklerArea == 1) {
if (CM.Config.ToolWrink == 1 && CM.Disp.TooltipWrinklerArea == 1) {
var showingTooltip = false;
var mouseInWrinkler = function (x, y, rect) {
var dx = x + Math.sin(-rect.r) * (-(rect.h / 2 - rect.o)), dy = y + Math.cos(-rect.r) * (-(rect.h / 2 - rect.o));
@@ -1320,6 +1360,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 +1375,7 @@ CM.Disp.CheckWrinklerTooltip = function() {
CM.Disp.TooltipWrinkler = i;
CM.Disp.TooltipWrinklerCache[i] = 1;
}
showingTooltip = true;
else break;
}
else {
CM.Disp.TooltipWrinklerCache[i] = 0;
@@ -1347,7 +1388,7 @@ CM.Disp.CheckWrinklerTooltip = function() {
}
CM.Disp.UpdateWrinklerTooltip = function() {
if (l('CMTooltipWrinkler') != null) {
if (CM.Config.ToolWrink == 1 && l('CMTooltipWrinkler') != null) {
var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked;
sucked *= 1.1;
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
@@ -1355,13 +1396,6 @@ 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.right = 'auto';
}
}
CM.Disp.ToggleSayTime = function() {
if (CM.Config.SayTime == 1) {
Game.sayTime = CM.Disp.sayTime;

View File

@@ -33,8 +33,8 @@ CM.ReplaceNative = function() {
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this').join('Game.tooltip'));
Game.tooltip.update = function() {
CM.Backup.tooltip.updateMod();
CM.Disp.UpdateTooltipWrinklerLocation();
CM.Disp.UpdateTooltipWarnCaut();
CM.Disp.UpdateTooltipLocation();
}
CM.Backup.RebuildUpgrades = Game.RebuildUpgrades;
@@ -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();
@@ -124,9 +125,9 @@ CM.Init = function() {
}
}
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCTimer: 1, Title: 1, Tooltip: 1, ToolWarnCaut: 1, ToolWarnCautPos: 0, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}};
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}};
CM.ConfigPrefix = 'CMConfig';
CM.VersionMajor = '1.0465';
CM.VersionMinor = '8';
CM.VersionMinor = '9';