Compare commits

...

61 Commits

Author SHA1 Message Date
Daniël van Noord
ca5d9bae11 Merge pull request #748 from Aktanusa/dev
Master to version 2.031.7
2021-04-04 20:44:39 +02:00
Daniël van Noord
cba8eb7632 Merge pull request #747 from DanielNoord/version20317
Update to version 2.031.7
2021-04-04 20:44:01 +02:00
Daniël van Noord
119faa5305 Update to version 2.031.7 2021-04-04 20:42:05 +02:00
Daniël van Noord
32c38fd9fa Merge pull request #746 from DanielNoord/fixflicker
Fixflicker
2021-04-04 20:37:08 +02:00
Daniël van Noord
fd2d22564c Merge branch 'dev' of https://github.com/Aktanusa/CookieMonster into fixflicker 2021-04-04 20:29:44 +02:00
Daniël van Noord
48e8fd2154 Fix black flicker at loading & timers change #621 2021-04-04 20:29:29 +02:00
Daniël van Noord
e7cf3b076d Merge pull request #745 from DanielNoord/cyclius
Cyclius and ESLint errors
2021-04-04 20:15:17 +02:00
Daniël van Noord
37bff7df1e Fixed #707 2021-04-04 20:13:44 +02:00
Daniël van Noord
9b04663cd8 Build CookieMonster.js 2021-04-04 17:06:45 +02:00
Daniël van Noord
e3321ebe2f Fixed high number of ESLint errors 2021-04-04 17:05:39 +02:00
Daniël van Noord
e2f99d1cf9 Removed eslintignore file 2021-04-04 15:14:29 +02:00
Daniël van Noord
3f08ed3e2d Additional fixes for #707 2021-04-04 14:04:56 +02:00
Daniël van Noord
444462ae53 Initial fix for #707 2021-04-04 13:52:34 +02:00
Daniël van Noord
5017f1c217 Merge pull request #744 from DanielNoord/missingachievements
Missingachievements
2021-04-04 13:36:35 +02:00
Daniël van Noord
d5aaba3546 Build CookieMonster.js 2021-04-04 13:25:02 +02:00
Daniël van Noord
d511f4f1f2 Show missing achievements toggle 2021-04-04 13:22:44 +02:00
Daniël van Noord
5a14712841 Renamed Draw hook 2021-04-03 16:25:24 +02:00
Daniël van Noord
383be573c9 Merge pull request #743 from DanielNoord/clickscps
Show cookies from clicks in stats
2021-04-03 16:13:56 +02:00
Daniël van Noord
66ede34b92 Fixed some typos 2021-04-03 16:11:42 +02:00
Daniël van Noord
e482a62fe8 Updated npm and dependencies 2021-04-03 16:11:34 +02:00
Daniël van Noord
e1c6f60726 Show cookies from clicking in stats #698 2021-04-03 16:00:00 +02:00
Daniël van Noord
bfc54bf9de Merge pull request #742 from DanielNoord/favouritesettingsfixes
Changes to favourite settings
2021-04-03 09:13:14 +02:00
Daniël van Noord
812a2aaa69 Reordered directory Disp/Settings 2021-04-03 09:09:14 +02:00
Daniël van Noord
08a1e5aa6b Fixed overlapping labels in settings 2021-04-03 09:06:07 +02:00
Daniël van Noord
566efbc68b Made favourite settings stars yellow 2021-04-03 08:50:35 +02:00
Daniël van Noord
66e74bb702 Merge pull request #741 from DanielNoord/favouritesettings
Created favourite settings functionality #727
2021-04-02 23:23:06 +02:00
Daniël van Noord
9a84b0abe5 Created favourite settings functionality #727 2021-04-02 23:20:19 +02:00
Daniël van Noord
ddc77b332d Merge pull request #740 from DanielNoord/bugfixes
Fixed bug in Dragon Aura cps change display #734
2021-04-02 20:11:32 +02:00
Daniël van Noord
2cff52f5c7 Fixed bug in Dragon Aura cps change display #734 2021-04-02 19:29:49 +02:00
Daniël van Noord
3a28263099 Merge pull request #738 from DanielNoord/bugfixes
Bugfixes
2021-04-02 15:12:37 +02:00
Daniël van Noord
822e8a8066 Fixed red and purple PP switched #735 2021-04-02 15:10:13 +02:00
Daniël van Noord
ba0ff40aba Fixed dragon tooltip #736 2021-04-02 15:08:02 +02:00
Daniël van Noord
5f64d2dd9f Fixed notation of negative numbers #736 2021-04-02 14:58:31 +02:00
Daniël van Noord
10eb88cde1 Fixed typo 2021-04-02 14:50:55 +02:00
Daniël van Noord
aebd62317b Merge pull request #733 from DanielNoord/bugfixes
Bugfixes
2021-03-28 15:09:51 +02:00
Daniël van Noord
305762e797 Fixed edit prompts in settings #732 2021-03-28 15:07:41 +02:00
Daniël van Noord
fb0f9c3bf3 Increase max length to 100 2021-03-28 14:53:20 +02:00
Daniël van Noord
f506cb136e Fixed incorrect mature for Garden tooltip #731 2021-03-28 14:11:58 +02:00
Daniël van Noord
adb020dfc2 Merge pull request #730 from DanielNoord/functions
Functions
2021-03-28 10:56:51 +02:00
Daniël van Noord
972d4723ed New colour settings, changeable flash colour #728 2021-03-28 10:55:10 +02:00
Daniël van Noord
fe8749e7b2 Wrinkler button disappear when not active 2021-03-26 16:26:57 +01:00
Daniël van Noord
48c3bad336 Fixed #726 2021-03-26 13:08:04 +01:00
Daniël van Noord
212a358a6a Merge pull request #725 from DanielNoord/reordersettings
Reordersettings
2021-03-23 09:38:45 +01:00
Daniël van Noord
02d49dca2e Changed order and reformatted settings #721 2021-03-23 09:35:48 +01:00
Daniël van Noord
f7c4e23eb3 Merge pull request #723 from Aktanusa/dev
Push to master
2021-03-23 08:42:17 +01:00
Daniël van Noord
202913179c Merge pull request #722 from DanielNoord/fix/hotfixes
Hotfixes
2021-03-23 08:41:44 +01:00
Daniël van Noord
c0a13231ad Fix formatting of Cookie Counter #714 2021-03-23 08:38:03 +01:00
Daniël van Noord
d1daa6d434 Merge pull request #718 from Aktanusa/dev
Push fixes to master
2021-03-22 08:28:28 +01:00
Daniël van Noord
9d9ef9b514 Merge pull request #717 from DanielNoord/fix/hotfixes
Fix/hotfixes
2021-03-22 08:28:03 +01:00
Daniël van Noord
be529d0b71 Update commands and removed comment 2021-03-22 08:21:28 +01:00
Daniël van Noord
68c8cc9d54 Fix break upon 0 wrinklers #715 2021-03-22 08:20:52 +01:00
Daniël van Noord
e882cb15f5 Merge pull request #712 from Aktanusa/dev
Push fixes to master
2021-03-21 14:57:02 +01:00
Daniël van Noord
ae7ea4fbd4 Merge pull request #711 from DanielNoord/fix/hotfixes
Fix/hotfixes
2021-03-21 14:56:35 +01:00
Daniël van Noord
1653c18c55 Fixed negative GC effect breaking mod #710 2021-03-21 14:13:35 +01:00
Daniël van Noord
2438da6e38 Merge pull request #705 from Aktanusa/dev
Push hot fixes to master
2021-03-19 17:51:59 +01:00
Daniël van Noord
79b960bde7 Merge pull request #704 from DanielNoord/fix/hotfixes
Fix/hotfixes
2021-03-19 17:51:31 +01:00
Daniël van Noord
11554722ed Update changelog to reflect hotfixes 2021-03-19 17:49:06 +01:00
Daniël van Noord
a4e2b9f68c Changed name of Rigidel option 2021-03-19 17:44:24 +01:00
Daniël van Noord
823d12fa70 Created RIgidel mode #694 2021-03-19 17:39:27 +01:00
Daniël van Noord
51c89bdc88 Fix upgr bar legend, wrink butt tooltip #700, #695 2021-03-19 17:38:45 +01:00
Daniël van Noord
9e107c7a3a Update README.md 2021-03-19 08:52:07 +01:00
109 changed files with 2059 additions and 1680 deletions

View File

@@ -1,6 +0,0 @@
CookieMonster.js
CookieMonster.user.js
src/*.js
!src/CookieMonster.js
!src/*/*
dist/*

View File

@@ -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,
},
],
}, },
}; };

View File

@@ -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

View File

@@ -16,7 +16,8 @@ max(cost - cookies in bank, 0)/cps + cost/Δ cps
Cookie Monster also indicates the time left before being able to buy an upgrade or building, and takes it into consideration. It will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, it will know and highlight that building's value. Cookie Monster also indicates the time left before being able to buy an upgrade or building, and takes it into consideration. It will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, it will know and highlight that building's value.
This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value: This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value. It compares the PP across all possible buy options: if a buy 10 option is better than any of the buy 1 options Cookie Monster will colour them accordingly.
Cookie Monster uses the following standard colours:
* Light Blue: (upgrades) This item has a better PP than the best building to buy * Light Blue: (upgrades) This item has a better PP than the best building to buy
* Green: This building has the best PP * Green: This building has the best PP

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

320
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "cookiemonster-mod", "name": "cookiemonster-mod",
"version": "2.031.5", "version": "2.031.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cookiemonster-mod", "name": "cookiemonster-mod",
"version": "2.031.5", "version": "2.031.6",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eastdesire/jscolor": "^2.4.5" "@eastdesire/jscolor": "^2.4.5"
@@ -170,9 +170,9 @@
} }
}, },
"node_modules/@types/eslint": { "node_modules/@types/eslint": {
"version": "7.2.7", "version": "7.2.8",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.7.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.8.tgz",
"integrity": "sha512-EHXbc1z2GoQRqHaAT7+grxlTJ3WE2YNeD6jlpPoRc83cCoThRY+NUWjCUZaYmk51OICkPXn2hhphcWcWXgNW0Q==", "integrity": "sha512-RTKvBsfz0T8CKOGZMfuluDNyMFHnu5lvNr4hWEsQeHXH6FcmIDIozOyWMh36nLGMwVd5UFNXC2xztA8lln22MQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/estree": "*", "@types/estree": "*",
@@ -208,9 +208,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "14.14.35", "version": "14.14.37",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.35.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz",
"integrity": "sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==", "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==",
"dev": true "dev": true
}, },
"node_modules/@webassemblyjs/ast": { "node_modules/@webassemblyjs/ast": {
@@ -360,9 +360,9 @@
} }
}, },
"node_modules/@webpack-cli/configtest": { "node_modules/@webpack-cli/configtest": {
"version": "1.0.1", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.2.tgz",
"integrity": "sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ==", "integrity": "sha512-3OBzV2fBGZ5TBfdW50cha1lHDVf9vlvRXnjpVbJBa20pSZQaSkMJZiwA8V2vD9ogyeXn8nU5s5A6mHyf5jhMzA==",
"dev": true, "dev": true,
"peerDependencies": { "peerDependencies": {
"webpack": "4.x.x || 5.x.x", "webpack": "4.x.x || 5.x.x",
@@ -370,9 +370,9 @@
} }
}, },
"node_modules/@webpack-cli/info": { "node_modules/@webpack-cli/info": {
"version": "1.2.2", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.2.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.3.tgz",
"integrity": "sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ==", "integrity": "sha512-lLek3/T7u40lTqzCGpC6CAbY6+vXhdhmwFRxZLMnRm6/sIF/7qMpT8MocXCRQfz0JAh63wpbXLMnsQ5162WS7Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"envinfo": "^7.7.3" "envinfo": "^7.7.3"
@@ -382,9 +382,9 @@
} }
}, },
"node_modules/@webpack-cli/serve": { "node_modules/@webpack-cli/serve": {
"version": "1.3.0", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.3.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.3.1.tgz",
"integrity": "sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw==", "integrity": "sha512-0qXvpeYO6vaNoRBI52/UsbcaBydJCggoBBnIo/ovQQdn6fug0BgwsjorV1hVS7fMqGVTZGcVxv8334gjmbj5hw==",
"dev": true, "dev": true,
"peerDependencies": { "peerDependencies": {
"webpack-cli": "4.x.x" "webpack-cli": "4.x.x"
@@ -608,9 +608,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001202", "version": "1.0.30001205",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001202.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz",
"integrity": "sha512-ZcijQNqrcF8JNLjzvEiXqX4JUYxoZa7Pvcsd9UD8Kz4TvhTonOSNRsK+qtvpVL4l6+T1Rh4LFtLfnNWg6BGWCQ==", "integrity": "sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==",
"dev": true "dev": true
}, },
"node_modules/chalk": { "node_modules/chalk": {
@@ -768,9 +768,9 @@
} }
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.3.690", "version": "1.3.707",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.690.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz",
"integrity": "sha512-zPbaSv1c8LUKqQ+scNxJKv01RYFkVVF1xli+b+3Ty8ONujHjAMg+t/COmdZqrtnS1gT+g4hbSodHillymt1Lww==", "integrity": "sha512-BqddgxNPrcWnbDdJw7SzXVzPmp+oiyjVrc7tkQVaznPGSS9SKZatw6qxoP857M+HbOyyqJQwYQtsuFIMSTNSZA==",
"dev": true "dev": true
}, },
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
@@ -897,9 +897,9 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "7.22.0", "version": "7.23.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.23.0.tgz",
"integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", "integrity": "sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "7.12.11", "@babel/code-frame": "7.12.11",
@@ -1439,9 +1439,9 @@
"dev": true "dev": true
}, },
"node_modules/globals": { "node_modules/globals": {
"version": "13.6.0", "version": "13.7.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.6.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz",
"integrity": "sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ==", "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
@@ -2006,6 +2006,24 @@
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true "dev": true
}, },
"node_modules/lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
"dev": true
},
"node_modules/lodash.flatten": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
"integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
"dev": true
},
"node_modules/lodash.truncate": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
"integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=",
"dev": true
},
"node_modules/lru-cache": { "node_modules/lru-cache": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
@@ -2034,21 +2052,21 @@
"dev": true "dev": true
}, },
"node_modules/mime-db": { "node_modules/mime-db": {
"version": "1.46.0", "version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==", "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/mime-types": { "node_modules/mime-types": {
"version": "2.1.29", "version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"mime-db": "1.46.0" "mime-db": "1.47.0"
}, },
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
@@ -2823,9 +2841,9 @@
} }
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "7.3.4", "version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -3083,13 +3101,18 @@
} }
}, },
"node_modules/table": { "node_modules/table": {
"version": "6.0.7", "version": "6.0.9",
"resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", "resolved": "https://registry.npmjs.org/table/-/table-6.0.9.tgz",
"integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", "integrity": "sha512-F3cLs9a3hL1Z7N4+EkSscsel3z55XT950AvB05bwayrNg5T1/gykXtigioTAjbltvbMSJvvhFCbnf6mX+ntnJQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^7.0.2", "ajv": "^8.0.1",
"lodash": "^4.17.20", "is-boolean-object": "^1.1.0",
"is-number-object": "^1.0.4",
"is-string": "^1.0.5",
"lodash.clonedeep": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.truncate": "^4.4.2",
"slice-ansi": "^4.0.0", "slice-ansi": "^4.0.0",
"string-width": "^4.2.0" "string-width": "^4.2.0"
}, },
@@ -3098,9 +3121,9 @@
} }
}, },
"node_modules/table/node_modules/ajv": { "node_modules/table/node_modules/ajv": {
"version": "7.2.1", "version": "8.0.5",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.1.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.0.5.tgz",
"integrity": "sha512-+nu0HDv7kNSOua9apAVc979qd932rrZeb3WOvoiD31A/p1mIE5/9bN2027pE2rOPYEdS3UHzsvof4hY+lM9/WQ==", "integrity": "sha512-RkiLa/AeJx7+9OvniQ/qeWu0w74A8DiPPBclQ6ji3ZQkv5KamO+QGpqmi7O4JIw3rHGUXZ6CoP9tsAkn3gyazg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
@@ -3129,9 +3152,9 @@
} }
}, },
"node_modules/terser": { "node_modules/terser": {
"version": "5.6.0", "version": "5.6.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.6.0.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-5.6.1.tgz",
"integrity": "sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA==", "integrity": "sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"commander": "^2.20.0", "commander": "^2.20.0",
@@ -3242,15 +3265,18 @@
} }
}, },
"node_modules/unbox-primitive": { "node_modules/unbox-primitive": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.0.tgz", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
"integrity": "sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA==", "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"has-bigints": "^1.0.0", "has-bigints": "^1.0.1",
"has-symbols": "^1.0.0", "has-symbols": "^1.0.2",
"which-boxed-primitive": "^1.0.1" "which-boxed-primitive": "^1.0.2"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/uri-js": { "node_modules/uri-js": {
@@ -3292,9 +3318,9 @@
} }
}, },
"node_modules/webpack": { "node_modules/webpack": {
"version": "5.26.2", "version": "5.30.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.26.2.tgz", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.30.0.tgz",
"integrity": "sha512-h07tAPeQceEO3Idrevqv4ECcpMH8Zp0aUUJ+IytujWTVf6TF5PI3rKVw0Z+7rNjU4qJuEx18BykFxgRvR9VgEQ==", "integrity": "sha512-Zr9NIri5yzpfmaMea2lSMV1UygbW0zQsSlGLMgKUm63ACXg6alhd1u4v5UBSBjzYKXJN6BNMGVM7w165e7NxYA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/eslint-scope": "^3.7.0", "@types/eslint-scope": "^3.7.0",
@@ -3338,15 +3364,15 @@
} }
}, },
"node_modules/webpack-cli": { "node_modules/webpack-cli": {
"version": "4.5.0", "version": "4.6.0",
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.5.0.tgz", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.6.0.tgz",
"integrity": "sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q==", "integrity": "sha512-9YV+qTcGMjQFiY7Nb1kmnupvb1x40lfpj8pwdO/bom+sQiP4OBMKjHq29YQrlDWDPZO9r/qWaRRywKaRDKqBTA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@discoveryjs/json-ext": "^0.5.0", "@discoveryjs/json-ext": "^0.5.0",
"@webpack-cli/configtest": "^1.0.1", "@webpack-cli/configtest": "^1.0.2",
"@webpack-cli/info": "^1.2.2", "@webpack-cli/info": "^1.2.3",
"@webpack-cli/serve": "^1.3.0", "@webpack-cli/serve": "^1.3.1",
"colorette": "^1.2.1", "colorette": "^1.2.1",
"commander": "^7.0.0", "commander": "^7.0.0",
"enquirer": "^2.3.6", "enquirer": "^2.3.6",
@@ -3371,9 +3397,6 @@
"@webpack-cli/generators": { "@webpack-cli/generators": {
"optional": true "optional": true
}, },
"@webpack-cli/init": {
"optional": true
},
"@webpack-cli/migrate": { "@webpack-cli/migrate": {
"optional": true "optional": true
}, },
@@ -3386,9 +3409,9 @@
} }
}, },
"node_modules/webpack-cli/node_modules/commander": { "node_modules/webpack-cli/node_modules/commander": {
"version": "7.1.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==", "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
@@ -3628,9 +3651,9 @@
} }
}, },
"@types/eslint": { "@types/eslint": {
"version": "7.2.7", "version": "7.2.8",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.7.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.8.tgz",
"integrity": "sha512-EHXbc1z2GoQRqHaAT7+grxlTJ3WE2YNeD6jlpPoRc83cCoThRY+NUWjCUZaYmk51OICkPXn2hhphcWcWXgNW0Q==", "integrity": "sha512-RTKvBsfz0T8CKOGZMfuluDNyMFHnu5lvNr4hWEsQeHXH6FcmIDIozOyWMh36nLGMwVd5UFNXC2xztA8lln22MQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/estree": "*", "@types/estree": "*",
@@ -3666,9 +3689,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "14.14.35", "version": "14.14.37",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.35.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz",
"integrity": "sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==", "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==",
"dev": true "dev": true
}, },
"@webassemblyjs/ast": { "@webassemblyjs/ast": {
@@ -3818,25 +3841,25 @@
} }
}, },
"@webpack-cli/configtest": { "@webpack-cli/configtest": {
"version": "1.0.1", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.2.tgz",
"integrity": "sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ==", "integrity": "sha512-3OBzV2fBGZ5TBfdW50cha1lHDVf9vlvRXnjpVbJBa20pSZQaSkMJZiwA8V2vD9ogyeXn8nU5s5A6mHyf5jhMzA==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
"@webpack-cli/info": { "@webpack-cli/info": {
"version": "1.2.2", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.2.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.3.tgz",
"integrity": "sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ==", "integrity": "sha512-lLek3/T7u40lTqzCGpC6CAbY6+vXhdhmwFRxZLMnRm6/sIF/7qMpT8MocXCRQfz0JAh63wpbXLMnsQ5162WS7Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"envinfo": "^7.7.3" "envinfo": "^7.7.3"
} }
}, },
"@webpack-cli/serve": { "@webpack-cli/serve": {
"version": "1.3.0", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.3.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.3.1.tgz",
"integrity": "sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw==", "integrity": "sha512-0qXvpeYO6vaNoRBI52/UsbcaBydJCggoBBnIo/ovQQdn6fug0BgwsjorV1hVS7fMqGVTZGcVxv8334gjmbj5hw==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
@@ -3996,9 +4019,9 @@
"dev": true "dev": true
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001202", "version": "1.0.30001205",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001202.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz",
"integrity": "sha512-ZcijQNqrcF8JNLjzvEiXqX4JUYxoZa7Pvcsd9UD8Kz4TvhTonOSNRsK+qtvpVL4l6+T1Rh4LFtLfnNWg6BGWCQ==", "integrity": "sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==",
"dev": true "dev": true
}, },
"chalk": { "chalk": {
@@ -4121,9 +4144,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.690", "version": "1.3.707",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.690.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz",
"integrity": "sha512-zPbaSv1c8LUKqQ+scNxJKv01RYFkVVF1xli+b+3Ty8ONujHjAMg+t/COmdZqrtnS1gT+g4hbSodHillymt1Lww==", "integrity": "sha512-BqddgxNPrcWnbDdJw7SzXVzPmp+oiyjVrc7tkQVaznPGSS9SKZatw6qxoP857M+HbOyyqJQwYQtsuFIMSTNSZA==",
"dev": true "dev": true
}, },
"emoji-regex": { "emoji-regex": {
@@ -4220,9 +4243,9 @@
"dev": true "dev": true
}, },
"eslint": { "eslint": {
"version": "7.22.0", "version": "7.23.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.23.0.tgz",
"integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", "integrity": "sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "7.12.11", "@babel/code-frame": "7.12.11",
@@ -4649,9 +4672,9 @@
"dev": true "dev": true
}, },
"globals": { "globals": {
"version": "13.6.0", "version": "13.7.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.6.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz",
"integrity": "sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ==", "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==",
"dev": true, "dev": true,
"requires": { "requires": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
@@ -5053,6 +5076,24 @@
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true "dev": true
}, },
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
"dev": true
},
"lodash.flatten": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
"integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
"dev": true
},
"lodash.truncate": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
"integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=",
"dev": true
},
"lru-cache": { "lru-cache": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
@@ -5075,18 +5116,18 @@
"dev": true "dev": true
}, },
"mime-db": { "mime-db": {
"version": "1.46.0", "version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==", "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"dev": true "dev": true
}, },
"mime-types": { "mime-types": {
"version": "2.1.29", "version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"dev": true, "dev": true,
"requires": { "requires": {
"mime-db": "1.46.0" "mime-db": "1.47.0"
} }
}, },
"mimic-fn": { "mimic-fn": {
@@ -5657,9 +5698,9 @@
} }
}, },
"semver": { "semver": {
"version": "7.3.4", "version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -5860,21 +5901,26 @@
} }
}, },
"table": { "table": {
"version": "6.0.7", "version": "6.0.9",
"resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", "resolved": "https://registry.npmjs.org/table/-/table-6.0.9.tgz",
"integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", "integrity": "sha512-F3cLs9a3hL1Z7N4+EkSscsel3z55XT950AvB05bwayrNg5T1/gykXtigioTAjbltvbMSJvvhFCbnf6mX+ntnJQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "^7.0.2", "ajv": "^8.0.1",
"lodash": "^4.17.20", "is-boolean-object": "^1.1.0",
"is-number-object": "^1.0.4",
"is-string": "^1.0.5",
"lodash.clonedeep": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.truncate": "^4.4.2",
"slice-ansi": "^4.0.0", "slice-ansi": "^4.0.0",
"string-width": "^4.2.0" "string-width": "^4.2.0"
}, },
"dependencies": { "dependencies": {
"ajv": { "ajv": {
"version": "7.2.1", "version": "8.0.5",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.1.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.0.5.tgz",
"integrity": "sha512-+nu0HDv7kNSOua9apAVc979qd932rrZeb3WOvoiD31A/p1mIE5/9bN2027pE2rOPYEdS3UHzsvof4hY+lM9/WQ==", "integrity": "sha512-RkiLa/AeJx7+9OvniQ/qeWu0w74A8DiPPBclQ6ji3ZQkv5KamO+QGpqmi7O4JIw3rHGUXZ6CoP9tsAkn3gyazg==",
"dev": true, "dev": true,
"requires": { "requires": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
@@ -5898,9 +5944,9 @@
"dev": true "dev": true
}, },
"terser": { "terser": {
"version": "5.6.0", "version": "5.6.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.6.0.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-5.6.1.tgz",
"integrity": "sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA==", "integrity": "sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==",
"dev": true, "dev": true,
"requires": { "requires": {
"commander": "^2.20.0", "commander": "^2.20.0",
@@ -5981,15 +6027,15 @@
"dev": true "dev": true
}, },
"unbox-primitive": { "unbox-primitive": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.0.tgz", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
"integrity": "sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA==", "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
"dev": true, "dev": true,
"requires": { "requires": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"has-bigints": "^1.0.0", "has-bigints": "^1.0.1",
"has-symbols": "^1.0.0", "has-symbols": "^1.0.2",
"which-boxed-primitive": "^1.0.1" "which-boxed-primitive": "^1.0.2"
} }
}, },
"uri-js": { "uri-js": {
@@ -6028,9 +6074,9 @@
} }
}, },
"webpack": { "webpack": {
"version": "5.26.2", "version": "5.30.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.26.2.tgz", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.30.0.tgz",
"integrity": "sha512-h07tAPeQceEO3Idrevqv4ECcpMH8Zp0aUUJ+IytujWTVf6TF5PI3rKVw0Z+7rNjU4qJuEx18BykFxgRvR9VgEQ==", "integrity": "sha512-Zr9NIri5yzpfmaMea2lSMV1UygbW0zQsSlGLMgKUm63ACXg6alhd1u4v5UBSBjzYKXJN6BNMGVM7w165e7NxYA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/eslint-scope": "^3.7.0", "@types/eslint-scope": "^3.7.0",
@@ -6067,15 +6113,15 @@
} }
}, },
"webpack-cli": { "webpack-cli": {
"version": "4.5.0", "version": "4.6.0",
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.5.0.tgz", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.6.0.tgz",
"integrity": "sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q==", "integrity": "sha512-9YV+qTcGMjQFiY7Nb1kmnupvb1x40lfpj8pwdO/bom+sQiP4OBMKjHq29YQrlDWDPZO9r/qWaRRywKaRDKqBTA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@discoveryjs/json-ext": "^0.5.0", "@discoveryjs/json-ext": "^0.5.0",
"@webpack-cli/configtest": "^1.0.1", "@webpack-cli/configtest": "^1.0.2",
"@webpack-cli/info": "^1.2.2", "@webpack-cli/info": "^1.2.3",
"@webpack-cli/serve": "^1.3.0", "@webpack-cli/serve": "^1.3.1",
"colorette": "^1.2.1", "colorette": "^1.2.1",
"commander": "^7.0.0", "commander": "^7.0.0",
"enquirer": "^2.3.6", "enquirer": "^2.3.6",
@@ -6089,9 +6135,9 @@
}, },
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "7.1.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==", "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true "dev": true
} }
} }

View File

@@ -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": [

View File

@@ -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
} }

View File

@@ -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],
); );

View File

@@ -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) *

View File

@@ -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
} }

View File

@@ -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
} }

View File

@@ -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();

View File

@@ -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
} }

View File

@@ -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
} }

View File

@@ -1,5 +1,3 @@
/* eslint-disable no-restricted-syntax */
/* 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';
@@ -7,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';
@@ -47,17 +43,17 @@ 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;
CopyData(); CopyData();
for (const j of Object.keys(Game.Objects)) { Object.keys(Game.Objects).forEach((j) => {
target = j; target = j;
if (Game.Objects[target].amount < amount) { if (Game.Objects[target].amount < amount) {
CacheCostDragonUpgrade = 'Not enough buildings to sell'; CacheCostDragonUpgrade = 'Not enough buildings to sell';
break; return;
} else { }
for (let i = 0; i < amount; i++) { for (let i = 0; i < amount; i++) {
let price = let price =
SimObjects[target].basePrice * SimObjects[target].basePrice *
@@ -71,9 +67,8 @@ export default function CacheDragonCost() {
cost += price; cost += price;
SimObjects[target].amount -= 1; SimObjects[target].amount -= 1;
} }
} CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`; // eslint-disable-line no-unused-vars
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`; });
}
} }
} }
CacheLastDragonLevel = Game.dragonLevel; CacheLastDragonLevel = Game.dragonLevel;

View File

@@ -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,15 +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) {
target[i].color = ColourGray; // eslint-disable-line no-param-reassign
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
} }
}); });
} }
@@ -34,11 +37,12 @@ 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))
CachePPArray.push([target[i].pp, amount]); CachePPArray.push([target[i].pp, amount]);
}); });
} }
@@ -68,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);
} }

View File

@@ -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;
} }

View File

@@ -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,
@@ -24,13 +21,13 @@ import {
* @param {amount} amount Amount to be bought * @param {amount} amount Amount to be bought
* @parem {string} target The target Cache object ("Objects1", "Objects10" or "Objects100") * @parem {string} target The target Cache object ("Objects1", "Objects10" or "Objects100")
*/ */
function CacheBuildingIncome(amount, target) { function CacheBuildingIncome(amount) {
const result = []; const result = {};
Object.keys(Game.Objects).forEach((i) => { Object.keys(Game.Objects).forEach((i) => {
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;

View File

@@ -1,4 +1,3 @@
/* eslint-disable no-unused-vars */
import GetCPSBuffMult from '../CPS/GetCPSBuffMult'; import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
import { import {
CacheChainFrenzyMaxReward, CacheChainFrenzyMaxReward,
@@ -34,7 +33,7 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
let nextRequired = 0; let nextRequired = 0;
let chain = let chain =
1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10); 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
while (nextMoni < maxPayout) { while (nextMoni < maxPayout * mult) {
moni = Math.max( moni = Math.max(
digit, digit,
Math.min( Math.min(
@@ -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 /

View File

@@ -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
} }
} }

View File

@@ -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 */
} }
}); });
} }

View File

@@ -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
} }
} }

View File

@@ -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
} }
}); });
} }

View File

@@ -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 = {};

View File

@@ -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];
} }

View File

@@ -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 {

View File

@@ -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();
} }

View 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);
}

View File

@@ -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'));
} }
} }

View File

@@ -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

View File

@@ -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 {

View File

@@ -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';

View File

@@ -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';

View File

@@ -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,27 +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>
</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>
`; `;

View File

@@ -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',
}; };

View File

@@ -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

View File

@@ -1,62 +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,
PPSecondsLowerLimit: 0, Favicon: 1,
PPOnlyConsiderBuyable: 0, WrinklerButtons: 1,
ToolWarnBon: 1, HideSectionsButtons: 0,
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,
@@ -65,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,
@@ -115,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,

View File

@@ -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 };
} }

View File

@@ -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

View File

@@ -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';
@@ -38,23 +38,25 @@ function CreateUpgradeBarLegend() {
return div; return div;
}; };
legend.appendChild(legendLine(ColorBlue, 'Better than best PP building'));
legend.appendChild(legendLine(ColorGreen, 'Same as best PP building'));
legend.appendChild( legend.appendChild(
legendLine( legendLine(ColourBlue, 'Better than the best PP of a building option'),
ColorYellow,
'Between best and worst PP buildings closer to best',
),
); );
legend.appendChild( legend.appendChild(
legendLine( legendLine(ColourGreen, 'Same as the best PP building option'),
ColorOrange,
'Between best and worst PP buildings closer to worst',
),
); );
legend.appendChild(legendLine(ColorRed, 'Same as worst PP building')); legend.appendChild(
legend.appendChild(legendLine(ColorPurple, 'Worse than worst PP building')); legendLine(ColourYellow, 'Within the top 10 of PP for buildings'),
legend.appendChild(legendLine(ColorGray, 'Negative or infinity PP')); );
legend.appendChild(
legendLine(ColourOrange, 'Within the top 20 of PP for buildings'),
);
legend.appendChild(
legendLine(ColourRed, 'Within the top 30 of PP for buildings'),
);
legend.appendChild(
legendLine(ColourPurple, 'Outside of the top 30 of PP for buildings'),
);
legend.appendChild(legendLine(ColourGray, 'Negative or infinity PP'));
return legend; return legend;
} }
@@ -65,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';
@@ -83,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,

View File

@@ -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

View File

@@ -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';

View File

@@ -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,11 +53,16 @@ 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) {
let str = l('cookies').innerHTML.replace( let str = l('cookies').innerHTML.replace(
/.*(?=<br>)/i, /.*(?=<br>)/i,
Beautify(Game.cookies), Beautify(Game.cookies),
); );
if (Game.prefs.monospace) str = `<span class="monospace">${str}</span>`; if (Game.prefs.monospace) str = `<span class="monospace">${str}</span>`;
l('cookies').innerHTML = str; l('cookies').innerHTML = str;
}
} }

View File

@@ -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;

View File

@@ -23,6 +23,7 @@ export default function GetCPS() {
(CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05)) (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05))
); );
} }
if (CacheWrinklersFattest[1] !== null)
if ( if (
CMOptions.CalcWrink === 2 && CMOptions.CalcWrink === 2 &&
Game.wrinklers[CacheWrinklersFattest[1]].type === 1 Game.wrinklers[CacheWrinklersFattest[1]].type === 1

View File

@@ -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 };
}

View 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 };
}

View File

@@ -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();
} }

View File

@@ -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
}

View 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
}

View File

@@ -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;
}); });
} }
} }

View File

@@ -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';

View File

@@ -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(

View File

@@ -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';

View File

@@ -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

View File

@@ -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

View 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();
}

View 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;
}

View 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;
}

View 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
],
);
}

View File

@@ -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
],
);
}

View File

@@ -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();
}
} }

View File

@@ -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

View File

@@ -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();
}
};
}
});
}
}

View File

@@ -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

View File

@@ -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(

View File

@@ -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';
} }

View File

@@ -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>`

View File

@@ -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);

View File

@@ -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/>&bull; <b>${Beautify(amortizeAmount)}</b> ${ `so far<br/>&bull; <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();

View File

@@ -1,4 +1,3 @@
/* eslint-disable no-restricted-syntax */
import { import {
CacheObjects1, CacheObjects1,
CacheObjects10, CacheObjects10,
@@ -9,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,
@@ -55,27 +54,31 @@ 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
l('CMTooltipProductionHeader').style.display = 'none'; l('CMTooltipProductionHeader').style.display = 'none';
l('CMTooltipTime').style.marginBottom = '0px'; l('CMTooltipTime').style.marginBottom = '0px';
// Can this ESLint error be solved while retaining the functionality of break?
// eslint-disable-next-line no-restricted-syntax
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) { for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
if ( if (
!Game.HasAchiev( !Game.HasAchiev(

View File

@@ -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;

View File

@@ -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)

View File

@@ -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';
} }

View File

@@ -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') {

View File

@@ -2,6 +2,7 @@ import {
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersTotal, CacheWrinklersTotal,
} from '../../../Cache/VariablesAndData'; } from '../../../Cache/VariablesAndData';
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
import { TooltipName } from '../../VariablesAndData'; import { TooltipName } from '../../VariablesAndData';
import * as Create from '../CreateTooltip'; import * as Create from '../CreateTooltip';
@@ -16,9 +17,9 @@ export default function WrinklerButton() {
const WrinklerReward = document.createElement('div'); const WrinklerReward = document.createElement('div');
WrinklerReward.id = 'CMWrinklerReward'; WrinklerReward.id = 'CMWrinklerReward';
if (TooltipName === 'PopAll') { if (TooltipName === 'PopAll') {
WrinklerReward.textContent = CacheWrinklersTotal; WrinklerReward.textContent = Beautify(CacheWrinklersTotal);
} else if (TooltipName === 'PopFattest') { } else if (TooltipName === 'PopFattest') {
WrinklerReward.textContent = CacheWrinklersFattest[0]; WrinklerReward.textContent = Beautify(CacheWrinklersFattest[0]);
} }
l('tooltip').appendChild(WrinklerReward); l('tooltip').appendChild(WrinklerReward);

View File

@@ -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

View File

@@ -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;

View File

@@ -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
} }
} }

View File

@@ -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)

View File

@@ -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}`,
}); });

View File

@@ -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;

View File

@@ -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;

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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
View 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);
}

View File

@@ -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(

View File

@@ -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();

View File

@@ -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')

View File

@@ -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(

View File

@@ -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 {
@@ -11,13 +10,13 @@ import UpdateTitle from '../../Disp/TabTitle/TabTitle';
import ReplaceAscendTooltip from '../../Disp/Tooltips/AscendButton'; import ReplaceAscendTooltip from '../../Disp/Tooltips/AscendButton';
import UpdateTooltipLocation from '../../Disp/Tooltips/PositionLocation'; import UpdateTooltipLocation from '../../Disp/Tooltips/PositionLocation';
import { CMSayTime, Title } from '../../Disp/VariablesAndData'; import { CMSayTime, Title } from '../../Disp/VariablesAndData';
import { import { SimDoSims } from '../../Sim/VariablesAndData';
SimDateAges,
SimDateCentury,
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';
/** /**
@@ -32,14 +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
SimDateAges = Date.now(); CycliusDateAtBeginLoop = Date.now(); // eslint-disable-line no-unused-vars
SimDateCentury = Date.now(); 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) {
@@ -47,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.')
@@ -132,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);
@@ -145,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}`;

View File

@@ -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

View File

@@ -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;

View File

@@ -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';
@@ -11,8 +14,6 @@ import {
SimAchievementsOwned, SimAchievementsOwned,
SimCookiesPs, SimCookiesPs,
SimCookiesPsRaw, SimCookiesPsRaw,
SimDateAges,
SimDateCentury,
SimEffs, SimEffs,
SimHeavenlyPower, SimHeavenlyPower,
SimObjects, SimObjects,
@@ -40,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 +=
@@ -94,15 +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((SimDateAges / 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 + 1 +
0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 12)) * Math.PI * 2); 0.15 *
Math.sin(
(CycliusDateAtBeginLoop / 1000 / (60 * 60 * 12)) * Math.PI * 2,
);
else if (godLvl === 3) else if (godLvl === 3)
mult *= mult *=
1 + 1 +
0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 24)) * Math.PI * 2); 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;
@@ -193,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((SimDateCentury - Game.startDate) / 1000 / 10) * 10) / (Math.floor((CenturyDateAtBeginLoop - Game.startDate) / 1000 / 10) * 10) /
60 / 60 /
60 / 60 /
24; 24;
@@ -215,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");

Some files were not shown because too many files have changed in this diff Show More