Toggle to display PP as time period #625
This commit is contained in:
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -100,6 +100,13 @@ const Config = {
|
|||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
PPDisplayTime: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'BarsColors',
|
||||||
|
['PP As Value (Standard)', 'PP As Time Unit'],
|
||||||
|
'Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.',
|
||||||
|
false,
|
||||||
|
),
|
||||||
UpBarColor: new SettingStandard(
|
UpBarColor: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsColors',
|
'BarsColors',
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const ConfigDefault = {
|
|||||||
TimerBarPos: 0,
|
TimerBarPos: 0,
|
||||||
TimerBarOverlay: 2,
|
TimerBarOverlay: 2,
|
||||||
BuildColor: 1,
|
BuildColor: 1,
|
||||||
|
PPDisplayTime: 0,
|
||||||
UpBarColor: 1,
|
UpBarColor: 1,
|
||||||
UpgradeBarFixedPos: 1,
|
UpgradeBarFixedPos: 1,
|
||||||
CalcWrink: 0,
|
CalcWrink: 0,
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ export function Beautify(num, floats, forced) {
|
|||||||
export function FormatTime(time, longFormat) {
|
export function FormatTime(time, longFormat) {
|
||||||
let formattedTime = time;
|
let formattedTime = time;
|
||||||
if (time === Infinity) return time;
|
if (time === Infinity) return time;
|
||||||
|
if (time < 0) return 'Negative time period';
|
||||||
formattedTime = Math.ceil(time);
|
formattedTime = Math.ceil(time);
|
||||||
const y = Math.floor(formattedTime / 31557600);
|
const y = Math.floor(formattedTime / 31557600);
|
||||||
const d = Math.floor((formattedTime % 31557600) / 86400);
|
const d = Math.floor((formattedTime % 31557600) / 86400);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColor,
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
import GetCPS from '../HelperFunctions/GetCPS';
|
||||||
@@ -94,9 +95,13 @@ export function UpdateBotBar() {
|
|||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
count
|
count
|
||||||
].className = ColorTextPre + target[i].color;
|
].className = ColorTextPre + target[i].color;
|
||||||
|
let PPString;
|
||||||
|
if (CMOptions.PPDisplayTime)
|
||||||
|
PPString = FormatTime(Math.round(target[i].pp));
|
||||||
|
else PPString = Beautify(Math.round(target[i].pp), 2);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
count
|
count
|
||||||
].textContent = Beautify(Math.round(target[i].pp), 2);
|
].textContent = PPString;
|
||||||
const timeColor = GetTimeColor(
|
const timeColor = GetTimeColor(
|
||||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
||||||
GetCPS(),
|
GetCPS(),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { CMOptions } from '../../../Config/VariablesAndData';
|
|||||||
import { SimObjects } from '../../../Sim/VariablesAndData';
|
import { SimObjects } from '../../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColor,
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
@@ -55,7 +56,9 @@ export default function Building() {
|
|||||||
}01% of income)`;
|
}01% of income)`;
|
||||||
}
|
}
|
||||||
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
||||||
l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
if (CMOptions.PPDisplayTime)
|
||||||
|
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
||||||
|
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||||
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
||||||
const timeColor = GetTimeColor(
|
const timeColor = GetTimeColor(
|
||||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColor,
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
@@ -70,6 +71,11 @@ export default function Upgrade() {
|
|||||||
)} Clicks`;
|
)} Clicks`;
|
||||||
l('CMTooltipPP').style.color = 'white';
|
l('CMTooltipPP').style.color = 'white';
|
||||||
} else {
|
} else {
|
||||||
|
if (CMOptions.PPDisplayTime)
|
||||||
|
l('CMTooltipPP').textContent = FormatTime(
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
|
);
|
||||||
|
else
|
||||||
l('CMTooltipPP').textContent = Beautify(
|
l('CMTooltipPP').textContent = Beautify(
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
2,
|
2,
|
||||||
|
|||||||
Reference in New Issue
Block a user