Changed folder structure
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
@@ -1,4 +1,4 @@
|
|||||||
import { FormatTime } from '../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime';
|
||||||
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
||||||
import CacheAvgCPS from './CPS/CPS';
|
import CacheAvgCPS from './CPS/CPS';
|
||||||
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
|
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/** Functions related to the Dragon */
|
/** Functions related to the Dragon */
|
||||||
|
|
||||||
import { Beautify } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify';
|
||||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -7,12 +7,6 @@ import {
|
|||||||
shortScaleAbbreviated,
|
shortScaleAbbreviated,
|
||||||
} from '../../Data/Scales.ts';
|
} from '../../Data/Scales.ts';
|
||||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||||
import {
|
|
||||||
ColourGreen,
|
|
||||||
ColourOrange,
|
|
||||||
ColourRed,
|
|
||||||
ColourYellow,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns formats number based on the Scale setting
|
* This function returns formats number based on the Scale setting
|
||||||
@@ -21,7 +15,7 @@ import {
|
|||||||
* @param {number} forced Used to force (type 3) in certains cases
|
* @param {number} forced Used to force (type 3) in certains cases
|
||||||
* @returns {string} Formatted number
|
* @returns {string} Formatted number
|
||||||
*/
|
*/
|
||||||
export function Beautify(num, floats, forced) {
|
export default function Beautify(num, floats, forced) {
|
||||||
const decimals = CMOptions.ScaleDecimals + 1;
|
const decimals = CMOptions.ScaleDecimals + 1;
|
||||||
if (num === Infinity) {
|
if (num === Infinity) {
|
||||||
return 'Infinity';
|
return 'Infinity';
|
||||||
@@ -93,66 +87,3 @@ export function Beautify(num, floats, forced) {
|
|||||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
||||||
return BackupFunctions.Beautify(num, floats);
|
return BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns time as a string depending on TimeFormat setting
|
|
||||||
* @param {number} time Time to be formatted
|
|
||||||
* @param {number} longFormat 1 or 0
|
|
||||||
* @returns {string} Formatted time
|
|
||||||
*/
|
|
||||||
export function FormatTime(time, longFormat) {
|
|
||||||
let formattedTime = time;
|
|
||||||
if (time === Infinity) return time;
|
|
||||||
if (time < 0) return 'Negative time period';
|
|
||||||
formattedTime = Math.ceil(time);
|
|
||||||
const y = Math.floor(formattedTime / 31557600);
|
|
||||||
const d = Math.floor((formattedTime % 31557600) / 86400);
|
|
||||||
const h = Math.floor((formattedTime % 86400) / 3600);
|
|
||||||
const m = Math.floor((formattedTime % 3600) / 60);
|
|
||||||
const s = Math.floor(formattedTime % 60);
|
|
||||||
let str = '';
|
|
||||||
if (CMOptions.TimeFormat) {
|
|
||||||
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
|
||||||
str += `${(y < 10 ? '0' : '') + y}:`;
|
|
||||||
str += `${(d < 10 ? '0' : '') + d}:`;
|
|
||||||
str += `${(h < 10 ? '0' : '') + h}:`;
|
|
||||||
str += `${(m < 10 ? '0' : '') + m}:`;
|
|
||||||
str += (s < 10 ? '0' : '') + s;
|
|
||||||
} else {
|
|
||||||
if (formattedTime > 777600000)
|
|
||||||
return longFormat ? 'Over 9000 days!' : '>9000d';
|
|
||||||
str +=
|
|
||||||
y > 0
|
|
||||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
|
|
||||||
: '';
|
|
||||||
str +=
|
|
||||||
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : ''; // eslint-disable-line no-nested-ternary
|
|
||||||
if (str.length > 0 || h > 0)
|
|
||||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
|
|
||||||
if (str.length > 0 || m > 0)
|
|
||||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
|
|
||||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the color to be used for time-strings
|
|
||||||
* @param {number} time Time to be coloured
|
|
||||||
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
|
||||||
*/
|
|
||||||
export function GetTimeColour(time) {
|
|
||||||
let color;
|
|
||||||
let text;
|
|
||||||
if (time <= 0) {
|
|
||||||
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
|
||||||
else text = 'Done!';
|
|
||||||
color = ColourGreen;
|
|
||||||
} else {
|
|
||||||
text = FormatTime(time);
|
|
||||||
if (time > 300) color = ColourRed;
|
|
||||||
else if (time > 60) color = ColourOrange;
|
|
||||||
else color = ColourYellow;
|
|
||||||
}
|
|
||||||
return { text, color };
|
|
||||||
}
|
|
||||||
43
src/Disp/BeautifyAndFormatting/FormatTime.js
Normal file
43
src/Disp/BeautifyAndFormatting/FormatTime.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns time as a string depending on TimeFormat setting
|
||||||
|
* @param {number} time Time to be formatted
|
||||||
|
* @param {number} longFormat 1 or 0
|
||||||
|
* @returns {string} Formatted time
|
||||||
|
*/
|
||||||
|
export default function FormatTime(time, longFormat) {
|
||||||
|
let formattedTime = time;
|
||||||
|
if (time === Infinity) return time;
|
||||||
|
if (time < 0) return 'Negative time period';
|
||||||
|
formattedTime = Math.ceil(time);
|
||||||
|
const y = Math.floor(formattedTime / 31557600);
|
||||||
|
const d = Math.floor((formattedTime % 31557600) / 86400);
|
||||||
|
const h = Math.floor((formattedTime % 86400) / 3600);
|
||||||
|
const m = Math.floor((formattedTime % 3600) / 60);
|
||||||
|
const s = Math.floor(formattedTime % 60);
|
||||||
|
let str = '';
|
||||||
|
if (CMOptions.TimeFormat) {
|
||||||
|
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
||||||
|
str += `${(y < 10 ? '0' : '') + y}:`;
|
||||||
|
str += `${(d < 10 ? '0' : '') + d}:`;
|
||||||
|
str += `${(h < 10 ? '0' : '') + h}:`;
|
||||||
|
str += `${(m < 10 ? '0' : '') + m}:`;
|
||||||
|
str += (s < 10 ? '0' : '') + s;
|
||||||
|
} else {
|
||||||
|
if (formattedTime > 777600000)
|
||||||
|
return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||||
|
str +=
|
||||||
|
y > 0
|
||||||
|
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
|
||||||
|
: '';
|
||||||
|
str +=
|
||||||
|
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : ''; // eslint-disable-line no-nested-ternary
|
||||||
|
if (str.length > 0 || h > 0)
|
||||||
|
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
if (str.length > 0 || m > 0)
|
||||||
|
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
29
src/Disp/BeautifyAndFormatting/GetTimeColour.js
Normal file
29
src/Disp/BeautifyAndFormatting/GetTimeColour.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
import {
|
||||||
|
ColourGreen,
|
||||||
|
ColourOrange,
|
||||||
|
ColourRed,
|
||||||
|
ColourYellow,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
import FormatTime from './FormatTime';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns the color to be used for time-strings
|
||||||
|
* @param {number} time Time to be coloured
|
||||||
|
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
||||||
|
*/
|
||||||
|
export default function GetTimeColour(time) {
|
||||||
|
let color;
|
||||||
|
let text;
|
||||||
|
if (time <= 0) {
|
||||||
|
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
||||||
|
else text = 'Done!';
|
||||||
|
color = ColourGreen;
|
||||||
|
} else {
|
||||||
|
text = FormatTime(time);
|
||||||
|
if (time > 300) color = ColourRed;
|
||||||
|
else if (time > 60) color = ColourOrange;
|
||||||
|
else color = ColourYellow;
|
||||||
|
}
|
||||||
|
return { text, color };
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import CacheDragonCost from '../../Cache/Dragon/Dragon';
|
|||||||
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
||||||
import {
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
import { CMOptions } from '../Config/VariablesAndData';
|
import { CMOptions } from '../Config/VariablesAndData';
|
||||||
import { Beautify } from './BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from './BeautifyAndFormatting/Beautify';
|
||||||
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
||||||
import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
||||||
import { UpdateBotBar } from './InfoBars/BottomBar';
|
import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ import {
|
|||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
|
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
|
||||||
import {
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
import GetCPS from '../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers';
|
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers';
|
||||||
import { ClickTimes, CookieTimes } from '../../VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../VariablesAndData';
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import AddMissingAchievements from './CreateMissingAchievements';
|
import AddMissingAchievements from './CreateMissingAchievements';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -38,15 +38,12 @@ import {
|
|||||||
} from '../../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
|
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
|
||||||
import {
|
|
||||||
Beautify,
|
|
||||||
FormatTime,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
|
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
||||||
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
||||||
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates the "Lucky" section of the stats page
|
* This function creates the "Lucky" section of the stats page
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
CacheTimeTillNextPrestige,
|
CacheTimeTillNextPrestige,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a header object for tooltips.
|
* This function creates a header object for tooltips.
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import UpdateTooltips from './UpdateTooltips';
|
import UpdateTooltips from './UpdateTooltips';
|
||||||
import {
|
|
||||||
Beautify,
|
|
||||||
GetTimeColour,
|
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import {
|
import {
|
||||||
SimpleTooltipElements,
|
SimpleTooltipElements,
|
||||||
TooltipName,
|
TooltipName,
|
||||||
@@ -10,6 +6,8 @@ import {
|
|||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
|
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
|
||||||
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
|
|
||||||
/** All general functions related to creating and updating tooltips */
|
/** All general functions related to creating and updating tooltips */
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,9 @@ import {
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||||
import { SimObjects } from '../../../Sim/VariablesAndData';
|
import { SimObjects } from '../../../Sim/VariablesAndData';
|
||||||
import {
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import { TooltipName } from '../../VariablesAndData';
|
import { TooltipName } from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColourTextPre, TooltipName } from '../../VariablesAndData';
|
import { ColourTextPre, TooltipName } from '../../VariablesAndData';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CacheGods } from '../../../Cache/VariablesAndData';
|
import { CacheGods } from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import { TooltipName, TooltipType } from '../../VariablesAndData';
|
import { TooltipName, TooltipType } from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,9 @@ import {
|
|||||||
CacheUpgrades,
|
CacheUpgrades,
|
||||||
} from '../../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -2,11 +2,8 @@ import GetCPSBuffMult from '../../../Cache/CPS/GetCPSBuffMult';
|
|||||||
import { CacheEdifice, CacheLucky } from '../../../Cache/VariablesAndData';
|
import { CacheEdifice, CacheLucky } from '../../../Cache/VariablesAndData';
|
||||||
import ToggleToolWarnPos from '../../../Config/Toggles/ToggleToolWarnPos';
|
import ToggleToolWarnPos from '../../../Config/Toggles/ToggleToolWarnPos';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import {
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
Beautify,
|
|
||||||
FormatTime,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
} from '../../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import { TooltipName } from '../../VariablesAndData';
|
import { TooltipName } from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
import {
|
import {
|
||||||
TooltipWrinkler,
|
TooltipWrinkler,
|
||||||
TooltipWrinklerArea,
|
TooltipWrinklerArea,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { FormatTime } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import FormatTime from '../../Disp/BeautifyAndFormatting/FormatTime';
|
||||||
|
|
||||||
import CalculateGrimoireRefillTime from '../../Disp/HelperFunctions/CalculateGrimoireRefillTime';
|
import CalculateGrimoireRefillTime from '../../Disp/HelperFunctions/CalculateGrimoireRefillTime';
|
||||||
import {
|
import {
|
||||||
BackupGrimoireDraw,
|
BackupGrimoireDraw,
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import jscolor from '@eastdesire/jscolor';
|
import jscolor from '@eastdesire/jscolor';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify';
|
||||||
Beautify as CMBeautify,
|
import FormatTime from '../../Disp/BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
|
||||||
} from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import { AddAuraInfo, AddDragonLevelUpTooltip } from '../../Disp/Dragon/Dragon';
|
import { AddAuraInfo, AddDragonLevelUpTooltip } from '../../Disp/Dragon/Dragon';
|
||||||
import AddMenu from '../../Disp/MenuSections/AddMenus';
|
import AddMenu from '../../Disp/MenuSections/AddMenus';
|
||||||
import UpdateTitle from '../../Disp/TabTitle/TabTitle';
|
import UpdateTitle from '../../Disp/TabTitle/TabTitle';
|
||||||
@@ -146,7 +144,7 @@ export default function ReplaceNative() {
|
|||||||
let title = 'Cookie Clicker';
|
let title = 'Cookie Clicker';
|
||||||
if (Game.season === 'fools') title = 'Cookie Baker';
|
if (Game.season === 'fools') title = 'Cookie Baker';
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${CMBeautify(Game.cookies)} ${
|
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${Beautify(Game.cookies)} ${
|
||||||
Game.cookies === 1 ? 'cookie' : 'cookies'
|
Game.cookies === 1 ? 'cookie' : 'cookies'
|
||||||
} - ${title}`;
|
} - ${title}`;
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
|
|||||||
11
test/Test_Disp/Test_BeautifyFormatting.js
Normal file
11
test/Test_Disp/Test_BeautifyFormatting.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/* global describe, it */
|
||||||
|
const { assert } = require('../../node_modules/chai/chai');
|
||||||
|
const {
|
||||||
|
FormatTime,
|
||||||
|
} = require('../../src/Disp/BeautifyAndFormatting/Beautify');
|
||||||
|
|
||||||
|
describe('FormatTime', function () {
|
||||||
|
it('should return -1 when the value is not present', function () {
|
||||||
|
assert.equal(FormatTime(1, 0), '1 s');
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user