@@ -1,6 +0,0 @@
|
|||||||
CookieMonster.js
|
|
||||||
CookieMonster.user.js
|
|
||||||
src/*.js
|
|
||||||
!src/CookieMonster.js
|
|
||||||
!src/*/*
|
|
||||||
dist/*
|
|
||||||
15
.eslintrc.js
15
.eslintrc.js
@@ -9,19 +9,26 @@ module.exports = {
|
|||||||
b64_to_utf8: 'readonly',
|
b64_to_utf8: 'readonly',
|
||||||
utf8_to_b64: 'readonly',
|
utf8_to_b64: 'readonly',
|
||||||
BeautifyAll: 'readonly',
|
BeautifyAll: 'readonly',
|
||||||
|
PlaySound: 'readonly',
|
||||||
},
|
},
|
||||||
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 12,
|
ecmaVersion: 12,
|
||||||
},
|
},
|
||||||
|
ignorePatterns: ['*CookieMonster*.js', 'dist/*', 'node_modules/*'],
|
||||||
rules: {
|
rules: {
|
||||||
'import/no-mutable-exports': 'off',
|
'import/no-mutable-exports': 'off',
|
||||||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
||||||
'no-new-func': 'off',
|
|
||||||
'func-names': 'off',
|
'func-names': 'off',
|
||||||
'no-console': 'off',
|
|
||||||
'no-alert': 'off',
|
|
||||||
'no-restricted-globals': 'off',
|
|
||||||
'prefer-destructuring': ['error', { object: true, array: false }],
|
'prefer-destructuring': ['error', { object: true, array: false }],
|
||||||
|
'max-len': [
|
||||||
|
1,
|
||||||
|
{
|
||||||
|
code: 100,
|
||||||
|
ignoreComments: true,
|
||||||
|
ignoreStrings: true,
|
||||||
|
ignoreTemplateLiterals: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "all",
|
"trailingComma": "all"
|
||||||
"printWidth": 80
|
|
||||||
}
|
}
|
||||||
|
|||||||
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
1873
package-lock.json
generated
1873
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cookiemonster-mod",
|
"name": "cookiemonster-mod",
|
||||||
"version": "2.031.6",
|
"version": "2.031.7",
|
||||||
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
||||||
"main": "CookieMonster.js",
|
"main": "CookieMonster.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ChoEggDiff,
|
ChoEggDiff,
|
||||||
@@ -50,6 +49,14 @@ export class CMAvgQueue {
|
|||||||
}
|
}
|
||||||
return ret / time;
|
return ret / time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
calcSum(timePeriod) {
|
||||||
|
let time = timePeriod;
|
||||||
|
if (time > this.maxLength) time = this.maxLength;
|
||||||
|
if (time > this.queue.length) time = this.queue.length;
|
||||||
|
if (time === 0) return 0;
|
||||||
|
return this.queue.slice(-time).reduce((a, b) => a + b, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -57,9 +64,9 @@ export class CMAvgQueue {
|
|||||||
* Called by CM.Cache.InitCache()
|
* Called by CM.Cache.InitCache()
|
||||||
*/
|
*/
|
||||||
export function InitCookiesDiff() {
|
export function InitCookiesDiff() {
|
||||||
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||||
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||||
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||||
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||||
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]);
|
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
@@ -41,7 +39,7 @@ export default function CacheAvgCPS() {
|
|||||||
if ((Game.T / Game.fps) % 1 === 0) {
|
if ((Game.T / Game.fps) % 1 === 0) {
|
||||||
let choEggTotal = Game.cookies + CacheSellForChoEgg;
|
let choEggTotal = Game.cookies + CacheSellForChoEgg;
|
||||||
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
|
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
|
||||||
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal); // eslint-disable-line no-unused-vars
|
||||||
choEggTotal *= 0.05;
|
choEggTotal *= 0.05;
|
||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
@@ -89,8 +87,9 @@ export default function CacheAvgCPS() {
|
|||||||
CacheAverageGainBank +
|
CacheAverageGainBank +
|
||||||
CacheAverageGainWrink +
|
CacheAverageGainWrink +
|
||||||
(choEgg ? CacheAverageGainChoEgg : 0);
|
(choEgg ? CacheAverageGainChoEgg : 0);
|
||||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
} else CacheAvgCPSWithChoEgg = CacheAverageCPS; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
CacheAverageClicks = ClicksDiff.calcAverage(
|
CacheAverageClicks = ClicksDiff.calcAverage(
|
||||||
ClickTimes[CMOptions.AvgClicksHist],
|
ClickTimes[CMOptions.AvgClicksHist],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheCurrWrinklerCount,
|
CacheCurrWrinklerCount,
|
||||||
@@ -23,8 +22,8 @@ export default function CacheCurrWrinklerCPS() {
|
|||||||
else if (godLvl === 2) godMult *= 1.1;
|
else if (godLvl === 2) godMult *= 1.1;
|
||||||
else if (godLvl === 3) godMult *= 1.05;
|
else if (godLvl === 3) godMult *= 1.05;
|
||||||
}
|
}
|
||||||
CacheCurrWrinklerCount = count;
|
CacheCurrWrinklerCount = count; // eslint-disable-line no-unused-vars
|
||||||
CacheCurrWrinklerCPSMult =
|
CacheCurrWrinklerCPSMult = // eslint-disable-line no-unused-vars
|
||||||
count *
|
count *
|
||||||
(count * 0.05 * 1.1) *
|
(count * 0.05 * 1.1) *
|
||||||
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc';
|
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc';
|
||||||
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -10,5 +9,5 @@ import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
|||||||
export default function CacheNoGoldSwitchCPS() {
|
export default function CacheNoGoldSwitchCPS() {
|
||||||
if (Game.Has('Golden switch [off]')) {
|
if (Game.Has('Golden switch [off]')) {
|
||||||
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
||||||
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
|
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg';
|
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg';
|
||||||
import { CacheSellForChoEgg } from '../VariablesAndData';
|
import { CacheSellForChoEgg } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -21,5 +20,5 @@ export default function CacheSellAllForChoEgg() {
|
|||||||
}
|
}
|
||||||
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
||||||
sellTotal += SellBuildingsForChoEgg();
|
sellTotal += SellBuildingsForChoEgg();
|
||||||
CacheSellForChoEgg = sellTotal;
|
CacheSellForChoEgg = sellTotal; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
import { ClickTimes } from '../Disp/VariablesAndData';
|
||||||
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
||||||
import CacheAvgCPS from './CPS/CPS';
|
import CacheAvgCPS from './CPS/CPS';
|
||||||
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
||||||
@@ -15,7 +15,10 @@ import {
|
|||||||
CacheGoldenAndWrathCookiesMults,
|
CacheGoldenAndWrathCookiesMults,
|
||||||
CacheStatsCookies,
|
CacheStatsCookies,
|
||||||
} from './Stats/Stats';
|
} from './Stats/Stats';
|
||||||
import { HeavenlyChipsDiff } from './VariablesAndData';
|
import {
|
||||||
|
CacheAverageCookiesFromClicks,
|
||||||
|
HeavenlyChipsDiff,
|
||||||
|
} from './VariablesAndData';
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,7 +33,11 @@ export default function InitCache() {
|
|||||||
CacheAllMissingUpgrades();
|
CacheAllMissingUpgrades();
|
||||||
CacheSeasonSpec();
|
CacheSeasonSpec();
|
||||||
InitCookiesDiff();
|
InitCookiesDiff();
|
||||||
HeavenlyChipsDiff = new CMAvgQueue(5); // Used by CM.Cache.CacheHeavenlyChipsPS()
|
/** Used by CM.Cache.CacheHeavenlyChipsPS() */
|
||||||
|
HeavenlyChipsDiff = new CMAvgQueue(5); // eslint-disable-line no-unused-vars
|
||||||
|
CacheAverageCookiesFromClicks = new CMAvgQueue( // eslint-disable-line no-unused-vars
|
||||||
|
ClickTimes[ClickTimes.length - 1] * 20,
|
||||||
|
);
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheIncome();
|
CacheIncome();
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { FormatTime } from '../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import { FormatTime } from '../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
||||||
import CacheAvgCPS from './CPS/CPS';
|
import CacheAvgCPS from './CPS/CPS';
|
||||||
@@ -27,5 +26,5 @@ export default function LoopCache() {
|
|||||||
1,
|
1,
|
||||||
) -
|
) -
|
||||||
(Game.cookiesEarned + Game.cookiesReset);
|
(Game.cookiesEarned + Game.cookiesReset);
|
||||||
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS()); // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData';
|
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the currently selected Dragon Auras
|
* This functions caches the currently selected Dragon Auras
|
||||||
*/
|
*/
|
||||||
export default function CacheDragonAuras() {
|
export default function CacheDragonAuras() {
|
||||||
CacheDragonAura = Game.dragonAura;
|
CacheDragonAura = Game.dragonAura; // eslint-disable-line no-unused-vars
|
||||||
CacheDragonAura2 = Game.dragonAura2;
|
CacheDragonAura2 = Game.dragonAura2; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
/** Functions related to the Dragon */
|
/** Functions related to the Dragon */
|
||||||
|
|
||||||
import { Beautify } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import { Beautify } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||||
@@ -6,8 +5,6 @@ import CopyData from '../../Sim/SimulationData/CopyData';
|
|||||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheCostDragonUpgrade,
|
CacheCostDragonUpgrade,
|
||||||
CacheDragonAura,
|
|
||||||
CacheDragonAura2,
|
|
||||||
CacheLastDragonLevel,
|
CacheLastDragonLevel,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -46,7 +43,7 @@ export default function CacheDragonCost() {
|
|||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount -= 1;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
}
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${cost}`;
|
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let cost = 0;
|
let cost = 0;
|
||||||
@@ -70,7 +67,7 @@ export default function CacheDragonCost() {
|
|||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount -= 1;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
}
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`; // eslint-disable-line no-unused-vars
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
|
||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColorGray } from '../../Disp/VariablesAndData';
|
import { ColourGray } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheMinPP,
|
CacheMinPP,
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
@@ -17,19 +15,20 @@ import ColourOfPP from './ColourOfPP';
|
|||||||
* It saves all date in CM.Cache.Objects...
|
* It saves all date in CM.Cache.Objects...
|
||||||
* It is called by CM.Cache.CacheBuildingsPP()
|
* It is called by CM.Cache.CacheBuildingsPP()
|
||||||
*/
|
*/
|
||||||
function CacheColor(target, amount) {
|
function CacheColour(target, amount) {
|
||||||
Object.keys(target).forEach((i) => {
|
Object.keys(target).forEach((i) => {
|
||||||
if (CMOptions.PPRigidelMode && amount === 1) {
|
if (CMOptions.PPRigidelMode && amount === 1) {
|
||||||
target[i].color = ColorGray;
|
target[i].color = ColourGray; // eslint-disable-line no-param-reassign
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
target[i].color = ColourOfPP(
|
target[i].color = ColourOfPP(
|
||||||
target[i],
|
target[i],
|
||||||
Game.Objects[i].getSumPrice(amount),
|
Game.Objects[i].getSumPrice(amount),
|
||||||
);
|
);
|
||||||
// Colour based on excluding certain top-buildings
|
// Colour based on excluding certain top-buildings
|
||||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
||||||
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColorGray;
|
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColourGray; // eslint-disable-line no-param-reassign
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -38,11 +37,11 @@ function CachePP(target, amount) {
|
|||||||
Object.keys(target).forEach((i) => {
|
Object.keys(target).forEach((i) => {
|
||||||
const price = Game.Objects[i].getSumPrice(amount);
|
const price = Game.Objects[i].getSumPrice(amount);
|
||||||
if (Game.cookiesPs) {
|
if (Game.cookiesPs) {
|
||||||
target[i].pp =
|
target[i].pp = // eslint-disable-line no-param-reassign
|
||||||
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||||
Game.cookiesPs +
|
Game.cookiesPs +
|
||||||
price / target[i].bonus;
|
price / target[i].bonus;
|
||||||
} else target[i].pp = price / target[i].bonus;
|
} else target[i].pp = price / target[i].bonus; // eslint-disable-line no-param-reassign
|
||||||
if (!(CMOptions.PPRigidelMode && amount === 1))
|
if (!(CMOptions.PPRigidelMode && amount === 1))
|
||||||
CachePPArray.push([target[i].pp, amount]);
|
CachePPArray.push([target[i].pp, amount]);
|
||||||
});
|
});
|
||||||
@@ -73,9 +72,9 @@ export default function CacheBuildingsPP() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin];
|
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin]; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
CacheColor(CacheObjects1, 1);
|
CacheColour(CacheObjects1, 1);
|
||||||
CacheColor(CacheObjects10, 10);
|
CacheColour(CacheObjects10, 10);
|
||||||
CacheColor(CacheObjects100, 100);
|
CacheColour(CacheObjects100, 100);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||||
import {
|
import {
|
||||||
ColorBlue,
|
ColourBlue,
|
||||||
ColorGray,
|
ColourGray,
|
||||||
ColorGreen,
|
ColourGreen,
|
||||||
ColorOrange,
|
ColourOrange,
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
ColorRed,
|
ColourRed,
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
} from '../../Disp/VariablesAndData';
|
} from '../../Disp/VariablesAndData';
|
||||||
import { CacheMinPP, CachePPArray } from '../VariablesAndData';
|
import { CacheMinPP, CachePPArray } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -21,22 +21,22 @@ import { CacheMinPP, CachePPArray } from '../VariablesAndData';
|
|||||||
export default function ColourOfPP(me, price) {
|
export default function ColourOfPP(me, price) {
|
||||||
let color = '';
|
let color = '';
|
||||||
// Colour based on PP
|
// Colour based on PP
|
||||||
if (me.pp <= 0 || me.pp === Infinity) color = ColorGray;
|
if (me.pp <= 0 || me.pp === Infinity) color = ColourGray;
|
||||||
else if (me.pp < CacheMinPP) color = ColorBlue;
|
else if (me.pp < CacheMinPP) color = ColourBlue;
|
||||||
else if (me.pp === CacheMinPP) color = ColorGreen;
|
else if (me.pp === CacheMinPP) color = ColourGreen;
|
||||||
else if (me.pp < CachePPArray[10][0]) color = ColorYellow;
|
else if (me.pp < CachePPArray[10][0]) color = ColourYellow;
|
||||||
else if (me.pp < CachePPArray[20][0]) color = ColorOrange;
|
else if (me.pp < CachePPArray[20][0]) color = ColourOrange;
|
||||||
else if (me.pp > CachePPArray[30][0]) color = ColorRed;
|
else if (me.pp < CachePPArray[30][0]) color = ColourRed;
|
||||||
else color = ColorPurple;
|
else color = ColourPurple;
|
||||||
|
|
||||||
// Colour based on price in terms of CPS
|
// Colour based on price in terms of CPS
|
||||||
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
||||||
if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit))
|
if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit))
|
||||||
color = ColorBlue;
|
color = ColourBlue;
|
||||||
}
|
}
|
||||||
// Colour based on being able to purchase
|
// Colour based on being able to purchase
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||||
if (price - Game.cookies > 0) color = ColorRed;
|
if (price - Game.cookies > 0) color = ColourRed;
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
/** Section: Functions related to caching income */
|
/** Section: Functions related to caching income */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
|
||||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||||
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
||||||
import {
|
import {
|
||||||
CacheAverageCPS,
|
|
||||||
CacheAverageGainBank,
|
CacheAverageGainBank,
|
||||||
CacheAverageGainWrink,
|
CacheAverageGainWrink,
|
||||||
CacheAverageGainWrinkFattest,
|
CacheAverageGainWrinkFattest,
|
||||||
@@ -30,7 +27,7 @@ function CacheBuildingIncome(amount) {
|
|||||||
result[i] = {};
|
result[i] = {};
|
||||||
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
||||||
if (amount !== 1) {
|
if (amount !== 1) {
|
||||||
CacheDoRemakeBuildPrices = 1;
|
CacheDoRemakeBuildPrices = 1; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||||
import {
|
import {
|
||||||
CacheChainFrenzyMaxReward,
|
CacheChainFrenzyMaxReward,
|
||||||
@@ -89,8 +88,8 @@ export function CacheChain() {
|
|||||||
maxPayout,
|
maxPayout,
|
||||||
CacheGoldenCookiesMult,
|
CacheGoldenCookiesMult,
|
||||||
);
|
);
|
||||||
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult; // eslint-disable-line no-unused-vars
|
||||||
CacheChainRequiredNext =
|
CacheChainRequiredNext = // eslint-disable-line no-unused-vars
|
||||||
CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
|
|
||||||
CacheChainWrathMaxReward = MaxChainCookieReward(
|
CacheChainWrathMaxReward = MaxChainCookieReward(
|
||||||
@@ -98,9 +97,9 @@ export function CacheChain() {
|
|||||||
maxPayout,
|
maxPayout,
|
||||||
CacheWrathCookiesMult,
|
CacheWrathCookiesMult,
|
||||||
);
|
);
|
||||||
CacheChainWrathRequired =
|
CacheChainWrathRequired = // eslint-disable-line no-unused-vars
|
||||||
(CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
(CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
CacheChainWrathRequiredNext =
|
CacheChainWrathRequiredNext = // eslint-disable-line no-unused-vars
|
||||||
CacheChainWrathMaxReward[2] /
|
CacheChainWrathMaxReward[2] /
|
||||||
60 /
|
60 /
|
||||||
60 /
|
60 /
|
||||||
@@ -112,9 +111,9 @@ export function CacheChain() {
|
|||||||
maxPayout * 7,
|
maxPayout * 7,
|
||||||
CacheGoldenCookiesMult,
|
CacheGoldenCookiesMult,
|
||||||
);
|
);
|
||||||
CacheChainFrenzyRequired =
|
CacheChainFrenzyRequired = // eslint-disable-line no-unused-vars
|
||||||
(CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
(CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
CacheChainFrenzyRequiredNext =
|
CacheChainFrenzyRequiredNext = // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyMaxReward[2] /
|
CacheChainFrenzyMaxReward[2] /
|
||||||
60 /
|
60 /
|
||||||
60 /
|
60 /
|
||||||
@@ -126,9 +125,9 @@ export function CacheChain() {
|
|||||||
maxPayout * 7,
|
maxPayout * 7,
|
||||||
CacheWrathCookiesMult,
|
CacheWrathCookiesMult,
|
||||||
);
|
);
|
||||||
CacheChainFrenzyWrathRequired =
|
CacheChainFrenzyWrathRequired = // eslint-disable-line no-unused-vars
|
||||||
(CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
(CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
CacheChainFrenzyWrathRequiredNext =
|
CacheChainFrenzyWrathRequiredNext = // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyWrathMaxReward[2] /
|
CacheChainFrenzyWrathMaxReward[2] /
|
||||||
60 /
|
60 /
|
||||||
60 /
|
60 /
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import {
|
import {
|
||||||
CacheHCPerSecond,
|
CacheHCPerSecond,
|
||||||
CacheLastHeavenlyCheck,
|
CacheLastHeavenlyCheck,
|
||||||
@@ -34,6 +33,6 @@ export default function CacheHeavenlyChipsPS() {
|
|||||||
CacheLastHeavenlyChips = ascendNowToGet;
|
CacheLastHeavenlyChips = ascendNowToGet;
|
||||||
|
|
||||||
// Get average gain over period of 5 seconds
|
// Get average gain over period of 5 seconds
|
||||||
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5);
|
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5); // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
|
||||||
import { crateMissing } from '../../Disp/MenuSections/CreateMissingUpgrades';
|
|
||||||
import {
|
import {
|
||||||
CacheMissingUpgrades,
|
CacheMissingUpgrades,
|
||||||
CacheMissingUpgradesCookies,
|
CacheMissingUpgradesCookies,
|
||||||
@@ -36,6 +35,7 @@ export default function CacheAllMissingUpgrades() {
|
|||||||
let str = '';
|
let str = '';
|
||||||
|
|
||||||
str += crateMissing(me);
|
str += crateMissing(me);
|
||||||
|
/* eslint-disable no-unused-vars */
|
||||||
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
|
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
|
||||||
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
|
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
|
||||||
else if (
|
else if (
|
||||||
@@ -44,6 +44,7 @@ export default function CacheAllMissingUpgrades() {
|
|||||||
me.pool !== 'debug'
|
me.pool !== 'debug'
|
||||||
)
|
)
|
||||||
CacheMissingUpgrades += str;
|
CacheMissingUpgrades += str;
|
||||||
|
/* eslint-enable no-unused-vars */
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { CacheSeaSpec } from '../VariablesAndData';
|
import { CacheSeaSpec } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,6 +11,6 @@ export default function CacheSeasonSpec() {
|
|||||||
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
||||||
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
||||||
CacheSeaSpec = Math.max(25, val);
|
CacheSeaSpec = Math.max(25, val);
|
||||||
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2;
|
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
/** Functions related to Caching stats */
|
/** Functions related to Caching stats */
|
||||||
|
|
||||||
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
||||||
@@ -29,15 +28,15 @@ export function CacheStatsCookies() {
|
|||||||
const cpsBuffMult = GetCPSBuffMult();
|
const cpsBuffMult = GetCPSBuffMult();
|
||||||
if (cpsBuffMult > 0) CacheLucky /= cpsBuffMult;
|
if (cpsBuffMult > 0) CacheLucky /= cpsBuffMult;
|
||||||
else CacheLucky = 0;
|
else CacheLucky = 0;
|
||||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyFrenzy = CacheLucky * 7;
|
CacheLuckyFrenzy = CacheLucky * 7;
|
||||||
CacheLuckyRewardFrenzy =
|
CacheLuckyRewardFrenzy = // eslint-disable-line no-unused-vars
|
||||||
CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheLuckyWrathRewardFrenzy =
|
CacheLuckyWrathRewardFrenzy = // eslint-disable-line no-unused-vars
|
||||||
CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheConjure = CacheLucky * 2;
|
CacheConjure = CacheLucky * 2;
|
||||||
CacheConjureReward = CacheConjure * 0.15;
|
CacheConjureReward = CacheConjure * 0.15; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
CacheEdifice = 0;
|
CacheEdifice = 0;
|
||||||
let max = 0;
|
let max = 0;
|
||||||
@@ -53,7 +52,7 @@ export function CacheStatsCookies() {
|
|||||||
Game.Objects[i].price * 2 > CacheEdifice
|
Game.Objects[i].price * 2 > CacheEdifice
|
||||||
) {
|
) {
|
||||||
CacheEdifice = Game.Objects[i].price * 2;
|
CacheEdifice = Game.Objects[i].price * 2;
|
||||||
CacheEdificeBuilding = i;
|
CacheEdificeBuilding = i; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export let CacheCurrWrinklerCount = 0;
|
|||||||
export let CacheUpgrades = {};
|
export let CacheUpgrades = {};
|
||||||
|
|
||||||
export let CacheAverageClicks = {};
|
export let CacheAverageClicks = {};
|
||||||
|
export let CacheAverageCookiesFromClicks;
|
||||||
|
|
||||||
export let CacheMissingUpgrades = {};
|
export let CacheMissingUpgrades = {};
|
||||||
export let CacheMissingUpgradesPrestige = {};
|
export let CacheMissingUpgradesPrestige = {};
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
/** Caches data related to Wrinklers */
|
/** Caches data related to Wrinklers */
|
||||||
|
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
@@ -32,9 +31,9 @@ export default function CacheWrinklers() {
|
|||||||
else if (godLvl === 2) sucked *= 1.1;
|
else if (godLvl === 2) sucked *= 1.1;
|
||||||
else if (godLvl === 3) sucked *= 1.05;
|
else if (godLvl === 3) sucked *= 1.05;
|
||||||
}
|
}
|
||||||
CacheWrinklersTotal += sucked;
|
CacheWrinklersTotal += sucked; // eslint-disable-line no-unused-vars
|
||||||
if (Game.wrinklers[i].type === 0) {
|
if (Game.wrinklers[i].type === 0) {
|
||||||
CacheWrinklersNormal += sucked;
|
CacheWrinklersNormal += sucked; // eslint-disable-line no-unused-vars
|
||||||
if (sucked > CacheWrinklersFattest[0])
|
if (sucked > CacheWrinklersFattest[0])
|
||||||
CacheWrinklersFattest = [sucked, i];
|
CacheWrinklersFattest = [sucked, i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function CheckNotificationPermissions(ToggleOnOff) {
|
|||||||
|
|
||||||
// Check if the browser supports notifications and which type
|
// Check if the browser supports notifications and which type
|
||||||
if (!('Notification' in window)) {
|
if (!('Notification' in window)) {
|
||||||
console.log('This browser does not support notifications.');
|
console.log('This browser does not support notifications.'); // eslint-disable-line no-console
|
||||||
} else if (checkNotificationPromise()) {
|
} else if (checkNotificationPromise()) {
|
||||||
Notification.requestPermission().then();
|
Notification.requestPermission().then();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import ConfigDefault from '../../Data/SettingsDefault';
|
|||||||
import ConfigData from '../../Data/SettingsData';
|
import ConfigData from '../../Data/SettingsData';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
import { CMOptions } from '../VariablesAndData';
|
||||||
import save from '../../InitSaveLoad/save';
|
import save from '../../InitSaveLoad/save';
|
||||||
import CMLoop from '../../Main/Loop';
|
import CMLoopHook from '../../Main/LoopHook';
|
||||||
|
import UpdateColours from '../../Disp/HelperFunctions/UpdateColours';
|
||||||
|
|
||||||
/** Functions related to saving, loading and restoring all settings */
|
/** Functions related to saving, loading and restoring all settings */
|
||||||
|
|
||||||
@@ -41,25 +42,19 @@ export function LoadConfig(settings) {
|
|||||||
if (settings !== undefined) {
|
if (settings !== undefined) {
|
||||||
CMOptions = settings;
|
CMOptions = settings;
|
||||||
|
|
||||||
|
if (typeof CMOptions.Colors !== 'undefined') {
|
||||||
|
delete CMOptions.Colors;
|
||||||
|
}
|
||||||
|
if (typeof CMOptions.Colours !== 'undefined') {
|
||||||
|
delete CMOptions.Colours;
|
||||||
|
}
|
||||||
|
|
||||||
// Check values
|
// Check values
|
||||||
let mod = false;
|
let mod = false;
|
||||||
Object.keys(ConfigDefault).forEach((i) => {
|
Object.keys(ConfigDefault).forEach((i) => {
|
||||||
if (typeof CMOptions[i] === 'undefined') {
|
if (typeof CMOptions[i] === 'undefined') {
|
||||||
mod = true;
|
mod = true;
|
||||||
CMOptions[i] = ConfigDefault[i];
|
CMOptions[i] = ConfigDefault[i];
|
||||||
} else if (i !== 'Header' && i !== 'Colors') {
|
|
||||||
if (i.indexOf('SoundURL') === -1) {
|
|
||||||
if (
|
|
||||||
!(CMOptions[i] > -1 && CMOptions[i] < ConfigData[i].label.length)
|
|
||||||
) {
|
|
||||||
mod = true;
|
|
||||||
CMOptions[i] = ConfigDefault[i];
|
|
||||||
}
|
|
||||||
} else if (typeof CMOptions[i] !== 'string') {
|
|
||||||
// Sound URLs
|
|
||||||
mod = true;
|
|
||||||
CMOptions[i] = ConfigDefault[i];
|
|
||||||
}
|
|
||||||
} else if (i === 'Header') {
|
} else if (i === 'Header') {
|
||||||
Object.keys(ConfigDefault.Header).forEach((j) => {
|
Object.keys(ConfigDefault.Header).forEach((j) => {
|
||||||
if (
|
if (
|
||||||
@@ -70,21 +65,10 @@ export function LoadConfig(settings) {
|
|||||||
CMOptions[i][j] = ConfigDefault[i][j];
|
CMOptions[i][j] = ConfigDefault[i][j];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// Colors
|
|
||||||
Object.keys(ConfigDefault.Colors).forEach((j) => {
|
|
||||||
if (
|
|
||||||
typeof CMOptions[i][j] === 'undefined' ||
|
|
||||||
typeof CMOptions[i][j] !== 'string'
|
|
||||||
) {
|
|
||||||
mod = true;
|
|
||||||
CMOptions[i][j] = ConfigDefault[i][j];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (mod) SaveConfig();
|
if (mod) SaveConfig();
|
||||||
CMLoop(); // Do loop once
|
CMLoopHook(); // Do loop once
|
||||||
Object.keys(ConfigDefault).forEach((i) => {
|
Object.keys(ConfigDefault).forEach((i) => {
|
||||||
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
||||||
ConfigData[i].func();
|
ConfigData[i].func();
|
||||||
@@ -94,4 +78,6 @@ export function LoadConfig(settings) {
|
|||||||
// Default values
|
// Default values
|
||||||
LoadConfig(ConfigDefault);
|
LoadConfig(ConfigDefault);
|
||||||
}
|
}
|
||||||
|
Game.UpdateMenu();
|
||||||
|
UpdateColours();
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/Config/Toggles/ToggleFavourites.js
Normal file
13
src/Config/Toggles/ToggleFavourites.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { FavouriteSettings } from '../../Disp/VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function toggles whether a setting is part of the favourites section in setting or not
|
||||||
|
* @param {string} config The name of the toggleable config option
|
||||||
|
*/
|
||||||
|
export default function ToggleFavouriteSetting(config) {
|
||||||
|
if (FavouriteSettings.includes(config))
|
||||||
|
FavouriteSettings = FavouriteSettings.filter(function (ele) {
|
||||||
|
return ele !== config;
|
||||||
|
});
|
||||||
|
else FavouriteSettings.push(config);
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-return-assign */
|
|
||||||
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
||||||
import { GCTimers } from '../../Disp/VariablesAndData';
|
import { GCTimers } from '../../Disp/VariablesAndData';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
import { CMOptions } from '../VariablesAndData';
|
||||||
@@ -15,6 +14,7 @@ export default function ToggleGCTimer() {
|
|||||||
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// eslint-disable-next-line no-return-assign
|
||||||
Object.keys(GCTimers).forEach((i) => (GCTimers[i].style.display = 'none'));
|
Object.keys(GCTimers).forEach((i) => (GCTimers[i].style.display = 'none'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
import { CMOptions } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
|
||||||
* Section: Functions related to the Upgrade Bar
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggles the upgrade bar and the colours of upgrades
|
* This function toggles the upgrade bar and the colours of upgrades
|
||||||
* It is called by a change in CM.Options.UpBarColor
|
* It is called by a change in CM.Options.UpBarColor
|
||||||
@@ -5,7 +5,7 @@ import { CMOptions } from '../VariablesAndData';
|
|||||||
* It is called by changes in CM.Options.WrinklerButtons
|
* It is called by changes in CM.Options.WrinklerButtons
|
||||||
*/
|
*/
|
||||||
export default function ToggleWrinklerButtons() {
|
export default function ToggleWrinklerButtons() {
|
||||||
if (CMOptions.WrinklerButtons) {
|
if (CMOptions.WrinklerButtons && Game.elderWrath) {
|
||||||
l('PopAllNormalWrinklerButton').style.display = '';
|
l('PopAllNormalWrinklerButton').style.display = '';
|
||||||
l('PopFattestWrinklerButton').style.display = '';
|
l('PopFattestWrinklerButton').style.display = '';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
/* eslint-disable prefer-const */
|
export let CMOptions = {}; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
export let CMOptions = {};
|
|
||||||
export const ConfigPrefix = 'CMConfig';
|
export const ConfigPrefix = 'CMConfig';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import init from './InitSaveLoad/init';
|
import init from './InitSaveLoad/init';
|
||||||
import load from './InitSaveLoad/load';
|
import load from './InitSaveLoad/load';
|
||||||
import save from './InitSaveLoad/save';
|
import save from './InitSaveLoad/save';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Data related directly to Cookie Monster */
|
/** Data related directly to Cookie Monster */
|
||||||
|
|
||||||
export const VersionMajor = '2.031';
|
export const VersionMajor = '2.031';
|
||||||
export const VersionMinor = '6';
|
export const VersionMinor = '7';
|
||||||
|
|
||||||
/** Information about Cookie Monster to be displayed in the info section */
|
/** Information about Cookie Monster to be displayed in the info section */
|
||||||
export const ModDescription = `<div class="listing">
|
export const ModDescription = `<div class="listing">
|
||||||
@@ -15,28 +15,25 @@ export const ModDescription = `<div class="listing">
|
|||||||
|
|
||||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||||
export const LatestReleaseNotes = `<div class="listing">
|
export const LatestReleaseNotes = `<div class="listing">
|
||||||
The latest update (v 2.031.6) has revamped the way PP is colourcoded. In the previous versions this was not always correct and we had some settings that made it even more incorrect. With this update Cookie Monster compares the PP of a building to all other possibilities (also buying 10 or 100) of a building and colors the PP accordingly.</br>
|
These are the release notes for the latest update (v 2.031.7).</br>
|
||||||
This means that if it is better to buy 10 of a building immediately rather than to buy in increments of 1 Cookie Monster will now show this! In this case the buy 1 option will be yellow, while the buy 10 option will be green.</br>
|
|
||||||
This also means that you will see some more diverse colors. Rather than coloring according to arbitrary "middle values" Cookie Monster now uses a top 10, 20 and 30. While this might take some getting used to we believe the new system is much better in conveying useful information to the user while also being more correct!</br>
|
|
||||||
</br>
|
</br>
|
||||||
This update also implements the following functions:</br>
|
This update implements the following functions:</br>
|
||||||
- Added a tooltip displaying the reward to the extra pop wrinkler buttons</br>
|
- Updated the ordering and description of all settings of Cookie Monster</br>
|
||||||
- Added tooltips to the Gods in the Pantheon</br>
|
- Colours of Flash notifications can now be set by the user</br>
|
||||||
- The tooltip for Elder Pledge now displays correctly, although it takes some time to load after Cookie Monster has been loaded</br>
|
- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section</br>
|
||||||
- You can now test the volume and sound of notifications in the settings screen</br>
|
- The statistics page now shows cookies earned by clicking for a selected time period</br>
|
||||||
- The bottom bar will now flicker less and each column has received a bit of padding</br>
|
- The statistics page can now show missing normal achievements, this can be toggled in the settings</br>
|
||||||
- Introduced new colour scheme for PP, see the explanation of colors in the Readme or the settings</br>
|
|
||||||
- Added option to show buttons that can hide the upgrade and building section</br>
|
|
||||||
- Added option to display PP as a time unit, note that these are only approximations. PP does not translate directly into time (the name is deceptive, we know...)</br>
|
|
||||||
- Statistics page now shows chance for random drops when they have not been achieved</br>
|
|
||||||
- In a later hotfix we have added a Rigidel mode that will colour all buy 1 options grey</br>
|
|
||||||
</br>
|
</br>
|
||||||
This update fixes the following bugs:</br>
|
This update fixes the following bugs:</br>
|
||||||
- Incorrect amount for "required for max plant reward" in statistics page</br>
|
- Fixed some typo's</br>
|
||||||
- Fixed the tooltips of the '?' buttons in the statistics page not showing</br>
|
- No longer show the wrinkler pop buttons when wrinklers can't spawn</br>
|
||||||
- Fixed some unclear settings descriptions </br>
|
- Fixed incorrect calculation of plant maturity for relevant tooltips</br>
|
||||||
</br>
|
- Fixed edit prompts not working in settings</br>
|
||||||
Please submit any bug reports or feature requests to the <a href="https://github.com/Aktanusa/CookieMonster">GitHub page!</a>
|
- Fixed red and purple being switched around for PP colour coding</br>
|
||||||
</br>
|
- Fixed incorrect notation of numbers in Dragon tooltip and interface</br>
|
||||||
|
- Fixed incorrect calculation of changing Dragon aura cost</br>
|
||||||
|
- Fixed incorrect calculation of changing Pantheon gods effect</br>
|
||||||
|
- Fixed fluctuating PP values when god Cyclius was selected</br>
|
||||||
|
- Fixed black flickering when Golden Cookies or buffs start</br>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
/** Display titles of the headers of the Cookie Monster settings section */
|
/** Display titles of the headers of the Cookie Monster settings section */
|
||||||
export const ConfigGroups = {
|
export const ConfigGroups = {
|
||||||
BarsColors: 'Bars/Colors',
|
Favourite: 'Favourite Settings',
|
||||||
Calculation: 'Calculation',
|
Calculation: 'Calculation',
|
||||||
Notification: 'Notification',
|
|
||||||
Tooltip: 'Tooltips and additional insights',
|
|
||||||
Statistics: 'Statistics',
|
|
||||||
Notation: 'Notation',
|
Notation: 'Notation',
|
||||||
|
Colours: 'Colours and colour coding',
|
||||||
|
BarsDisplay: 'Infobars and visual settings',
|
||||||
|
Tooltip: 'Tooltips',
|
||||||
|
Statistics: 'Statistics',
|
||||||
|
Notification: 'Notifications',
|
||||||
Miscellaneous: 'Miscellaneous',
|
Miscellaneous: 'Miscellaneous',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,9 @@ export class SettingStandard extends Setting {
|
|||||||
}
|
}
|
||||||
/** The colour picker setting class */
|
/** The colour picker setting class */
|
||||||
export class SettingColours extends Setting {
|
export class SettingColours extends Setting {
|
||||||
constructor(type, group, desc, func) {
|
constructor(type, group, desc) {
|
||||||
super(type, group);
|
super(type, group);
|
||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
this.func = func;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,63 +1,44 @@
|
|||||||
/** This array describes all default settings */
|
/** This array describes all default settings */
|
||||||
const ConfigDefault = {
|
const ConfigDefault = {
|
||||||
|
CPSMode: 1,
|
||||||
|
AvgCPSHist: 3,
|
||||||
|
AvgClicksHist: 0,
|
||||||
|
CalcWrink: 0,
|
||||||
|
Scale: 2,
|
||||||
|
ScaleDecimals: 2,
|
||||||
|
ScaleSeparator: 0,
|
||||||
|
ScaleCutoff: 999999,
|
||||||
|
TimeFormat: 0,
|
||||||
|
DetailedTime: 1,
|
||||||
|
PPDisplayTime: 0,
|
||||||
|
BuildColour: 1,
|
||||||
|
PPOnlyConsiderBuyable: 0,
|
||||||
|
PPExcludeTop: 0,
|
||||||
|
PPRigidelMode: 0,
|
||||||
|
PPSecondsLowerLimit: 0,
|
||||||
|
ColourBlue: '#4bb8f0',
|
||||||
|
ColourGreen: '#00ff00',
|
||||||
|
ColourYellow: '#ffff00',
|
||||||
|
ColourOrange: '#ff7f00',
|
||||||
|
ColourRed: '#ff0000',
|
||||||
|
ColourPurple: '#ff00ff',
|
||||||
|
ColourGray: '#b3b3b3',
|
||||||
|
ColourPink: '#ff1493',
|
||||||
|
ColourBrown: '#8b4513',
|
||||||
BotBar: 1,
|
BotBar: 1,
|
||||||
TimerBar: 1,
|
TimerBar: 1,
|
||||||
TimerBarPos: 0,
|
TimerBarPos: 0,
|
||||||
TimerBarOverlay: 2,
|
TimerBarOverlay: 2,
|
||||||
BuildColor: 1,
|
UpBarColour: 1,
|
||||||
PPDisplayTime: 0,
|
|
||||||
UpBarColor: 1,
|
|
||||||
UpgradeBarFixedPos: 1,
|
UpgradeBarFixedPos: 1,
|
||||||
CalcWrink: 0,
|
SortBuildings: 0,
|
||||||
CPSMode: 1,
|
SortUpgrades: 0,
|
||||||
AvgCPSHist: 3,
|
DragonAuraInfo: 1,
|
||||||
AvgClicksHist: 0,
|
GrimoireBar: 1,
|
||||||
PPExcludeTop: 0,
|
GCTimer: 1,
|
||||||
PPRigidelMode: 0,
|
Favicon: 1,
|
||||||
PPSecondsLowerLimit: 0,
|
WrinklerButtons: 1,
|
||||||
PPOnlyConsiderBuyable: 0,
|
HideSectionsButtons: 0,
|
||||||
ToolWarnBon: 1,
|
|
||||||
Title: 1,
|
|
||||||
GeneralSound: 1,
|
|
||||||
GCNotification: 0,
|
|
||||||
GCFlash: 1,
|
|
||||||
GCSound: 1,
|
|
||||||
GCVolume: 100,
|
|
||||||
GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
|
|
||||||
FortuneNotification: 0,
|
|
||||||
FortuneFlash: 1,
|
|
||||||
FortuneSound: 1,
|
|
||||||
FortuneVolume: 100,
|
|
||||||
FortuneSoundURL:
|
|
||||||
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
|
||||||
SeaNotification: 0,
|
|
||||||
SeaFlash: 1,
|
|
||||||
SeaSound: 1,
|
|
||||||
SeaVolume: 100,
|
|
||||||
SeaSoundURL:
|
|
||||||
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
|
||||||
GardFlash: 1,
|
|
||||||
GardSound: 1,
|
|
||||||
GardVolume: 100,
|
|
||||||
GardSoundURL: 'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
|
|
||||||
MagicNotification: 0,
|
|
||||||
MagicFlash: 1,
|
|
||||||
MagicSound: 1,
|
|
||||||
MagicVolume: 100,
|
|
||||||
MagicSoundURL:
|
|
||||||
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
|
||||||
WrinklerNotification: 0,
|
|
||||||
WrinklerFlash: 1,
|
|
||||||
WrinklerSound: 1,
|
|
||||||
WrinklerVolume: 100,
|
|
||||||
WrinklerSoundURL:
|
|
||||||
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
|
||||||
WrinklerMaxNotification: 0,
|
|
||||||
WrinklerMaxFlash: 1,
|
|
||||||
WrinklerMaxSound: 1,
|
|
||||||
WrinklerMaxVolume: 100,
|
|
||||||
WrinklerMaxSoundURL:
|
|
||||||
'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
|
||||||
TooltipBuildUpgrade: 1,
|
TooltipBuildUpgrade: 1,
|
||||||
TooltipAmor: 0,
|
TooltipAmor: 0,
|
||||||
ToolWarnLucky: 1,
|
ToolWarnLucky: 1,
|
||||||
@@ -66,47 +47,78 @@ const ConfigDefault = {
|
|||||||
ToolWarnConjureFrenzy: 1,
|
ToolWarnConjureFrenzy: 1,
|
||||||
ToolWarnEdifice: 1,
|
ToolWarnEdifice: 1,
|
||||||
ToolWarnUser: 0,
|
ToolWarnUser: 0,
|
||||||
|
ToolWarnBon: 1,
|
||||||
ToolWarnPos: 1,
|
ToolWarnPos: 1,
|
||||||
TooltipGrim: 1,
|
TooltipGrim: 1,
|
||||||
TooltipWrink: 1,
|
TooltipWrink: 1,
|
||||||
TooltipLump: 1,
|
TooltipLump: 1,
|
||||||
TooltipPlots: 1,
|
TooltipPlots: 1,
|
||||||
TooltipPantheon: 1,
|
TooltipPantheon: 1,
|
||||||
DragonAuraInfo: 1,
|
|
||||||
TooltipAscendButton: 1,
|
TooltipAscendButton: 1,
|
||||||
Stats: 1,
|
Stats: 1,
|
||||||
MissingUpgrades: 1,
|
MissingUpgrades: 1,
|
||||||
|
MissingAchievements: 0,
|
||||||
UpStats: 1,
|
UpStats: 1,
|
||||||
TimeFormat: 0,
|
|
||||||
DetailedTime: 1,
|
|
||||||
GrimoireBar: 1,
|
|
||||||
HeavenlyChipsTarget: 1,
|
HeavenlyChipsTarget: 1,
|
||||||
ShowMissedGC: 1,
|
ShowMissedGC: 1,
|
||||||
Scale: 2,
|
Title: 1,
|
||||||
ScaleDecimals: 2,
|
GeneralSound: 1,
|
||||||
ScaleSeparator: 0,
|
GCNotification: 0,
|
||||||
ScaleCutoff: 999999,
|
GCFlash: 1,
|
||||||
Colors: {
|
ColourGCFlash: '#ffffff',
|
||||||
Blue: '#4bb8f0',
|
GCSound: 1,
|
||||||
Green: '#00ff00',
|
GCVolume: 100,
|
||||||
Yellow: '#ffff00',
|
GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
|
||||||
Orange: '#ff7f00',
|
FortuneNotification: 0,
|
||||||
Red: '#ff0000',
|
FortuneFlash: 1,
|
||||||
Purple: '#ff00ff',
|
ColourFortuneFlash: '#ffffff',
|
||||||
Gray: '#b3b3b3',
|
FortuneSound: 1,
|
||||||
Pink: '#ff1493',
|
FortuneVolume: 100,
|
||||||
Brown: '#8b4513',
|
FortuneSoundURL:
|
||||||
},
|
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
||||||
SortBuildings: 0,
|
SeaNotification: 0,
|
||||||
SortUpgrades: 0,
|
SeaFlash: 1,
|
||||||
GCTimer: 1,
|
ColourSeaFlash: '#ffffff',
|
||||||
Favicon: 1,
|
SeaSound: 1,
|
||||||
WrinklerButtons: 1,
|
SeaVolume: 100,
|
||||||
HideSectionsButtons: 0,
|
SeaSoundURL:
|
||||||
|
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
||||||
|
GardFlash: 1,
|
||||||
|
ColourGardFlash: '#ffffff',
|
||||||
|
GardSound: 1,
|
||||||
|
GardVolume: 100,
|
||||||
|
GardSoundURL: 'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
|
||||||
|
MagicNotification: 0,
|
||||||
|
MagicFlash: 1,
|
||||||
|
ColourMagicFlash: '#ffffff',
|
||||||
|
MagicSound: 1,
|
||||||
|
MagicVolume: 100,
|
||||||
|
MagicSoundURL:
|
||||||
|
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
||||||
|
WrinklerNotification: 0,
|
||||||
|
WrinklerFlash: 1,
|
||||||
|
ColourWrinklerFlash: '#ffffff',
|
||||||
|
WrinklerSound: 1,
|
||||||
|
WrinklerVolume: 100,
|
||||||
|
WrinklerSoundURL:
|
||||||
|
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
||||||
|
WrinklerMaxNotification: 0,
|
||||||
|
WrinklerMaxFlash: 1,
|
||||||
|
ColourWrinklerMaxFlash: '#ffffff',
|
||||||
|
WrinklerMaxSound: 1,
|
||||||
|
WrinklerMaxVolume: 100,
|
||||||
|
WrinklerMaxSoundURL:
|
||||||
|
'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
||||||
BulkBuyBlock: 0,
|
BulkBuyBlock: 0,
|
||||||
|
FavouriteSettings: 1,
|
||||||
Header: {
|
Header: {
|
||||||
BarsColors: 1,
|
Favourite: 1,
|
||||||
Calculation: 1,
|
Calculation: 1,
|
||||||
|
Notation: 1,
|
||||||
|
Colours: 1,
|
||||||
|
BarsDisplay: 1,
|
||||||
|
Tooltip: 1,
|
||||||
|
Statistics: 1,
|
||||||
Notification: 1,
|
Notification: 1,
|
||||||
NotificationGeneral: 1,
|
NotificationGeneral: 1,
|
||||||
NotificationGC: 1,
|
NotificationGC: 1,
|
||||||
@@ -116,9 +128,6 @@ const ConfigDefault = {
|
|||||||
NotificationMagi: 1,
|
NotificationMagi: 1,
|
||||||
NotificationWrink: 1,
|
NotificationWrink: 1,
|
||||||
NotificationWrinkMax: 1,
|
NotificationWrinkMax: 1,
|
||||||
Tooltip: 1,
|
|
||||||
Statistics: 1,
|
|
||||||
Notation: 1,
|
|
||||||
Miscellaneous: 1,
|
Miscellaneous: 1,
|
||||||
Lucky: 1,
|
Lucky: 1,
|
||||||
Chain: 1,
|
Chain: 1,
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
/* eslint-disable no-nested-ternary */
|
|
||||||
/** General functions to format or beautify strings */
|
/** General functions to format or beautify strings */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales';
|
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales';
|
||||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ColorGreen,
|
ColourGreen,
|
||||||
ColorOrange,
|
ColourOrange,
|
||||||
ColorRed,
|
ColourRed,
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +29,9 @@ export function Beautify(num, floats, forced) {
|
|||||||
return BackupFunctions.Beautify(num, floats);
|
return BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
if (Number.isFinite(num)) {
|
if (Number.isFinite(num)) {
|
||||||
|
if (num < 0) {
|
||||||
|
return `-${Beautify(Math.abs(num))}`;
|
||||||
|
}
|
||||||
let answer = '';
|
let answer = '';
|
||||||
if (num === 0) {
|
if (num === 0) {
|
||||||
return num.toString();
|
return num.toString();
|
||||||
@@ -75,6 +77,7 @@ export function Beautify(num, floats, forced) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (answer === '') {
|
if (answer === '') {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(
|
console.log(
|
||||||
`Could not beautify number with Cookie Monster Beautify: ${num}`,
|
`Could not beautify number with Cookie Monster Beautify: ${num}`,
|
||||||
);
|
);
|
||||||
@@ -83,7 +86,7 @@ export function Beautify(num, floats, forced) {
|
|||||||
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,15 +119,15 @@ export function FormatTime(time, longFormat) {
|
|||||||
return longFormat ? 'Over 9000 days!' : '>9000d';
|
return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||||
str +=
|
str +=
|
||||||
y > 0
|
y > 0
|
||||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `
|
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
|
||||||
: '';
|
: '';
|
||||||
str +=
|
str +=
|
||||||
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : '';
|
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : ''; // eslint-disable-line no-nested-ternary
|
||||||
if (str.length > 0 || h > 0)
|
if (str.length > 0 || h > 0)
|
||||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
|
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
|
||||||
if (str.length > 0 || m > 0)
|
if (str.length > 0 || m > 0)
|
||||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
|
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
|
||||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@@ -134,18 +137,18 @@ export function FormatTime(time, longFormat) {
|
|||||||
* @param {number} time Time to be coloured
|
* @param {number} time Time to be coloured
|
||||||
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
||||||
*/
|
*/
|
||||||
export function GetTimeColor(time) {
|
export function GetTimeColour(time) {
|
||||||
let color;
|
let color;
|
||||||
let text;
|
let text;
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
||||||
else text = 'Done!';
|
else text = 'Done!';
|
||||||
color = ColorGreen;
|
color = ColourGreen;
|
||||||
} else {
|
} else {
|
||||||
text = FormatTime(time);
|
text = FormatTime(time);
|
||||||
if (time > 300) color = ColorRed;
|
if (time > 300) color = ColourRed;
|
||||||
else if (time > 60) color = ColorOrange;
|
else if (time > 60) color = ColourOrange;
|
||||||
else color = ColorYellow;
|
else color = ColourYellow;
|
||||||
}
|
}
|
||||||
return { text, color };
|
return { text, color };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-nested-ternary */
|
|
||||||
import {
|
import {
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
@@ -7,7 +6,7 @@ import {
|
|||||||
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/BeautifyFormatting';
|
||||||
import { Colors, LastTargetBuildings } from '../VariablesAndData';
|
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Section: Functions related to right column of the screen (buildings/upgrades)
|
* Section: Functions related to right column of the screen (buildings/upgrades)
|
||||||
@@ -15,8 +14,8 @@ import { Colors, LastTargetBuildings } from '../VariablesAndData';
|
|||||||
/**
|
/**
|
||||||
* This function adjusts some things in the column of buildings.
|
* This function adjusts some things in the column of buildings.
|
||||||
* It colours them, helps display the correct sell-price and shuffles the order when CM.Options.SortBuildings is set
|
* It colours them, helps display the correct sell-price and shuffles the order when CM.Options.SortBuildings is set
|
||||||
* The function is called by CM.Disp.Draw(), CM.Disp.UpdateColors() & CM.Disp.RefreshScale()
|
* The function is called by CM.Disp.Draw(), CM.Disp.UpdateColours() & CM.Disp.RefreshScale()
|
||||||
* And by changes in CM.Options.BuildColor, CM.Options.SortBuild & CM.Data.Config.BulkBuildColor
|
* And by changes in CM.Options.BuildColour, CM.Options.SortBuild & CM.Data.Config.BulkBuildColour
|
||||||
*/
|
*/
|
||||||
export default function UpdateBuildings() {
|
export default function UpdateBuildings() {
|
||||||
let target = Game.buyBulk;
|
let target = Game.buyBulk;
|
||||||
@@ -30,10 +29,10 @@ export default function UpdateBuildings() {
|
|||||||
else if (target === 100) target = CacheObjects100;
|
else if (target === 100) target = CacheObjects100;
|
||||||
|
|
||||||
if (Game.buyMode === 1) {
|
if (Game.buyMode === 1) {
|
||||||
if (CMOptions.BuildColor === 1) {
|
if (CMOptions.BuildColour === 1) {
|
||||||
Object.keys(target).forEach((i) => {
|
Object.keys(target).forEach((i) => {
|
||||||
l(`productPrice${Game.Objects[i].id}`).style.color =
|
l(`productPrice${Game.Objects[i].id}`).style.color =
|
||||||
CMOptions.Colors[target[i].color];
|
CMOptions[`Colour${target[i].color}`];
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Object.keys(Game.Objects).forEach((i) => {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
@@ -72,9 +71,10 @@ export default function UpdateBuildings() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
arr.sort(function (a, b) {
|
||||||
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
||||||
|
ColoursOrdering.indexOf(b.color)
|
||||||
? 1
|
? 1
|
||||||
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
? -1
|
? -1
|
||||||
: a.pp < b.pp
|
: a.pp < b.pp
|
||||||
? -1
|
? -1
|
||||||
@@ -89,9 +89,10 @@ export default function UpdateBuildings() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
arr.sort(function (a, b) {
|
||||||
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
||||||
|
ColoursOrdering.indexOf(b.color)
|
||||||
? 1
|
? 1
|
||||||
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
? -1
|
? -1
|
||||||
: a.pp < b.pp
|
: a.pp < b.pp
|
||||||
? -1
|
? -1
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
ColorBackPre,
|
ColourBackPre,
|
||||||
ColorBlue,
|
ColourBlue,
|
||||||
ColorGray,
|
ColourGray,
|
||||||
ColorGreen,
|
ColourGreen,
|
||||||
ColorOrange,
|
ColourOrange,
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
ColorRed,
|
ColourRed,
|
||||||
ColorTextPre,
|
ColourTextPre,
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,7 +28,7 @@ function CreateUpgradeBarLegend() {
|
|||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.style.verticalAlign = 'middle';
|
div.style.verticalAlign = 'middle';
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.className = ColorBackPre + color;
|
span.className = ColourBackPre + color;
|
||||||
span.style.display = 'inline-block';
|
span.style.display = 'inline-block';
|
||||||
span.style.height = '10px';
|
span.style.height = '10px';
|
||||||
span.style.width = '10px';
|
span.style.width = '10px';
|
||||||
@@ -39,24 +39,24 @@ function CreateUpgradeBarLegend() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
legend.appendChild(
|
legend.appendChild(
|
||||||
legendLine(ColorBlue, 'Better than the best PP of a building option'),
|
legendLine(ColourBlue, 'Better than the best PP of a building option'),
|
||||||
);
|
);
|
||||||
legend.appendChild(
|
legend.appendChild(
|
||||||
legendLine(ColorGreen, 'Same as the best PP building option'),
|
legendLine(ColourGreen, 'Same as the best PP building option'),
|
||||||
);
|
);
|
||||||
legend.appendChild(
|
legend.appendChild(
|
||||||
legendLine(ColorYellow, 'Within the top 10 of PP for buildings'),
|
legendLine(ColourYellow, 'Within the top 10 of PP for buildings'),
|
||||||
);
|
);
|
||||||
legend.appendChild(
|
legend.appendChild(
|
||||||
legendLine(ColorOrange, 'Within the top 20 of PP for buildings'),
|
legendLine(ColourOrange, 'Within the top 20 of PP for buildings'),
|
||||||
);
|
);
|
||||||
legend.appendChild(
|
legend.appendChild(
|
||||||
legendLine(ColorRed, 'Within the top 30 of PP for buildings'),
|
legendLine(ColourRed, 'Within the top 30 of PP for buildings'),
|
||||||
);
|
);
|
||||||
legend.appendChild(
|
legend.appendChild(
|
||||||
legendLine(ColorPurple, 'Outside of the top 30 of PP for buildings'),
|
legendLine(ColourPurple, 'Outside of the top 30 of PP for buildings'),
|
||||||
);
|
);
|
||||||
legend.appendChild(legendLine(ColorGray, 'Negative or infinity PP'));
|
legend.appendChild(legendLine(ColourGray, 'Negative or infinity PP'));
|
||||||
return legend;
|
return legend;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ export default function CreateUpgradeBar() {
|
|||||||
const UpgradeBar = document.createElement('div');
|
const UpgradeBar = document.createElement('div');
|
||||||
UpgradeBar.id = 'CMUpgradeBar';
|
UpgradeBar.id = 'CMUpgradeBar';
|
||||||
UpgradeBar.style.width = '100%';
|
UpgradeBar.style.width = '100%';
|
||||||
UpgradeBar.style.backgroundColor = 'black';
|
UpgradeBar.style.backgroundColour = 'black';
|
||||||
UpgradeBar.style.textAlign = 'center';
|
UpgradeBar.style.textAlign = 'center';
|
||||||
UpgradeBar.style.fontWeight = 'bold';
|
UpgradeBar.style.fontWeight = 'bold';
|
||||||
UpgradeBar.style.display = 'none';
|
UpgradeBar.style.display = 'none';
|
||||||
@@ -85,19 +85,19 @@ export default function CreateUpgradeBar() {
|
|||||||
const upgradeNumber = function (id, color) {
|
const upgradeNumber = function (id, color) {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.id = id;
|
span.id = id;
|
||||||
span.className = ColorTextPre + color;
|
span.className = ColourTextPre + color;
|
||||||
span.style.width = '14.28571428571429%';
|
span.style.width = '14.28571428571429%';
|
||||||
span.style.display = 'inline-block';
|
span.style.display = 'inline-block';
|
||||||
span.textContent = '0';
|
span.textContent = '0';
|
||||||
return span;
|
return span;
|
||||||
};
|
};
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarBlue', ColorBlue));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarBlue', ColourBlue));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGreen', ColorGreen));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGreen', ColourGreen));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarYellow', ColorYellow));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarYellow', ColourYellow));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarOrange', ColorOrange));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarOrange', ColourOrange));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarRed', ColorRed));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarRed', ColourRed));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColorPurple));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColourPurple));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGray', ColorGray));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGray', ColourGray));
|
||||||
|
|
||||||
l('upgrades').parentNode.insertBefore(
|
l('upgrades').parentNode.insertBefore(
|
||||||
UpgradeBar,
|
UpgradeBar,
|
||||||
|
|||||||
@@ -1,27 +1,26 @@
|
|||||||
/* eslint-disable no-nested-ternary */
|
|
||||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ColorBackPre,
|
ColourBackPre,
|
||||||
ColorBlue,
|
ColourBlue,
|
||||||
ColorGray,
|
ColourGray,
|
||||||
ColorGreen,
|
ColourGreen,
|
||||||
ColorOrange,
|
ColourOrange,
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
ColorRed,
|
ColourRed,
|
||||||
Colors,
|
ColoursOrdering,
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function adjusts some things in the upgrades section
|
* This function adjusts some things in the upgrades section
|
||||||
* It colours them and shuffles the order when CM.Options.SortBuildings is set
|
* It colours them and shuffles the order when CM.Options.SortBuildings is set
|
||||||
* The function is called by CM.Disp.Draw(), CM.Disp.ToggleUpgradeBarAndColor & CM.Disp.RefreshScale()
|
* The function is called by CM.Disp.Draw(), CM.Disp.ToggleUpgradeBarAndColour & CM.Disp.RefreshScale()
|
||||||
* And by changes in CM.Options.SortUpgrades
|
* And by changes in CM.Options.SortUpgrades
|
||||||
*/
|
*/
|
||||||
export default function UpdateUpgrades() {
|
export default function UpdateUpgrades() {
|
||||||
// This counts the amount of upgrades for each pp group and updates the Upgrade Bar
|
// This counts the amount of upgrades for each pp group and updates the Upgrade Bar
|
||||||
if (CMOptions.UpBarColor > 0) {
|
if (CMOptions.UpBarColour > 0) {
|
||||||
let blue = 0;
|
let blue = 0;
|
||||||
let green = 0;
|
let green = 0;
|
||||||
let yellow = 0;
|
let yellow = 0;
|
||||||
@@ -32,31 +31,31 @@ export default function UpdateUpgrades() {
|
|||||||
|
|
||||||
Object.keys(Game.UpgradesInStore).forEach((i) => {
|
Object.keys(Game.UpgradesInStore).forEach((i) => {
|
||||||
const me = Game.UpgradesInStore[i];
|
const me = Game.UpgradesInStore[i];
|
||||||
let addedColor = false;
|
let addedColour = false;
|
||||||
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 1) {
|
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 1) {
|
||||||
if (
|
if (
|
||||||
l(`upgrade${i}`).childNodes[j].className.indexOf(ColorBackPre) !== -1
|
l(`upgrade${i}`).childNodes[j].className.indexOf(ColourBackPre) !== -1
|
||||||
) {
|
) {
|
||||||
l(`upgrade${i}`).childNodes[j].className =
|
l(`upgrade${i}`).childNodes[j].className =
|
||||||
ColorBackPre + CacheUpgrades[me.name].color;
|
ColourBackPre + CacheUpgrades[me.name].color;
|
||||||
addedColor = true;
|
addedColour = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!addedColor) {
|
if (!addedColour) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.style.width = '10px';
|
div.style.width = '10px';
|
||||||
div.style.height = '10px';
|
div.style.height = '10px';
|
||||||
div.className = ColorBackPre + CacheUpgrades[me.name].color;
|
div.className = ColourBackPre + CacheUpgrades[me.name].color;
|
||||||
l(`upgrade${i}`).appendChild(div);
|
l(`upgrade${i}`).appendChild(div);
|
||||||
}
|
}
|
||||||
if (CacheUpgrades[me.name].color === ColorBlue) blue += 1;
|
if (CacheUpgrades[me.name].color === ColourBlue) blue += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorGreen) green += 1;
|
else if (CacheUpgrades[me.name].color === ColourGreen) green += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorYellow) yellow += 1;
|
else if (CacheUpgrades[me.name].color === ColourYellow) yellow += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorOrange) orange += 1;
|
else if (CacheUpgrades[me.name].color === ColourOrange) orange += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorRed) red += 1;
|
else if (CacheUpgrades[me.name].color === ColourRed) red += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorPurple) purple += 1;
|
else if (CacheUpgrades[me.name].color === ColourPurple) purple += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorGray) gray += 1;
|
else if (CacheUpgrades[me.name].color === ColourGray) gray += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
l('CMUpgradeBarBlue').textContent = blue;
|
l('CMUpgradeBarBlue').textContent = blue;
|
||||||
@@ -81,9 +80,9 @@ export default function UpdateUpgrades() {
|
|||||||
|
|
||||||
if (CMOptions.SortUpgrades) {
|
if (CMOptions.SortUpgrades) {
|
||||||
arr.sort(function (a, b) {
|
arr.sort(function (a, b) {
|
||||||
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
return ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
? 1
|
? 1
|
||||||
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
? -1
|
? -1
|
||||||
: a.pp < b.pp
|
: a.pp < b.pp
|
||||||
? -1
|
? -1
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function AddAuraInfo(aura) {
|
|||||||
const timeToRecover = FormatTime(
|
const timeToRecover = FormatTime(
|
||||||
priceOfChange / (bonusCPS + Game.cookiesPs),
|
priceOfChange / (bonusCPS + Game.cookiesPs),
|
||||||
);
|
);
|
||||||
const bonusCPSPercentage = Beautify(bonusCPS / Game.cookiesPs);
|
const bonusCPSPercentage = Beautify((bonusCPS / Game.cookiesPs) * 100);
|
||||||
|
|
||||||
l('dragonAuraInfo').style.minHeight = '60px';
|
l('dragonAuraInfo').style.minHeight = '60px';
|
||||||
l('dragonAuraInfo').style.margin = '8px';
|
l('dragonAuraInfo').style.margin = '8px';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
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/BeautifyFormatting';
|
||||||
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
||||||
@@ -15,7 +16,7 @@ import {
|
|||||||
* This function handles all custom drawing for the Game.Draw() function.
|
* This function handles all custom drawing for the Game.Draw() function.
|
||||||
* It is hooked on 'draw' by CM.RegisterHooks()
|
* It is hooked on 'draw' by CM.RegisterHooks()
|
||||||
*/
|
*/
|
||||||
export default function Draw() {
|
export default function CMDrawHook() {
|
||||||
// Draw autosave timer in stats menu, this must be done here to make it count down correctly
|
// Draw autosave timer in stats menu, this must be done here to make it count down correctly
|
||||||
if (
|
if (
|
||||||
Game.prefs.autosave &&
|
Game.prefs.autosave &&
|
||||||
@@ -52,6 +53,9 @@ export default function Draw() {
|
|||||||
// Change menu refresh interval
|
// Change menu refresh interval
|
||||||
RefreshMenu();
|
RefreshMenu();
|
||||||
|
|
||||||
|
// Update display of wrinkler buttons, this checks if Elder Pledge has been bought and if they should be disabled
|
||||||
|
ToggleWrinklerButtons();
|
||||||
|
|
||||||
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
||||||
if (CMOptions.Scale) {
|
if (CMOptions.Scale) {
|
||||||
let str = l('cookies').innerHTML.replace(
|
let str = l('cookies').innerHTML.replace(
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
|
||||||
/** Section: Functions related to the Golden Cookie Timers */
|
/** Section: Functions related to the Golden Cookie Timers */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
@@ -28,14 +27,14 @@ export default function CreateGCTimer(cookie) {
|
|||||||
cookie.pop();
|
cookie.pop();
|
||||||
};
|
};
|
||||||
GCTimer.onmouseover = function () {
|
GCTimer.onmouseover = function () {
|
||||||
cookie.l.style.filter =
|
cookie.l.style.filter = // eslint-disable-line no-param-reassign
|
||||||
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
||||||
cookie.l.style.webkitFilter =
|
cookie.l.style.webkitFilter = // eslint-disable-line no-param-reassign
|
||||||
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
||||||
};
|
};
|
||||||
GCTimer.onmouseout = function () {
|
GCTimer.onmouseout = function () {
|
||||||
cookie.l.style.filter = '';
|
cookie.l.style.filter = ''; // eslint-disable-line no-param-reassign
|
||||||
cookie.l.style.webkitFilter = '';
|
cookie.l.style.webkitFilter = ''; // eslint-disable-line no-param-reassign
|
||||||
};
|
};
|
||||||
|
|
||||||
GCTimers[cookie.id] = GCTimer;
|
GCTimers[cookie.id] = GCTimer;
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
import {
|
|
||||||
ColorGray,
|
|
||||||
ColorGreen,
|
|
||||||
ColorOrange,
|
|
||||||
ColorPurple,
|
|
||||||
ColorRed,
|
|
||||||
ColorYellow,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns Name and Color as object for sugar lump type that is given as input param.
|
|
||||||
* It is called by CM.Disp.UpdateTooltipSugarLump()
|
|
||||||
* @param {string} type Sugar Lump Type.
|
|
||||||
* @returns {{string}, {string}} text, color An array containing the text and display-color of the sugar lump
|
|
||||||
*/
|
|
||||||
export default function GetLumpColor(type) {
|
|
||||||
if (type === 0) {
|
|
||||||
return { text: 'Normal', color: ColorGray };
|
|
||||||
}
|
|
||||||
if (type === 1) {
|
|
||||||
return { text: 'Bifurcated', color: ColorGreen };
|
|
||||||
}
|
|
||||||
if (type === 2) {
|
|
||||||
return { text: 'Golden', color: ColorYellow };
|
|
||||||
}
|
|
||||||
if (type === 3) {
|
|
||||||
return { text: 'Meaty', color: ColorOrange };
|
|
||||||
}
|
|
||||||
if (type === 4) {
|
|
||||||
return { text: 'Caramelized', color: ColorPurple };
|
|
||||||
}
|
|
||||||
return { text: 'Unknown Sugar Lump', color: ColorRed };
|
|
||||||
}
|
|
||||||
33
src/Disp/HelperFunctions/GetLumpColour.js
Normal file
33
src/Disp/HelperFunctions/GetLumpColour.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import {
|
||||||
|
ColourGray,
|
||||||
|
ColourGreen,
|
||||||
|
ColourOrange,
|
||||||
|
ColourPurple,
|
||||||
|
ColourRed,
|
||||||
|
ColourYellow,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns Name and Colour as object for sugar lump type that is given as input param.
|
||||||
|
* It is called by CM.Disp.UpdateTooltipSugarLump()
|
||||||
|
* @param {string} type Sugar Lump Type.
|
||||||
|
* @returns {{string}, {string}} text, color An array containing the text and display-color of the sugar lump
|
||||||
|
*/
|
||||||
|
export default function GetLumpColour(type) {
|
||||||
|
if (type === 0) {
|
||||||
|
return { text: 'Normal', color: ColourGray };
|
||||||
|
}
|
||||||
|
if (type === 1) {
|
||||||
|
return { text: 'Bifurcated', color: ColourGreen };
|
||||||
|
}
|
||||||
|
if (type === 2) {
|
||||||
|
return { text: 'Golden', color: ColourYellow };
|
||||||
|
}
|
||||||
|
if (type === 3) {
|
||||||
|
return { text: 'Meaty', color: ColourOrange };
|
||||||
|
}
|
||||||
|
if (type === 4) {
|
||||||
|
return { text: 'Caramelized', color: ColourPurple };
|
||||||
|
}
|
||||||
|
return { text: 'Unknown Sugar Lump', color: ColourRed };
|
||||||
|
}
|
||||||
@@ -11,4 +11,5 @@ export default function UpdateBackground() {
|
|||||||
Game.LeftBackground.canvas.parentNode.offsetWidth;
|
Game.LeftBackground.canvas.parentNode.offsetWidth;
|
||||||
Game.LeftBackground.canvas.height =
|
Game.LeftBackground.canvas.height =
|
||||||
Game.LeftBackground.canvas.parentNode.offsetHeight;
|
Game.LeftBackground.canvas.parentNode.offsetHeight;
|
||||||
|
Game.DrawBackground();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
|
||||||
import {
|
|
||||||
ColorBackPre,
|
|
||||||
ColorBorderPre,
|
|
||||||
Colors,
|
|
||||||
ColorTextPre,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function changes/refreshes colours if the user has set new standard colours
|
|
||||||
* The function is therefore called by a change in CM.Options.Colors
|
|
||||||
*/
|
|
||||||
export default function UpdateColors() {
|
|
||||||
let str = '';
|
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
|
||||||
str += `.${ColorTextPre}${Colors[i]} { color: ${
|
|
||||||
CMOptions.Colors[Colors[i]]
|
|
||||||
}; }\n`;
|
|
||||||
}
|
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
|
||||||
str += `.${ColorBackPre}${Colors[i]} { background-color: ${
|
|
||||||
CMOptions.Colors[Colors[i]]
|
|
||||||
}; }\n`;
|
|
||||||
}
|
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
|
||||||
str += `.${ColorBorderPre}${Colors[i]} { border: 1px solid ${
|
|
||||||
CMOptions.Colors[Colors[i]]
|
|
||||||
}; }\n`;
|
|
||||||
}
|
|
||||||
l('CMCSS').textContent = str;
|
|
||||||
UpdateBuildings(); // Class has been already set
|
|
||||||
}
|
|
||||||
33
src/Disp/HelperFunctions/UpdateColours.js
Normal file
33
src/Disp/HelperFunctions/UpdateColours.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
||||||
|
import {
|
||||||
|
ColourBackPre,
|
||||||
|
ColourBorderPre,
|
||||||
|
ColoursOrdering,
|
||||||
|
ColourTextPre,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function changes/refreshes colours if the user has set new standard colours
|
||||||
|
* The function is therefore called by a change in CM.Options.Colours
|
||||||
|
*/
|
||||||
|
export default function UpdateColours() {
|
||||||
|
let str = '';
|
||||||
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
|
str += `.${ColourTextPre}${ColoursOrdering[i]} { color: ${
|
||||||
|
CMOptions[`Colour${ColoursOrdering[i]}`]
|
||||||
|
}; }\n`;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
|
str += `.${ColourBackPre}${ColoursOrdering[i]} { background-color: ${
|
||||||
|
CMOptions[`Colour${ColoursOrdering[i]}`]
|
||||||
|
}; }\n`;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
|
str += `.${ColourBorderPre}${ColoursOrdering[i]} { border: 1px solid ${
|
||||||
|
CMOptions[`Colour${ColoursOrdering[i]}`]
|
||||||
|
}; }\n`;
|
||||||
|
}
|
||||||
|
l('CMCSS').textContent = str;
|
||||||
|
UpdateBuildings(); // Class has been already set
|
||||||
|
}
|
||||||
@@ -10,14 +10,14 @@ import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
|||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
FormatTime,
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColour,
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
} 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 {
|
||||||
ColorBlue,
|
ColourBlue,
|
||||||
ColorTextPre,
|
ColourTextPre,
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
LastTargetBotBar,
|
LastTargetBotBar,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
||||||
@@ -32,7 +32,7 @@ export function CreateBotBar() {
|
|||||||
BotBar.style.width = '100%';
|
BotBar.style.width = '100%';
|
||||||
BotBar.style.position = 'absolute';
|
BotBar.style.position = 'absolute';
|
||||||
BotBar.style.display = 'none';
|
BotBar.style.display = 'none';
|
||||||
BotBar.style.backgroundColor = '#262224';
|
BotBar.style.backgroundColour = '#262224';
|
||||||
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
|
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
|
||||||
BotBar.style.borderTop = '1px solid black';
|
BotBar.style.borderTop = '1px solid black';
|
||||||
BotBar.style.overflow = 'auto';
|
BotBar.style.overflow = 'auto';
|
||||||
@@ -48,19 +48,21 @@ export function CreateBotBar() {
|
|||||||
const firstCol = function (text, color) {
|
const firstCol = function (text, color) {
|
||||||
const td = document.createElement('td');
|
const td = document.createElement('td');
|
||||||
td.style.textAlign = 'right';
|
td.style.textAlign = 'right';
|
||||||
td.className = ColorTextPre + color;
|
td.className = ColourTextPre + color;
|
||||||
td.textContent = text;
|
td.textContent = text;
|
||||||
return td;
|
return td;
|
||||||
};
|
};
|
||||||
const type = tbody.appendChild(document.createElement('tr'));
|
const type = tbody.appendChild(document.createElement('tr'));
|
||||||
type.style.fontWeight = 'bold';
|
type.style.fontWeight = 'bold';
|
||||||
type.appendChild(firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColorYellow));
|
type.appendChild(
|
||||||
|
firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColourYellow),
|
||||||
|
);
|
||||||
const bonus = tbody.appendChild(document.createElement('tr'));
|
const bonus = tbody.appendChild(document.createElement('tr'));
|
||||||
bonus.appendChild(firstCol('Bonus Income', ColorBlue));
|
bonus.appendChild(firstCol('Bonus Income', ColourBlue));
|
||||||
const pp = tbody.appendChild(document.createElement('tr'));
|
const pp = tbody.appendChild(document.createElement('tr'));
|
||||||
pp.appendChild(firstCol('Payback Period', ColorBlue));
|
pp.appendChild(firstCol('Payback Period', ColourBlue));
|
||||||
const time = tbody.appendChild(document.createElement('tr'));
|
const time = tbody.appendChild(document.createElement('tr'));
|
||||||
time.appendChild(firstCol('Time Left', ColorBlue));
|
time.appendChild(firstCol('Time Left', ColourBlue));
|
||||||
|
|
||||||
l('wrapper').appendChild(BotBar);
|
l('wrapper').appendChild(BotBar);
|
||||||
|
|
||||||
@@ -94,7 +96,7 @@ export function UpdateBotBar() {
|
|||||||
].textContent = Beautify(target[i].bonus, 2);
|
].textContent = Beautify(target[i].bonus, 2);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
count
|
count
|
||||||
].className = ColorTextPre + target[i].color;
|
].className = ColourTextPre + target[i].color;
|
||||||
let PPString;
|
let PPString;
|
||||||
if (CMOptions.PPDisplayTime)
|
if (CMOptions.PPDisplayTime)
|
||||||
PPString = FormatTime(Math.round(target[i].pp));
|
PPString = FormatTime(Math.round(target[i].pp));
|
||||||
@@ -102,24 +104,24 @@ export function UpdateBotBar() {
|
|||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
count
|
count
|
||||||
].textContent = PPString;
|
].textContent = PPString;
|
||||||
const timeColor = GetTimeColor(
|
const timeColour = GetTimeColour(
|
||||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
||||||
GetCPS(),
|
GetCPS(),
|
||||||
);
|
);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
count
|
count
|
||||||
].className = ColorTextPre + timeColor.color;
|
].className = ColourTextPre + timeColour.color;
|
||||||
if (
|
if (
|
||||||
timeColor.text === 'Done!' &&
|
timeColour.text === 'Done!' &&
|
||||||
Game.cookies < Game.Objects[i].bulkPrice
|
Game.cookies < Game.Objects[i].bulkPrice
|
||||||
) {
|
) {
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
count
|
count
|
||||||
].textContent = `${timeColor.text} (with Wrink)`;
|
].textContent = `${timeColour.text} (with Wrink)`;
|
||||||
} else
|
} else
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
count
|
count
|
||||||
].textContent = timeColor.text;
|
].textContent = timeColour.text;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/** Functions to create various DOM elements used by the Bars */
|
/** Functions to create various DOM elements used by the Bars */
|
||||||
|
|
||||||
import { ColorBackPre, ColorBlue, ColorTextPre } from '../VariablesAndData';
|
import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates an indivudual timer for the timer bar
|
* This function creates an indivudual timer for the timer bar
|
||||||
@@ -47,7 +47,7 @@ export function CreateTimer(id, name, bars) {
|
|||||||
colorBar.style.borderBottomRightRadius = '10px';
|
colorBar.style.borderBottomRightRadius = '10px';
|
||||||
}
|
}
|
||||||
if (typeof bars[i].color !== 'undefined') {
|
if (typeof bars[i].color !== 'undefined') {
|
||||||
colorBar.className = ColorBackPre + bars[i].color;
|
colorBar.className = ColourBackPre + bars[i].color;
|
||||||
}
|
}
|
||||||
div.appendChild(colorBar);
|
div.appendChild(colorBar);
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ export function CreateBotBarBuildingColumn(buildingName) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const span = header.appendChild(document.createElement('span'));
|
const span = header.appendChild(document.createElement('span'));
|
||||||
span.className = ColorTextPre + ColorBlue;
|
span.className = ColourTextPre + ColourBlue;
|
||||||
|
|
||||||
header.appendChild(document.createTextNode(')'));
|
header.appendChild(document.createTextNode(')'));
|
||||||
type.lastChild.style.paddingLeft = '8px';
|
type.lastChild.style.paddingLeft = '8px';
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
|
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
BuffColors,
|
BuffColours,
|
||||||
ColorBackPre,
|
ColourBackPre,
|
||||||
ColorGray,
|
ColourGray,
|
||||||
ColorOrange,
|
ColourOrange,
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
LastNumberOfTimers,
|
LastNumberOfTimers,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
import { CreateTimer } from './CreateDOMElements';
|
import { CreateTimer } from './CreateDOMElements';
|
||||||
@@ -23,19 +23,19 @@ export function CreateTimerBar() {
|
|||||||
TimerBar.style.height = '0px';
|
TimerBar.style.height = '0px';
|
||||||
TimerBar.style.fontSize = '10px';
|
TimerBar.style.fontSize = '10px';
|
||||||
TimerBar.style.fontWeight = 'bold';
|
TimerBar.style.fontWeight = 'bold';
|
||||||
TimerBar.style.backgroundColor = 'black';
|
TimerBar.style.backgroundColour = 'black';
|
||||||
|
|
||||||
// Create standard Golden Cookie bar
|
// Create standard Golden Cookie bar
|
||||||
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
|
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
|
||||||
{ id: 'CMTimerBarGCMinBar', color: ColorGray },
|
{ id: 'CMTimerBarGCMinBar', color: ColourGray },
|
||||||
{ id: 'CMTimerBarGCBar', color: ColorPurple },
|
{ id: 'CMTimerBarGCBar', color: ColourPurple },
|
||||||
]);
|
]);
|
||||||
TimerBar.appendChild(CMTimerBarGC);
|
TimerBar.appendChild(CMTimerBarGC);
|
||||||
|
|
||||||
// Create standard Reindeer bar
|
// Create standard Reindeer bar
|
||||||
const CMTimerBarRen = CreateTimer('CMTimerBarRen', 'Next Reindeer', [
|
const CMTimerBarRen = CreateTimer('CMTimerBarRen', 'Next Reindeer', [
|
||||||
{ id: 'CMTimerBarRenMinBar', color: ColorGray },
|
{ id: 'CMTimerBarRenMinBar', color: ColourGray },
|
||||||
{ id: 'CMTimerBarRenBar', color: ColorOrange },
|
{ id: 'CMTimerBarRenBar', color: ColourOrange },
|
||||||
]);
|
]);
|
||||||
TimerBar.appendChild(CMTimerBarRen);
|
TimerBar.appendChild(CMTimerBarRen);
|
||||||
const TimerBarBuffTimers = document.createElement('div');
|
const TimerBarBuffTimers = document.createElement('div');
|
||||||
@@ -166,12 +166,12 @@ export function UpdateTimerBar() {
|
|||||||
{ id: `${Game.buffs[i].name}Bar` },
|
{ id: `${Game.buffs[i].name}Bar` },
|
||||||
]);
|
]);
|
||||||
timer.style.display = '';
|
timer.style.display = '';
|
||||||
let classColor = '';
|
let classColour = '';
|
||||||
// Gives specific timers specific colors
|
// Gives specific timers specific colors
|
||||||
if (typeof BuffColors[Game.buffs[i].name] !== 'undefined') {
|
if (typeof BuffColours[Game.buffs[i].name] !== 'undefined') {
|
||||||
classColor = BuffColors[Game.buffs[i].name];
|
classColour = BuffColours[Game.buffs[i].name];
|
||||||
} else classColor = ColorPurple;
|
} else classColour = ColourPurple;
|
||||||
timer.lastChild.children[1].className = ColorBackPre + classColor;
|
timer.lastChild.children[1].className = ColourBackPre + classColour;
|
||||||
timer.lastChild.children[1].style.color = 'black';
|
timer.lastChild.children[1].style.color = 'black';
|
||||||
if (CMOptions.TimerBarOverlay === 2)
|
if (CMOptions.TimerBarOverlay === 2)
|
||||||
timer.lastChild.children[1].textContent = `${Math.round(
|
timer.lastChild.children[1].textContent = `${Math.round(
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* This function creates a white square over the full screen and appends it to l('wrapper')
|
* This function creates a white square over the full screen and appends it to l('wrapper')
|
||||||
*/
|
*/
|
||||||
export default function CreateWhiteScreen() {
|
export default function CreateFlashScreen() {
|
||||||
const WhiteScreen = document.createElement('div');
|
const WhiteScreen = document.createElement('div');
|
||||||
WhiteScreen.id = 'CMWhiteScreen';
|
WhiteScreen.id = 'CMFlashScreen';
|
||||||
WhiteScreen.style.width = '100%';
|
WhiteScreen.style.width = '100%';
|
||||||
WhiteScreen.style.height = '100%';
|
WhiteScreen.style.height = '100%';
|
||||||
WhiteScreen.style.backgroundColor = 'white';
|
WhiteScreen.style.backgroundColor = 'white';
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import AddMenuStats from './AddStatsPage';
|
import AddMenuStats from './Statistics/AddStatsPage';
|
||||||
import AddMenuInfo from './InfoPage';
|
import AddMenuInfo from './Info/InfoPage';
|
||||||
import AddMenuPref from './SettingsPage';
|
import AddMenuPref from './Settings/SettingsPage';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function adds the calll the functions to add extra info to the stats and options pages
|
* This function adds the calll the functions to add extra info to the stats and options pages
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/** Functions related to the Stats page */
|
/** Functions related to the Stats page */
|
||||||
|
|
||||||
import { ToggleHeader } from '../../Config/ToggleSetting';
|
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata';
|
import { LatestReleaseNotes, ModDescription } from '../../../Data/Moddata';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function adds stats created by CookieMonster to the stats page
|
* This function adds stats created by CookieMonster to the stats page
|
||||||
22
src/Disp/MenuSections/Prompt.js
Normal file
22
src/Disp/MenuSections/Prompt.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/** Creates a Prompt similar to the base game without some of the stuff breaking them */
|
||||||
|
export default function CookieMonsterPrompt(content, options) {
|
||||||
|
Game.promptWrapL.className = 'framed';
|
||||||
|
const str = content;
|
||||||
|
Game.promptL.innerHTML = `${str}<div class="optionBox"></div>`;
|
||||||
|
Object.keys(options).forEach((i) => {
|
||||||
|
const option = document.createElement('a');
|
||||||
|
option.id = `promptOption${i}`;
|
||||||
|
option.className = 'option';
|
||||||
|
option.onclick = function () {
|
||||||
|
PlaySound('snd/tick.mp3');
|
||||||
|
options[i][1]();
|
||||||
|
};
|
||||||
|
option.textContent = options[i][0];
|
||||||
|
Game.promptL.children[1].appendChild(option);
|
||||||
|
});
|
||||||
|
Game.promptAnchorL.style.display = 'block';
|
||||||
|
Game.darkenL.style.display = 'block';
|
||||||
|
Game.promptL.focus();
|
||||||
|
Game.promptOn = 1;
|
||||||
|
Game.UpdatePrompt();
|
||||||
|
}
|
||||||
35
src/Disp/MenuSections/Settings/CreateHeader.js
Normal file
35
src/Disp/MenuSections/Settings/CreateHeader.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates a header-object for the options page
|
||||||
|
* @param {string} config The name of the Config-group
|
||||||
|
* @param {string} text The to-be displayed name of the header
|
||||||
|
* @returns {object} div The header object
|
||||||
|
*/
|
||||||
|
export default function CreatePrefHeader(config, text) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'title';
|
||||||
|
|
||||||
|
div.style.opacity = '0.7';
|
||||||
|
div.style.fontSize = '17px';
|
||||||
|
div.appendChild(document.createTextNode(`${text} `));
|
||||||
|
const span = document.createElement('span'); // Creates the +/- button
|
||||||
|
span.style.cursor = 'pointer';
|
||||||
|
span.style.display = 'inline-block';
|
||||||
|
span.style.height = '14px';
|
||||||
|
span.style.width = '14px';
|
||||||
|
span.style.borderRadius = '7px';
|
||||||
|
span.style.textAlign = 'center';
|
||||||
|
span.style.backgroundColor = '#C0C0C0';
|
||||||
|
span.style.color = 'black';
|
||||||
|
span.style.fontSize = '13px';
|
||||||
|
span.style.verticalAlign = 'middle';
|
||||||
|
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
||||||
|
span.onclick = function () {
|
||||||
|
ToggleHeader(config);
|
||||||
|
Game.UpdateMenu();
|
||||||
|
};
|
||||||
|
div.appendChild(span);
|
||||||
|
return div;
|
||||||
|
}
|
||||||
234
src/Disp/MenuSections/Settings/CreateOption.js
Normal file
234
src/Disp/MenuSections/Settings/CreateOption.js
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
||||||
|
import ToggleFavouriteSetting from '../../../Config/Toggles/ToggleFavourites';
|
||||||
|
import { SaveConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||||
|
import {
|
||||||
|
ConfigPrefix,
|
||||||
|
ToggleConfig,
|
||||||
|
ToggleConfigVolume,
|
||||||
|
} from '../../../Config/ToggleSetting';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import {} from '../../../Data/Sectionheaders';
|
||||||
|
import Config from '../../../Data/SettingsData';
|
||||||
|
import RefreshScale from '../../HelperFunctions/RefreshScale';
|
||||||
|
import UpdateColours from '../../HelperFunctions/UpdateColours';
|
||||||
|
import Flash from '../../Notifications/Flash';
|
||||||
|
import PlaySound from '../../Notifications/Sound';
|
||||||
|
import {
|
||||||
|
FavouriteSettings,
|
||||||
|
SimpleTooltipElements,
|
||||||
|
} from '../../VariablesAndData';
|
||||||
|
import CookieMonsterPrompt from '../Prompt';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates the favourite setting star object
|
||||||
|
* @param {string} config The name of the option
|
||||||
|
* @returns {object} div The option object
|
||||||
|
*/
|
||||||
|
function CreateFavouriteStar(config) {
|
||||||
|
const FavStar = document.createElement('a');
|
||||||
|
if (FavouriteSettings.includes(config)) {
|
||||||
|
FavStar.innerText = '★';
|
||||||
|
FavStar.style.color = 'yellow';
|
||||||
|
} else FavStar.innerText = '☆';
|
||||||
|
FavStar.className = 'option';
|
||||||
|
FavStar.onclick = function () {
|
||||||
|
ToggleFavouriteSetting(config);
|
||||||
|
SaveConfig();
|
||||||
|
Game.UpdateMenu();
|
||||||
|
};
|
||||||
|
FavStar.onmouseover = function () {
|
||||||
|
Game.tooltip.draw(
|
||||||
|
this,
|
||||||
|
escape(SimpleTooltipElements.FavouriteSettingPlaceholder.innerHTML),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
FavStar.onmouseout = function () {
|
||||||
|
Game.tooltip.hide();
|
||||||
|
};
|
||||||
|
FavStar.appendChild(document.createTextNode(' '));
|
||||||
|
return FavStar;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates an option-object for the options page
|
||||||
|
* @param {string} config The name of the option
|
||||||
|
* @returns {object} div The option object
|
||||||
|
*/
|
||||||
|
export default function CreatePrefOption(config) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'listing';
|
||||||
|
if (CMOptions.FavouriteSettings === 1) {
|
||||||
|
div.appendChild(CreateFavouriteStar(config));
|
||||||
|
}
|
||||||
|
if (Config[config].type === 'bool') {
|
||||||
|
const a = document.createElement('a');
|
||||||
|
if (Config[config].toggle && CMOptions[config] === 0) {
|
||||||
|
a.className = 'option off';
|
||||||
|
} else {
|
||||||
|
a.className = 'option';
|
||||||
|
}
|
||||||
|
a.id = ConfigPrefix + config;
|
||||||
|
a.onclick = function () {
|
||||||
|
ToggleConfig(config);
|
||||||
|
};
|
||||||
|
a.textContent = Config[config].label[CMOptions[config]];
|
||||||
|
div.appendChild(a);
|
||||||
|
const label = document.createElement('label');
|
||||||
|
label.textContent = Config[config].desc;
|
||||||
|
label.style.lineHeight = '1.6';
|
||||||
|
div.appendChild(label);
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
if (Config[config].type === 'vol') {
|
||||||
|
const volume = document.createElement('div');
|
||||||
|
volume.className = 'sliderBox';
|
||||||
|
const title = document.createElement('div');
|
||||||
|
title.style.float = 'left';
|
||||||
|
title.innerHTML = Config[config].desc;
|
||||||
|
volume.appendChild(title);
|
||||||
|
const percent = document.createElement('div');
|
||||||
|
percent.id = `slider${config}right`;
|
||||||
|
percent.style.float = 'right';
|
||||||
|
percent.innerHTML = `${CMOptions[config]}%`;
|
||||||
|
volume.appendChild(percent);
|
||||||
|
const slider = document.createElement('input');
|
||||||
|
slider.className = 'slider';
|
||||||
|
slider.id = `slider${config}`;
|
||||||
|
slider.style.clear = 'both';
|
||||||
|
slider.type = 'range';
|
||||||
|
slider.min = '0';
|
||||||
|
slider.max = '100';
|
||||||
|
slider.step = '1';
|
||||||
|
slider.value = CMOptions[config];
|
||||||
|
slider.oninput = function () {
|
||||||
|
ToggleConfigVolume(config);
|
||||||
|
};
|
||||||
|
slider.onchange = function () {
|
||||||
|
ToggleConfigVolume(config);
|
||||||
|
};
|
||||||
|
volume.appendChild(slider);
|
||||||
|
div.appendChild(volume);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.className = 'option';
|
||||||
|
a.onclick = function () {
|
||||||
|
PlaySound(
|
||||||
|
CMOptions[config.replace('Volume', 'SoundURL')],
|
||||||
|
config.replace('Volume', 'Sound'),
|
||||||
|
config,
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
a.textContent = 'Test sound';
|
||||||
|
div.appendChild(a);
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
if (Config[config].type === 'url') {
|
||||||
|
const span = document.createElement('span');
|
||||||
|
span.className = 'option';
|
||||||
|
span.textContent = `${Config[config].label} `;
|
||||||
|
span.style.lineHeight = '1.6';
|
||||||
|
div.appendChild(span);
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.id = ConfigPrefix + config;
|
||||||
|
input.className = 'option';
|
||||||
|
input.type = 'text';
|
||||||
|
input.readOnly = true;
|
||||||
|
input.setAttribute('value', CMOptions[config]);
|
||||||
|
input.style.width = '300px';
|
||||||
|
div.appendChild(input);
|
||||||
|
div.appendChild(document.createTextNode(' '));
|
||||||
|
const inputPrompt = document.createElement('input');
|
||||||
|
inputPrompt.id = `${ConfigPrefix + config}Prompt`;
|
||||||
|
inputPrompt.className = 'option';
|
||||||
|
inputPrompt.type = 'text';
|
||||||
|
inputPrompt.setAttribute('value', CMOptions[config]);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.className = 'option';
|
||||||
|
a.onclick = function () {
|
||||||
|
CookieMonsterPrompt(inputPrompt.outerHTML, [
|
||||||
|
[
|
||||||
|
'Save',
|
||||||
|
function () {
|
||||||
|
CMOptions[config] = l(`${ConfigPrefix}${config}Prompt`).value;
|
||||||
|
SaveConfig();
|
||||||
|
Game.ClosePrompt();
|
||||||
|
Game.UpdateMenu();
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'Cancel',
|
||||||
|
function () {
|
||||||
|
Game.ClosePrompt();
|
||||||
|
},
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
a.textContent = 'Edit';
|
||||||
|
div.appendChild(a);
|
||||||
|
const label = document.createElement('label');
|
||||||
|
label.textContent = Config[config].desc;
|
||||||
|
label.style.lineHeight = '1.6';
|
||||||
|
div.appendChild(label);
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
if (Config[config].type === 'colour') {
|
||||||
|
const innerSpan = document.createElement('span');
|
||||||
|
innerSpan.className = 'option';
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.id = config;
|
||||||
|
input.style.width = '65px';
|
||||||
|
input.setAttribute('value', CMOptions[config]);
|
||||||
|
innerSpan.appendChild(input);
|
||||||
|
const change = function () {
|
||||||
|
CMOptions[this.targetElement.id] = this.toHEXString();
|
||||||
|
UpdateColours();
|
||||||
|
SaveConfig();
|
||||||
|
Game.UpdateMenu();
|
||||||
|
};
|
||||||
|
// eslint-disable-next-line no-new
|
||||||
|
new JsColor(input, { hash: true, position: 'right', onInput: change });
|
||||||
|
const label = document.createElement('label');
|
||||||
|
label.textContent = Config[config].desc;
|
||||||
|
label.style.lineHeight = '1.6';
|
||||||
|
innerSpan.appendChild(label);
|
||||||
|
if (config.includes('Flash')) {
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.className = 'option';
|
||||||
|
a.onclick = function () {
|
||||||
|
Flash(3, config.replace('Colour', ''), true);
|
||||||
|
};
|
||||||
|
a.textContent = 'Test flash';
|
||||||
|
innerSpan.appendChild(a);
|
||||||
|
}
|
||||||
|
div.appendChild(innerSpan);
|
||||||
|
jscolor.init();
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
if (Config[config].type === 'numscale') {
|
||||||
|
const span = document.createElement('span');
|
||||||
|
span.className = 'option';
|
||||||
|
span.textContent = `${Config[config].label} `;
|
||||||
|
span.style.lineHeight = '1.6';
|
||||||
|
div.appendChild(span);
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.id = ConfigPrefix + config;
|
||||||
|
input.className = 'option';
|
||||||
|
input.type = 'number';
|
||||||
|
input.value = CMOptions[config];
|
||||||
|
input.min = Config[config].min;
|
||||||
|
input.max = Config[config].max;
|
||||||
|
input.oninput = function () {
|
||||||
|
CMOptions[config] = this.value;
|
||||||
|
SaveConfig();
|
||||||
|
RefreshScale();
|
||||||
|
};
|
||||||
|
div.appendChild(input);
|
||||||
|
div.appendChild(document.createTextNode(' '));
|
||||||
|
const label = document.createElement('label');
|
||||||
|
label.textContent = Config[config].desc;
|
||||||
|
label.style.lineHeight = '1.6';
|
||||||
|
div.appendChild(label);
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
return div;
|
||||||
|
}
|
||||||
79
src/Disp/MenuSections/Settings/SettingsPage.js
Normal file
79
src/Disp/MenuSections/Settings/SettingsPage.js
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import { LoadConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import {
|
||||||
|
ConfigGroups,
|
||||||
|
ConfigGroupsNotification,
|
||||||
|
} from '../../../Data/Sectionheaders';
|
||||||
|
import Config from '../../../Data/SettingsData';
|
||||||
|
import ConfigDefault from '../../../Data/SettingsDefault';
|
||||||
|
import { FavouriteSettings } from '../../VariablesAndData';
|
||||||
|
import CreatePrefHeader from './CreateHeader';
|
||||||
|
import CreatePrefOption from './CreateOption';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds the options/settings of CookieMonster to the options page
|
||||||
|
* It is called by CM.Disp.AddMenu
|
||||||
|
* @param {object} title On object that includes the title of the menu
|
||||||
|
*/
|
||||||
|
export default function AddMenuPref(title) {
|
||||||
|
const frag = document.createDocumentFragment();
|
||||||
|
frag.appendChild(title);
|
||||||
|
|
||||||
|
Object.keys(ConfigGroups).forEach((group) => {
|
||||||
|
if (group === 'Favourite') {
|
||||||
|
if (FavouriteSettings.length !== 0 && CMOptions.FavouriteSettings > 0) {
|
||||||
|
frag.appendChild(CreatePrefHeader(group, ConfigGroups[group])); // (group, display-name of group)
|
||||||
|
if (CMOptions.Header[group])
|
||||||
|
for (let index = 0; index < FavouriteSettings.length; index++) {
|
||||||
|
frag.appendChild(CreatePrefOption(FavouriteSettings[index]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
frag.appendChild(CreatePrefHeader(group, ConfigGroups[group])); // (group, display-name of group)
|
||||||
|
if (CMOptions.Header[group]) {
|
||||||
|
// 0 is show, 1 is collapsed
|
||||||
|
// Make sub-sections of Notification section
|
||||||
|
if (group === 'Notification') {
|
||||||
|
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
||||||
|
const subGroupObject = CreatePrefHeader(
|
||||||
|
subGroup,
|
||||||
|
ConfigGroupsNotification[subGroup],
|
||||||
|
); // (group, display-name of group)
|
||||||
|
subGroupObject.style.fontSize = '15px';
|
||||||
|
subGroupObject.style.opacity = '0.5';
|
||||||
|
frag.appendChild(subGroupObject);
|
||||||
|
if (CMOptions.Header[subGroup]) {
|
||||||
|
Object.keys(Config).forEach((option) => {
|
||||||
|
if (Config[option].group === subGroup)
|
||||||
|
frag.appendChild(CreatePrefOption(option));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Object.keys(Config).forEach((option) => {
|
||||||
|
if (Config[option].group === group)
|
||||||
|
frag.appendChild(CreatePrefOption(option));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const resDef = document.createElement('div');
|
||||||
|
resDef.className = 'listing';
|
||||||
|
const resDefBut = document.createElement('a');
|
||||||
|
resDefBut.className = 'option';
|
||||||
|
resDefBut.onclick = function () {
|
||||||
|
LoadConfig(ConfigDefault);
|
||||||
|
};
|
||||||
|
resDefBut.textContent = 'Restore Default';
|
||||||
|
resDef.appendChild(resDefBut);
|
||||||
|
frag.appendChild(resDef);
|
||||||
|
|
||||||
|
l('menu').childNodes[2].insertBefore(
|
||||||
|
frag,
|
||||||
|
l('menu').childNodes[2].childNodes[
|
||||||
|
l('menu').childNodes[2].childNodes.length - 1
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,281 +0,0 @@
|
|||||||
/** Functions related to the Options/Preferences page */
|
|
||||||
|
|
||||||
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
|
||||||
import {
|
|
||||||
LoadConfig,
|
|
||||||
SaveConfig,
|
|
||||||
} from '../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
|
||||||
import {
|
|
||||||
ConfigPrefix,
|
|
||||||
ToggleConfig,
|
|
||||||
ToggleConfigVolume,
|
|
||||||
ToggleHeader,
|
|
||||||
} from '../../Config/ToggleSetting';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import {
|
|
||||||
ConfigGroups,
|
|
||||||
ConfigGroupsNotification,
|
|
||||||
} from '../../Data/Sectionheaders';
|
|
||||||
import Config from '../../Data/SettingsData';
|
|
||||||
import ConfigDefault from '../../Data/SettingsDefault';
|
|
||||||
import RefreshScale from '../HelperFunctions/RefreshScale';
|
|
||||||
import UpdateColors from '../HelperFunctions/UpdateColors';
|
|
||||||
import PlaySound from '../Notifications/Sound';
|
|
||||||
import { Colors } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function creates a header-object for the options page
|
|
||||||
* @param {string} config The name of the Config-group
|
|
||||||
* @param {string} text The to-be displayed name of the header
|
|
||||||
* @returns {object} div The header object
|
|
||||||
*/
|
|
||||||
function CreatePrefHeader(config, text) {
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.className = 'title';
|
|
||||||
|
|
||||||
div.style.opacity = '0.7';
|
|
||||||
div.style.fontSize = '17px';
|
|
||||||
div.appendChild(document.createTextNode(`${text} `));
|
|
||||||
const span = document.createElement('span'); // Creates the +/- button
|
|
||||||
span.style.cursor = 'pointer';
|
|
||||||
span.style.display = 'inline-block';
|
|
||||||
span.style.height = '14px';
|
|
||||||
span.style.width = '14px';
|
|
||||||
span.style.borderRadius = '7px';
|
|
||||||
span.style.textAlign = 'center';
|
|
||||||
span.style.backgroundColor = '#C0C0C0';
|
|
||||||
span.style.color = 'black';
|
|
||||||
span.style.fontSize = '13px';
|
|
||||||
span.style.verticalAlign = 'middle';
|
|
||||||
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
|
||||||
span.onclick = function () {
|
|
||||||
ToggleHeader(config);
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
div.appendChild(span);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function creates an option-object for the options page
|
|
||||||
* @param {string} config The name of the option
|
|
||||||
* @returns {object} div The option object
|
|
||||||
*/
|
|
||||||
function CreatePrefOption(config) {
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.className = 'listing';
|
|
||||||
if (Config[config].type === 'bool') {
|
|
||||||
const a = document.createElement('a');
|
|
||||||
if (Config[config].toggle && CMOptions[config] === 0) {
|
|
||||||
a.className = 'option off';
|
|
||||||
} else {
|
|
||||||
a.className = 'option';
|
|
||||||
}
|
|
||||||
a.id = ConfigPrefix + config;
|
|
||||||
a.onclick = function () {
|
|
||||||
ToggleConfig(config);
|
|
||||||
};
|
|
||||||
a.textContent = Config[config].label[CMOptions[config]];
|
|
||||||
div.appendChild(a);
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config[config].desc;
|
|
||||||
div.appendChild(label);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'vol') {
|
|
||||||
const volume = document.createElement('div');
|
|
||||||
volume.className = 'sliderBox';
|
|
||||||
const title = document.createElement('div');
|
|
||||||
title.style.float = 'left';
|
|
||||||
title.innerHTML = Config[config].desc;
|
|
||||||
volume.appendChild(title);
|
|
||||||
const percent = document.createElement('div');
|
|
||||||
percent.id = `slider${config}right`;
|
|
||||||
percent.style.float = 'right';
|
|
||||||
percent.innerHTML = `${CMOptions[config]}%`;
|
|
||||||
volume.appendChild(percent);
|
|
||||||
const slider = document.createElement('input');
|
|
||||||
slider.className = 'slider';
|
|
||||||
slider.id = `slider${config}`;
|
|
||||||
slider.style.clear = 'both';
|
|
||||||
slider.type = 'range';
|
|
||||||
slider.min = '0';
|
|
||||||
slider.max = '100';
|
|
||||||
slider.step = '1';
|
|
||||||
slider.value = CMOptions[config];
|
|
||||||
slider.oninput = function () {
|
|
||||||
ToggleConfigVolume(config);
|
|
||||||
};
|
|
||||||
slider.onchange = function () {
|
|
||||||
ToggleConfigVolume(config);
|
|
||||||
};
|
|
||||||
volume.appendChild(slider);
|
|
||||||
div.appendChild(volume);
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.className = 'option';
|
|
||||||
a.onclick = function () {
|
|
||||||
PlaySound(
|
|
||||||
CMOptions[config.replace('Volume', 'SoundURL')],
|
|
||||||
config.replace('Volume', 'Sound'),
|
|
||||||
config,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
a.textContent = 'Test sound';
|
|
||||||
div.appendChild(a);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'url') {
|
|
||||||
const span = document.createElement('span');
|
|
||||||
span.className = 'option';
|
|
||||||
span.textContent = `${Config[config].label} `;
|
|
||||||
div.appendChild(span);
|
|
||||||
const input = document.createElement('input');
|
|
||||||
input.id = ConfigPrefix + config;
|
|
||||||
input.className = 'option';
|
|
||||||
input.type = 'text';
|
|
||||||
input.readOnly = true;
|
|
||||||
input.setAttribute('value', CMOptions[config]);
|
|
||||||
input.style.width = '300px';
|
|
||||||
div.appendChild(input);
|
|
||||||
div.appendChild(document.createTextNode(' '));
|
|
||||||
const inputPrompt = document.createElement('input');
|
|
||||||
inputPrompt.id = `${ConfigPrefix + config}Prompt`;
|
|
||||||
inputPrompt.className = 'option';
|
|
||||||
inputPrompt.type = 'text';
|
|
||||||
inputPrompt.setAttribute('value', CMOptions[config]);
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.className = 'option';
|
|
||||||
a.onclick = function () {
|
|
||||||
Game.Prompt(inputPrompt.outerHTML, [
|
|
||||||
[
|
|
||||||
'Save',
|
|
||||||
function () {
|
|
||||||
CMOptions[`${config}`] = l(`${ConfigPrefix}${config}Prompt`).value;
|
|
||||||
SaveConfig();
|
|
||||||
Game.ClosePrompt();
|
|
||||||
Game.UpdateMenu();
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'Cancel',
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
a.textContent = 'Edit';
|
|
||||||
div.appendChild(a);
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config[config].desc;
|
|
||||||
div.appendChild(label);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'color') {
|
|
||||||
div.className = '';
|
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
|
||||||
const innerDiv = document.createElement('div');
|
|
||||||
innerDiv.className = 'listing';
|
|
||||||
const input = document.createElement('input');
|
|
||||||
input.id = Colors[i];
|
|
||||||
input.style.width = '65px';
|
|
||||||
input.setAttribute('value', CMOptions.Colors[Colors[i]]);
|
|
||||||
innerDiv.appendChild(input);
|
|
||||||
const change = function () {
|
|
||||||
CMOptions.Colors[this.targetElement.id] = this.toHEXString();
|
|
||||||
UpdateColors();
|
|
||||||
SaveConfig();
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line no-new
|
|
||||||
new JsColor(input, { hash: true, position: 'right', onInput: change });
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config.Colors.desc[Colors[i]];
|
|
||||||
innerDiv.appendChild(label);
|
|
||||||
div.appendChild(innerDiv);
|
|
||||||
}
|
|
||||||
jscolor.init();
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'numscale') {
|
|
||||||
const span = document.createElement('span');
|
|
||||||
span.className = 'option';
|
|
||||||
span.textContent = `${Config[config].label} `;
|
|
||||||
div.appendChild(span);
|
|
||||||
const input = document.createElement('input');
|
|
||||||
input.id = ConfigPrefix + config;
|
|
||||||
input.className = 'option';
|
|
||||||
input.type = 'number';
|
|
||||||
input.value = CMOptions[config];
|
|
||||||
input.min = Config[config].min;
|
|
||||||
input.max = Config[config].max;
|
|
||||||
input.oninput = function () {
|
|
||||||
if (this.value > this.max) console.log('TEST');
|
|
||||||
CMOptions[config] = this.value;
|
|
||||||
SaveConfig();
|
|
||||||
RefreshScale();
|
|
||||||
};
|
|
||||||
div.appendChild(input);
|
|
||||||
div.appendChild(document.createTextNode(' '));
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config[config].desc;
|
|
||||||
div.appendChild(label);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds the options/settings of CookieMonster to the options page
|
|
||||||
* It is called by CM.Disp.AddMenu
|
|
||||||
* @param {object} title On object that includes the title of the menu
|
|
||||||
*/
|
|
||||||
export default function AddMenuPref(title) {
|
|
||||||
const frag = document.createDocumentFragment();
|
|
||||||
frag.appendChild(title);
|
|
||||||
|
|
||||||
Object.keys(ConfigGroups).forEach((group) => {
|
|
||||||
const groupObject = CreatePrefHeader(group, ConfigGroups[group]); // (group, display-name of group)
|
|
||||||
frag.appendChild(groupObject);
|
|
||||||
if (CMOptions.Header[group]) {
|
|
||||||
// 0 is show, 1 is collapsed
|
|
||||||
// Make sub-sections of Notification section
|
|
||||||
if (group === 'Notification') {
|
|
||||||
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
|
||||||
const subGroupObject = CreatePrefHeader(
|
|
||||||
subGroup,
|
|
||||||
ConfigGroupsNotification[subGroup],
|
|
||||||
); // (group, display-name of group)
|
|
||||||
subGroupObject.style.fontSize = '15px';
|
|
||||||
subGroupObject.style.opacity = '0.5';
|
|
||||||
frag.appendChild(subGroupObject);
|
|
||||||
if (CMOptions.Header[subGroup]) {
|
|
||||||
Object.keys(Config).forEach((option) => {
|
|
||||||
if (Config[option].group === subGroup)
|
|
||||||
frag.appendChild(CreatePrefOption(option));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Object.keys(Config).forEach((option) => {
|
|
||||||
if (Config[option].group === group)
|
|
||||||
frag.appendChild(CreatePrefOption(option));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const resDef = document.createElement('div');
|
|
||||||
resDef.className = 'listing';
|
|
||||||
const resDefBut = document.createElement('a');
|
|
||||||
resDefBut.className = 'option';
|
|
||||||
resDefBut.onclick = function () {
|
|
||||||
LoadConfig(ConfigDefault);
|
|
||||||
};
|
|
||||||
resDefBut.textContent = 'Restore Default';
|
|
||||||
resDef.appendChild(resDefBut);
|
|
||||||
frag.appendChild(resDef);
|
|
||||||
|
|
||||||
l('menu').childNodes[2].insertBefore(
|
|
||||||
frag,
|
|
||||||
l('menu').childNodes[2].childNodes[
|
|
||||||
l('menu').childNodes[2].childNodes.length - 1
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -3,19 +3,21 @@
|
|||||||
import { AddMissingUpgrades } from './CreateMissingUpgrades';
|
import { AddMissingUpgrades } from './CreateMissingUpgrades';
|
||||||
import * as CreateSections from './CreateStatsSections';
|
import * as CreateSections from './CreateStatsSections';
|
||||||
import * as CreateElements from './CreateDOMElements';
|
import * as CreateElements from './CreateDOMElements';
|
||||||
import * as GameData from '../../Data/Gamedata';
|
import * as GameData from '../../../Data/Gamedata';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks,
|
CacheAverageClicks,
|
||||||
|
CacheAverageCookiesFromClicks,
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersNormal,
|
CacheWrinklersNormal,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
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/BeautifyFormatting';
|
||||||
|
import AddMissingAchievements from './CreateMissingAchievements';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function adds stats created by CookieMonster to the stats page
|
* This function adds stats created by CookieMonster to the stats page
|
||||||
@@ -114,7 +116,7 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Average Cookies Per Second (Past ${
|
`Average cookies per second (past ${
|
||||||
CookieTimes[CMOptions.AvgCPSHist] < 60
|
CookieTimes[CMOptions.AvgCPSHist] < 60
|
||||||
? `${CookieTimes[CMOptions.AvgCPSHist]} seconds`
|
? `${CookieTimes[CMOptions.AvgCPSHist]} seconds`
|
||||||
: CookieTimes[CMOptions.AvgCPSHist] / 60 +
|
: CookieTimes[CMOptions.AvgCPSHist] / 60 +
|
||||||
@@ -126,12 +128,27 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Average Cookie Clicks Per Second (Past ${
|
`Average cookie clicks per second (past ${
|
||||||
ClickTimes[CMOptions.AvgClicksHist]
|
ClickTimes[CMOptions.AvgClicksHist]
|
||||||
}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`,
|
}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`,
|
||||||
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
`Cookies from clicking (past ${ClickTimes[CMOptions.AvgClicksHist]}${
|
||||||
|
CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'
|
||||||
|
})`,
|
||||||
|
document.createTextNode(
|
||||||
|
Beautify(
|
||||||
|
CacheAverageCookiesFromClicks.calcSum(
|
||||||
|
CacheAverageClicks * ClickTimes[CMOptions.AvgClicksHist],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
if (Game.Has('Fortune cookies')) {
|
if (Game.Has('Fortune cookies')) {
|
||||||
const fortunes = [];
|
const fortunes = [];
|
||||||
Object.keys(GameData.Fortunes).forEach((i) => {
|
Object.keys(GameData.Fortunes).forEach((i) => {
|
||||||
@@ -152,7 +169,7 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Missed Golden Cookies',
|
'Missed golden cookies',
|
||||||
document.createTextNode(Beautify(Game.missedGoldenClicks)),
|
document.createTextNode(Beautify(Game.missedGoldenClicks)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -175,4 +192,7 @@ export default function AddMenuStats(title) {
|
|||||||
if (CMOptions.MissingUpgrades) {
|
if (CMOptions.MissingUpgrades) {
|
||||||
AddMissingUpgrades();
|
AddMissingUpgrades();
|
||||||
}
|
}
|
||||||
|
if (CMOptions.MissingAchievements) {
|
||||||
|
AddMissingAchievements();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/** Section: Functions related to the creation of basic DOM elements page */
|
/** Section: Functions related to the creation of basic DOM elements page */
|
||||||
|
|
||||||
import { ToggleHeader } from '../../Config/ToggleSetting';
|
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { SimpleTooltipElements } from '../VariablesAndData';
|
import { SimpleTooltipElements } from '../../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a header-object for the stats page
|
* This function creates a header-object for the stats page
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
|
||||||
|
function CrateTooltipLockedAchievements(me) {
|
||||||
|
const tags = [];
|
||||||
|
if (me.pool === 'shadow') tags.push('Shadow Achievement', '#9700cf');
|
||||||
|
else tags.push('Achievement', 0);
|
||||||
|
tags.push('Locked', 0);
|
||||||
|
|
||||||
|
let neuromancy = 0;
|
||||||
|
if (Game.Has('Neuromancy') || (Game.sesame && me.pool === 'debug'))
|
||||||
|
neuromancy = 1;
|
||||||
|
if (neuromancy && me.won === 0) tags.push('Click to win!', '#00c462');
|
||||||
|
else if (neuromancy && me.won > 0) tags.push('Click to lose!', '#00c462');
|
||||||
|
|
||||||
|
let { icon } = me;
|
||||||
|
if (me.iconFunction) icon = me.iconFunction();
|
||||||
|
|
||||||
|
let { desc } = me;
|
||||||
|
if (me.descFunc) desc = me.descFunc('stats');
|
||||||
|
|
||||||
|
let tagsStr = '';
|
||||||
|
for (let i = 0; i < tags.length; i += 2) {
|
||||||
|
if (i % 2 === 0)
|
||||||
|
tagsStr += ` <div class="tag" style="color:${
|
||||||
|
tags[i + 1] === 0 ? '#fff' : tags[i + 1]
|
||||||
|
};">[${tags[i]}]</div>`;
|
||||||
|
}
|
||||||
|
tagsStr = tagsStr.substring(1);
|
||||||
|
|
||||||
|
return `<div style="padding:8px 4px;min-width:350px;opacity:0.5">
|
||||||
|
<div class="icon" style="float:left;margin-left:-8px;margin-top:-8px;background-position:${
|
||||||
|
-icon[0] * 48
|
||||||
|
}px ${-icon[1] * 48}px;"></div>
|
||||||
|
<div class="name">${me.name}</div>
|
||||||
|
${tagsStr}<div class="line"></div><div class="description">${desc}</div></div>
|
||||||
|
${
|
||||||
|
Game.sesame
|
||||||
|
? `<div style="font-size:9px;">Id : ${me.id} | Order : ${Math.floor(
|
||||||
|
me.order,
|
||||||
|
)}${me.tier ? ` | Tier : ${me.tier}` : ''}</div>`
|
||||||
|
: ''
|
||||||
|
}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function overwrites the crates of missing achievements
|
||||||
|
*/
|
||||||
|
export default function AddMissingAchievements() {
|
||||||
|
let achievs;
|
||||||
|
Object.values(document.querySelectorAll('div.title')).forEach((i) => {
|
||||||
|
if (i.textContent.includes('Achievements')) {
|
||||||
|
achievs = i.parentElement.querySelectorAll('div.listing.crateBox')[0];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (CMOptions.MissingAchievements) {
|
||||||
|
Object.values(achievs.children).forEach((achievsCrate) => {
|
||||||
|
if (!achievsCrate.className.includes('enabled')) {
|
||||||
|
const id = achievsCrate.onclick.toString().match(/(?<=\[).*(?=\])/g)[0];
|
||||||
|
const { icon } = Game.AchievementsById[id];
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
achievsCrate.style.backgroundPosition = `${-icon[0] * 48}px ${
|
||||||
|
-icon[1] * 48
|
||||||
|
}px`;
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
achievsCrate.onmouseover = function () {
|
||||||
|
if (!Game.mouseDown) {
|
||||||
|
Game.setOnCrate(this);
|
||||||
|
Game.tooltip.dynamic = 1;
|
||||||
|
Game.tooltip.draw(
|
||||||
|
this,
|
||||||
|
function () {
|
||||||
|
return (function () {
|
||||||
|
return CrateTooltipLockedAchievements(
|
||||||
|
Game.AchievementsById[id],
|
||||||
|
);
|
||||||
|
})();
|
||||||
|
},
|
||||||
|
'top',
|
||||||
|
);
|
||||||
|
Game.tooltip.wobble();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
CacheMissingUpgrades,
|
CacheMissingUpgrades,
|
||||||
CacheMissingUpgradesCookies,
|
CacheMissingUpgradesCookies,
|
||||||
CacheMissingUpgradesPrestige,
|
CacheMissingUpgradesPrestige,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates the missing upgrades sections for prestige, normal and cookie upgrades
|
* This function creates the missing upgrades sections for prestige, normal and cookie upgrades
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Functions to create the individual sections of the Statistics page */
|
/** Functions to create the individual sections of the Statistics page */
|
||||||
|
|
||||||
import * as GameData from '../../Data/Gamedata';
|
import * as GameData from '../../../Data/Gamedata';
|
||||||
import { MaxChainCookieReward } from '../../Cache/Stats/ChainCookies';
|
import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies';
|
||||||
import {
|
import {
|
||||||
CacheAvgCPSWithChoEgg,
|
CacheAvgCPSWithChoEgg,
|
||||||
CacheCentEgg,
|
CacheCentEgg,
|
||||||
@@ -35,17 +35,17 @@ import {
|
|||||||
CacheSeaSpec,
|
CacheSeaSpec,
|
||||||
CacheWrathCookiesMult,
|
CacheWrathCookiesMult,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
} 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 {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
FormatTime,
|
FormatTime,
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColorGreen, ColorRed, ColorTextPre } from '../VariablesAndData';
|
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
||||||
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,8 +61,8 @@ export function LuckySection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsLuckySection';
|
section.className = 'CMStatsLuckySection';
|
||||||
|
|
||||||
const luckyColor =
|
const luckyColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColorRed : ColorGreen;
|
Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColourRed : ColourGreen;
|
||||||
const luckyTime =
|
const luckyTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLucky
|
Game.cookies + GetWrinkConfigBank() < CacheLucky
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
@@ -72,7 +72,7 @@ export function LuckySection() {
|
|||||||
const luckyReqFrag = document.createDocumentFragment();
|
const luckyReqFrag = document.createDocumentFragment();
|
||||||
const luckyReqSpan = document.createElement('span');
|
const luckyReqSpan = document.createElement('span');
|
||||||
luckyReqSpan.style.fontWeight = 'bold';
|
luckyReqSpan.style.fontWeight = 'bold';
|
||||||
luckyReqSpan.className = ColorTextPre + luckyColor;
|
luckyReqSpan.className = ColourTextPre + luckyColour;
|
||||||
luckyReqSpan.textContent = Beautify(CacheLucky);
|
luckyReqSpan.textContent = Beautify(CacheLucky);
|
||||||
luckyReqFrag.appendChild(luckyReqSpan);
|
luckyReqFrag.appendChild(luckyReqSpan);
|
||||||
if (luckyTime !== '') {
|
if (luckyTime !== '') {
|
||||||
@@ -83,16 +83,16 @@ export function LuckySection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Lucky!" Cookies Required',
|
'"Lucky!" cookies required',
|
||||||
luckyReqFrag,
|
luckyReqFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const luckyColorFrenzy =
|
const luckyColourFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
||||||
? ColorRed
|
? ColourRed
|
||||||
: ColorGreen;
|
: ColourGreen;
|
||||||
const luckyTimeFrenzy =
|
const luckyTimeFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
@@ -102,7 +102,7 @@ export function LuckySection() {
|
|||||||
const luckyReqFrenFrag = document.createDocumentFragment();
|
const luckyReqFrenFrag = document.createDocumentFragment();
|
||||||
const luckyReqFrenSpan = document.createElement('span');
|
const luckyReqFrenSpan = document.createElement('span');
|
||||||
luckyReqFrenSpan.style.fontWeight = 'bold';
|
luckyReqFrenSpan.style.fontWeight = 'bold';
|
||||||
luckyReqFrenSpan.className = ColorTextPre + luckyColorFrenzy;
|
luckyReqFrenSpan.className = ColourTextPre + luckyColourFrenzy;
|
||||||
luckyReqFrenSpan.textContent = Beautify(CacheLuckyFrenzy);
|
luckyReqFrenSpan.textContent = Beautify(CacheLuckyFrenzy);
|
||||||
luckyReqFrenFrag.appendChild(luckyReqFrenSpan);
|
luckyReqFrenFrag.appendChild(luckyReqFrenSpan);
|
||||||
if (luckyTimeFrenzy !== '') {
|
if (luckyTimeFrenzy !== '') {
|
||||||
@@ -113,7 +113,7 @@ export function LuckySection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Lucky!" Cookies Required (Frenzy)',
|
'"Lucky!" cookies required (frenzy)',
|
||||||
luckyReqFrenFrag,
|
luckyReqFrenFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -123,14 +123,14 @@ export function LuckySection() {
|
|||||||
|
|
||||||
const luckyRewardMaxSpan = document.createElement('span');
|
const luckyRewardMaxSpan = document.createElement('span');
|
||||||
luckyRewardMaxSpan.style.fontWeight = 'bold';
|
luckyRewardMaxSpan.style.fontWeight = 'bold';
|
||||||
luckyRewardMaxSpan.className = ColorTextPre + CacheLuckyReward;
|
luckyRewardMaxSpan.className = ColourTextPre + CacheLuckyReward;
|
||||||
luckyRewardMaxSpan.textContent =
|
luckyRewardMaxSpan.textContent =
|
||||||
Beautify(CacheLuckyReward) +
|
Beautify(CacheLuckyReward) +
|
||||||
(luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : '');
|
(luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : '');
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
`"Lucky!" Reward (MAX)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
`"Lucky!" reward (max)${luckySplit ? ' (golden / wrath)' : ''}`,
|
||||||
luckyRewardMaxSpan,
|
luckyRewardMaxSpan,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -138,14 +138,14 @@ export function LuckySection() {
|
|||||||
|
|
||||||
const luckyRewardFrenzyMaxSpan = document.createElement('span');
|
const luckyRewardFrenzyMaxSpan = document.createElement('span');
|
||||||
luckyRewardFrenzyMaxSpan.style.fontWeight = 'bold';
|
luckyRewardFrenzyMaxSpan.style.fontWeight = 'bold';
|
||||||
luckyRewardFrenzyMaxSpan.className = ColorTextPre + luckyRewardFrenzyMaxSpan;
|
luckyRewardFrenzyMaxSpan.className = ColourTextPre + luckyRewardFrenzyMaxSpan;
|
||||||
luckyRewardFrenzyMaxSpan.textContent =
|
luckyRewardFrenzyMaxSpan.textContent =
|
||||||
Beautify(CacheLuckyRewardFrenzy) +
|
Beautify(CacheLuckyRewardFrenzy) +
|
||||||
(luckySplit ? ` / ${Beautify(CacheLuckyWrathRewardFrenzy)}` : '');
|
(luckySplit ? ` / ${Beautify(CacheLuckyWrathRewardFrenzy)}` : '');
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
`"Lucky!" Reward (MAX) (Frenzy)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
`"Lucky!" reward (max) (frenzy)${luckySplit ? ' (golden / wrath)' : ''}`,
|
||||||
luckyRewardFrenzyMaxSpan,
|
luckyRewardFrenzyMaxSpan,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -158,14 +158,14 @@ export function LuckySection() {
|
|||||||
) + 13;
|
) + 13;
|
||||||
const luckyCurSpan = document.createElement('span');
|
const luckyCurSpan = document.createElement('span');
|
||||||
luckyCurSpan.style.fontWeight = 'bold';
|
luckyCurSpan.style.fontWeight = 'bold';
|
||||||
luckyCurSpan.className = ColorTextPre + luckyCurSpan;
|
luckyCurSpan.className = ColourTextPre + luckyCurSpan;
|
||||||
luckyCurSpan.textContent =
|
luckyCurSpan.textContent =
|
||||||
Beautify(CacheGoldenCookiesMult * luckyCurBase) +
|
Beautify(CacheGoldenCookiesMult * luckyCurBase) +
|
||||||
(luckySplit ? ` / ${Beautify(CacheWrathCookiesMult * luckyCurBase)}` : '');
|
(luckySplit ? ` / ${Beautify(CacheWrathCookiesMult * luckyCurBase)}` : '');
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
`"Lucky!" Reward (CUR)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
`"Lucky!" reward (cur)${luckySplit ? ' (golden / wrath)' : ''}`,
|
||||||
luckyCurSpan,
|
luckyCurSpan,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -186,10 +186,10 @@ export function ChainSection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsChainSection';
|
section.className = 'CMStatsChainSection';
|
||||||
|
|
||||||
const chainColor =
|
const chainColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
||||||
? ColorRed
|
? ColourRed
|
||||||
: ColorGreen;
|
: ColourGreen;
|
||||||
const chainTime =
|
const chainTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
@@ -200,7 +200,7 @@ export function ChainSection() {
|
|||||||
const chainReqFrag = document.createDocumentFragment();
|
const chainReqFrag = document.createDocumentFragment();
|
||||||
const chainReqSpan = document.createElement('span');
|
const chainReqSpan = document.createElement('span');
|
||||||
chainReqSpan.style.fontWeight = 'bold';
|
chainReqSpan.style.fontWeight = 'bold';
|
||||||
chainReqSpan.className = ColorTextPre + chainColor;
|
chainReqSpan.className = ColourTextPre + chainColour;
|
||||||
chainReqSpan.textContent = Beautify(CacheChainRequired);
|
chainReqSpan.textContent = Beautify(CacheChainRequired);
|
||||||
chainReqFrag.appendChild(chainReqSpan);
|
chainReqFrag.appendChild(chainReqSpan);
|
||||||
if (chainTime !== '') {
|
if (chainTime !== '') {
|
||||||
@@ -211,16 +211,16 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required',
|
'"Chain" cookies required',
|
||||||
chainReqFrag,
|
chainReqFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const chainWrathColor =
|
const chainWrathColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
||||||
? ColorRed
|
? ColourRed
|
||||||
: ColorGreen;
|
: ColourGreen;
|
||||||
const chainWrathTime =
|
const chainWrathTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
@@ -231,7 +231,7 @@ export function ChainSection() {
|
|||||||
const chainWrathReqFrag = document.createDocumentFragment();
|
const chainWrathReqFrag = document.createDocumentFragment();
|
||||||
const chainWrathReqSpan = document.createElement('span');
|
const chainWrathReqSpan = document.createElement('span');
|
||||||
chainWrathReqSpan.style.fontWeight = 'bold';
|
chainWrathReqSpan.style.fontWeight = 'bold';
|
||||||
chainWrathReqSpan.className = ColorTextPre + chainWrathColor;
|
chainWrathReqSpan.className = ColourTextPre + chainWrathColour;
|
||||||
chainWrathReqSpan.textContent = Beautify(CacheChainWrathRequired);
|
chainWrathReqSpan.textContent = Beautify(CacheChainWrathRequired);
|
||||||
chainWrathReqFrag.appendChild(chainWrathReqSpan);
|
chainWrathReqFrag.appendChild(chainWrathReqSpan);
|
||||||
if (chainWrathTime !== '') {
|
if (chainWrathTime !== '') {
|
||||||
@@ -242,16 +242,16 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required (Wrath)',
|
'"Chain" cookies required (Wrath)',
|
||||||
chainWrathReqFrag,
|
chainWrathReqFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const chainColorFrenzy =
|
const chainColourFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
||||||
? ColorRed
|
? ColourRed
|
||||||
: ColorGreen;
|
: ColourGreen;
|
||||||
const chainTimeFrenzy =
|
const chainTimeFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
@@ -262,7 +262,7 @@ export function ChainSection() {
|
|||||||
const chainReqFrenFrag = document.createDocumentFragment();
|
const chainReqFrenFrag = document.createDocumentFragment();
|
||||||
const chainReqFrenSpan = document.createElement('span');
|
const chainReqFrenSpan = document.createElement('span');
|
||||||
chainReqFrenSpan.style.fontWeight = 'bold';
|
chainReqFrenSpan.style.fontWeight = 'bold';
|
||||||
chainReqFrenSpan.className = ColorTextPre + chainColorFrenzy;
|
chainReqFrenSpan.className = ColourTextPre + chainColourFrenzy;
|
||||||
chainReqFrenSpan.textContent = Beautify(CacheChainFrenzyRequired);
|
chainReqFrenSpan.textContent = Beautify(CacheChainFrenzyRequired);
|
||||||
chainReqFrenFrag.appendChild(chainReqFrenSpan);
|
chainReqFrenFrag.appendChild(chainReqFrenSpan);
|
||||||
if (chainTimeFrenzy !== '') {
|
if (chainTimeFrenzy !== '') {
|
||||||
@@ -273,16 +273,16 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required (Frenzy)',
|
'"Chain" cookies required (Frenzy)',
|
||||||
chainReqFrenFrag,
|
chainReqFrenFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const chainWrathColorFrenzy =
|
const chainWrathColourFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
||||||
? ColorRed
|
? ColourRed
|
||||||
: ColorGreen;
|
: ColourGreen;
|
||||||
const chainWrathTimeFrenzy =
|
const chainWrathTimeFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
@@ -294,7 +294,7 @@ export function ChainSection() {
|
|||||||
const chainWrathReqFrenFrag = document.createDocumentFragment();
|
const chainWrathReqFrenFrag = document.createDocumentFragment();
|
||||||
const chainWrathReqFrenSpan = document.createElement('span');
|
const chainWrathReqFrenSpan = document.createElement('span');
|
||||||
chainWrathReqFrenSpan.style.fontWeight = 'bold';
|
chainWrathReqFrenSpan.style.fontWeight = 'bold';
|
||||||
chainWrathReqFrenSpan.className = ColorTextPre + chainWrathColorFrenzy;
|
chainWrathReqFrenSpan.className = ColourTextPre + chainWrathColourFrenzy;
|
||||||
chainWrathReqFrenSpan.textContent = Beautify(CacheChainFrenzyWrathRequired);
|
chainWrathReqFrenSpan.textContent = Beautify(CacheChainFrenzyWrathRequired);
|
||||||
chainWrathReqFrenFrag.appendChild(chainWrathReqFrenSpan);
|
chainWrathReqFrenFrag.appendChild(chainWrathReqFrenSpan);
|
||||||
if (chainWrathTimeFrenzy !== '') {
|
if (chainWrathTimeFrenzy !== '') {
|
||||||
@@ -305,7 +305,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required (Frenzy) (Wrath)',
|
'"Chain" cookies required (frenzy) (Wrath)',
|
||||||
chainWrathReqFrenFrag,
|
chainWrathReqFrenFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -314,7 +314,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Reward (MAX) (Golden / Wrath)',
|
'"Chain" reward (max) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainMaxReward[0])} / ${Beautify(
|
`${Beautify(CacheChainMaxReward[0])} / ${Beautify(
|
||||||
CacheChainWrathMaxReward[0],
|
CacheChainWrathMaxReward[0],
|
||||||
@@ -327,7 +327,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Reward (MAX) (Frenzy) (Golden / Wrath)',
|
'"Chain" reward (max) (frenzy) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(
|
`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(
|
||||||
CacheChainFrenzyMaxReward[0],
|
CacheChainFrenzyMaxReward[0],
|
||||||
@@ -354,7 +354,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Reward (CUR) (Golden / Wrath)',
|
'"Chain" reward (cur) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`,
|
`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`,
|
||||||
),
|
),
|
||||||
@@ -365,7 +365,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'CPS Needed For Next Level (G / W)',
|
'CPS needed for next level (g / w)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainRequiredNext)} / ${Beautify(
|
`${Beautify(CacheChainRequiredNext)} / ${Beautify(
|
||||||
CacheChainWrathRequiredNext,
|
CacheChainWrathRequiredNext,
|
||||||
@@ -377,7 +377,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'CPS Needed For Next Level (Frenzy) (G / W)',
|
'CPS needed for next level (frenzy) (g / w)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainFrenzyRequiredNext)} / ${Beautify(
|
`${Beautify(CacheChainFrenzyRequiredNext)} / ${Beautify(
|
||||||
CacheChainFrenzyWrathRequiredNext,
|
CacheChainFrenzyWrathRequiredNext,
|
||||||
@@ -397,8 +397,10 @@ export function SpellsSection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsSpellsSection';
|
section.className = 'CMStatsSpellsSection';
|
||||||
|
|
||||||
const conjureColor =
|
const conjureColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheConjure ? ColorRed : ColorGreen;
|
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
||||||
|
? ColourRed
|
||||||
|
: ColourGreen;
|
||||||
const conjureTime =
|
const conjureTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
@@ -409,7 +411,7 @@ export function SpellsSection() {
|
|||||||
const conjureReqFrag = document.createDocumentFragment();
|
const conjureReqFrag = document.createDocumentFragment();
|
||||||
const conjureReqSpan = document.createElement('span');
|
const conjureReqSpan = document.createElement('span');
|
||||||
conjureReqSpan.style.fontWeight = 'bold';
|
conjureReqSpan.style.fontWeight = 'bold';
|
||||||
conjureReqSpan.className = ColorTextPre + conjureColor;
|
conjureReqSpan.className = ColourTextPre + conjureColour;
|
||||||
conjureReqSpan.textContent = Beautify(CacheConjure);
|
conjureReqSpan.textContent = Beautify(CacheConjure);
|
||||||
conjureReqFrag.appendChild(conjureReqSpan);
|
conjureReqFrag.appendChild(conjureReqSpan);
|
||||||
if (conjureTime !== '') {
|
if (conjureTime !== '') {
|
||||||
@@ -420,7 +422,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Cookies Required',
|
'"Conjure Baked Goods" cookies required',
|
||||||
conjureReqFrag,
|
conjureReqFrag,
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -428,16 +430,16 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Reward (MAX)',
|
'"Conjure Baked Goods" reward (max)',
|
||||||
document.createTextNode(Beautify(CacheConjureReward)),
|
document.createTextNode(Beautify(CacheConjureReward)),
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const conjureFrenzyColor =
|
const conjureFrenzyColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
||||||
? ColorRed
|
? ColourRed
|
||||||
: ColorGreen;
|
: ColourGreen;
|
||||||
const conjureFrenzyCur = Math.min(
|
const conjureFrenzyCur = Math.min(
|
||||||
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||||
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
||||||
@@ -452,7 +454,7 @@ export function SpellsSection() {
|
|||||||
const conjureFrenzyReqFrag = document.createDocumentFragment();
|
const conjureFrenzyReqFrag = document.createDocumentFragment();
|
||||||
const conjureFrenzyReqSpan = document.createElement('span');
|
const conjureFrenzyReqSpan = document.createElement('span');
|
||||||
conjureFrenzyReqSpan.style.fontWeight = 'bold';
|
conjureFrenzyReqSpan.style.fontWeight = 'bold';
|
||||||
conjureFrenzyReqSpan.className = ColorTextPre + conjureFrenzyColor;
|
conjureFrenzyReqSpan.className = ColourTextPre + conjureFrenzyColour;
|
||||||
conjureFrenzyReqSpan.textContent = Beautify(CacheConjure * 7);
|
conjureFrenzyReqSpan.textContent = Beautify(CacheConjure * 7);
|
||||||
conjureFrenzyReqFrag.appendChild(conjureFrenzyReqSpan);
|
conjureFrenzyReqFrag.appendChild(conjureFrenzyReqSpan);
|
||||||
if (conjureFrenzyTime !== '') {
|
if (conjureFrenzyTime !== '') {
|
||||||
@@ -463,7 +465,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Cookies Required (Frenzy)',
|
'"Conjure Baked Goods" cookies required (frenzy)',
|
||||||
conjureFrenzyReqFrag,
|
conjureFrenzyReqFrag,
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -471,7 +473,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Reward (MAX) (Frenzy)',
|
'"Conjure Baked Goods" reward (max) (frenzy)',
|
||||||
document.createTextNode(Beautify(CacheConjureReward * 7)),
|
document.createTextNode(Beautify(CacheConjureReward * 7)),
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -479,7 +481,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Reward (CUR)',
|
'"Conjure Baked Goods" reward (cur)',
|
||||||
document.createTextNode(Beautify(conjureFrenzyCur)),
|
document.createTextNode(Beautify(conjureFrenzyCur)),
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -488,7 +490,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Spontaneous Edifice" Cookies Required (most expensive building)',
|
'"Spontaneous Edifice" cookies required (most expensive building)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`,
|
`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`,
|
||||||
),
|
),
|
||||||
@@ -507,11 +509,11 @@ export function GardenSection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsGardenSection';
|
section.className = 'CMStatsGardenSection';
|
||||||
|
|
||||||
const bakeberryColor =
|
const bakeberryColour =
|
||||||
Game.cookies < Game.cookiesPs * 60 * 10 * 100 ? ColorRed : ColorGreen;
|
Game.cookies < Game.cookiesPs * 60 * 10 * 100 ? ColourRed : ColourGreen;
|
||||||
const bakeberryFrag = document.createElement('span');
|
const bakeberryFrag = document.createElement('span');
|
||||||
bakeberryFrag.style.fontWeight = 'bold';
|
bakeberryFrag.style.fontWeight = 'bold';
|
||||||
bakeberryFrag.className = ColorTextPre + bakeberryColor;
|
bakeberryFrag.className = ColourTextPre + bakeberryColour;
|
||||||
bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 10 * 100);
|
bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 10 * 100);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
@@ -521,11 +523,11 @@ export function GardenSection() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const chocorootColor =
|
const chocorootColour =
|
||||||
Game.cookies < Game.cookiesPs * 60 * 100 ? ColorRed : ColorGreen;
|
Game.cookies < Game.cookiesPs * 60 * 100 ? ColourRed : ColourGreen;
|
||||||
const chocorootFrag = document.createElement('span');
|
const chocorootFrag = document.createElement('span');
|
||||||
chocorootFrag.style.fontWeight = 'bold';
|
chocorootFrag.style.fontWeight = 'bold';
|
||||||
chocorootFrag.className = ColorTextPre + chocorootColor;
|
chocorootFrag.className = ColourTextPre + chocorootColour;
|
||||||
chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 100);
|
chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 100);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
@@ -535,11 +537,11 @@ export function GardenSection() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const queenbeetColor =
|
const queenbeetColour =
|
||||||
Game.cookies < Game.cookiesPs * 60 * 60 * 25 ? ColorRed : ColorGreen;
|
Game.cookies < Game.cookiesPs * 60 * 60 * 25 ? ColourRed : ColourGreen;
|
||||||
const queenbeetFrag = document.createElement('span');
|
const queenbeetFrag = document.createElement('span');
|
||||||
queenbeetFrag.style.fontWeight = 'bold';
|
queenbeetFrag.style.fontWeight = 'bold';
|
||||||
queenbeetFrag.className = ColorTextPre + queenbeetColor;
|
queenbeetFrag.className = ColourTextPre + queenbeetColour;
|
||||||
queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60 * 25);
|
queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60 * 25);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
@@ -549,11 +551,11 @@ export function GardenSection() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const duketaterColor =
|
const duketaterColour =
|
||||||
Game.cookies < Game.cookiesPs * 60 * 15 * 100 ? ColorRed : ColorGreen;
|
Game.cookies < Game.cookiesPs * 60 * 15 * 100 ? ColourRed : ColourGreen;
|
||||||
const duketaterFrag = document.createElement('span');
|
const duketaterFrag = document.createElement('span');
|
||||||
duketaterFrag.style.fontWeight = 'bold';
|
duketaterFrag.style.fontWeight = 'bold';
|
||||||
duketaterFrag.className = ColorTextPre + duketaterColor;
|
duketaterFrag.className = ColourTextPre + duketaterColour;
|
||||||
duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 15 * 100);
|
duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 15 * 100);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
@@ -562,6 +564,21 @@ export function GardenSection() {
|
|||||||
duketaterFrag,
|
duketaterFrag,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
const missingPlantDrops = [];
|
||||||
|
Object.keys(GameData.PlantDrops).forEach((i) => {
|
||||||
|
if (!Game.HasUnlocked(GameData.PlantDrops[i])) {
|
||||||
|
missingPlantDrops.push(GameData.PlantDrops[i]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (missingPlantDrops.length !== 0) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Rare plant drops left to unlock',
|
||||||
|
StatsMissDisp(missingPlantDrops),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,7 +603,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Prestige Level (CUR / MAX)',
|
'Prestige level (cur / max)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`,
|
`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`,
|
||||||
),
|
),
|
||||||
@@ -619,7 +636,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Cookies To Next Level',
|
'Cookies to next level',
|
||||||
cookiesNextFrag,
|
cookiesNextFrag,
|
||||||
'NextPrestTooltipPlaceholder',
|
'NextPrestTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -628,7 +645,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Heavenly Chips (CUR / MAX)',
|
'Heavenly chips (cur / max)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(Game.heavenlyChips)} / ${Beautify(
|
`${Beautify(Game.heavenlyChips)} / ${Beautify(
|
||||||
possiblePresMax - Game.prestige + Game.heavenlyChips,
|
possiblePresMax - Game.prestige + Game.heavenlyChips,
|
||||||
@@ -641,7 +658,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Heavenly Chips Per Second (last 5 seconds)',
|
'Heavenly chips per second (last 5 seconds)',
|
||||||
document.createTextNode(Beautify(CacheHCPerSecond, 2)),
|
document.createTextNode(Beautify(CacheHCPerSecond, 2)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -655,14 +672,14 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Heavenly Chips To Target Set In Settings (CUR)',
|
'Heavenly chips to target set in settings (cur)',
|
||||||
document.createTextNode(Beautify(CookiesTillTarget)),
|
document.createTextNode(Beautify(CookiesTillTarget)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Time To Target (CUR, Current 5 Second Average)',
|
'Time till target (cur, current 5 second average)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
FormatTime(CookiesTillTarget / CacheHCPerSecond),
|
FormatTime(CookiesTillTarget / CacheHCPerSecond),
|
||||||
),
|
),
|
||||||
@@ -683,7 +700,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Reset Bonus Income',
|
'Reset bonus income',
|
||||||
resetFrag,
|
resetFrag,
|
||||||
'ResetTooltipPlaceholder',
|
'ResetTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -789,13 +806,6 @@ export function SeasonSection() {
|
|||||||
specDisp = true;
|
specDisp = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const missingPlantDrops = [];
|
|
||||||
Object.keys(GameData.PlantDrops).forEach((i) => {
|
|
||||||
if (!Game.HasUnlocked(GameData.PlantDrops[i])) {
|
|
||||||
missingPlantDrops.push(GameData.PlantDrops[i]);
|
|
||||||
specDisp = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const choEgg =
|
const choEgg =
|
||||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||||
const centEgg = Game.Has('Century egg');
|
const centEgg = Game.Has('Century egg');
|
||||||
@@ -821,13 +831,16 @@ export function SeasonSection() {
|
|||||||
else if (godLvl === 2) failRateHalloween *= 0.95;
|
else if (godLvl === 2) failRateHalloween *= 0.95;
|
||||||
else if (godLvl === 3) failRateHalloween *= 0.97;
|
else if (godLvl === 3) failRateHalloween *= 0.97;
|
||||||
}
|
}
|
||||||
|
const obtainedCookiesChance = missingHalloweenCookies.length / 7;
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify((1 - failRateHalloween) * 100)}% / ${Beautify(
|
`${Beautify(
|
||||||
(1 - failRateHalloween * 0.9) * 100,
|
(1 - failRateHalloween) * obtainedCookiesChance * 100,
|
||||||
|
)}% / ${Beautify(
|
||||||
|
(1 - failRateHalloween * 0.9) * obtainedCookiesChance * 100,
|
||||||
)}%`,
|
)}%`,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -851,12 +864,15 @@ export function SeasonSection() {
|
|||||||
else if (godLvl === 2) failRateChristmas *= 0.95;
|
else if (godLvl === 2) failRateChristmas *= 0.95;
|
||||||
else if (godLvl === 3) failRateChristmas *= 0.97;
|
else if (godLvl === 3) failRateChristmas *= 0.97;
|
||||||
}
|
}
|
||||||
|
const obtainedCookiesChance = missingChristmasCookies.length / 7;
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a cookie from reindeer',
|
'Chance of receiving a cookie from reindeer',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify((1 - failRateChristmas) * 100)}%`,
|
`${Beautify(
|
||||||
|
(1 - failRateChristmas) * obtainedCookiesChance * 100,
|
||||||
|
)}%`,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -943,15 +959,6 @@ export function SeasonSection() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (missingPlantDrops.length !== 0) {
|
|
||||||
section.appendChild(
|
|
||||||
StatsListing(
|
|
||||||
'basic',
|
|
||||||
'Rare plant drops left to unlock',
|
|
||||||
StatsMissDisp(missingPlantDrops),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Game.season === 'christmas')
|
if (Game.season === 'christmas')
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
@@ -7,28 +7,32 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
|||||||
* @param {number} mode Sets the intensity of the flash, used to recursively dim flash
|
* @param {number} mode Sets the intensity of the flash, used to recursively dim flash
|
||||||
* All calls of function have use mode === 3
|
* All calls of function have use mode === 3
|
||||||
* @param {string} config The setting in CM.Options that is checked before creating the flash
|
* @param {string} config The setting in CM.Options that is checked before creating the flash
|
||||||
|
* @param {bool} forced Whether the sound should play regardless of settings, used to test the sound
|
||||||
*/
|
*/
|
||||||
export default function Flash(mode, config) {
|
export default function Flash(mode, config, forced) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if (
|
if (
|
||||||
(CMOptions[config] === 1 && mode === 3 && isInitializing === false) ||
|
((CMOptions[config] === 1 || forced) &&
|
||||||
|
mode === 3 &&
|
||||||
|
isInitializing === false) ||
|
||||||
mode === 1
|
mode === 1
|
||||||
) {
|
) {
|
||||||
l('CMWhiteScreen').style.opacity = '0.5';
|
l('CMFlashScreen').style.backgroundColor = CMOptions[`Colour${config}`];
|
||||||
|
l('CMFlashScreen').style.opacity = '0.5';
|
||||||
if (mode === 3) {
|
if (mode === 3) {
|
||||||
l('CMWhiteScreen').style.display = 'inline';
|
l('CMFlashScreen').style.display = 'inline';
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
Flash(2, config);
|
Flash(2, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
Flash(0, config);
|
Flash(0, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
}
|
}
|
||||||
} else if (mode === 2) {
|
} else if (mode === 2) {
|
||||||
l('CMWhiteScreen').style.opacity = '1';
|
l('CMFlashScreen').style.opacity = '1';
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
Flash(1, config);
|
Flash(1, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
} else if (mode === 0) l('CMWhiteScreen').style.display = 'none';
|
} else if (mode === 0) l('CMFlashScreen').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default function ReplaceAscendTooltip() {
|
|||||||
)} more cookies</b> for the next level.<br>`;
|
)} more cookies</b> for the next level.<br>`;
|
||||||
str += `${
|
str += `${
|
||||||
CMOptions.TooltipAscendButton
|
CMOptions.TooltipAscendButton
|
||||||
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you are making ${Beautify(
|
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify(
|
||||||
CacheHCPerSecond,
|
CacheHCPerSecond,
|
||||||
2,
|
2,
|
||||||
)} chips on average in the last 5 seconds.<br>`
|
)} chips on average in the last 5 seconds.<br>`
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ColorTextPre,
|
ColourTextPre,
|
||||||
ColorBorderPre,
|
ColourBorderPre,
|
||||||
ColorGray,
|
ColourGray,
|
||||||
ColorBlue,
|
ColourBlue,
|
||||||
ColorRed,
|
ColourRed,
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
TooltipType,
|
TooltipType,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ export function TooltipCreateTooltipBox() {
|
|||||||
tooltipBox.style.padding = '4px';
|
tooltipBox.style.padding = '4px';
|
||||||
tooltipBox.style.margin = '0px -4px';
|
tooltipBox.style.margin = '0px -4px';
|
||||||
tooltipBox.id = 'CMTooltipBorder';
|
tooltipBox.id = 'CMTooltipBorder';
|
||||||
tooltipBox.className = ColorTextPre + ColorGray;
|
tooltipBox.className = ColourTextPre + ColourGray;
|
||||||
return tooltipBox;
|
return tooltipBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +36,7 @@ export function TooltipCreateHeader(text) {
|
|||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.style.fontWeight = 'bold';
|
div.style.fontWeight = 'bold';
|
||||||
div.id = `${text}Title`;
|
div.id = `${text}Title`;
|
||||||
div.className = ColorTextPre + ColorBlue;
|
div.className = ColourTextPre + ColourBlue;
|
||||||
div.textContent = text;
|
div.textContent = text;
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
@@ -66,13 +65,13 @@ export function TooltipCreateWarningSection() {
|
|||||||
box.id = boxId;
|
box.id = boxId;
|
||||||
box.style.display = 'none';
|
box.style.display = 'none';
|
||||||
box.style.transition = 'opacity 0.1s ease-out';
|
box.style.transition = 'opacity 0.1s ease-out';
|
||||||
box.className = ColorBorderPre + color;
|
box.className = ColourBorderPre + color;
|
||||||
box.style.padding = '2px';
|
box.style.padding = '2px';
|
||||||
box.style.background = '#000 url(img/darkNoise.png)';
|
box.style.background = '#000 url(img/darkNoise.png)';
|
||||||
const labelDiv = document.createElement('div');
|
const labelDiv = document.createElement('div');
|
||||||
box.appendChild(labelDiv);
|
box.appendChild(labelDiv);
|
||||||
const labelSpan = document.createElement('span');
|
const labelSpan = document.createElement('span');
|
||||||
labelSpan.className = ColorTextPre + color;
|
labelSpan.className = ColourTextPre + color;
|
||||||
labelSpan.style.fontWeight = 'bold';
|
labelSpan.style.fontWeight = 'bold';
|
||||||
labelSpan.textContent = labelTextFront;
|
labelSpan.textContent = labelTextFront;
|
||||||
labelDiv.appendChild(labelSpan);
|
labelDiv.appendChild(labelSpan);
|
||||||
@@ -89,7 +88,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.appendChild(
|
TooltipWarn.appendChild(
|
||||||
create(
|
create(
|
||||||
'CMDispTooltipWarnLucky',
|
'CMDispTooltipWarnLucky',
|
||||||
ColorRed,
|
ColourRed,
|
||||||
'Warning: ',
|
'Warning: ',
|
||||||
'Purchase of this item will put you under the number of Cookies required for "Lucky!"',
|
'Purchase of this item will put you under the number of Cookies required for "Lucky!"',
|
||||||
'CMDispTooltipWarnLuckyText',
|
'CMDispTooltipWarnLuckyText',
|
||||||
@@ -99,7 +98,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.appendChild(
|
TooltipWarn.appendChild(
|
||||||
create(
|
create(
|
||||||
'CMDispTooltipWarnLuckyFrenzy',
|
'CMDispTooltipWarnLuckyFrenzy',
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
'Warning: ',
|
'Warning: ',
|
||||||
'Purchase of this item will put you under the number of Cookies required for "Lucky!" (Frenzy)',
|
'Purchase of this item will put you under the number of Cookies required for "Lucky!" (Frenzy)',
|
||||||
'CMDispTooltipWarnLuckyFrenzyText',
|
'CMDispTooltipWarnLuckyFrenzyText',
|
||||||
@@ -109,7 +108,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.appendChild(
|
TooltipWarn.appendChild(
|
||||||
create(
|
create(
|
||||||
'CMDispTooltipWarnConjure',
|
'CMDispTooltipWarnConjure',
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
'Warning: ',
|
'Warning: ',
|
||||||
'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods"',
|
'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods"',
|
||||||
'CMDispTooltipWarnConjureText',
|
'CMDispTooltipWarnConjureText',
|
||||||
@@ -119,7 +118,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.appendChild(
|
TooltipWarn.appendChild(
|
||||||
create(
|
create(
|
||||||
'CMDispTooltipWarnConjureFrenzy',
|
'CMDispTooltipWarnConjureFrenzy',
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
'Warning: ',
|
'Warning: ',
|
||||||
'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods" (Frenzy)',
|
'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods" (Frenzy)',
|
||||||
'CMDispTooltipWarnConjureFrenzyText',
|
'CMDispTooltipWarnConjureFrenzyText',
|
||||||
@@ -129,7 +128,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.appendChild(
|
TooltipWarn.appendChild(
|
||||||
create(
|
create(
|
||||||
'CMDispTooltipWarnEdifice',
|
'CMDispTooltipWarnEdifice',
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
'Warning: ',
|
'Warning: ',
|
||||||
'Purchase of this item will put you under the number of Cookies needed for "Spontaneous Edifice" to possibly give you your most expensive building"',
|
'Purchase of this item will put you under the number of Cookies needed for "Spontaneous Edifice" to possibly give you your most expensive building"',
|
||||||
'CMDispTooltipWarnEdificeText',
|
'CMDispTooltipWarnEdificeText',
|
||||||
@@ -139,7 +138,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.appendChild(
|
TooltipWarn.appendChild(
|
||||||
create(
|
create(
|
||||||
'CMDispTooltipWarnUser',
|
'CMDispTooltipWarnUser',
|
||||||
ColorRed,
|
ColourRed,
|
||||||
'Warning: ',
|
'Warning: ',
|
||||||
`Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`,
|
`Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`,
|
||||||
'CMDispTooltipWarnUserText',
|
'CMDispTooltipWarnUserText',
|
||||||
@@ -163,7 +162,7 @@ export function TooltipCreateCalculationSection(tooltip) {
|
|||||||
tooltip.appendChild(income);
|
tooltip.appendChild(income);
|
||||||
|
|
||||||
tooltip.appendChild(TooltipCreateHeader('Bonus Cookies per Click'));
|
tooltip.appendChild(TooltipCreateHeader('Bonus Cookies per Click'));
|
||||||
tooltip.lastChild.style.display = 'none';
|
tooltip.lastChild.style.display = 'none'; // eslint-disable-line no-param-reassign
|
||||||
const click = document.createElement('div');
|
const click = document.createElement('div');
|
||||||
click.style.marginBottom = '4px';
|
click.style.marginBottom = '4px';
|
||||||
click.style.color = 'white';
|
click.style.color = 'white';
|
||||||
@@ -186,7 +185,8 @@ export function TooltipCreateCalculationSection(tooltip) {
|
|||||||
tooltip.appendChild(
|
tooltip.appendChild(
|
||||||
TooltipCreateHeader('Production left till next achievement'),
|
TooltipCreateHeader('Production left till next achievement'),
|
||||||
);
|
);
|
||||||
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // Assign a id in order to hid when no achiev's are left
|
// Assign a id in order to hide when no achiev's are left
|
||||||
|
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // eslint-disable-line no-param-reassign
|
||||||
const production = document.createElement('div');
|
const production = document.createElement('div');
|
||||||
production.id = 'CMTooltipProduction';
|
production.id = 'CMTooltipProduction';
|
||||||
tooltip.appendChild(production);
|
tooltip.appendChild(production);
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
import UpdateTooltips from './UpdateTooltips';
|
||||||
import UpdateTooltips, * as UpdateTooltip from './UpdateTooltips';
|
|
||||||
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
GetTimeColor,
|
GetTimeColour,
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
|
||||||
import {
|
import {
|
||||||
SimpleTooltipElements,
|
SimpleTooltipElements,
|
||||||
TooltipName,
|
TooltipName,
|
||||||
@@ -65,7 +62,7 @@ export function CreateTooltip(type, name) {
|
|||||||
`so far<br/>• <b>${Beautify(amortizeAmount)}</b> ${
|
`so far<br/>• <b>${Beautify(amortizeAmount)}</b> ${
|
||||||
Math.floor(amortizeAmount) === 1 ? 'cookie' : 'cookies'
|
Math.floor(amortizeAmount) === 1 ? 'cookie' : 'cookies'
|
||||||
} left to amortize (${
|
} left to amortize (${
|
||||||
GetTimeColor(
|
GetTimeColour(
|
||||||
(buildPrice - Game.Objects[name].totalCookies) /
|
(buildPrice - Game.Objects[name].totalCookies) /
|
||||||
(Game.Objects[name].storedTotalCps * Game.globalCpsMult),
|
(Game.Objects[name].storedTotalCps * Game.globalCpsMult),
|
||||||
).text
|
).text
|
||||||
@@ -143,8 +140,8 @@ export function CreateTooltip(type, name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sets global variables used by CM.Disp.UpdateTooltip()
|
// Sets global variables used by CM.Disp.UpdateTooltip()
|
||||||
TooltipType = type;
|
TooltipType = type; // eslint-disable-line no-unused-vars
|
||||||
TooltipName = name;
|
TooltipName = name; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
UpdateTooltips();
|
UpdateTooltips();
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import { SimObjects } from '../../../Sim/VariablesAndData';
|
|||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
FormatTime,
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColour,
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
} 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 {
|
||||||
ColorTextPre,
|
ColourTextPre,
|
||||||
LastTargetTooltipBuilding,
|
LastTargetTooltipBuilding,
|
||||||
TooltipBonusIncome,
|
TooltipBonusIncome,
|
||||||
TooltipName,
|
TooltipName,
|
||||||
@@ -54,22 +54,23 @@ export default function Building() {
|
|||||||
CMOptions.ScaleSeparator ? ',' : '.'
|
CMOptions.ScaleSeparator ? ',' : '.'
|
||||||
}01% of income)`;
|
}01% of income)`;
|
||||||
}
|
}
|
||||||
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
l('CMTooltipBorder').className =
|
||||||
|
ColourTextPre + target[TooltipName].color;
|
||||||
if (CMOptions.PPDisplayTime)
|
if (CMOptions.PPDisplayTime)
|
||||||
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
||||||
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||||
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
l('CMTooltipPP').className = ColourTextPre + target[TooltipName].color;
|
||||||
const timeColor = GetTimeColor(
|
const timeColour = GetTimeColour(
|
||||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
);
|
);
|
||||||
l('CMTooltipTime').textContent = timeColor.text;
|
l('CMTooltipTime').textContent = timeColour.text;
|
||||||
if (
|
if (
|
||||||
timeColor.text === 'Done!' &&
|
timeColour.text === 'Done!' &&
|
||||||
Game.cookies < target[TooltipName].price
|
Game.cookies < target[TooltipName].price
|
||||||
) {
|
) {
|
||||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
l('CMTooltipTime').textContent = `${timeColour.text} (with Wrink)`;
|
||||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
} else l('CMTooltipTime').textContent = timeColour.text;
|
||||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
l('CMTooltipTime').className = ColourTextPre + timeColour.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add "production left till next achievement"-bar
|
// Add "production left till next achievement"-bar
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default function GardenPlots() {
|
|||||||
const mature =
|
const mature =
|
||||||
minigame.plot[TooltipName[1]][TooltipName[0]][1] >
|
minigame.plot[TooltipName[1]][TooltipName[0]][1] >
|
||||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||||
.matureBase;
|
.mature;
|
||||||
const plantName =
|
const plantName =
|
||||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||||
.name;
|
.name;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
GetTimeColor,
|
GetTimeColour,
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColorTextPre, TooltipName } from '../../VariablesAndData';
|
import { ColourTextPre, TooltipName } from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,11 +25,11 @@ export default function Grimoire() {
|
|||||||
const time = document.createElement('div');
|
const time = document.createElement('div');
|
||||||
time.id = 'CMTooltipTime';
|
time.id = 'CMTooltipTime';
|
||||||
tooltipBox.appendChild(time);
|
tooltipBox.appendChild(time);
|
||||||
const timeColor = GetTimeColor(
|
const timeColour = GetTimeColour(
|
||||||
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost),
|
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost),
|
||||||
);
|
);
|
||||||
time.textContent = timeColor.text;
|
time.textContent = timeColour.text;
|
||||||
time.className = ColorTextPre + timeColor.color;
|
time.className = ColourTextPre + timeColour.color;
|
||||||
|
|
||||||
// Time left untill magic spent is recovered
|
// Time left untill magic spent is recovered
|
||||||
if (spellCost <= minigame.magic) {
|
if (spellCost <= minigame.magic) {
|
||||||
@@ -37,15 +37,15 @@ export default function Grimoire() {
|
|||||||
const recover = document.createElement('div');
|
const recover = document.createElement('div');
|
||||||
recover.id = 'CMTooltipRecover';
|
recover.id = 'CMTooltipRecover';
|
||||||
tooltipBox.appendChild(recover);
|
tooltipBox.appendChild(recover);
|
||||||
const recoverColor = GetTimeColor(
|
const recoverColour = GetTimeColour(
|
||||||
CalculateGrimoireRefillTime(
|
CalculateGrimoireRefillTime(
|
||||||
Math.max(0, minigame.magic - spellCost),
|
Math.max(0, minigame.magic - spellCost),
|
||||||
minigame.magicM,
|
minigame.magicM,
|
||||||
minigame.magic,
|
minigame.magic,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
recover.textContent = recoverColor.text;
|
recover.textContent = recoverColour.text;
|
||||||
recover.className = ColorTextPre + recoverColor.color;
|
recover.className = ColourTextPre + recoverColour.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import GetLumpColor from '../../HelperFunctions/GetLumpColor';
|
import GetLumpColour from '../../HelperFunctions/GetLumpColour';
|
||||||
import { ColorTextPre } from '../../VariablesAndData';
|
import { ColourTextPre } from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
/**
|
/**
|
||||||
* This function adds extra info to the Sugar Lump tooltip
|
* This function adds extra info to the Sugar Lump tooltip
|
||||||
@@ -15,8 +15,8 @@ export default function SugarLump() {
|
|||||||
const lumpType = document.createElement('div');
|
const lumpType = document.createElement('div');
|
||||||
lumpType.id = 'CMTooltipTime';
|
lumpType.id = 'CMTooltipTime';
|
||||||
tooltipBox.appendChild(lumpType);
|
tooltipBox.appendChild(lumpType);
|
||||||
const lumpColor = GetLumpColor(Game.lumpCurrentType);
|
const lumpColour = GetLumpColour(Game.lumpCurrentType);
|
||||||
lumpType.textContent = lumpColor.text;
|
lumpType.textContent = lumpColour.text;
|
||||||
lumpType.className = ColorTextPre + lumpColor.color;
|
lumpType.className = ColourTextPre + lumpColour.color;
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import { CMOptions } from '../../../Config/VariablesAndData';
|
|||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
FormatTime,
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColour,
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
} 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 {
|
||||||
ColorTextPre,
|
ColourTextPre,
|
||||||
TooltipBonusIncome,
|
TooltipBonusIncome,
|
||||||
TooltipBonusMouse,
|
TooltipBonusMouse,
|
||||||
TooltipName,
|
TooltipName,
|
||||||
@@ -56,7 +56,7 @@ export default function Upgrade() {
|
|||||||
}01% of income)`;
|
}01% of income)`;
|
||||||
}
|
}
|
||||||
l('CMTooltipBorder').className =
|
l('CMTooltipBorder').className =
|
||||||
ColorTextPre +
|
ColourTextPre +
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||||
// If clicking power upgrade
|
// If clicking power upgrade
|
||||||
if (TooltipBonusMouse) {
|
if (TooltipBonusMouse) {
|
||||||
@@ -81,21 +81,21 @@ export default function Upgrade() {
|
|||||||
2,
|
2,
|
||||||
);
|
);
|
||||||
l('CMTooltipPP').className =
|
l('CMTooltipPP').className =
|
||||||
ColorTextPre +
|
ColourTextPre +
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const timeColor = GetTimeColor(
|
const timeColour = GetTimeColour(
|
||||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
);
|
);
|
||||||
l('CMTooltipTime').textContent = timeColor.text;
|
l('CMTooltipTime').textContent = timeColour.text;
|
||||||
if (
|
if (
|
||||||
timeColor.text === 'Done!' &&
|
timeColour.text === 'Done!' &&
|
||||||
Game.cookies < Game.UpgradesInStore[TooltipName].getPrice()
|
Game.cookies < Game.UpgradesInStore[TooltipName].getPrice()
|
||||||
) {
|
) {
|
||||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
l('CMTooltipTime').textContent = `${timeColour.text} (with Wrink)`;
|
||||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
} else l('CMTooltipTime').textContent = timeColour.text;
|
||||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
l('CMTooltipTime').className = ColourTextPre + timeColour.color;
|
||||||
|
|
||||||
// Add extra info to Chocolate egg tooltip
|
// Add extra info to Chocolate egg tooltip
|
||||||
if (Game.UpgradesInStore[TooltipName].name === 'Chocolate egg') {
|
if (Game.UpgradesInStore[TooltipName].name === 'Chocolate egg') {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable prefer-const */
|
|
||||||
/**
|
/**
|
||||||
* Section: Variables used in Disp functions */
|
* Section: Variables used in Disp functions */
|
||||||
|
|
||||||
@@ -7,32 +6,32 @@ export let DispCSS;
|
|||||||
/**
|
/**
|
||||||
* These are variables used to create DOM object names and id (e.g., 'CMTextTooltip)
|
* These are variables used to create DOM object names and id (e.g., 'CMTextTooltip)
|
||||||
*/
|
*/
|
||||||
export const ColorTextPre = 'CMText';
|
export const ColourTextPre = 'CMText';
|
||||||
export const ColorBackPre = 'CMBack';
|
export const ColourBackPre = 'CMBack';
|
||||||
export const ColorBorderPre = 'CMBorder';
|
export const ColourBorderPre = 'CMBorder';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These are variables which can be set in the options by the user to standardize colours throughout CookieMonster
|
* These are variables which can be set in the options by the user to standardize colours throughout CookieMonster
|
||||||
*/
|
*/
|
||||||
export const ColorBlue = 'Blue';
|
export const ColourBlue = 'Blue';
|
||||||
export const ColorGreen = 'Green';
|
export const ColourGreen = 'Green';
|
||||||
export const ColorYellow = 'Yellow';
|
export const ColourYellow = 'Yellow';
|
||||||
export const ColorOrange = 'Orange';
|
export const ColourOrange = 'Orange';
|
||||||
export const ColorRed = 'Red';
|
export const ColourRed = 'Red';
|
||||||
export const ColorPurple = 'Purple';
|
export const ColourPurple = 'Purple';
|
||||||
export const ColorGray = 'Gray';
|
export const ColourGray = 'Gray';
|
||||||
export const ColorPink = 'Pink';
|
export const ColourPink = 'Pink';
|
||||||
export const ColorBrown = 'Brown';
|
export const ColourBrown = 'Brown';
|
||||||
export const Colors = [
|
export const ColoursOrdering = [
|
||||||
ColorGray,
|
ColourGray,
|
||||||
ColorBlue,
|
ColourBlue,
|
||||||
ColorGreen,
|
ColourGreen,
|
||||||
ColorYellow,
|
ColourYellow,
|
||||||
ColorOrange,
|
ColourOrange,
|
||||||
ColorRed,
|
ColourRed,
|
||||||
ColorPurple,
|
ColourPurple,
|
||||||
ColorPink,
|
ColourPink,
|
||||||
ColorBrown,
|
ColourBrown,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,6 +78,11 @@ export const TooltipText = [
|
|||||||
'Cheated cookies might break this formula',
|
'Cheated cookies might break this formula',
|
||||||
'250px',
|
'250px',
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'FavouriteSettingPlaceholder',
|
||||||
|
"Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings",
|
||||||
|
'250px',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
export const SimpleTooltipElements = {};
|
export const SimpleTooltipElements = {};
|
||||||
|
|
||||||
@@ -86,15 +90,15 @@ export const SimpleTooltipElements = {};
|
|||||||
* These are variables used by the functions that create tooltips for wrinklers
|
* These are variables used by the functions that create tooltips for wrinklers
|
||||||
* See CM.Disp.CheckWrinklerTooltip(), CM.Disp.UpdateWrinklerTooltip() and CM.Main.AddWrinklerAreaDetect()
|
* See CM.Disp.CheckWrinklerTooltip(), CM.Disp.UpdateWrinklerTooltip() and CM.Main.AddWrinklerAreaDetect()
|
||||||
*/
|
*/
|
||||||
export let TooltipWrinklerArea = 0;
|
export let TooltipWrinklerArea = 0; // eslint-disable-line prefer-const
|
||||||
export let TooltipWrinkler = -1;
|
export let TooltipWrinkler = -1; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This array is used to store whether a Wrinkler tooltip is being shown or not
|
* This array is used to store whether a Wrinkler tooltip is being shown or not
|
||||||
* [i] = 1 means tooltip is being shown, [i] = 0 means hidden
|
* [i] = 1 means tooltip is being shown, [i] = 0 means hidden
|
||||||
* It is used by CM.Disp.CheckWrinklerTooltip() and CM.Main.AddWrinklerAreaDetect()
|
* It is used by CM.Disp.CheckWrinklerTooltip() and CM.Main.AddWrinklerAreaDetect()
|
||||||
*/
|
*/
|
||||||
export let TooltipWrinklerBeingShown = [];
|
export let TooltipWrinklerBeingShown = []; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
export let CMLastAscendState;
|
export let CMLastAscendState;
|
||||||
export let CMSayTime;
|
export let CMSayTime;
|
||||||
@@ -102,9 +106,9 @@ export let CMSayTime;
|
|||||||
/**
|
/**
|
||||||
* These are variables used to create various displays when the game is loaded on the "sell all" screen
|
* These are variables used to create various displays when the game is loaded on the "sell all" screen
|
||||||
*/
|
*/
|
||||||
export let LastTargetBotBar = 1;
|
export let LastTargetBotBar = 1; // eslint-disable-line prefer-const
|
||||||
export let LastTargetBuildings = 1;
|
export let LastTargetBuildings = 1; // eslint-disable-line prefer-const
|
||||||
export let LastTargetTooltipBuilding = 1;
|
export let LastTargetTooltipBuilding = 1; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These arrays are used in the stats page to show
|
* These arrays are used in the stats page to show
|
||||||
@@ -116,24 +120,24 @@ export const ClickTimes = [1, 5, 10, 15, 30];
|
|||||||
/**
|
/**
|
||||||
* This array is used to give certain timers specific colours
|
* This array is used to give certain timers specific colours
|
||||||
*/
|
*/
|
||||||
export const BuffColors = {
|
export const BuffColours = {
|
||||||
Frenzy: ColorYellow,
|
Frenzy: ColourYellow,
|
||||||
'Dragon Harvest': ColorBrown,
|
'Dragon Harvest': ColourBrown,
|
||||||
'Elder frenzy': ColorGreen,
|
'Elder frenzy': ColourGreen,
|
||||||
Clot: ColorRed,
|
Clot: ColourRed,
|
||||||
'Click frenzy': ColorBlue,
|
'Click frenzy': ColourBlue,
|
||||||
Dragonflight: ColorPink,
|
Dragonflight: ColourPink,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This array is used to track GC timers
|
* This array is used to track GC timers
|
||||||
*/
|
*/
|
||||||
export let GCTimers = {};
|
export let GCTimers = {}; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to store the number of cookies to be displayed in the tab-title
|
* Used to store the number of cookies to be displayed in the tab-title
|
||||||
*/
|
*/
|
||||||
export let Title = '';
|
export let Title = ''; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
export let TooltipPrice;
|
export let TooltipPrice;
|
||||||
export let TooltipBonusIncome;
|
export let TooltipBonusIncome;
|
||||||
@@ -143,3 +147,8 @@ export let TooltipBonusMouse;
|
|||||||
|
|
||||||
export let LastAscendState;
|
export let LastAscendState;
|
||||||
export let LastNumberOfTimers;
|
export let LastNumberOfTimers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This stores the names of settings shown in the favourites section
|
||||||
|
*/
|
||||||
|
export let FavouriteSettings = []; // eslint-disable-line prefer-const
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable prefer-const */
|
|
||||||
/** Variable that shows if Cookie Moonster is initzializing */
|
/** Variable that shows if Cookie Moonster is initzializing */
|
||||||
export let isInitializing = false;
|
export let isInitializing = false; // eslint-disable-line prefer-const
|
||||||
export let test;
|
export let test;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||||
import Draw from '../Disp/Draw';
|
import CMDrawHook from '../Disp/DrawHook';
|
||||||
|
import CMClickHook from '../Main/ClickHook';
|
||||||
import InitializeCookieMonster from '../Main/Initialization';
|
import InitializeCookieMonster from '../Main/Initialization';
|
||||||
import CMLoop from '../Main/Loop';
|
import CMLoopHook from '../Main/LoopHook';
|
||||||
import { isInitializing } from './Variables';
|
import { isInitializing } from './Variables';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,14 +15,16 @@ export default function init() {
|
|||||||
isInitializing = true;
|
isInitializing = true;
|
||||||
let proceed = true;
|
let proceed = true;
|
||||||
if (Game.version !== Number(VersionMajor)) {
|
if (Game.version !== Number(VersionMajor)) {
|
||||||
|
// eslint-disable-next-line no-restricted-globals, no-alert
|
||||||
proceed = confirm(
|
proceed = confirm(
|
||||||
`Cookie Monster version ${VersionMajor}.${VersionMinor} is meant for Game version ${VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`,
|
`Cookie Monster version ${VersionMajor}.${VersionMinor} is meant for Game version ${VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (proceed) {
|
if (proceed) {
|
||||||
InitializeCookieMonster();
|
InitializeCookieMonster();
|
||||||
Game.registerHook('draw', Draw);
|
Game.registerHook('draw', CMDrawHook);
|
||||||
Game.registerHook('logic', CMLoop);
|
Game.registerHook('logic', CMLoopHook);
|
||||||
isInitializing = false;
|
Game.registerHook('click', CMClickHook);
|
||||||
|
isInitializing = false; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { LoadConfig } from '../Config/SaveLoadReload/SaveLoadReloadSettings';
|
import { LoadConfig } from '../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||||
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||||
|
import { FavouriteSettings } from '../Disp/VariablesAndData';
|
||||||
import InitData from '../Sim/InitializeData/InitData';
|
import InitData from '../Sim/InitializeData/InitData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,6 +10,9 @@ import InitData from '../Sim/InitializeData/InitData';
|
|||||||
export default function load(str) {
|
export default function load(str) {
|
||||||
const save = JSON.parse(str);
|
const save = JSON.parse(str);
|
||||||
InitData();
|
InitData();
|
||||||
|
// The if-statement is a failsafe for old saves
|
||||||
|
if (typeof save.favouriteSettings !== 'undefined')
|
||||||
|
FavouriteSettings = save.favouriteSettings; // eslint-disable-line no-unused-vars
|
||||||
LoadConfig(save.settings);
|
LoadConfig(save.settings);
|
||||||
if (save.version !== `${VersionMajor}.${VersionMinor}`) {
|
if (save.version !== `${VersionMajor}.${VersionMinor}`) {
|
||||||
if (Game.prefs.popups)
|
if (Game.prefs.popups)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { CMOptions } from '../Config/VariablesAndData';
|
import { CMOptions } from '../Config/VariablesAndData';
|
||||||
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||||
|
import { FavouriteSettings } from '../Disp/VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This creates a save function to the CM object. Per Game code/comments:
|
* This creates a save function to the CM object. Per Game code/comments:
|
||||||
@@ -8,6 +9,7 @@ import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
|||||||
*/
|
*/
|
||||||
export default function save() {
|
export default function save() {
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
|
favouriteSettings: FavouriteSettings,
|
||||||
settings: CMOptions,
|
settings: CMOptions,
|
||||||
version: `${VersionMajor}.${VersionMinor}`,
|
version: `${VersionMajor}.${VersionMinor}`,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default function CheckGardenTick() {
|
|||||||
LastGardenNextStep !== Game.Objects.Farm.minigame.nextStep
|
LastGardenNextStep !== Game.Objects.Farm.minigame.nextStep
|
||||||
) {
|
) {
|
||||||
if (LastGardenNextStep !== 0 && LastGardenNextStep < Date.now()) {
|
if (LastGardenNextStep !== 0 && LastGardenNextStep < Date.now()) {
|
||||||
Flash(3, 'GardFlash');
|
Flash(3, 'GardFlash', false);
|
||||||
PlaySound(CMOptions.GardSoundURL, 'GardSound', 'GardVolume', false);
|
PlaySound(CMOptions.GardSoundURL, 'GardSound', 'GardVolume', false);
|
||||||
}
|
}
|
||||||
LastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
|
LastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import {
|
import {
|
||||||
CacheSpawnedGoldenShimmer,
|
CacheSpawnedGoldenShimmer,
|
||||||
CacheGoldenShimmersByID,
|
CacheGoldenShimmersByID,
|
||||||
@@ -49,7 +48,7 @@ export default function CheckGoldenCookie() {
|
|||||||
LastGoldenCookieState = Game.shimmerTypes.golden.n;
|
LastGoldenCookieState = Game.shimmerTypes.golden.n;
|
||||||
if (LastGoldenCookieState) {
|
if (LastGoldenCookieState) {
|
||||||
if (LastSpawnedGoldenCookieState < CurrSpawnedGoldenCookieState) {
|
if (LastSpawnedGoldenCookieState < CurrSpawnedGoldenCookieState) {
|
||||||
Flash(3, 'GCFlash');
|
Flash(3, 'GCFlash', false);
|
||||||
PlaySound(CMOptions.GCSoundURL, 'GCSound', 'GCVolume', false);
|
PlaySound(CMOptions.GCSoundURL, 'GCSound', 'GCVolume', false);
|
||||||
CreateNotification(
|
CreateNotification(
|
||||||
'GCNotification',
|
'GCNotification',
|
||||||
@@ -66,7 +65,7 @@ export default function CheckGoldenCookie() {
|
|||||||
}
|
}
|
||||||
UpdateFavicon();
|
UpdateFavicon();
|
||||||
LastSpawnedGoldenCookieState = CurrSpawnedGoldenCookieState;
|
LastSpawnedGoldenCookieState = CurrSpawnedGoldenCookieState;
|
||||||
if (CurrSpawnedGoldenCookieState === 0) CacheSpawnedGoldenShimmer = 0;
|
if (CurrSpawnedGoldenCookieState === 0) CacheSpawnedGoldenShimmer = 0; // eslint-disable-line no-unused-vars
|
||||||
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
||||||
Object.keys(GCTimers).forEach((i) => {
|
Object.keys(GCTimers).forEach((i) => {
|
||||||
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function CheckMagicMeter() {
|
|||||||
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
||||||
else if (!LastMagicBarFull) {
|
else if (!LastMagicBarFull) {
|
||||||
LastMagicBarFull = true;
|
LastMagicBarFull = true;
|
||||||
Flash(3, 'MagicFlash');
|
Flash(3, 'MagicFlash', false);
|
||||||
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume', false);
|
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume', false);
|
||||||
CreateNotification(
|
CreateNotification(
|
||||||
'MagicNotification',
|
'MagicNotification',
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { CacheSeasonPopShimmer } from '../../Cache/VariablesAndData';
|
import { CacheSeasonPopShimmer } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import Flash from '../../Disp/Notifications/Flash';
|
import Flash from '../../Disp/Notifications/Flash';
|
||||||
@@ -15,10 +14,10 @@ export default function CheckSeasonPopup() {
|
|||||||
LastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
LastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
||||||
Object.keys(Game.shimmers).forEach((i) => {
|
Object.keys(Game.shimmers).forEach((i) => {
|
||||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
||||||
CacheSeasonPopShimmer = Game.shimmers[i];
|
CacheSeasonPopShimmer = Game.shimmers[i]; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Flash(3, 'SeaFlash');
|
Flash(3, 'SeaFlash', false);
|
||||||
PlaySound(CMOptions.SeaSoundURL, 'SeaSound', 'SeaVolume', false);
|
PlaySound(CMOptions.SeaSoundURL, 'SeaSound', 'SeaVolume', false);
|
||||||
CreateNotification(
|
CreateNotification(
|
||||||
'SeaNotification',
|
'SeaNotification',
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default function CheckTickerFortune() {
|
|||||||
LastTickerFortuneState =
|
LastTickerFortuneState =
|
||||||
Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
||||||
if (LastTickerFortuneState) {
|
if (LastTickerFortuneState) {
|
||||||
Flash(3, 'FortuneFlash');
|
Flash(3, 'FortuneFlash', false);
|
||||||
PlaySound(
|
PlaySound(
|
||||||
CMOptions.FortuneSoundURL,
|
CMOptions.FortuneSoundURL,
|
||||||
'FortuneSound',
|
'FortuneSound',
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ export default function CheckWrinklerCount() {
|
|||||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||||
CMOptions.WrinklerMaxFlash
|
CMOptions.WrinklerMaxFlash
|
||||||
) {
|
) {
|
||||||
Flash(3, 'WrinklerMaxFlash');
|
Flash(3, 'WrinklerMaxFlash', false);
|
||||||
} else {
|
} else {
|
||||||
Flash(3, 'WrinklerFlash');
|
Flash(3, 'WrinklerFlash', false);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||||
|
|||||||
6
src/Main/ClickHook.js
Normal file
6
src/Main/ClickHook.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { CacheAverageCookiesFromClicks } from '../Cache/VariablesAndData';
|
||||||
|
|
||||||
|
export default function CMClickHook() {
|
||||||
|
// Add cookies from click to array that stores average
|
||||||
|
CacheAverageCookiesFromClicks.addLatest(Game.computedMouseCps);
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import InitCache from '../Cache/CacheInit';
|
import InitCache from '../Cache/CacheInit';
|
||||||
import { CacheStatsCookies } from '../Cache/Stats/Stats';
|
import { CacheStatsCookies } from '../Cache/Stats/Stats';
|
||||||
import { LoadConfig } from '../Config/SaveLoadReload/SaveLoadReloadSettings';
|
import { LoadConfig } from '../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||||
@@ -10,7 +9,7 @@ import CreateSectionHideButtons from '../Disp/Initialization/CreateSectionHideBu
|
|||||||
import CreateWrinklerButtons from '../Disp/Initialization/CreateWrinklerButton';
|
import CreateWrinklerButtons from '../Disp/Initialization/CreateWrinklerButton';
|
||||||
import CreateCssArea from '../Disp/Initialization/CssArea';
|
import CreateCssArea from '../Disp/Initialization/CssArea';
|
||||||
import UpdateBuildingUpgradeStyle from '../Disp/Initialization/UpdateBuildingUpgradeStyle';
|
import UpdateBuildingUpgradeStyle from '../Disp/Initialization/UpdateBuildingUpgradeStyle';
|
||||||
import CreateWhiteScreen from '../Disp/Initialization/WhiteScreen';
|
import CreateFlashScreen from '../Disp/Initialization/FlashScreen';
|
||||||
import { CreateFavicon } from '../Disp/TabTitle/FavIcon';
|
import { CreateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||||
import { CreateSimpleTooltip } from '../Disp/Tooltips/Tooltip';
|
import { CreateSimpleTooltip } from '../Disp/Tooltips/Tooltip';
|
||||||
import { CMLastAscendState, TooltipText } from '../Disp/VariablesAndData';
|
import { CMLastAscendState, TooltipText } from '../Disp/VariablesAndData';
|
||||||
@@ -30,14 +29,14 @@ export default function InitializeCookieMonster() {
|
|||||||
InitCache();
|
InitCache();
|
||||||
|
|
||||||
// Stored to check if we need to re-initiliaze data
|
// Stored to check if we need to re-initiliaze data
|
||||||
LastModCount = Object.keys(Game.mods).length;
|
LastModCount = Object.keys(Game.mods).length; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
// Creating visual elements
|
// Creating visual elements
|
||||||
CreateCssArea();
|
CreateCssArea();
|
||||||
CreateBotBar();
|
CreateBotBar();
|
||||||
CreateTimerBar();
|
CreateTimerBar();
|
||||||
CreateUpgradeBar();
|
CreateUpgradeBar();
|
||||||
CreateWhiteScreen();
|
CreateFlashScreen();
|
||||||
CreateSectionHideButtons();
|
CreateSectionHideButtons();
|
||||||
CreateFavicon();
|
CreateFavicon();
|
||||||
Object.keys(TooltipText).forEach((i) => {
|
Object.keys(TooltipText).forEach((i) => {
|
||||||
@@ -58,8 +57,8 @@ export default function InitializeCookieMonster() {
|
|||||||
ReplaceNativeGrimoire();
|
ReplaceNativeGrimoire();
|
||||||
Game.CalculateGains();
|
Game.CalculateGains();
|
||||||
|
|
||||||
LoadConfig(); // Must be after all things are created!
|
LoadConfig();
|
||||||
CMLastAscendState = Game.OnAscend;
|
CMLastAscendState = Game.OnAscend; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
if (Game.prefs.popups)
|
if (Game.prefs.popups)
|
||||||
Game.Popup(
|
Game.Popup(
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import { LastModCount } from './VariablesAndData';
|
|||||||
* Main loop of Cookie Monster
|
* Main loop of Cookie Monster
|
||||||
* CM.init registers it to the "logic" hook provided by the modding api
|
* CM.init registers it to the "logic" hook provided by the modding api
|
||||||
*/
|
*/
|
||||||
export default function CMLoop() {
|
export default function CMLoopHook() {
|
||||||
if (LastAscendState !== Game.OnAscend) {
|
if (LastAscendState !== Game.OnAscend) {
|
||||||
LastAscendState = Game.OnAscend;
|
LastAscendState = Game.OnAscend;
|
||||||
UpdateAscendState();
|
UpdateAscendState();
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { FormatTime } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import { FormatTime } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
|
||||||
@@ -47,8 +46,8 @@ function ReplaceNativeGrimoireLaunch() {
|
|||||||
Game.Objects['Wizard tower'].minigameLoaded
|
Game.Objects['Wizard tower'].minigameLoaded
|
||||||
) {
|
) {
|
||||||
const { minigame } = Game.Objects['Wizard tower'];
|
const { minigame } = Game.Objects['Wizard tower'];
|
||||||
BackupGrimoireLaunch = minigame.launch;
|
BackupGrimoireLaunch = minigame.launch; // eslint-disable-line no-unused-vars
|
||||||
BackupGrimoireLaunchMod = new Function(
|
BackupGrimoireLaunchMod = new Function( // eslint-disable-line no-new-func
|
||||||
`return ${minigame.launch
|
`return ${minigame.launch
|
||||||
.toString()
|
.toString()
|
||||||
.split('=this')
|
.split('=this')
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
|
||||||
/* eslint-disable no-unused-vars */
|
|
||||||
/** Functions related to replacing tooltips */
|
/** Functions related to replacing tooltips */
|
||||||
|
|
||||||
import { CreateTooltip } from '../../Disp/Tooltips/Tooltip';
|
import { CreateTooltip } from '../../Disp/Tooltips/Tooltip';
|
||||||
@@ -39,7 +37,7 @@ function ReplaceTooltipBuild() {
|
|||||||
*/
|
*/
|
||||||
function ReplaceTooltipLump() {
|
function ReplaceTooltipLump() {
|
||||||
if (Game.canLumps()) {
|
if (Game.canLumps()) {
|
||||||
TooltipLumpBackup = l('lumps').onmouseover;
|
TooltipLumpBackup = l('lumps').onmouseover; // eslint-disable-line no-unused-vars
|
||||||
l('lumps').onmouseover = function () {
|
l('lumps').onmouseover = function () {
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
@@ -72,6 +70,7 @@ function ReplaceTooltipGarden() {
|
|||||||
};
|
};
|
||||||
Array.from(l('gardenPlot').children).forEach((child) => {
|
Array.from(l('gardenPlot').children).forEach((child) => {
|
||||||
const coords = child.id.slice(-3);
|
const coords = child.id.slice(-3);
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
child.onmouseover = function () {
|
child.onmouseover = function () {
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import jscolor from '@eastdesire/jscolor';
|
import jscolor from '@eastdesire/jscolor';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
@@ -13,7 +12,11 @@ import UpdateTooltipLocation from '../../Disp/Tooltips/PositionLocation';
|
|||||||
import { CMSayTime, Title } from '../../Disp/VariablesAndData';
|
import { CMSayTime, Title } from '../../Disp/VariablesAndData';
|
||||||
import { SimDoSims } from '../../Sim/VariablesAndData';
|
import { SimDoSims } from '../../Sim/VariablesAndData';
|
||||||
import ReplaceTooltipUpgrade from '../ReplaceGameElements/TooltipUpgrades';
|
import ReplaceTooltipUpgrade from '../ReplaceGameElements/TooltipUpgrades';
|
||||||
import { BackupFunctions } from '../VariablesAndData';
|
import {
|
||||||
|
BackupFunctions,
|
||||||
|
CenturyDateAtBeginLoop,
|
||||||
|
CycliusDateAtBeginLoop,
|
||||||
|
} from '../VariablesAndData';
|
||||||
import FixMouseY from './FixMouse';
|
import FixMouseY from './FixMouse';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,12 +31,14 @@ export default function ReplaceNative() {
|
|||||||
BackupFunctions.CalculateGains = Game.CalculateGains;
|
BackupFunctions.CalculateGains = Game.CalculateGains;
|
||||||
Game.CalculateGains = function () {
|
Game.CalculateGains = function () {
|
||||||
BackupFunctions.CalculateGains();
|
BackupFunctions.CalculateGains();
|
||||||
SimDoSims = 1;
|
SimDoSims = 1; // eslint-disable-line no-unused-vars
|
||||||
|
CycliusDateAtBeginLoop = Date.now(); // eslint-disable-line no-unused-vars
|
||||||
|
CenturyDateAtBeginLoop = Date.now(); // eslint-disable-line no-unused-vars
|
||||||
};
|
};
|
||||||
|
|
||||||
BackupFunctions.tooltip = {};
|
BackupFunctions.tooltip = {};
|
||||||
BackupFunctions.tooltip.draw = Game.tooltip.draw;
|
BackupFunctions.tooltip.draw = Game.tooltip.draw;
|
||||||
BackupFunctions.tooltip.drawMod = new Function(
|
BackupFunctions.tooltip.drawMod = new Function( // eslint-disable-line no-new-func
|
||||||
`return ${Game.tooltip.draw.toString().split('this').join('Game.tooltip')}`,
|
`return ${Game.tooltip.draw.toString().split('this').join('Game.tooltip')}`,
|
||||||
)();
|
)();
|
||||||
Game.tooltip.draw = function (from, text, origin) {
|
Game.tooltip.draw = function (from, text, origin) {
|
||||||
@@ -41,7 +46,7 @@ export default function ReplaceNative() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
BackupFunctions.tooltip.update = Game.tooltip.update;
|
BackupFunctions.tooltip.update = Game.tooltip.update;
|
||||||
BackupFunctions.tooltip.updateMod = new Function(
|
BackupFunctions.tooltip.updateMod = new Function( // eslint-disable-line no-new-func
|
||||||
`return ${Game.tooltip.update
|
`return ${Game.tooltip.update
|
||||||
.toString()
|
.toString()
|
||||||
.split('this.')
|
.split('this.')
|
||||||
@@ -126,6 +131,7 @@ export default function ReplaceNative() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
BackupFunctions.sayTime = Game.sayTime;
|
BackupFunctions.sayTime = Game.sayTime;
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
CMSayTime = function (time, detail) {
|
CMSayTime = function (time, detail) {
|
||||||
if (Number.isNaN(time) || time <= 0)
|
if (Number.isNaN(time) || time <= 0)
|
||||||
return BackupFunctions.sayTime(time, detail);
|
return BackupFunctions.sayTime(time, detail);
|
||||||
@@ -139,6 +145,7 @@ export default function ReplaceNative() {
|
|||||||
// Update tab title
|
// Update tab title
|
||||||
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
|
||||||
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${CMBeautify(Game.cookies)} ${
|
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${CMBeautify(Game.cookies)} ${
|
||||||
Game.cookies === 1 ? 'cookie' : 'cookies'
|
Game.cookies === 1 ? 'cookie' : 'cookies'
|
||||||
} - ${title}`;
|
} - ${title}`;
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
/* eslint-disable prefer-const */
|
|
||||||
|
|
||||||
export let LastModCount;
|
export let LastModCount;
|
||||||
export let TooltipBuildBackup = [];
|
export let TooltipBuildBackup = []; // eslint-disable-line prefer-const
|
||||||
export let TooltipLumpBackup;
|
export let TooltipLumpBackup;
|
||||||
export let TooltipGrimoireBackup = [];
|
export let TooltipGrimoireBackup = []; // eslint-disable-line prefer-const
|
||||||
export let TooltipUpgradeBackup = [];
|
export let TooltipUpgradeBackup = []; // eslint-disable-line prefer-const
|
||||||
export let BackupGrimoireLaunch;
|
export let BackupGrimoireLaunch;
|
||||||
export let BackupGrimoireLaunchMod;
|
export let BackupGrimoireLaunchMod;
|
||||||
export let BackupGrimoireDraw;
|
export let BackupGrimoireDraw;
|
||||||
export let HasReplaceNativeGrimoireLaunch;
|
export let HasReplaceNativeGrimoireLaunch;
|
||||||
export let HasReplaceNativeGrimoireDraw;
|
export let HasReplaceNativeGrimoireDraw;
|
||||||
export let LoadMinigames;
|
export let LoadMinigames;
|
||||||
export let BackupFunctions = {};
|
export let BackupFunctions = {}; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
export let LastSeasonPopupState;
|
export let LastSeasonPopupState;
|
||||||
export let LastTickerFortuneState;
|
export let LastTickerFortuneState;
|
||||||
@@ -21,3 +19,11 @@ export let LastSpawnedGoldenCookieState;
|
|||||||
export let LastMagicBarFull;
|
export let LastMagicBarFull;
|
||||||
export let CurrSpawnedGoldenCookieState;
|
export let CurrSpawnedGoldenCookieState;
|
||||||
export let LastWrinklerCount;
|
export let LastWrinklerCount;
|
||||||
|
|
||||||
|
/** Stores the date at Game.CalculateGains for God Cyclius
|
||||||
|
*/
|
||||||
|
export let CycliusDateAtBeginLoop = Date.now(); // eslint-disable-line prefer-const
|
||||||
|
|
||||||
|
/** Stores the date at Game.CalculateGains for the Century egg
|
||||||
|
*/
|
||||||
|
export let CenturyDateAtBeginLoop = Date.now(); // eslint-disable-line prefer-const
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import {
|
import {
|
||||||
TooltipWrinklerArea,
|
TooltipWrinklerArea,
|
||||||
TooltipWrinklerBeingShown,
|
TooltipWrinklerBeingShown,
|
||||||
@@ -13,7 +12,7 @@ export default function AddWrinklerAreaDetect() {
|
|||||||
TooltipWrinklerArea = 1;
|
TooltipWrinklerArea = 1;
|
||||||
};
|
};
|
||||||
l('backgroundLeftCanvas').onmouseout = function () {
|
l('backgroundLeftCanvas').onmouseout = function () {
|
||||||
TooltipWrinklerArea = 0;
|
TooltipWrinklerArea = 0; // eslint-disable-line no-unused-vars
|
||||||
Game.tooltip.hide();
|
Game.tooltip.hide();
|
||||||
Object.keys(Game.wrinklers).forEach((i) => {
|
Object.keys(Game.wrinklers).forEach((i) => {
|
||||||
TooltipWrinklerBeingShown[i] = 0;
|
TooltipWrinklerBeingShown[i] = 0;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
||||||
import { CacheCentEgg } from '../../Cache/VariablesAndData';
|
import { CacheCentEgg } from '../../Cache/VariablesAndData';
|
||||||
|
import {
|
||||||
|
CenturyDateAtBeginLoop,
|
||||||
|
CycliusDateAtBeginLoop,
|
||||||
|
} from '../../Main/VariablesAndData';
|
||||||
import SimAuraMult from '../ReplacedGameFunctions/SimAuraMult';
|
import SimAuraMult from '../ReplacedGameFunctions/SimAuraMult';
|
||||||
import SimEff from '../ReplacedGameFunctions/SimEff';
|
import SimEff from '../ReplacedGameFunctions/SimEff';
|
||||||
import SimGetHeavenlyMultiplier from '../ReplacedGameFunctions/SimGetHeavenlyMultiplier';
|
import SimGetHeavenlyMultiplier from '../ReplacedGameFunctions/SimGetHeavenlyMultiplier';
|
||||||
@@ -38,7 +41,7 @@ export default function CalculateGains() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
SimEffs = effs;
|
SimEffs = effs; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
if (Game.ascensionMode !== 1)
|
if (Game.ascensionMode !== 1)
|
||||||
mult +=
|
mult +=
|
||||||
@@ -92,13 +95,25 @@ export default function CalculateGains() {
|
|||||||
godLvl = SimHasGod('ages');
|
godLvl = SimHasGod('ages');
|
||||||
if (godLvl === 1)
|
if (godLvl === 1)
|
||||||
mult *=
|
mult *=
|
||||||
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 3)) * Math.PI * 2);
|
1 +
|
||||||
|
0.15 *
|
||||||
|
Math.sin(
|
||||||
|
(CycliusDateAtBeginLoop / 1000 / (60 * 60 * 3)) * Math.PI * 2,
|
||||||
|
);
|
||||||
else if (godLvl === 2)
|
else if (godLvl === 2)
|
||||||
mult *=
|
mult *=
|
||||||
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 12)) * Math.PI * 2);
|
1 +
|
||||||
|
0.15 *
|
||||||
|
Math.sin(
|
||||||
|
(CycliusDateAtBeginLoop / 1000 / (60 * 60 * 12)) * Math.PI * 2,
|
||||||
|
);
|
||||||
else if (godLvl === 3)
|
else if (godLvl === 3)
|
||||||
mult *=
|
mult *=
|
||||||
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 24)) * Math.PI * 2);
|
1 +
|
||||||
|
0.15 *
|
||||||
|
Math.sin(
|
||||||
|
(CycliusDateAtBeginLoop / 1000 / (60 * 60 * 24)) * Math.PI * 2,
|
||||||
|
);
|
||||||
|
|
||||||
godLvl = SimHasGod('decadence');
|
godLvl = SimHasGod('decadence');
|
||||||
if (godLvl === 1) buildMult *= 0.93;
|
if (godLvl === 1) buildMult *= 0.93;
|
||||||
@@ -189,7 +204,7 @@ export default function CalculateGains() {
|
|||||||
if (SimHas('Century egg')) {
|
if (SimHas('Century egg')) {
|
||||||
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
||||||
let day =
|
let day =
|
||||||
(Math.floor((Date.now() - Game.startDate) / 1000 / 10) * 10) /
|
(Math.floor((CenturyDateAtBeginLoop - Game.startDate) / 1000 / 10) * 10) /
|
||||||
60 /
|
60 /
|
||||||
60 /
|
60 /
|
||||||
24;
|
24;
|
||||||
@@ -211,7 +226,7 @@ export default function CalculateGains() {
|
|||||||
SimWin(Game.CpsAchievements[i].name);
|
SimWin(Game.CpsAchievements[i].name);
|
||||||
});
|
});
|
||||||
|
|
||||||
SimCookiesPsRaw = rawCookiesPs;
|
SimCookiesPsRaw = rawCookiesPs; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
const { n } = Game.shimmerTypes.golden;
|
const { n } = Game.shimmerTypes.golden;
|
||||||
const auraMult = SimAuraMult("Dragon's Fortune");
|
const auraMult = SimAuraMult("Dragon's Fortune");
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import CacheDragonAuras from '../../Cache/Dragon/CacheDragonAuras';
|
import CacheDragonAuras from '../../Cache/Dragon/CacheDragonAuras';
|
||||||
import {
|
import {
|
||||||
CacheDragonAura,
|
CacheDragonAura,
|
||||||
@@ -30,11 +29,11 @@ import {
|
|||||||
*/
|
*/
|
||||||
export default function CopyData() {
|
export default function CopyData() {
|
||||||
// Other variables
|
// Other variables
|
||||||
SimUpgradesOwned = Game.UpgradesOwned;
|
SimUpgradesOwned = Game.UpgradesOwned; // eslint-disable-line no-unused-vars
|
||||||
SimPledges = Game.pledges;
|
SimPledges = Game.pledges; // eslint-disable-line no-unused-vars
|
||||||
SimAchievementsOwned = Game.AchievementsOwned;
|
SimAchievementsOwned = Game.AchievementsOwned; // eslint-disable-line no-unused-vars
|
||||||
SimHeavenlyPower = Game.heavenlyPower;
|
SimHeavenlyPower = Game.heavenlyPower; // eslint-disable-line no-unused-vars
|
||||||
SimPrestige = Game.prestige;
|
SimPrestige = Game.prestige; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
// Buildings
|
// Buildings
|
||||||
Object.keys(Game.Objects).forEach((i) => {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
@@ -53,9 +52,9 @@ export default function CopyData() {
|
|||||||
you.free = me.free;
|
you.free = me.free;
|
||||||
if (me.minigameLoaded) {
|
if (me.minigameLoaded) {
|
||||||
if (me.name === 'Temple') {
|
if (me.name === 'Temple') {
|
||||||
SimGod1 = me.minigame.slot[0];
|
SimGod1 = me.minigame.slot[0]; // eslint-disable-line no-unused-vars
|
||||||
SimGod2 = me.minigame.slot[1];
|
SimGod2 = me.minigame.slot[1]; // eslint-disable-line no-unused-vars
|
||||||
SimGod3 = me.minigame.slot[2];
|
SimGod3 = me.minigame.slot[2]; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
you.minigameLoaded = me.minigameLoaded;
|
you.minigameLoaded = me.minigameLoaded;
|
||||||
you.minigame = me.minigame;
|
you.minigame = me.minigame;
|
||||||
@@ -89,6 +88,6 @@ export default function CopyData() {
|
|||||||
|
|
||||||
// Auras
|
// Auras
|
||||||
CacheDragonAuras();
|
CacheDragonAuras();
|
||||||
SimDragonAura = CacheDragonAura;
|
SimDragonAura = CacheDragonAura; // eslint-disable-line no-unused-vars
|
||||||
SimDragonAura2 = CacheDragonAura2;
|
SimDragonAura2 = CacheDragonAura2; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { SimAchievements, SimAchievementsOwned } from '../VariablesAndData';
|
import { SimAchievements, SimAchievementsOwned } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,7 +10,7 @@ export default function SimWin(what) {
|
|||||||
if (SimAchievements[what]) {
|
if (SimAchievements[what]) {
|
||||||
if (SimAchievements[what].won === 0) {
|
if (SimAchievements[what].won === 0) {
|
||||||
SimAchievements[what].won = 1;
|
SimAchievements[what].won = 1;
|
||||||
if (Game.Achievements[what].pool !== 'shadow') SimAchievementsOwned += 1;
|
if (Game.Achievements[what].pool !== 'shadow') SimAchievementsOwned += 1; // eslint-disable-line no-unused-vars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import {
|
import {
|
||||||
CacheDragonAura,
|
CacheDragonAura,
|
||||||
CacheDragonAura2,
|
CacheDragonAura2,
|
||||||
@@ -38,10 +37,10 @@ export default function CalculateChangeAura(aura) {
|
|||||||
SimDragonAura2 !== CacheDragonAura2
|
SimDragonAura2 !== CacheDragonAura2
|
||||||
) {
|
) {
|
||||||
for (let i = Game.ObjectsById.length - 1; i > -1; --i) {
|
for (let i = Game.ObjectsById.length - 1; i > -1; --i) {
|
||||||
if (Game.ObjectsById[i - 1].amount > 0) {
|
if (Game.ObjectsById[i].amount > 0) {
|
||||||
const highestBuilding = SimObjects[Game.ObjectsById[i].name].name;
|
const highestBuilding = SimObjects[Game.ObjectsById[i].name].name;
|
||||||
SimObjects[highestBuilding].amount -= 1;
|
SimObjects[highestBuilding].amount -= 1;
|
||||||
SimBuildingsOwned -= 1;
|
SimBuildingsOwned -= 1; // eslint-disable-line no-unused-vars
|
||||||
price =
|
price =
|
||||||
SimObjects[highestBuilding].basePrice *
|
SimObjects[highestBuilding].basePrice *
|
||||||
Game.priceIncrease **
|
Game.priceIncrease **
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user