Merge branch 'dev' into dev
This commit is contained in:
@@ -225,6 +225,7 @@ 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();}};
|
||||
@@ -312,6 +313,7 @@ CM.Data.ConfigDefault = {
|
||||
DragonAuraInfo: 1,
|
||||
Stats: 1,
|
||||
MissingUpgrades: 1,
|
||||
MissingAchievements: 3,
|
||||
UpStats: 1,
|
||||
TimeFormat: 0,
|
||||
DetailedTime: 1,
|
||||
|
||||
57
src/Disp.js
57
src/Disp.js
@@ -1226,6 +1226,63 @@ 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('<div class="name">???</div>', '<div class="name">'+me.name+'</div>');
|
||||
output = output.replace('<div class="description">???</div>', '<div class="description">'+me.desc+'</div>');
|
||||
}
|
||||
if (options.shadow && me.pool === 'shadow') {
|
||||
output = output.replace('<div class="name">???</div>', '<div class="name">'+me.name+'</div>');
|
||||
output = output.replace('<div class="description">???</div>', '<div class="description">'+me.desc+'</div>');
|
||||
}
|
||||
} 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()
|
||||
|
||||
@@ -210,7 +210,9 @@ 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();
|
||||
@@ -245,6 +247,7 @@ CM.DelayInit = function() {
|
||||
CM.Main.ReplaceTooltips = function() {
|
||||
CM.Main.ReplaceTooltipBuild();
|
||||
CM.Main.ReplaceTooltipLump();
|
||||
CM.Disp.ReplaceCrateTooltipAchievements();
|
||||
|
||||
// Replace Tooltips of Minigames. Nesting it in LoadMinigames makes sure to replace them even if
|
||||
// they were not loaded initially
|
||||
|
||||
Reference in New Issue
Block a user