From 0a57450815587d91019417bf3940bb99757a17ed Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Mon, 25 Jan 2021 22:39:03 +0100 Subject: [PATCH 1/7] Fix colour settings not displaying #504 --- CookieMonster.js | 12 +++++++----- src/Disp.js | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index bed6c54..9891323 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -3242,22 +3242,24 @@ CM.Disp.CreatePrefOption = function(config) { return div; } else if (CM.ConfigData[config].type == "color") { + var div = document.createElement('div'); for (var i = 0; i < CM.Disp.colors.length; i++) { - var div = document.createElement('div'); - div.className = 'listing'; + var innerDiv = document.createElement('div'); + innerDiv.className = 'listing'; var input = document.createElement('input'); input.id = CM.ConfigPrefix + 'Color' + CM.Disp.colors[i]; input.className = 'option'; input.style.width = '65px'; input.setAttribute('value', CM.Options.Colors[CM.Disp.colors[i]]); - div.appendChild(input); + innerDiv.appendChild(input); eval('var change = function() {CM.Options.Colors[\'' + CM.Disp.colors[i] + '\'] = l(CM.ConfigPrefix + \'Color\' + \'' + CM.Disp.colors[i] + '\').value; CM.Disp.UpdateColors(); CM.Config.SaveConfig();}'); var jscolorpicker = new jscolor.color(input, {hash: true, caps: false, pickerZIndex: 1000000, pickerPosition: 'right', onImmediateChange: change}); var label = document.createElement('label'); label.textContent = CM.ConfigData.Colors.desc[CM.Disp.colors[i]]; - div.appendChild(label); - return div; + innerDiv.appendChild(label); + div.appendChild(innerDiv) } + return div } else if (CM.ConfigData[config].type == "numscale") { var div = document.createElement('div'); diff --git a/src/Disp.js b/src/Disp.js index f2f7fbd..be181a0 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -2061,22 +2061,24 @@ CM.Disp.CreatePrefOption = function(config) { return div; } else if (CM.ConfigData[config].type == "color") { + var div = document.createElement('div'); for (var i = 0; i < CM.Disp.colors.length; i++) { - var div = document.createElement('div'); - div.className = 'listing'; + var innerDiv = document.createElement('div'); + innerDiv.className = 'listing'; var input = document.createElement('input'); input.id = CM.ConfigPrefix + 'Color' + CM.Disp.colors[i]; input.className = 'option'; input.style.width = '65px'; input.setAttribute('value', CM.Options.Colors[CM.Disp.colors[i]]); - div.appendChild(input); + innerDiv.appendChild(input); eval('var change = function() {CM.Options.Colors[\'' + CM.Disp.colors[i] + '\'] = l(CM.ConfigPrefix + \'Color\' + \'' + CM.Disp.colors[i] + '\').value; CM.Disp.UpdateColors(); CM.Config.SaveConfig();}'); var jscolorpicker = new jscolor.color(input, {hash: true, caps: false, pickerZIndex: 1000000, pickerPosition: 'right', onImmediateChange: change}); var label = document.createElement('label'); label.textContent = CM.ConfigData.Colors.desc[CM.Disp.colors[i]]; - div.appendChild(label); - return div; + innerDiv.appendChild(label); + div.appendChild(innerDiv) } + return div } else if (CM.ConfigData[config].type == "numscale") { var div = document.createElement('div'); From 5f93186e7db97908e1755b88e5eb51277e053f8b Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Mon, 25 Jan 2021 22:46:08 +0100 Subject: [PATCH 2/7] Fixed bug with display of missing upgrades --- CookieMonster.js | 4 +++- src/Disp.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 9891323..5ed52a9 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -3889,7 +3889,9 @@ CM.Disp.AddMissingUpgrades = function() { l('menu').children[5].appendChild(upgrades) } if (CM.Cache.MissingUpgrades) { - var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + if (Game.UpgradesOwned) { + var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + } else var normalUpgradesOwned = 0; var title = document.createElement('div'); title.id = "CMMissingUpgradesTitle"; title.className = "listing"; diff --git a/src/Disp.js b/src/Disp.js index be181a0..ccf77e9 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -2708,7 +2708,9 @@ CM.Disp.AddMissingUpgrades = function() { l('menu').children[5].appendChild(upgrades) } if (CM.Cache.MissingUpgrades) { - var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + if (Game.UpgradesOwned) { + var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + } else var normalUpgradesOwned = 0; var title = document.createElement('div'); title.id = "CMMissingUpgradesTitle"; title.className = "listing"; From 28e28fd5a00aa295da06841fd3569d3bb174a440 Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Mon, 25 Jan 2021 22:55:57 +0100 Subject: [PATCH 3/7] Single fattest wrinkler now excludes shiny #498 --- CookieMonster.js | 16 +++++++++------- src/Cache.js | 8 +++++--- src/Data.js | 2 +- src/Disp.js | 6 +++--- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 5ed52a9..754debe 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -73,7 +73,7 @@ CM.Cache.CacheDragonAuras = function() { * It is called by CM.Loop() and CM.Cache.InitCache() * @global {number} CM.Cache.WrinklersTotal The cookies of all wrinklers * @global {number} CM.Cache.WrinklersNormal The cookies of all normal wrinklers - * @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest wrinkler + * @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest non-shiny wrinkler */ CM.Cache.CacheWrinklers = function() { CM.Cache.WrinklersTotal = 0; @@ -93,8 +93,10 @@ CM.Cache.CacheWrinklers = function() { else if (godLvl == 3) sucked *= 1.05; } CM.Cache.WrinklersTotal += sucked; - if (Game.wrinklers[i].type == 0) CM.Cache.WrinklersNormal += sucked; - if (sucked > CM.Cache.WrinklersFattest[0]) CM.Cache.WrinklersFattest = [sucked, i]; + if (Game.wrinklers[i].type == 0) { + CM.Cache.WrinklersNormal += sucked; + if (sucked > CM.Cache.WrinklersFattest[0]) CM.Cache.WrinklersFattest = [sucked, i]; + } } } @@ -997,7 +999,7 @@ CM.ConfigData.Colors = { type: 'color', group: 'BarsColors', CM.ConfigData.UpgradeBarFixedPos = {type: 'bool', group: 'BarsColors', label: ['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'], desc: 'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling', toggle: true, func: function() {CM.Disp.ToggleUpgradeBarFixedPos();}}; // Calculation -CM.ConfigData.CalcWrink = {type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single fattest) Wrinklers', toggle: true}; +CM.ConfigData.CalcWrink = {type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers', toggle: true}; CM.ConfigData.CPSMode = {type: 'bool', group: 'Calculation', label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false}; CM.ConfigData.AvgCPSHist = {type: 'bool', group: 'Calculation', label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false}; CM.ConfigData.AvgClicksHist = {type: 'bool', group: 'Calculation', label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false}; @@ -3380,9 +3382,9 @@ CM.Disp.AddMenuStats = function(title) { var popFattestA = document.createElement('a'); popFattestA.textContent = 'Pop Single Fattest'; popFattestA.className = 'option'; - popFattestA.onclick = function() { Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; }; + popFattestA.onclick = function() {if (CM.Cache.WrinklersFattest[1]) Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; };; popFattestFrag.appendChild(popFattestA); - stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping Single Fattest Wrinkler (id: ' + CM.Cache.WrinklersFattest[1] + ")", popFattestFrag)); + stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ' + (CM.Cache.WrinklersFattest[1] ? CM.Cache.WrinklersFattest[1] : "None") + ")", popFattestFrag)); } } @@ -3963,7 +3965,7 @@ CM.Disp.CreateWrinklerButtons = function() { popFattestA.id = "PopFattestWrinklerButton" popFattestA.textContent = 'Pop Single Fattest'; popFattestA.className = 'option'; - popFattestA.onclick = function() { Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; }; + popFattestA.onclick = function() {if (CM.Cache.WrinklersFattest[1]) Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; }; l('sectionLeftExtra').children[0].append(popFattestA); } diff --git a/src/Cache.js b/src/Cache.js index 349c517..dd8781c 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -42,7 +42,7 @@ CM.Cache.CacheDragonAuras = function() { * It is called by CM.Loop() and CM.Cache.InitCache() * @global {number} CM.Cache.WrinklersTotal The cookies of all wrinklers * @global {number} CM.Cache.WrinklersNormal The cookies of all normal wrinklers - * @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest wrinkler + * @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest non-shiny wrinkler */ CM.Cache.CacheWrinklers = function() { CM.Cache.WrinklersTotal = 0; @@ -62,8 +62,10 @@ CM.Cache.CacheWrinklers = function() { else if (godLvl == 3) sucked *= 1.05; } CM.Cache.WrinklersTotal += sucked; - if (Game.wrinklers[i].type == 0) CM.Cache.WrinklersNormal += sucked; - if (sucked > CM.Cache.WrinklersFattest[0]) CM.Cache.WrinklersFattest = [sucked, i]; + if (Game.wrinklers[i].type == 0) { + CM.Cache.WrinklersNormal += sucked; + if (sucked > CM.Cache.WrinklersFattest[0]) CM.Cache.WrinklersFattest = [sucked, i]; + } } } diff --git a/src/Data.js b/src/Data.js index 49ef144..ef16e4c 100644 --- a/src/Data.js +++ b/src/Data.js @@ -115,7 +115,7 @@ CM.ConfigData.Colors = { type: 'color', group: 'BarsColors', CM.ConfigData.UpgradeBarFixedPos = {type: 'bool', group: 'BarsColors', label: ['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'], desc: 'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling', toggle: true, func: function() {CM.Disp.ToggleUpgradeBarFixedPos();}}; // Calculation -CM.ConfigData.CalcWrink = {type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single fattest) Wrinklers', toggle: true}; +CM.ConfigData.CalcWrink = {type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers', toggle: true}; CM.ConfigData.CPSMode = {type: 'bool', group: 'Calculation', label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false}; CM.ConfigData.AvgCPSHist = {type: 'bool', group: 'Calculation', label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false}; CM.ConfigData.AvgClicksHist = {type: 'bool', group: 'Calculation', label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false}; diff --git a/src/Disp.js b/src/Disp.js index ccf77e9..ed20533 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -2199,9 +2199,9 @@ CM.Disp.AddMenuStats = function(title) { var popFattestA = document.createElement('a'); popFattestA.textContent = 'Pop Single Fattest'; popFattestA.className = 'option'; - popFattestA.onclick = function() { Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; }; + popFattestA.onclick = function() {if (CM.Cache.WrinklersFattest[1]) Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; };; popFattestFrag.appendChild(popFattestA); - stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping Single Fattest Wrinkler (id: ' + CM.Cache.WrinklersFattest[1] + ")", popFattestFrag)); + stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ' + (CM.Cache.WrinklersFattest[1] ? CM.Cache.WrinklersFattest[1] : "None") + ")", popFattestFrag)); } } @@ -2782,7 +2782,7 @@ CM.Disp.CreateWrinklerButtons = function() { popFattestA.id = "PopFattestWrinklerButton" popFattestA.textContent = 'Pop Single Fattest'; popFattestA.className = 'option'; - popFattestA.onclick = function() { Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; }; + popFattestA.onclick = function() {if (CM.Cache.WrinklersFattest[1]) Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; }; l('sectionLeftExtra').children[0].append(popFattestA); } From 867249e8cb4912aa3da9f34bf06e251478e83ecc Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Mon, 25 Jan 2021 23:00:30 +0100 Subject: [PATCH 4/7] Missing upgrades no longer shows debug #497 --- CookieMonster.js | 2 +- src/Cache.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 754debe..ed43c7a 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -183,7 +183,7 @@ CM.Cache.CacheMissingUpgrades = function() { str += CM.Disp.crateMissing(me); if (me.pool == 'prestige') CM.Cache.MissingUpgradesPrestige += str; else if (me.pool == 'cookie') CM.Cache.MissingUpgradesCookies += str; - else if (me.pool != 'toggle' && me.pool != 'unused') CM.Cache.MissingUpgrades += str; + else if (me.pool != 'toggle' && me.pool != 'unused' && me.pool != 'debug') CM.Cache.MissingUpgrades += str; } } } diff --git a/src/Cache.js b/src/Cache.js index dd8781c..7079c7f 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -152,7 +152,7 @@ CM.Cache.CacheMissingUpgrades = function() { str += CM.Disp.crateMissing(me); if (me.pool == 'prestige') CM.Cache.MissingUpgradesPrestige += str; else if (me.pool == 'cookie') CM.Cache.MissingUpgradesCookies += str; - else if (me.pool != 'toggle' && me.pool != 'unused') CM.Cache.MissingUpgrades += str; + else if (me.pool != 'toggle' && me.pool != 'unused' && me.pool != 'debug') CM.Cache.MissingUpgrades += str; } } } From d5c5a5f62e55636e51d54af921427c83521f8cd8 Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Mon, 25 Jan 2021 23:24:25 +0100 Subject: [PATCH 5/7] Show tooltip warnings when extra info is off #496 --- CookieMonster.js | 7 +++++-- src/Data.js | 4 ++-- src/Disp.js | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index ed43c7a..25bf0dd 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1064,7 +1064,7 @@ CM.ConfigData.WrinklerMaxSoundURL = {type: 'url', group: 'NotificationWrinkMax', CM.ConfigData.Title = {type: 'bool', group: 'Notification', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true}; // Tooltip -CM.ConfigData.TooltipBuildUp = {type: 'bool', group: 'Tooltip', label: ['Buildings/Upgrades Tooltip Information OFF', 'Buildings/Upgrades Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true}; +CM.ConfigData.TooltipInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Tooltip Information OFF', 'Extra Tooltip Information ON'], desc: 'Extra information in tooltips', toggle: true}; CM.ConfigData.TooltipAmor = {type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.ToolWarnLucky = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true}; CM.ConfigData.ToolWarnLuckyFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true}; @@ -1150,7 +1150,7 @@ CM.Data.ConfigDefault = { WrinklerMaxVolume: 100, WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3', Title: 1, - TooltipBuildUp: 1, + TooltipInfo: 1, TooltipAmor: 0, ToolWarnLucky: 1, ToolWarnLuckyFrenzy: 1, @@ -2611,6 +2611,9 @@ CM.Disp.TooltipCreateWarningSection = function() { CM.Disp.UpdateTooltip = function() { CM.Sim.CopyData(); if (l('tooltipAnchor').style.display != 'none' && l('CMTooltipArea')) { + if (CM.Options.TooltipInfo == 0) { + l('CMTooltipArea').style.display = "none"; + } l('CMTooltipArea').innerHTML = ''; tooltipBox = CM.Disp.TooltipCreateTooltipBox(); l('CMTooltipArea').appendChild(tooltipBox); diff --git a/src/Data.js b/src/Data.js index ef16e4c..63dc624 100644 --- a/src/Data.js +++ b/src/Data.js @@ -180,7 +180,7 @@ CM.ConfigData.WrinklerMaxSoundURL = {type: 'url', group: 'NotificationWrinkMax', CM.ConfigData.Title = {type: 'bool', group: 'Notification', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true}; // Tooltip -CM.ConfigData.TooltipBuildUp = {type: 'bool', group: 'Tooltip', label: ['Buildings/Upgrades Tooltip Information OFF', 'Buildings/Upgrades Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true}; +CM.ConfigData.TooltipInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Tooltip Information OFF', 'Extra Tooltip Information ON'], desc: 'Extra information in tooltips', toggle: true}; CM.ConfigData.TooltipAmor = {type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.ToolWarnLucky = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true}; CM.ConfigData.ToolWarnLuckyFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true}; @@ -266,7 +266,7 @@ CM.Data.ConfigDefault = { WrinklerMaxVolume: 100, WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3', Title: 1, - TooltipBuildUp: 1, + TooltipInfo: 1, TooltipAmor: 0, ToolWarnLucky: 1, ToolWarnLuckyFrenzy: 1, diff --git a/src/Disp.js b/src/Disp.js index ed20533..35e476c 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1428,6 +1428,9 @@ CM.Disp.TooltipCreateWarningSection = function() { CM.Disp.UpdateTooltip = function() { CM.Sim.CopyData(); if (l('tooltipAnchor').style.display != 'none' && l('CMTooltipArea')) { + if (CM.Options.TooltipInfo == 0) { + l('CMTooltipArea').style.display = "none"; + } l('CMTooltipArea').innerHTML = ''; tooltipBox = CM.Disp.TooltipCreateTooltipBox(); l('CMTooltipArea').appendChild(tooltipBox); From 92c28b092b64bbbe3da6414e0a71673b8b0eb578 Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Mon, 25 Jan 2021 23:29:21 +0100 Subject: [PATCH 6/7] Timer bar now adjusts height correctly #499 --- CookieMonster.js | 4 ++++ src/Disp.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CookieMonster.js b/CookieMonster.js index 25bf0dd..cec3c26 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1792,6 +1792,10 @@ CM.Disp.UpdateTimerBar = function() { if (numberOfTimers != 0) { CM.Disp.TimerBar.style.height = numberOfTimers * 12 + 2 + 'px'; } + if (CM.Disp.LastNumberOfTimers != numberOfTimers) { + CM.Disp.LastNumberOfTimers = numberOfTimers + CM.Disp.UpdateBotTimerBarPosition(); + } } } diff --git a/src/Disp.js b/src/Disp.js index 35e476c..c9d060a 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -609,6 +609,10 @@ CM.Disp.UpdateTimerBar = function() { if (numberOfTimers != 0) { CM.Disp.TimerBar.style.height = numberOfTimers * 12 + 2 + 'px'; } + if (CM.Disp.LastNumberOfTimers != numberOfTimers) { + CM.Disp.LastNumberOfTimers = numberOfTimers + CM.Disp.UpdateBotTimerBarPosition(); + } } } From e5b24b393eeba477f6030c64219c19675ff280b1 Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Mon, 25 Jan 2021 23:37:41 +0100 Subject: [PATCH 7/7] Fixed decimal notation #500 --- CookieMonster.js | 5 ++++- src/Disp.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index cec3c26..d8a7445 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1379,8 +1379,11 @@ CM.Disp.Beautify = function(num, floats, forced) { return num.toString() } else if (0.001 < num && num < CM.Options.ScaleCutoff) { - answer = num.toFixed(0); + answer = num.toFixed(2); if (CM.Options.ScaleSeparator) answer = answer.toLocaleString('nl'); + for (let i = 0; i < 3; i++) { + if (answer[answer.length - 1] == "0" | answer[answer.length - 1] == ".") answer = answer.slice(0, -1) + } return answer; } else if (CM.Options.Scale == 4 && !forced || forced == 4) { // Scientific notation, 123456789 => 1.235E+8 diff --git a/src/Disp.js b/src/Disp.js index c9d060a..f55a4e7 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -196,8 +196,11 @@ CM.Disp.Beautify = function(num, floats, forced) { return num.toString() } else if (0.001 < num && num < CM.Options.ScaleCutoff) { - answer = num.toFixed(0); + answer = num.toFixed(2); if (CM.Options.ScaleSeparator) answer = answer.toLocaleString('nl'); + for (let i = 0; i < 3; i++) { + if (answer[answer.length - 1] == "0" | answer[answer.length - 1] == ".") answer = answer.slice(0, -1) + } return answer; } else if (CM.Options.Scale == 4 && !forced || forced == 4) { // Scientific notation, 123456789 => 1.235E+8