Add amortization to tooltip config (Issue #19)
This commit is contained in:
@@ -318,6 +318,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', 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.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.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades'};
|
||||||
|
CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip'};
|
||||||
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.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.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.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it'};
|
||||||
@@ -1178,6 +1179,7 @@ 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('ToolWarnCaut'));
|
frag.appendChild(listing('ToolWarnCaut'));
|
||||||
frag.appendChild(listing('ToolWarnCautPos'));
|
frag.appendChild(listing('ToolWarnCautPos'));
|
||||||
frag.appendChild(listing('ToolWrink'));
|
frag.appendChild(listing('ToolWrink'));
|
||||||
@@ -1624,11 +1626,13 @@ CM.Disp.AddTooltipBuild10 = 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();
|
||||||
|
if (CM.Config.TooltipAmor == 1) {
|
||||||
var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].amount);
|
var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].amount);
|
||||||
var amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
|
var amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
|
||||||
if (amortizeAmount > 0) {
|
if (amortizeAmount > 0) {
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split('so far</div>').join('so far<br/>• <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/>• <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.Disp.TooltipBuy10) {
|
if (CM.Disp.TooltipBuy10) {
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
||||||
}
|
}
|
||||||
@@ -2040,7 +2044,7 @@ CM.DelayInit = function() {
|
|||||||
Game.Win('Third-party');
|
Game.Win('Third-party');
|
||||||
}
|
}
|
||||||
|
|
||||||
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, 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}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}};
|
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, 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, TooltipAmor: 0, 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}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}};
|
||||||
CM.ConfigPrefix = 'CMConfig';
|
CM.ConfigPrefix = 'CMConfig';
|
||||||
|
|
||||||
CM.VersionMajor = '1.0465';
|
CM.VersionMajor = '1.0465';
|
||||||
|
|||||||
@@ -119,6 +119,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', 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.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.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades'};
|
||||||
|
CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip'};
|
||||||
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.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.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.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it'};
|
||||||
|
|||||||
@@ -842,6 +842,7 @@ 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('ToolWarnCaut'));
|
frag.appendChild(listing('ToolWarnCaut'));
|
||||||
frag.appendChild(listing('ToolWarnCautPos'));
|
frag.appendChild(listing('ToolWarnCautPos'));
|
||||||
frag.appendChild(listing('ToolWrink'));
|
frag.appendChild(listing('ToolWrink'));
|
||||||
@@ -1288,11 +1289,13 @@ CM.Disp.AddTooltipBuild10 = 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();
|
||||||
|
if (CM.Config.TooltipAmor == 1) {
|
||||||
var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].amount);
|
var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].amount);
|
||||||
var amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
|
var amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
|
||||||
if (amortizeAmount > 0) {
|
if (amortizeAmount > 0) {
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split('so far</div>').join('so far<br/>• <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/>• <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.Disp.TooltipBuy10) {
|
if (CM.Disp.TooltipBuy10) {
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ CM.DelayInit = function() {
|
|||||||
Game.Win('Third-party');
|
Game.Win('Third-party');
|
||||||
}
|
}
|
||||||
|
|
||||||
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, 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}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}};
|
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, 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, TooltipAmor: 0, 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}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}};
|
||||||
CM.ConfigPrefix = 'CMConfig';
|
CM.ConfigPrefix = 'CMConfig';
|
||||||
|
|
||||||
CM.VersionMajor = '1.0465';
|
CM.VersionMajor = '1.0465';
|
||||||
|
|||||||
Reference in New Issue
Block a user