From a801e797909908b857230340387be1f8fad6012f Mon Sep 17 00:00:00 2001 From: DanielNoord Date: Sun, 31 Jan 2021 23:43:59 +0100 Subject: [PATCH] Revert "Added a feature to show mysterious achievements" --- src/Data.js | 2 -- src/Disp.js | 57 ----------------------------------------------------- src/Main.js | 5 +---- 3 files changed, 1 insertion(+), 63 deletions(-) diff --git a/src/Data.js b/src/Data.js index a27bffb..1a07f7f 100644 --- a/src/Data.js +++ b/src/Data.js @@ -225,7 +225,6 @@ CM.ConfigData.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra D // Statistics CM.ConfigData.Stats = {type: 'bool', group: 'Statistics', label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true}; CM.ConfigData.MissingUpgrades = {type: 'bool', group: 'Statistics', label: ['Missing Upgrades OFF', 'Missing Upgrades ON'], desc: 'Shows Missing upgrades in Stats Menu. This feature can be laggy for users with a low amount of unlocked achievements.', toggle: true}; -CM.ConfigData.MissingAchievements = {type: 'bool', group: 'Statistics', label: ['Missing Achievements OFF', 'Missing Normal Achievements ON', 'Missing Shadow Achievements ON', 'All Missing Achievements ON'], desc: 'Shows Missing normal or shadow achievements in Stats Menu.', toggle: false}; CM.ConfigData.UpStats = {type: 'bool', group: 'Statistics', label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false}; CM.ConfigData.TimeFormat = {type: 'bool', group: 'Statistics', label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false}; CM.ConfigData.DetailedTime = {type: 'bool', group: 'Statistics', label: ['Detailed Time OFF', 'Detailed Time ON'], desc: 'Change how time is displayed in certain statistics and tooltips', toggle: true, func: function() {CM.Disp.ToggleDetailedTime();}}; @@ -313,7 +312,6 @@ CM.Data.ConfigDefault = { DragonAuraInfo: 1, Stats: 1, MissingUpgrades: 1, - MissingAchievements: 3, UpStats: 1, TimeFormat: 0, DetailedTime: 1, diff --git a/src/Disp.js b/src/Disp.js index 8c17d62..ac9ace8 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1226,63 +1226,6 @@ CM.Disp.ReplaceTooltipUpgrade = function() { } }; -/** - * This function replaces the original Game.crate and Game.crateTooltip functions of stats page - */ -CM.Disp.ReplaceCrateTooltipAchievements = function() { - CM.Disp.CrateTooltipAchievementsBackup = [Game.crate, Game.crateTooltip]; - Game.crate = function(me,context,forceClickStr,id) { - let output; - if (me.type === 'achievement') { - let options = {normal: false, shadow: false}; - switch (CM.Options.MissingAchievements) { - case 0: options.normal = false; options.shadow = false; break; - case 1: options.normal = true; options.shadow = false; break; - case 2: options.normal = false; options.shadow = true; break; - case 3: options.normal = true; options.shadow = true; break; - } - let icon = me.icon; - if (options.shadow && me.pool === 'shadow') { - me.pool = 'normal'; - me.isShadow = true; - } - output = CM.Disp.CrateTooltipAchievementsBackup[0](me,context,forceClickStr,id); - if (options.normal && me.pool === 'normal' && !me.isShadow) output = output.replace('background-position:0px -336px', 'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px'); - if (options.shadow && me.isShadow) { - me.pool = 'shadow'; - output = output.replace('background-position:0px -336px', 'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px'); - } - } else { - output = CM.Disp.CrateTooltipAchievementsBackup[0](me,context,forceClickStr,id); - } - return output; - } - Game.crateTooltip = function(me,context) { - let output; - if (me.type === 'achievement') { - let options = {normal: false, shadow: false}; - switch (CM.Options.MissingAchievements) { - case 0: options.normal = false; options.shadow = false; break; - case 1: options.normal = true; options.shadow = false; break; - case 2: options.normal = false; options.shadow = true; break; - case 3: options.normal = true; options.shadow = true; break; - } - output = CM.Disp.CrateTooltipAchievementsBackup[1](me,context); - if (options.normal && me.pool === 'normal') { - output = output.replace('
???
', '
'+me.name+'
'); - output = output.replace('
???
', '
'+me.desc+'
'); - } - if (options.shadow && me.pool === 'shadow') { - output = output.replace('
???
', '
'+me.name+'
'); - output = output.replace('
???
', '
'+me.desc+'
'); - } - } else { - output = CM.Disp.CrateTooltipAchievementsBackup[1](me,context); - } - return output; - } -} - /** * This function enhance the standard tooltips by creating and changing l('tooltip') * The function is called by .onmouseover events that have replaced original code to use CM.Disp.Tooltip() diff --git a/src/Main.js b/src/Main.js index 5792671..e5e374d 100644 --- a/src/Main.js +++ b/src/Main.js @@ -210,9 +210,7 @@ CM.DelayInit = function() { CM.Disp.CreateSimpleTooltip(CM.Disp.TooltipText[i][0], CM.Disp.TooltipText[i][1], CM.Disp.TooltipText[i][2]); } CM.Disp.CreateWrinklerButtons(); - CM.Main.ReplaceTooltips(); - CM.Main.AddWrinklerAreaDetect(); CM.Cache.InitCookiesDiff(); CM.ReplaceNative(); @@ -246,8 +244,7 @@ CM.DelayInit = function() { */ CM.Main.ReplaceTooltips = function() { CM.Main.ReplaceTooltipBuild(); - CM.Main.ReplaceTooltipLump(); - CM.Disp.ReplaceCrateTooltipAchievements(); + CM.Main.ReplaceTooltipLump(); // Replace Tooltips of Minigames. Nesting it in LoadMinigames makes sure to replace them even if // they were not loaded initially