Merge pull request #2 from redthefed/custom

pull
This commit is contained in:
redthefed
2018-02-16 18:59:01 -06:00
committed by GitHub
5 changed files with 188 additions and 210 deletions

View File

@@ -529,7 +529,7 @@ CM.ConfigData.SeaSoundURL = {label: 'Season Special Sound URL:', desc: 'URL of t
CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, 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', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.Title = {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}; CM.ConfigData.Title = {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};
CM.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}}; CM.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}};
CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades/grimoire', toggle: true}; CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true};
CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true};
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', toggle: true, func: function() {CM.Disp.ToggleToolWarnCaut();}}; 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', toggle: true, 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', toggle: false, func: function() {CM.Disp.ToggleToolWarnCautPos();}}; CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnCautPos();}};
@@ -584,7 +584,7 @@ CM.Disp.FormatTime = function(time, format) {
} }
str += s; str += s;
} else { } else {
if (time > 777600000) return format ? 'Over 9000 days!' : '>9000d'; if (time > 86400) return format ? 'Over 24 hours' : '>24h';
time = Math.ceil(time); time = Math.ceil(time);
var d = Math.floor(time / 86400); var d = Math.floor(time / 86400);
var h = Math.floor(time % 86400 / 3600); var h = Math.floor(time % 86400 / 3600);
@@ -614,7 +614,7 @@ CM.Disp.GetTimeColor = function(price, bank, cps, time) {
text = '00:00:00:00:00'; text = '00:00:00:00:00';
} }
else { else {
text = 'Done!'; text = 'Ready';
} }
} }
else { else {
@@ -734,6 +734,8 @@ CM.Disp.CreateBotBar = function() {
table.style.width = '100%'; table.style.width = '100%';
table.style.textAlign = 'center'; table.style.textAlign = 'center';
table.style.whiteSpace = 'nowrap'; table.style.whiteSpace = 'nowrap';
table.style.tableLayout = 'fixed';
table.style.overflow = 'hidden';
var tbody = document.createElement('tbody'); var tbody = document.createElement('tbody');
table.appendChild(tbody); table.appendChild(tbody);
@@ -2495,7 +2497,6 @@ CM.Disp.TooltipWrinklerCache = [];
for (var i in Game.wrinklers) { for (var i in Game.wrinklers) {
CM.Disp.TooltipWrinklerCache[i] = 0; CM.Disp.TooltipWrinklerCache[i] = 0;
} }
/******** /********
* Main * * Main *
********/ ********/
@@ -2749,7 +2750,7 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkB
CM.ConfigPrefix = 'CMConfig'; CM.ConfigPrefix = 'CMConfig';
CM.VersionMajor = '2.0042'; CM.VersionMajor = '2.0042';
CM.VersionMinor = '3'; CM.VersionMinor = '2';
/******* /*******
* Sim * * Sim *

View File

@@ -133,14 +133,6 @@ CM.Cache.RemakePP = function() {
CM.Cache.RemakeBuildingsOtherPP(100, 'Objects100'); CM.Cache.RemakeBuildingsOtherPP(100, 'Objects100');
} }
CM.Cache.RemakeMultiple = function () {
for (var i in CM.Cache.Objects) {
var nextMultiple = 50 - Game.Objects[i].amount % 50;
CM.Cache.Objects[i].multiple_quantity = nextMultiple;
CM.Cache.Objects[i].multiple_price = CM.Sim.BuildingGetPrice(Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, nextMultiple);
}
}
CM.Cache.RemakeLucky = function() { CM.Cache.RemakeLucky = function() {
CM.Cache.Lucky = (CM.Cache.NoGoldSwitchCookiesPS * 60 * 15) / 0.15; CM.Cache.Lucky = (CM.Cache.NoGoldSwitchCookiesPS * 60 * 15) / 0.15;
CM.Cache.Lucky /= CM.Sim.getCPSBuffMult(); CM.Cache.Lucky /= CM.Sim.getCPSBuffMult();

View File

@@ -137,9 +137,8 @@ CM.ConfigData.SeaSoundURL = {label: 'Season Special Sound URL:', desc: 'URL of t
CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, 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', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.Title = {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}; CM.ConfigData.Title = {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};
CM.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}}; CM.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}};
CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades/grimoire', toggle: true}; CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true};
CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true};
CM.ConfigData.TooltipNextMultiple = {label: ['Tooltip Next Multiple of 50 Information OFF', 'Tooltip Next Multiple of 50 Information ON'], desc: 'Add the total price necessary to reach the next multiple of 50 buildings of a kind to buildings tooltip', toggle: true};
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', toggle: true, func: function() {CM.Disp.ToggleToolWarnCaut();}}; 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', toggle: true, 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', toggle: false, func: function() {CM.Disp.ToggleToolWarnCautPos();}}; CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', toggle: false, 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', toggle: true}; CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true};

View File

@@ -34,7 +34,7 @@ CM.Disp.FormatTime = function(time, format) {
} }
str += s; str += s;
} else { } else {
if (time > 777600000) return format ? 'Over 9000 days!' : '>9000d'; if (time > 86400) return format ? 'Over 24 hours' : '>24h';
time = Math.ceil(time); time = Math.ceil(time);
var d = Math.floor(time / 86400); var d = Math.floor(time / 86400);
var h = Math.floor(time % 86400 / 3600); var h = Math.floor(time % 86400 / 3600);
@@ -64,7 +64,7 @@ CM.Disp.GetTimeColor = function(price, bank, cps, time) {
text = '00:00:00:00:00'; text = '00:00:00:00:00';
} }
else { else {
text = 'Done!'; text = 'Ready';
} }
} }
else { else {
@@ -184,6 +184,8 @@ CM.Disp.CreateBotBar = function() {
table.style.width = '100%'; table.style.width = '100%';
table.style.textAlign = 'center'; table.style.textAlign = 'center';
table.style.whiteSpace = 'nowrap'; table.style.whiteSpace = 'nowrap';
table.style.tableLayout = 'fixed';
table.style.overflow = 'hidden';
var tbody = document.createElement('tbody'); var tbody = document.createElement('tbody');
table.appendChild(tbody); table.appendChild(tbody);
@@ -1047,7 +1049,6 @@ CM.Disp.AddMenuPref = function(title) {
frag.appendChild(header('Tooltip')); frag.appendChild(header('Tooltip'));
frag.appendChild(listing('Tooltip')); frag.appendChild(listing('Tooltip'));
frag.appendChild(listing('TooltipAmor')); frag.appendChild(listing('TooltipAmor'));
frag.appendChild(listing('TooltipNextMultiple'));
frag.appendChild(listing('ToolWarnCaut')); frag.appendChild(listing('ToolWarnCaut'));
frag.appendChild(listing('ToolWarnCautPos')); frag.appendChild(listing('ToolWarnCautPos'));
frag.appendChild(listing('ToolWrink')); frag.appendChild(listing('ToolWrink'));
@@ -1566,23 +1567,13 @@ CM.Disp.AddTooltipGrimoire = function() {
CM.Disp.Tooltip = function(type, name) { CM.Disp.Tooltip = function(type, name) {
if (type == 'b') { if (type == 'b') {
l('tooltip').innerHTML = Game.Objects[name].tooltip(); l('tooltip').innerHTML = Game.Objects[name].tooltip();
var addedAmor = false;
if (CM.Config.TooltipAmor == 1) { if (CM.Config.TooltipAmor == 1) {
var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount); var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount);
var amortizeAmount = buildPrice - Game.Objects[name].totalCookies; var amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
if (amortizeAmount > 0) { if (amortizeAmount > 0) {
addedAmor = true;
l('tooltip').innerHTML = l('tooltip').innerHTML.split('so far</div>').join('so far<br/>&bull; <b>' + Beautify(amortizeAmount) + '</b> ' + (Math.floor(amortizeAmount) == 1 ? 'cookie' : 'cookies') + ' left to amortize (' + CM.Disp.GetTimeColor(buildPrice, Game.Objects[name].totalCookies, (Game.Objects[name].storedTotalCps * Game.globalCpsMult)).text + ')</div>'); l('tooltip').innerHTML = l('tooltip').innerHTML.split('so far</div>').join('so far<br/>&bull; <b>' + Beautify(amortizeAmount) + '</b> ' + (Math.floor(amortizeAmount) == 1 ? 'cookie' : 'cookies') + ' left to amortize (' + CM.Disp.GetTimeColor(buildPrice, Game.Objects[name].totalCookies, (Game.Objects[name].storedTotalCps * Game.globalCpsMult)).text + ')</div>');
} }
} }
if (CM.Config.TooltipNextMultiple == 1) {
var marker = addedAmor ? ')' : 'so far';
var multiple_quantity = CM.Cache.Objects[name].multiple_quantity;
l('tooltip').innerHTML = l('tooltip').innerHTML.split(marker + '</div>').join(marker + '<br/>&bull; <b>' + multiple_quantity + '</b> ' + (multiple_quantity == 1 ? Game.Objects[name].single : Game.Objects[name].plural) + ' left to reach <b>' + (Game.Objects[name].amount + multiple_quantity) + '</b>, <b>' + Beautify(CM.Cache.Objects[name].multiple_price, 2) + '</b> cookies in total (' + CM.Disp.GetTimeColor(CM.Cache.Objects[name].multiple_price, (Game.cookies + CM.Disp.GetWrinkConfigBank()), CM.Disp.GetCPS()).text + ')</div>');
}
if (Game.buyMode == 1) { if (Game.buyMode == 1) {
var target = ''; var target = '';
var change = false; var change = false;
@@ -1956,4 +1947,3 @@ CM.Disp.TooltipWrinklerCache = [];
for (var i in Game.wrinklers) { for (var i in Game.wrinklers) {
CM.Disp.TooltipWrinklerCache[i] = 0; CM.Disp.TooltipWrinklerCache[i] = 0;
} }

View File

@@ -162,10 +162,6 @@ CM.Loop = function() {
// Calculate PP // Calculate PP
CM.Cache.RemakePP(); CM.Cache.RemakePP();
// Calculate total price until reaching next multiple of 50
// for each building
CM.Cache.RemakeMultiple();
// Update colors // Update colors
CM.Disp.UpdateBotBarOther(); CM.Disp.UpdateBotBarOther();
CM.Disp.UpdateBuildings(); CM.Disp.UpdateBuildings();
@@ -251,9 +247,9 @@ CM.DelayInit = function() {
CM.HasReplaceNativeGrimoireLaunch = false; CM.HasReplaceNativeGrimoireLaunch = false;
CM.HasReplaceNativeGrimoireDraw = false; CM.HasReplaceNativeGrimoireDraw = false;
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 0, AvgClicksHist: 0, ToolWarnCautBon: 0, 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, Favicon: 1, Tooltip: 1, TooltipAmor: 0, TooltipNextMultiple: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513'}}; CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 0, AvgClicksHist: 0, ToolWarnCautBon: 0, 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, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513'}};
CM.ConfigPrefix = 'CMConfig'; CM.ConfigPrefix = 'CMConfig';
CM.VersionMajor = '2.0042'; CM.VersionMajor = '2.0042';
CM.VersionMinor = '3'; CM.VersionMinor = '2';