Compare commits
496 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac7f630a8e | ||
|
|
2940d1c631 | ||
|
|
700a5987a8 | ||
|
|
029c25f48e | ||
|
|
518aff7ca7 | ||
|
|
f82b0fbc3a | ||
|
|
c0c3414dea | ||
|
|
295771bcec | ||
|
|
0184fde289 | ||
|
|
612ab6a6f5 | ||
|
|
b9fe2aa3fb | ||
|
|
4b454cc123 | ||
|
|
725e053df6 | ||
|
|
4008c2a8ee | ||
|
|
248c36c357 | ||
|
|
5679f4ab01 | ||
|
|
40dc0b89cc | ||
|
|
c6b38aa501 | ||
|
|
f4445f7b0a | ||
|
|
3d99f818ab | ||
|
|
5f40b2a45e | ||
|
|
1fbe7c4b51 | ||
|
|
fbaa2cc8de | ||
|
|
91dd817212 | ||
|
|
df392029ce | ||
|
|
5ae4ed761f | ||
|
|
001efa24bd | ||
|
|
0963a2b63a | ||
|
|
88952e9986 | ||
|
|
946d0ff00e | ||
|
|
cb23000caa | ||
|
|
2be1716c05 | ||
|
|
b363e3a06a | ||
|
|
c909c99cb5 | ||
|
|
97f8e974de | ||
|
|
42543370b7 | ||
|
|
b736015b1c | ||
|
|
60f19e5084 | ||
|
|
525ea72174 | ||
|
|
c455f940c6 | ||
|
|
36780486a1 | ||
|
|
55e3fe536c | ||
|
|
f60ac4889e | ||
|
|
51713afaea | ||
|
|
d0ddc93f7c | ||
|
|
65eff470cf | ||
|
|
9996e59024 | ||
|
|
f59972892b | ||
|
|
4fe07ba1d3 | ||
|
|
bedda0093d | ||
|
|
7c26b8015a | ||
|
|
1f219df674 | ||
|
|
8280d3ae7a | ||
|
|
3144e776b7 | ||
|
|
be0edd090d | ||
|
|
038a8b33b0 | ||
|
|
6395ad318a | ||
|
|
ed0049e367 | ||
|
|
bbd523ac3f | ||
|
|
cb1f9d7ca5 | ||
|
|
fb0f42deed | ||
|
|
74bb5d924d | ||
|
|
065f8b4c23 | ||
|
|
e685489543 | ||
|
|
6a4772d8e2 | ||
|
|
bd0a55609d | ||
|
|
6fcece6fc8 | ||
|
|
3e3659e2a4 | ||
|
|
10c1e9eefb | ||
|
|
4c4ef57ce4 | ||
|
|
02bf0d6455 | ||
|
|
f89a685c49 | ||
|
|
d776b9b799 | ||
|
|
2a82fc2b1f | ||
|
|
80b373ff6c | ||
|
|
8c118b6aef | ||
|
|
82c872ef18 | ||
|
|
e9dc2ffa51 | ||
|
|
9294a5bc87 | ||
|
|
248fd32e91 | ||
|
|
436c1d7239 | ||
|
|
055ba22ee2 | ||
|
|
b84e511e52 | ||
|
|
ec35013be7 | ||
|
|
52edc5696a | ||
|
|
eefecb7829 | ||
|
|
bb0ba7f116 | ||
|
|
075bd89669 | ||
|
|
43a651ea4a | ||
|
|
fde93b5639 | ||
|
|
80dab239b6 | ||
|
|
22faf1edc2 | ||
|
|
522443c30f | ||
|
|
d8eea6939e | ||
|
|
ab7a092ab9 | ||
|
|
c661cba533 | ||
|
|
451ed9ee7a | ||
|
|
6ac737d3af | ||
|
|
4572d0e5c5 | ||
|
|
b7c7739a25 | ||
|
|
85b6d96be6 | ||
|
|
68e42e2744 | ||
|
|
984c11e2ac | ||
|
|
e3eccf25e8 | ||
|
|
85b161fe14 | ||
|
|
a497dec741 | ||
|
|
5a7187aa3c | ||
|
|
db07ab6c3e | ||
|
|
c0e788b143 | ||
|
|
b959b3c024 | ||
|
|
c8eeab45af | ||
|
|
28bc2b5620 | ||
|
|
ecf73d815f | ||
|
|
094b153f7e | ||
|
|
3ac2c75b6f | ||
|
|
3b444c2b69 | ||
|
|
a5c052b46e | ||
|
|
531adb2a16 | ||
|
|
e3fddd4450 | ||
|
|
07bb28cf46 | ||
|
|
a9eb56de0c | ||
|
|
dcf00b82b8 | ||
|
|
27a621d9b0 | ||
|
|
14ba9105ca | ||
|
|
6f36d1dcf1 | ||
|
|
69afafd0fb | ||
|
|
c9b6a06908 | ||
|
|
a877dc5ad3 | ||
|
|
68e6afa410 | ||
|
|
3401a6165f | ||
|
|
59217317b3 | ||
|
|
a147065fd6 | ||
|
|
27ad606380 | ||
|
|
cff2928535 | ||
|
|
6a30843c7d | ||
|
|
5fec38625f | ||
|
|
1d325a253c | ||
|
|
33caf8838c | ||
|
|
ca5acc1d37 | ||
|
|
2708903e92 | ||
|
|
6b346e0272 | ||
|
|
d6a3209c43 | ||
|
|
dfd0d790bc | ||
|
|
a8c9fea127 | ||
|
|
f228365978 | ||
|
|
d549bbdf9b | ||
|
|
e7536d4bd4 | ||
|
|
9a6086d823 | ||
|
|
e6b5bddda6 | ||
|
|
527de03493 | ||
|
|
52d52baf8e | ||
|
|
9c1bfbf80a | ||
|
|
712a3dd5c3 | ||
|
|
d4043689a4 | ||
|
|
8cb0471694 | ||
|
|
e0756c4943 | ||
|
|
ce7f0eb7e3 | ||
|
|
70df241c8f | ||
|
|
3ba2a31363 | ||
|
|
c4907e9582 | ||
|
|
96b55fb77c | ||
|
|
1c1afb6880 | ||
|
|
1905f9a953 | ||
|
|
b06ff269a1 | ||
|
|
23eb28e29c | ||
|
|
38f430c930 | ||
|
|
17a3ef0d83 | ||
|
|
035318c33f | ||
|
|
8cc7bb7f99 | ||
|
|
a620efe44a | ||
|
|
26b08c77ce | ||
|
|
3e53ba7c6d | ||
|
|
0bff74bddd | ||
|
|
9252d10f23 | ||
|
|
0278162dce | ||
|
|
ad146f9a43 | ||
|
|
ee0ed81aba | ||
|
|
f69fb191d1 | ||
|
|
aba1b88eac | ||
|
|
c0e93f316f | ||
|
|
058555b148 | ||
|
|
dd2c4e56b4 | ||
|
|
be569ee218 | ||
|
|
af547ee2c4 | ||
|
|
c0e27f3c52 | ||
|
|
d694e82b02 | ||
|
|
6344c454a6 | ||
|
|
ca796c0b48 | ||
|
|
6c95e341f5 | ||
|
|
65cec9da50 | ||
|
|
f84f6fc348 | ||
|
|
be245da05f | ||
|
|
977c25e77a | ||
|
|
6ab791d762 | ||
|
|
962a709489 | ||
|
|
4fb58719d3 | ||
|
|
eaff9ef93d | ||
|
|
f403f89c20 | ||
|
|
100745946e | ||
|
|
18b151d7c0 | ||
|
|
2febfb4cbe | ||
|
|
73b9ebce7f | ||
|
|
39744d52b3 | ||
|
|
97624bd4da | ||
|
|
66549c5c96 | ||
|
|
df152fd302 | ||
|
|
ff31c45a4a | ||
|
|
9ba81afae1 | ||
|
|
66e906e878 | ||
|
|
865fc3b227 | ||
|
|
47ebed0925 | ||
|
|
734f3c38c2 | ||
|
|
fcbf1b2377 | ||
|
|
4c6dfbba69 | ||
|
|
3edcb0300b | ||
|
|
49e9711b7c | ||
|
|
a48ad37b7f | ||
|
|
ace1c9f6a9 | ||
|
|
fa942ff81d | ||
|
|
974b948583 | ||
|
|
e1e4327173 | ||
|
|
d054b55ddc | ||
|
|
6e0add10fb | ||
|
|
f431d2b6be | ||
|
|
68ad398b27 | ||
|
|
68d7295bbc | ||
|
|
2be4e2de57 | ||
|
|
ae6db8f330 | ||
|
|
5715274d1a | ||
|
|
74cdb613ca | ||
|
|
4eae4598a7 | ||
|
|
d9ef469980 | ||
|
|
5532e4d0ba | ||
|
|
e78703130e | ||
|
|
63240b01bc | ||
|
|
1a520b4d52 | ||
|
|
c7fd910a26 | ||
|
|
a3ad66a058 | ||
|
|
ee3aac59ce | ||
|
|
598a36493f | ||
|
|
507e168e24 | ||
|
|
35bd55f884 | ||
|
|
7202f0122d | ||
|
|
19edf86751 | ||
|
|
28857220f3 | ||
|
|
8d1d9697c1 | ||
|
|
6eb2b76d9f | ||
|
|
b674376433 | ||
|
|
9c24deb5aa | ||
|
|
88a6fc31a1 | ||
|
|
f791d47845 | ||
|
|
d6b0284da1 | ||
|
|
0f2bd0a10e | ||
|
|
41c28c21df | ||
|
|
67d3562659 | ||
|
|
770b238f70 | ||
|
|
305454b802 | ||
|
|
18ace33231 | ||
|
|
af803b4ead | ||
|
|
210f4d4aee | ||
|
|
5a045e7ac4 | ||
|
|
cc2a754425 | ||
|
|
e44e39bc2c | ||
|
|
48c1d12d86 | ||
|
|
195d7335f8 | ||
|
|
941ccfeb79 | ||
|
|
eb71fd9bd2 | ||
|
|
039155a607 | ||
|
|
9fe2e8b9b9 | ||
|
|
11b3a99314 | ||
|
|
932b03fd51 | ||
|
|
be8cf101e4 | ||
|
|
98e6cd1dfc | ||
|
|
7df6e5fa54 | ||
|
|
c3adcf4d81 | ||
|
|
82bf56cee0 | ||
|
|
21c714008c | ||
|
|
d377702d09 | ||
|
|
32f0572ab3 | ||
|
|
89952f20c2 | ||
|
|
8bab891231 | ||
|
|
0f6cffc9bf | ||
|
|
0aebc35a8b | ||
|
|
ec87a8ad3c | ||
|
|
6ff15db4da | ||
|
|
21b8a169ef | ||
|
|
32b7bfc2c9 | ||
|
|
e66ecb2be5 | ||
|
|
ddc46113bc | ||
|
|
3e80f95947 | ||
|
|
52ac7558c7 | ||
|
|
76c6d584df | ||
|
|
fa70faf386 | ||
|
|
4222e2d275 | ||
|
|
f95609a36d | ||
|
|
209d35d30e | ||
|
|
4da9d379c5 | ||
|
|
1c8bd79640 | ||
|
|
1d12977984 | ||
|
|
0f960b9ad4 | ||
|
|
87e4a6821a | ||
|
|
134828692a | ||
|
|
1b548e2beb | ||
|
|
30602b6ff7 | ||
|
|
09b0ca83ae | ||
|
|
091b1f100e | ||
|
|
c7a3a0a329 | ||
|
|
4d7e138e09 | ||
|
|
d909f593a7 | ||
|
|
266b808c4a | ||
|
|
bc936ebf20 | ||
|
|
32b3167697 | ||
|
|
f47e1f59fe | ||
|
|
e4cdc6b85a | ||
|
|
d23719c2a8 | ||
|
|
652d00ee72 | ||
|
|
f8a13302b1 | ||
|
|
8aac67b665 | ||
|
|
8ce4e13646 | ||
|
|
80d03e1cbc | ||
|
|
d300d7c0fc | ||
|
|
fbcee9a425 | ||
|
|
bf5e44ed9e | ||
|
|
d56ffd9961 | ||
|
|
adca267cfc | ||
|
|
75dac873dc | ||
|
|
84eed2d7c4 | ||
|
|
f5e342f7c5 | ||
|
|
23db16917c | ||
|
|
077f0120b7 | ||
|
|
1545d9782b | ||
|
|
62dea78e65 | ||
|
|
309ebd6805 | ||
|
|
3e3945461d | ||
|
|
d99837df61 | ||
|
|
fc37ae1b95 | ||
|
|
1a07cb6a01 | ||
|
|
3d6e1d0c84 | ||
|
|
5cd0613398 | ||
|
|
b011556841 | ||
|
|
2d0b499a14 | ||
|
|
210ac67701 | ||
|
|
6ff8ee69f2 | ||
|
|
16c80cbf4b | ||
|
|
d02ce3cd8f | ||
|
|
df639be579 | ||
|
|
86678b0871 | ||
|
|
90be659c13 | ||
|
|
c51c900d1c | ||
|
|
ca5d9bae11 | ||
|
|
cba8eb7632 | ||
|
|
119faa5305 | ||
|
|
32c38fd9fa | ||
|
|
fd2d22564c | ||
|
|
48e8fd2154 | ||
|
|
e7cf3b076d | ||
|
|
37bff7df1e | ||
|
|
9b04663cd8 | ||
|
|
e3321ebe2f | ||
|
|
e2f99d1cf9 | ||
|
|
3f08ed3e2d | ||
|
|
444462ae53 | ||
|
|
5017f1c217 | ||
|
|
d5aaba3546 | ||
|
|
d511f4f1f2 | ||
|
|
5a14712841 | ||
|
|
383be573c9 | ||
|
|
66ede34b92 | ||
|
|
e482a62fe8 | ||
|
|
e1c6f60726 | ||
|
|
bfc54bf9de | ||
|
|
812a2aaa69 | ||
|
|
08a1e5aa6b | ||
|
|
566efbc68b | ||
|
|
66e74bb702 | ||
|
|
9a84b0abe5 | ||
|
|
ddc77b332d | ||
|
|
2cff52f5c7 | ||
|
|
3a28263099 | ||
|
|
822e8a8066 | ||
|
|
ba0ff40aba | ||
|
|
5f64d2dd9f | ||
|
|
10eb88cde1 | ||
|
|
aebd62317b | ||
|
|
305762e797 | ||
|
|
fb0f9c3bf3 | ||
|
|
f506cb136e | ||
|
|
adb020dfc2 | ||
|
|
972d4723ed | ||
|
|
fe8749e7b2 | ||
|
|
48c3bad336 | ||
|
|
212a358a6a | ||
|
|
02d49dca2e | ||
|
|
cf1c2c39f4 | ||
|
|
f7c4e23eb3 | ||
|
|
202913179c | ||
|
|
c0a13231ad | ||
|
|
5b34685cd4 | ||
|
|
d1daa6d434 | ||
|
|
9d9ef9b514 | ||
|
|
be529d0b71 | ||
|
|
68c8cc9d54 | ||
|
|
81114acfa2 | ||
|
|
e882cb15f5 | ||
|
|
ae7ea4fbd4 | ||
|
|
1653c18c55 | ||
|
|
3e5671f39e | ||
|
|
2438da6e38 | ||
|
|
79b960bde7 | ||
|
|
11554722ed | ||
|
|
a4e2b9f68c | ||
|
|
823d12fa70 | ||
|
|
51c89bdc88 | ||
|
|
9e107c7a3a | ||
|
|
9b33169fcc | ||
|
|
f9513d3615 | ||
|
|
ad4e6560d6 | ||
|
|
91c0fd1165 | ||
|
|
3534466a58 | ||
|
|
7a3e153319 | ||
|
|
918790cad4 | ||
|
|
b4426e48db | ||
|
|
a9c1d6a170 | ||
|
|
d9429418e9 | ||
|
|
aa89b6f13c | ||
|
|
7986f2ab46 | ||
|
|
936f538343 | ||
|
|
0310d23eb4 | ||
|
|
392c473839 | ||
|
|
84502bff4a | ||
|
|
b42daead36 | ||
|
|
314efc87f6 | ||
|
|
3f20fac752 | ||
|
|
f916008a3b | ||
|
|
1a94c4cb7c | ||
|
|
937fa23569 | ||
|
|
be1ecf306a | ||
|
|
8ebb2f85ed | ||
|
|
116679a5c9 | ||
|
|
bf95af4e58 | ||
|
|
8a709af86f | ||
|
|
46c849ea9e | ||
|
|
49b8a8c6d7 | ||
|
|
88b36becbb | ||
|
|
e800159b1e | ||
|
|
da2902dd67 | ||
|
|
09cc7ca646 | ||
|
|
e1d6defaf6 | ||
|
|
0c10027fa4 | ||
|
|
0b3a12ce33 | ||
|
|
0ea8719dbf | ||
|
|
8fc6d64219 | ||
|
|
47988a3707 | ||
|
|
3d06ee6aec | ||
|
|
49c67bd86d | ||
|
|
2b1007f7af | ||
|
|
436a22f0c7 | ||
|
|
e3fdc6854d | ||
|
|
62bc84920a | ||
|
|
7b67ea19d8 | ||
|
|
aa93b6a6d2 | ||
|
|
6fc807e3ce | ||
|
|
605927359d | ||
|
|
9f870572f4 | ||
|
|
aec0583a89 | ||
|
|
db95fe5147 | ||
|
|
a21df99b0b | ||
|
|
79de5d09c7 | ||
|
|
0d1265d533 | ||
|
|
797a0ce498 | ||
|
|
494673a371 | ||
|
|
2299d0b89c | ||
|
|
c5806799a4 | ||
|
|
f44d03c4c7 | ||
|
|
b7666cca6d | ||
|
|
3568799c32 | ||
|
|
47a8427448 | ||
|
|
2899291162 | ||
|
|
a390734890 | ||
|
|
6995e86752 | ||
|
|
dbd2b0ae51 | ||
|
|
f9141a7f4f | ||
|
|
15b80cf48f | ||
|
|
030a0a20da | ||
|
|
a1f2e0f424 | ||
|
|
581db06f0f | ||
|
|
93ffc9d67b | ||
|
|
e6c1117a11 | ||
|
|
dcf233e7c2 | ||
|
|
47437ce496 | ||
|
|
aeee5a2e9c | ||
|
|
9b81c60f1e | ||
|
|
72e745c1f4 | ||
|
|
3ffedc83fa | ||
|
|
017096df73 | ||
|
|
f3507c4046 |
@@ -1,6 +0,0 @@
|
|||||||
CookieMonster.js
|
|
||||||
CookieMonster.user.js
|
|
||||||
src/*.js
|
|
||||||
!src/CookieMonster.js
|
|
||||||
!src/*/*
|
|
||||||
dist/*
|
|
||||||
27
.eslintrc.js
27
.eslintrc.js
@@ -1,27 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
es2021: true,
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
Game: 'writable',
|
|
||||||
l: 'readonly',
|
|
||||||
b64_to_utf8: 'readonly',
|
|
||||||
utf8_to_b64: 'readonly',
|
|
||||||
BeautifyAll: 'readonly',
|
|
||||||
},
|
|
||||||
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 12,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'import/no-mutable-exports': 'off',
|
|
||||||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
||||||
'no-new-func': 'off',
|
|
||||||
'func-names': 'off',
|
|
||||||
'no-console': 'off',
|
|
||||||
'no-alert': 'off',
|
|
||||||
'no-restricted-globals': 'off',
|
|
||||||
'prefer-destructuring': ['error', { object: true, array: false }],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
47
.eslintrc.json
Normal file
47
.eslintrc.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"Game": "writable",
|
||||||
|
"l": "readonly",
|
||||||
|
"b64_to_utf8": "readonly",
|
||||||
|
"utf8_to_b64": "readonly",
|
||||||
|
"BeautifyAll": "readonly"
|
||||||
|
},
|
||||||
|
"extends": ["airbnb-base", "prettier"],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 12
|
||||||
|
},
|
||||||
|
"plugins": ["@typescript-eslint"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["src/**/*.{ts,tsx}"],
|
||||||
|
"extends": ["plugin:@typescript-eslint/recommended"],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"rules": {
|
||||||
|
"import/extensions": "off", // To allow importing .ts without errors
|
||||||
|
"import/no-unresolved": "off" // To allow importing .ts without errors
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ignorePatterns": ["*CookieMonster*.js", "dist/*", "node_modules/*"],
|
||||||
|
"rules": {
|
||||||
|
"import/no-mutable-exports": "off", // We need to this throughout Cookie Monster
|
||||||
|
"no-plusplus": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"allowForLoopAfterthoughts": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func-names": "off", // To allow unnamed arrow functions
|
||||||
|
"prefer-destructuring": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"object": true,
|
||||||
|
"array": false
|
||||||
|
}
|
||||||
|
] // Importing arrays and then destructuring them seems to fail
|
||||||
|
}
|
||||||
|
}
|
||||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -22,3 +22,5 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
Please add a save file here.
|
Please add a save file here.
|
||||||
This makes debugging much easier as we do not always have a good test save to debug the issue
|
This makes debugging much easier as we do not always have a good test save to debug the issue
|
||||||
```
|
```
|
||||||
|
**Browser**
|
||||||
|
Please specify your current browser. This can help find/fix the bug!
|
||||||
|
|||||||
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
50
.github/workflows/CI.yml
vendored
50
.github/workflows/CI.yml
vendored
@@ -1,31 +1,43 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on: pull_request
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
- gh-pages
|
||||||
|
pull_request:
|
||||||
jobs:
|
jobs:
|
||||||
Check_ESLint:
|
Check_linting_test_and_build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GITHUB_REGISTERY_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 12
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
- name: Run ESLint
|
- name: Run ESLint
|
||||||
|
run: npx eslint src
|
||||||
|
- name: Run Mocha tests
|
||||||
|
run: npx mocha
|
||||||
|
- name: Check if CookieMonsterDev.js is built correctly
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npx webpack -o ./tmp --env minimize
|
||||||
npx eslint src
|
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
|
||||||
Check_main_file:
|
echo '### SUCCESS: CookieMonsterDev is built correctly! ###'
|
||||||
runs-on: ubuntu-latest
|
else
|
||||||
steps:
|
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###'
|
||||||
- uses: actions/checkout@v2
|
exit 1
|
||||||
|
fi
|
||||||
- name: Check if CookieMonster.js is built correctly
|
- name: Check if CookieMonster.js is built correctly
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npx webpack -o ./tmp --env minimize --env finalfile
|
||||||
npx webpack -o ./test --env production
|
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
|
||||||
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 test/CookieMonster.js); then
|
echo '### SUCCESS: CookieMonster is built correctly! ###'
|
||||||
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
|
||||||
else
|
else
|
||||||
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
|
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build-final" after saving all your changes! ###'
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if cmp <(head -n 2 CookieMonster.js) <(head -n 2 test/CookieMonster.js); then
|
|
||||||
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
|
||||||
else
|
|
||||||
echo '### WARNING: Make sure to move the file from the /dist folder to the main folder. Otherwise Github Pages won't notice it ###'
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
16
.github/workflows/publish-dev.yml
vendored
Normal file
16
.github/workflows/publish-dev.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Publish
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "dev"
|
||||||
|
jobs:
|
||||||
|
publish-dev:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: everlytic/branch-merge@1.1.0
|
||||||
|
with:
|
||||||
|
github_token: ${{ github.token }}
|
||||||
|
source_ref: 'dev'
|
||||||
|
target_branch: 'gh-pages'
|
||||||
|
commit_message_template: '[Automated] Merge {source_ref} into {target_branch}'
|
||||||
4
.mocharc.json
Normal file
4
.mocharc.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"recursive": true,
|
||||||
|
"require": ["esm", "ts-node/register"]
|
||||||
|
}
|
||||||
4
.npmrc
Normal file
4
.npmrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
always-auth=true
|
||||||
|
registry=https://registry.npmjs.org/
|
||||||
|
@cookiemonsterteam:registry=https://npm.pkg.github.com
|
||||||
|
//npm.pkg.github.com/:_authToken=${GITHUB_REGISTERY_PAT}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"printWidth": 100,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "all",
|
"trailingComma": "all"
|
||||||
"printWidth": 80
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -6,14 +6,8 @@
|
|||||||
const readyCheck = setInterval(() => {
|
const readyCheck = setInterval(() => {
|
||||||
const Game = unsafeWindow.Game;
|
const Game = unsafeWindow.Game;
|
||||||
|
|
||||||
if (
|
if (typeof Game !== 'undefined' && typeof Game.ready !== 'undefined' && Game.ready) {
|
||||||
typeof Game !== "undefined" &&
|
Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js');
|
||||||
typeof Game.ready !== "undefined" &&
|
|
||||||
Game.ready
|
|
||||||
) {
|
|
||||||
Game.LoadMod(
|
|
||||||
"https://aktanusa.github.io/CookieMonster/CookieMonster.js"
|
|
||||||
);
|
|
||||||
clearInterval(readyCheck);
|
clearInterval(readyCheck);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014 Aktanusa
|
Copyright (c) 2021 CookieMonsterTeam
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
40
README.md
40
README.md
@@ -1,22 +1,28 @@
|
|||||||

|
[](https://github.com/CookieMonsterTeam/CookieMonster/actions/workflows/CI.yml)
|
||||||
|
|
||||||
## Cookie Monster
|
## Cookie Monster
|
||||||
|
|
||||||
**Cookie Monster** is an addon you can load into Cookie Clicker, that 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.
|
**Cookie Monster** is an addon you can load into Cookie Clicker, that 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.
|
||||||
The mod helps you to *whichever* degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but **everything is an option**.
|
The mod helps you to *whichever* degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but **everything is an option**.
|
||||||
|
|
||||||
### Current version
|
### Current version
|
||||||
The `gh-pages` branch hosts the latest version intended for general users. All development and pull requests should target the `dev` branch.
|
|
||||||
|
The `master` branch hosts the latest production version intended for general users.
|
||||||
|
All development and pull requests should target the `dev` branch.
|
||||||
|
Github Pages is hosted from the `gh-pages` branch
|
||||||
|
|
||||||
### What it does
|
### What it does
|
||||||
|
|
||||||
At its core, Cookie Monster computes an index for both buildings and upgrades: the **Payback Period (PP)**. This indicates how much a building is worth by using the following formula:
|
At its core, Cookie Monster computes an index for both buildings and upgrades: the **Payback Period (PP)**. CM will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, CM will know and highlight that building's value. CM uses the following formula to calculate the PP:
|
||||||
```
|
|
||||||
|
```javascript
|
||||||
max(cost - cookies in bank, 0)/cps + cost/Δ cps
|
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.
|
If the relevant option is enabled, CM will color-code each of them based on their value. CM 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. Note that sometimes it is better to buy 10 of a building than to buy only 1, CM will also indicate this!
|
||||||
|
|
||||||
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:
|
<details>
|
||||||
|
<summary>The following standard colours are used:</summary>
|
||||||
|
|
||||||
* 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
|
||||||
@@ -26,6 +32,8 @@ This index is computed for buildings and upgrades. If the relevant option is ena
|
|||||||
* Purple: This building is worse than the top 10 of best PP's
|
* Purple: This building is worse than the top 10 of best PP's
|
||||||
* Gray: This item does not have a PP, often this means that there is no change to CPS
|
* Gray: This item does not have a PP, often this means that there is no change to CPS
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Note: For this index, **lower is better**, meaning a building with a PP of 1 is more interesting than one with a PP of 3.
|
Note: For this index, **lower is better**, meaning a building with a PP of 1 is more interesting than one with a PP of 3.
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
@@ -36,7 +44,7 @@ Copy this code and save it as a bookmark. Paste it in the URL section. To activa
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
javascript: (function () {
|
javascript: (function () {
|
||||||
Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js');
|
||||||
}());
|
}());
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -50,24 +58,30 @@ If you'd rather use the addon as a [userscript](https://en.wikipedia.org/wiki/Us
|
|||||||
|
|
||||||
## Bugs and suggestions
|
## Bugs and suggestions
|
||||||
|
|
||||||
Any bug or suggestion should be **opened as an issue** [in the repository](https://github.com/Aktanusa/CookieMonster/issues) for easier tracking. This allows us to close issues once they're fixed.
|
Any bug or suggestion should be **opened as an issue** [in the repository](https://github.com/CookieMonsterTeam/CookieMonster/issues) for easier tracking. This allows us to close issues once they're fixed.
|
||||||
|
|
||||||
Before submitting a bug, make sure to give a shot at the latest version of the addon on the `dev` branch. This version can be tested by copying the `CookieMonster.js` file of the dev branch into your console. If the bug is still here, you can submit an issue for it. Please do so by using the bug report template.
|
Before submitting a bug, make sure to give a shot at the latest version of the addon on the `dev` branch. This version can be tested by copying the `CookieMonsterDev.js` file of the dev branch into your console. You can also load the dev-version by using `https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonsterDev.js` to load the mod. If the bug is still here, you can submit an issue for it. Please do so by using the bug report template.
|
||||||
|
|
||||||
All suggestions are welcome, even the smallest ones.
|
All suggestions are welcome, even the smallest ones.
|
||||||
|
|
||||||
|
## For developers
|
||||||
|
|
||||||
|
Cookie Monster exposes some of the data it creates to the global scope. This data can be found in the `CookieMonsterData` object after loading Cookie Monster.
|
||||||
|
|
||||||
|
Currently we exposes relevant data for buildings and upgrades (PP, colour and bonus income). If you would like us to add any aditional data, please feel free to open an issue or create a PR doing so!
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
To contribute you can fork and clone the repository and run `npm install`.
|
To contribute you can fork and clone the repository and run `npm install`. Note that you will need to authenticate to the GitHub Package Registery (see [this documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages)). After creating a Public Access Token you should export this variable to $GITHUB_REGISTERY_PAT as defined in `.npmrc`.
|
||||||
|
|
||||||
Please also remember to run `npm run build` after saving all your changes to build the final `CookieMonster.js` file.
|
Please also remember to run `npm run build-dev` after saving all your changes to build the final `CookieMonsterDev.js` file.
|
||||||
|
|
||||||
|
Before pushing a new version to `main` and Github pages use the `build-final` command to build the final file.
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
* **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
* **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
||||||
* **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
* **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
||||||
* **[Alderi Tokori](http://forum.dashnet.org/profile/Alderi)**: ROI calculations (unused now)
|
|
||||||
* **[Alhifar](https://github.com/Alhifar)**: Missed Golden Cookie Stat
|
|
||||||
* **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
* **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
||||||
* **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
* **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
||||||
* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
||||||
|
|||||||
3
dist/CookieMonster.js
vendored
3
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
3
dist/CookieMonsterDev.js
vendored
Normal file
3
dist/CookieMonsterDev.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
dist/CookieMonsterDev.js.LICENSE.txt
vendored
Normal file
10
dist/CookieMonsterDev.js.LICENSE.txt
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* jscolor - JavaScript Color Picker
|
||||||
|
*
|
||||||
|
* @link http://jscolor.com
|
||||||
|
* @license For open source use: GPLv3
|
||||||
|
* For commercial use: JSColor Commercial License
|
||||||
|
* @author Jan Odvarko - East Desire
|
||||||
|
*
|
||||||
|
* See usage examples at http://jscolor.com/examples/
|
||||||
|
*/
|
||||||
1
dist/CookieMonsterDev.js.map
vendored
Normal file
1
dist/CookieMonsterDev.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
4267
package-lock.json
generated
4267
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
50
package.json
50
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cookiemonster-mod",
|
"name": "@cookiemonsterteam/cookiemonster-mod",
|
||||||
"version": "2.031.6",
|
"version": "2.031.10",
|
||||||
"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": [
|
||||||
@@ -11,17 +11,17 @@
|
|||||||
"Orteil"
|
"Orteil"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
"build-dev": "run-s eslint test pack-prod",
|
||||||
"eslint-src": "eslint src",
|
"build-final": "run-s eslint test pack-final",
|
||||||
"build": "run-s eslint-src pack-prod remove-comment copy-file",
|
"build-test": "webpack",
|
||||||
"build-test": "run-s pack-dev",
|
"eslint": "eslint src test",
|
||||||
"pack-prod": "webpack --env production",
|
"pack-prod": "webpack --env minimize",
|
||||||
"pack-dev": "webpack",
|
"pack-final": "webpack --env minimize --env finalfile",
|
||||||
"remove-comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
"test": "mocha"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/Aktanusa/CookieMonster.git"
|
"url": "git+https://github.com/CookieMonsterTeam/CookieMonster"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
@@ -40,19 +40,28 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Aktanusa/CookieMonster/issues"
|
"url": "https://github.com/CookieMonsterTeam/CookieMonster/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/Aktanusa/CookieMonster#readme",
|
"homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^7.19.0",
|
"@types/chai": "^4.2.19",
|
||||||
|
"@types/mocha": "^9.0.0",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^4.30.0",
|
||||||
|
"@typescript-eslint/parser": "^4.30.0",
|
||||||
|
"chai": "^4.3.4",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
"eslint-config-prettier": "^8.1.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.24.2",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"esm": "^3.2.25",
|
||||||
|
"mocha": "^8.4.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"prettier": "2.2.1",
|
"prettier": "2.3.2",
|
||||||
"webpack": "^5.24.4",
|
"ts-loader": "^9.2.5",
|
||||||
"webpack-cli": "^4.5.0"
|
"ts-node": "^10.2.1",
|
||||||
|
"typescript": "^4.4.2",
|
||||||
|
"webpack": "^5.51.2",
|
||||||
|
"webpack-cli": "^4.8.0"
|
||||||
},
|
},
|
||||||
"ccrepo": {
|
"ccrepo": {
|
||||||
"icon": [
|
"icon": [
|
||||||
@@ -62,6 +71,7 @@
|
|||||||
"name": "Cookie Monster"
|
"name": "Cookie Monster"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eastdesire/jscolor": "^2.4.5"
|
"@eastdesire/jscolor": "^2.4.5",
|
||||||
|
"@cookiemonsterteam/cookiemonsterframework": "^0.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ChoEggDiff,
|
ChoEggDiff, // eslint-disable-line no-unused-vars
|
||||||
ClicksDiff,
|
ClicksDiff, // eslint-disable-line no-unused-vars
|
||||||
CookiesDiff,
|
CookiesDiff, // eslint-disable-line no-unused-vars
|
||||||
WrinkDiff,
|
WrinkDiff, // eslint-disable-line no-unused-vars
|
||||||
WrinkFattestDiff,
|
WrinkFattestDiff, // eslint-disable-line no-unused-vars
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,11 +37,7 @@ export class CMAvgQueue {
|
|||||||
if (time > this.maxLength) time = this.maxLength;
|
if (time > this.maxLength) time = this.maxLength;
|
||||||
if (time > this.queue.length) time = this.queue.length;
|
if (time > this.queue.length) time = this.queue.length;
|
||||||
let ret = 0;
|
let ret = 0;
|
||||||
for (
|
for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - time; i--) {
|
||||||
let i = this.queue.length - 1;
|
|
||||||
i >= 0 && i > this.queue.length - 1 - time;
|
|
||||||
i--
|
|
||||||
) {
|
|
||||||
ret += this.queue[i];
|
ret += this.queue[i];
|
||||||
}
|
}
|
||||||
if (ret === 0) {
|
if (ret === 0) {
|
||||||
@@ -50,6 +45,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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,22 +1,19 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks,
|
CacheAverageClicks, // eslint-disable-line no-unused-vars
|
||||||
CacheAverageCPS,
|
CacheAverageCPS,
|
||||||
CacheAverageGainBank,
|
CacheAverageGainBank,
|
||||||
CacheAverageGainChoEgg,
|
CacheAverageGainChoEgg,
|
||||||
CacheAverageGainWrink,
|
CacheAverageGainWrink,
|
||||||
CacheAverageGainWrinkFattest,
|
CacheAverageGainWrinkFattest,
|
||||||
CacheAvgCPSWithChoEgg,
|
CacheAvgCPSWithChoEgg, // eslint-disable-line no-unused-vars
|
||||||
CacheLastChoEgg,
|
CacheLastChoEgg,
|
||||||
CacheLastClicks,
|
CacheLastClicks,
|
||||||
CacheLastCookies,
|
CacheLastCookies,
|
||||||
CacheLastCPSCheck,
|
CacheLastCPSCheck,
|
||||||
CacheLastWrinkCookies,
|
CacheLastWrinkCookies,
|
||||||
CacheLastWrinkFattestCookies,
|
CacheLastWrinkFattestCookies,
|
||||||
CacheRealCookiesEarned,
|
CacheRealCookiesEarned, // eslint-disable-line no-unused-vars
|
||||||
CacheSellForChoEgg,
|
CacheSellForChoEgg,
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
@@ -47,11 +44,9 @@ export default function CacheAvgCPS() {
|
|||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
const timeDiff = currDate - CacheLastCPSCheck;
|
const timeDiff = currDate - CacheLastCPSCheck;
|
||||||
const bankDiffAvg = Math.max(0, Game.cookies - CacheLastCookies) / timeDiff;
|
const bankDiffAvg = Math.max(0, Game.cookies - CacheLastCookies) / timeDiff;
|
||||||
const wrinkDiffAvg =
|
const wrinkDiffAvg = Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff;
|
||||||
Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff;
|
|
||||||
const wrinkFattestDiffAvg =
|
const wrinkFattestDiffAvg =
|
||||||
Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) /
|
Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) / timeDiff;
|
||||||
timeDiff;
|
|
||||||
const choEggDiffAvg = Math.max(0, choEggTotal - CacheLastChoEgg) / timeDiff;
|
const choEggDiffAvg = Math.max(0, choEggTotal - CacheLastChoEgg) / timeDiff;
|
||||||
const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff;
|
const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff;
|
||||||
for (let i = 0; i < timeDiff; i++) {
|
for (let i = 0; i < timeDiff; i++) {
|
||||||
@@ -71,28 +66,31 @@ export default function CacheAvgCPS() {
|
|||||||
CacheLastClicks = Game.cookieClicks;
|
CacheLastClicks = Game.cookieClicks;
|
||||||
|
|
||||||
// Get average gain over period of cpsLength seconds
|
// Get average gain over period of cpsLength seconds
|
||||||
const cpsLength = CookieTimes[CMOptions.AvgCPSHist];
|
const cpsLength =
|
||||||
|
CookieTimes[Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgCPSHist];
|
||||||
CacheAverageGainBank = CookiesDiff.calcAverage(cpsLength);
|
CacheAverageGainBank = CookiesDiff.calcAverage(cpsLength);
|
||||||
CacheAverageGainWrink = WrinkDiff.calcAverage(cpsLength);
|
CacheAverageGainWrink = WrinkDiff.calcAverage(cpsLength);
|
||||||
CacheAverageGainWrinkFattest = WrinkFattestDiff.calcAverage(cpsLength);
|
CacheAverageGainWrinkFattest = WrinkFattestDiff.calcAverage(cpsLength);
|
||||||
CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength);
|
CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength);
|
||||||
CacheAverageCPS = CacheAverageGainBank;
|
CacheAverageCPS = CacheAverageGainBank;
|
||||||
if (CMOptions.CalcWrink === 1) CacheAverageCPS += CacheAverageGainWrink;
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 1)
|
||||||
if (CMOptions.CalcWrink === 2)
|
CacheAverageCPS += CacheAverageGainWrink;
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 2)
|
||||||
CacheAverageCPS += CacheAverageGainWrinkFattest;
|
CacheAverageCPS += CacheAverageGainWrinkFattest;
|
||||||
|
|
||||||
const choEgg =
|
const choEgg = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
|
||||||
|
|
||||||
if (choEgg || CMOptions.CalcWrink === 0) {
|
if (
|
||||||
|
choEgg ||
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 0
|
||||||
|
) {
|
||||||
CacheAvgCPSWithChoEgg =
|
CacheAvgCPSWithChoEgg =
|
||||||
CacheAverageGainBank +
|
CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
|
||||||
CacheAverageGainWrink +
|
|
||||||
(choEgg ? CacheAverageGainChoEgg : 0);
|
|
||||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
CacheAverageClicks = ClicksDiff.calcAverage(
|
CacheAverageClicks = ClicksDiff.calcAverage(
|
||||||
ClickTimes[CMOptions.AvgClicksHist],
|
ClickTimes[Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
CacheCurrWrinklerCount,
|
|
||||||
CacheCurrWrinklerCPSMult,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the current Wrinkler CPS multiplier
|
* This functions caches the current Wrinkler CPS multiplier
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
export default function GetCPSBuffMult() {
|
export default function GetCPSBuffMult() {
|
||||||
let mult = 1;
|
let mult = 1;
|
||||||
Object.keys(Game.buffs).forEach((i) => {
|
Object.keys(Game.buffs).forEach((i) => {
|
||||||
if (typeof Game.buffs[i].multCpS !== 'undefined')
|
if (typeof Game.buffs[i].multCpS !== 'undefined') mult *= Game.buffs[i].multCpS;
|
||||||
mult *= Game.buffs[i].multCpS;
|
|
||||||
});
|
});
|
||||||
return mult;
|
return mult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/* 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'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function calculates CPS without the Golden Switch as it might be needed in other functions
|
* This function calculates CPS without the Golden Switch as it might be needed in other functions
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/* 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'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the reward for selling the Chocolate egg
|
* This functions caches the reward for selling the Chocolate egg
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
/* 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';
|
||||||
import CachePP from './PP/PP';
|
import CachePP from './PP/PP';
|
||||||
import {
|
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome';
|
||||||
CacheBuildingsPrices,
|
|
||||||
CacheIncome,
|
|
||||||
} from './PriceAndIncome/PriceAndIncome';
|
|
||||||
import { CacheChain } from './Stats/ChainCookies';
|
import { CacheChain } from './Stats/ChainCookies';
|
||||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||||
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
||||||
import CacheSeasonSpec from './Stats/Reindeer';
|
import CacheSeasonSpec from './Stats/Reindeer';
|
||||||
import {
|
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
|
||||||
CacheGoldenAndWrathCookiesMults,
|
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
||||||
CacheStatsCookies,
|
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
} from './Stats/Stats';
|
|
||||||
import { HeavenlyChipsDiff } from './VariablesAndData';
|
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,8 +25,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);
|
||||||
|
CacheAverageCookiesFromClicks = new CMAvgQueue(ClickTimes[ClickTimes.length - 1] * 20);
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
|
AllAmountTillNextAchievement();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheIncome();
|
CacheIncome();
|
||||||
CacheBuildingsPrices();
|
CacheBuildingsPrices();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime';
|
||||||
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';
|
||||||
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
|
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
|
||||||
import CachePP from './PP/PP';
|
import CachePP from './PP/PP';
|
||||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||||
import { CacheTimeTillNextPrestige } from './VariablesAndData';
|
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
||||||
|
import { CacheTimeTillNextPrestige } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,14 +17,14 @@ export default function LoopCache() {
|
|||||||
CacheWrinklers();
|
CacheWrinklers();
|
||||||
|
|
||||||
CachePP();
|
CachePP();
|
||||||
|
AllAmountTillNextAchievement(false);
|
||||||
CacheCurrWrinklerCPS();
|
CacheCurrWrinklerCPS();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
|
|
||||||
const cookiesToNext =
|
const cookiesToNext =
|
||||||
Game.HowManyCookiesReset(
|
Game.HowManyCookiesReset(
|
||||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) +
|
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1,
|
||||||
1,
|
|
||||||
) -
|
) -
|
||||||
(Game.cookiesEarned + Game.cookiesReset);
|
(Game.cookiesEarned + Game.cookiesReset);
|
||||||
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the currently selected Dragon Auras
|
* This functions caches the currently selected Dragon Auras
|
||||||
|
|||||||
@@ -1,16 +1,9 @@
|
|||||||
/* 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/Beautify';
|
||||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
CacheCostDragonUpgrade,
|
|
||||||
CacheDragonAura,
|
|
||||||
CacheDragonAura2,
|
|
||||||
CacheLastDragonLevel,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the current cost of upgrading the dragon level so it can be displayed in the tooltip
|
* This functions caches the current cost of upgrading the dragon level so it can be displayed in the tooltip
|
||||||
@@ -21,9 +14,7 @@ export default function CacheDragonCost() {
|
|||||||
Game.dragonLevel < 25 &&
|
Game.dragonLevel < 25 &&
|
||||||
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
|
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
|
||||||
) {
|
) {
|
||||||
let target = Game.dragonLevels[Game.dragonLevel].buy
|
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
|
||||||
.toString()
|
|
||||||
.match(/Objects\[(.*)\]/)[1];
|
|
||||||
const amount = Game.dragonLevels[Game.dragonLevel].buy
|
const amount = Game.dragonLevels[Game.dragonLevel].buy
|
||||||
.toString()
|
.toString()
|
||||||
.match(/sacrifice\((.*?)\)/)[1];
|
.match(/sacrifice\((.*?)\)/)[1];
|
||||||
@@ -38,42 +29,35 @@ export default function CacheDragonCost() {
|
|||||||
let price =
|
let price =
|
||||||
SimObjects[target].basePrice *
|
SimObjects[target].basePrice *
|
||||||
Game.priceIncrease **
|
Game.priceIncrease **
|
||||||
Math.max(
|
Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free);
|
||||||
0,
|
|
||||||
SimObjects[target].amount - 1 - SimObjects[target].free,
|
|
||||||
);
|
|
||||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
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 *
|
||||||
Game.priceIncrease **
|
Game.priceIncrease **
|
||||||
Math.max(
|
Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free);
|
||||||
0,
|
|
||||||
SimObjects[target].amount - 1 - SimObjects[target].free,
|
|
||||||
);
|
|
||||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount -= 1;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheLastDragonLevel = Game.dragonLevel;
|
CacheLastDragonLevel = Game.dragonLevel;
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
|
||||||
/* eslint-disable no-unused-vars */
|
|
||||||
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 BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
import {
|
import {
|
||||||
CacheMinPP,
|
CacheMinPP, // eslint-disable-line no-unused-vars
|
||||||
|
CacheMinPPBulk, // eslint-disable-line no-unused-vars
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
@@ -17,29 +16,58 @@ 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) => {
|
||||||
target[i].color = ColourOfPP(
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPRigidelMode &&
|
||||||
|
amount === 1
|
||||||
|
) {
|
||||||
|
target[i].colour = ColourGray; // eslint-disable-line no-param-reassign
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
target[i].colour = ColourOfPP(
|
||||||
target[i],
|
target[i],
|
||||||
Game.Objects[i].getSumPrice(amount),
|
BuildingGetPrice(
|
||||||
|
i,
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
amount,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
// Colour based on excluding certain top-buildings
|
// Colour based on excluding certain top-buildings
|
||||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
for (
|
||||||
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColorGray;
|
let j = 0;
|
||||||
|
j < Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPExcludeTop;
|
||||||
|
j++
|
||||||
|
) {
|
||||||
|
if (target[i].pp === CachePPArray[j][0]) target[i].colour = ColourGray; // eslint-disable-line no-param-reassign
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function CachePP(target, amount) {
|
function CachePP(target, amount) {
|
||||||
Object.keys(target).forEach((i) => {
|
Object.keys(target).forEach((i) => {
|
||||||
const price = Game.Objects[i].getSumPrice(amount);
|
const price = BuildingGetPrice(
|
||||||
|
i,
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
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
|
||||||
CachePPArray.push([target[i].pp, amount]);
|
if (
|
||||||
|
!(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPRigidelMode &&
|
||||||
|
amount === 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
CachePPArray.push([target[i].pp, amount, price]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,27 +78,32 @@ function CachePP(target, amount) {
|
|||||||
export default function CacheBuildingsPP() {
|
export default function CacheBuildingsPP() {
|
||||||
CacheMinPP = Infinity;
|
CacheMinPP = Infinity;
|
||||||
CachePPArray = [];
|
CachePPArray = [];
|
||||||
if (typeof CMOptions.PPExcludeTop === 'undefined') CMOptions.PPExcludeTop = 0; // Otherwise breaks during initialization
|
if (
|
||||||
|
typeof Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPExcludeTop ===
|
||||||
|
'undefined'
|
||||||
|
)
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPExcludeTop = 0; // Otherwise breaks during initialization
|
||||||
|
|
||||||
// Calculate PP and colors
|
// Calculate PP and colours
|
||||||
CachePP(CacheObjects1, 1);
|
CachePP(CacheObjects1, 1);
|
||||||
CachePP(CacheObjects10, 10);
|
CachePP(CacheObjects10, 10);
|
||||||
CachePP(CacheObjects100, 100);
|
CachePP(CacheObjects100, 100);
|
||||||
|
|
||||||
// Set CM.Cache.min to best non-excluded buidliung
|
// Set CM.Cache.min to best non-excluded buidliung
|
||||||
CachePPArray.sort((a, b) => a[0] - b[0]);
|
CachePPArray.sort((a, b) => a[0] - b[0]);
|
||||||
let indexOfMin = 0;
|
let indexOfMin = Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPExcludeTop;
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPOnlyConsiderBuyable) {
|
||||||
while (CachePPArray[indexOfMin][1] > Game.cookies) {
|
while (CachePPArray[indexOfMin][2] > Game.cookies) {
|
||||||
indexOfMin += 1;
|
indexOfMin += 1;
|
||||||
if (CachePPArray.length === indexOfMin + 1) {
|
if (CachePPArray.length === indexOfMin + 1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin];
|
CacheMinPP = CachePPArray[indexOfMin][0];
|
||||||
|
CacheMinPPBulk = CachePPArray[indexOfMin][1];
|
||||||
|
|
||||||
CacheColor(CacheObjects1, 1);
|
CacheColour(CacheObjects1, 1);
|
||||||
CacheColor(CacheObjects10, 10);
|
CacheColour(CacheObjects10, 10);
|
||||||
CacheColor(CacheObjects100, 100);
|
CacheColour(CacheObjects100, 100);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
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';
|
||||||
|
|
||||||
@@ -16,27 +15,36 @@ import { CacheMinPP, CachePPArray } from '../VariablesAndData';
|
|||||||
* It is called by CM.Cache.CacheBuildingsPP(), CM.Cache.CacheBuildingsBulkPP() and CM.Cache.CacheUpgradePP()
|
* It is called by CM.Cache.CacheBuildingsPP(), CM.Cache.CacheBuildingsBulkPP() and CM.Cache.CacheUpgradePP()
|
||||||
* @params {object} obj The obj of which the pp value should be checked
|
* @params {object} obj The obj of which the pp value should be checked
|
||||||
* @params {number} price The price of the object
|
* @params {number} price The price of the object
|
||||||
* @returns {string} color The colour assosciated with the pp value
|
* @returns {string} colour The colour assosciated with the pp value
|
||||||
*/
|
*/
|
||||||
export default function ColourOfPP(me, price) {
|
export default function ColourOfPP(me, price) {
|
||||||
let color = '';
|
let colour = '';
|
||||||
// Colour based on PP
|
// Colour based on PP
|
||||||
if (me.pp <= 0 || me.pp === Infinity) color = ColorGray;
|
if (me.pp <= 0 || me.pp === Infinity) colour = ColourGray;
|
||||||
else if (me.pp < CacheMinPP) color = ColorBlue;
|
else if (me.pp < CacheMinPP) colour = ColourBlue;
|
||||||
else if (me.pp === CacheMinPP) color = ColorGreen;
|
else if (me.pp === CacheMinPP) colour = ColourGreen;
|
||||||
else if (me.pp < CachePPArray[10][0]) color = ColorYellow;
|
else if (me.pp < CachePPArray[10][0]) colour = ColourYellow;
|
||||||
else if (me.pp < CachePPArray[20][0]) color = ColorOrange;
|
else if (me.pp < CachePPArray[20][0]) colour = ColourOrange;
|
||||||
else if (me.pp > CachePPArray[30][0]) color = ColorRed;
|
else if (me.pp < CachePPArray[30][0]) colour = ColourRed;
|
||||||
else color = ColorPurple;
|
else colour = ColourPurple;
|
||||||
|
|
||||||
// Colour based on price in terms of CPS
|
// Colour based on price in terms of CPS
|
||||||
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
if (
|
||||||
if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit))
|
Number(
|
||||||
color = ColorBlue;
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPSecondsLowerLimit,
|
||||||
|
) !== 0
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
price / GetCPS() <
|
||||||
|
Number(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPSecondsLowerLimit,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
colour = ColourBlue;
|
||||||
}
|
}
|
||||||
// Colour based on being able to purchase
|
// Colour based on being able to purchase
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPOnlyConsiderBuyable) {
|
||||||
if (price - Game.cookies > 0) color = ColorRed;
|
if (price - Game.cookies > 0) colour = ColourRed;
|
||||||
}
|
}
|
||||||
return color;
|
return colour;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Section: Functions related to caching PP */
|
* Section: Functions related to caching PP */
|
||||||
|
|
||||||
|
import { CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades } from '../VariablesAndData';
|
||||||
import CacheBuildingsPP from './Building';
|
import CacheBuildingsPP from './Building';
|
||||||
import CacheUpgradePP from './Upgrade';
|
import CacheUpgradePP from './Upgrade';
|
||||||
|
|
||||||
@@ -11,4 +12,11 @@ import CacheUpgradePP from './Upgrade';
|
|||||||
export default function CachePP() {
|
export default function CachePP() {
|
||||||
CacheBuildingsPP();
|
CacheBuildingsPP();
|
||||||
CacheUpgradePP();
|
CacheUpgradePP();
|
||||||
|
window.CookieMonsterData.Objects1 = JSON.parse(JSON.stringify(CacheObjects1));
|
||||||
|
window.CookieMonsterData.Objects10 = JSON.parse(JSON.stringify(CacheObjects10));
|
||||||
|
window.CookieMonsterData.Objects100 = JSON.parse(JSON.stringify(CacheObjects100));
|
||||||
|
window.CookieMonsterData.Upgrades = [];
|
||||||
|
Object.entries(CacheUpgrades).forEach((i) => {
|
||||||
|
window.CookieMonsterData.Upgrades[i[0]] = JSON.parse(JSON.stringify(i[1]));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,20 +10,12 @@ export default function CacheUpgradePP() {
|
|||||||
Object.keys(CacheUpgrades).forEach((i) => {
|
Object.keys(CacheUpgrades).forEach((i) => {
|
||||||
if (Game.cookiesPs) {
|
if (Game.cookiesPs) {
|
||||||
CacheUpgrades[i].pp =
|
CacheUpgrades[i].pp =
|
||||||
Math.max(
|
Math.max(Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||||
Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()),
|
|
||||||
0,
|
|
||||||
) /
|
|
||||||
Game.cookiesPs +
|
Game.cookiesPs +
|
||||||
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
||||||
} else
|
} else CacheUpgrades[i].pp = Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
||||||
CacheUpgrades[i].pp =
|
|
||||||
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
|
||||||
if (Number.isNaN(CacheUpgrades[i].pp)) CacheUpgrades[i].pp = Infinity;
|
if (Number.isNaN(CacheUpgrades[i].pp)) CacheUpgrades[i].pp = Infinity;
|
||||||
|
|
||||||
CacheUpgrades[i].color = ColourOfPP(
|
CacheUpgrades[i].colour = ColourOfPP(CacheUpgrades[i], Game.Upgrades[i].getPrice());
|
||||||
CacheUpgrades[i],
|
|
||||||
Game.Upgrades[i].getPrice(),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
/** Section: Functions related to caching income */
|
/** Section: Functions related to caching income */
|
||||||
|
|
||||||
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,
|
||||||
CacheDoRemakeBuildPrices,
|
CacheDoRemakeBuildPrices, // eslint-disable-line no-unused-vars
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
CacheUpgrades,
|
CacheUpgrades,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -24,8 +21,8 @@ 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);
|
||||||
@@ -41,22 +38,25 @@ function CacheBuildingIncome(amount, target) {
|
|||||||
* It is called by CM.Cache.CacheIncome()
|
* It is called by CM.Cache.CacheIncome()
|
||||||
*/
|
*/
|
||||||
function CacheUpgradeIncome() {
|
function CacheUpgradeIncome() {
|
||||||
CacheUpgrades = [];
|
CacheUpgrades = {};
|
||||||
Object.keys(Game.Upgrades).forEach((i) => {
|
for (let i = 0; i < Game.UpgradesInStore.length; i++) {
|
||||||
const bonusIncome = BuyUpgradesBonusIncome(i);
|
const upgradeName = Game.UpgradesInStore[i].name;
|
||||||
if (i === 'Elder Pledge') {
|
const bonusIncome = BuyUpgradesBonusIncome(upgradeName);
|
||||||
CacheUpgrades[i] = { bonus: Game.cookiesPs - CacheAverageGainBank };
|
if (upgradeName === 'Elder Pledge') {
|
||||||
if (CMOptions.CalcWrink === 1)
|
CacheUpgrades[upgradeName] = {
|
||||||
CacheUpgrades[i].bonus -= CacheAverageGainWrink;
|
bonus: Game.cookiesPs - CacheAverageGainBank,
|
||||||
else if (CMOptions.CalcWrink === 2)
|
};
|
||||||
CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest;
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 1)
|
||||||
if (!Number.isFinite(CacheUpgrades[i].bonus)) CacheUpgrades[i].bonus = 0;
|
CacheUpgrades[upgradeName].bonus -= CacheAverageGainWrink;
|
||||||
|
else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 2)
|
||||||
|
CacheUpgrades[upgradeName].bonus -= CacheAverageGainWrinkFattest;
|
||||||
|
if (!Number.isFinite(CacheUpgrades[upgradeName].bonus)) CacheUpgrades[upgradeName].bonus = 0;
|
||||||
} else {
|
} else {
|
||||||
CacheUpgrades[i] = {};
|
CacheUpgrades[upgradeName] = {};
|
||||||
if (bonusIncome[0]) CacheUpgrades[i].bonus = bonusIncome[0];
|
if (bonusIncome[0]) CacheUpgrades[upgradeName].bonus = bonusIncome[0];
|
||||||
if (bonusIncome[1]) CacheUpgrades[i].bonusMouse = bonusIncome[1];
|
if (bonusIncome[1]) CacheUpgrades[upgradeName].bonusMouse = bonusIncome[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,26 +65,33 @@ function CacheUpgradeIncome() {
|
|||||||
export function CacheBuildingsPrices() {
|
export function CacheBuildingsPrices() {
|
||||||
Object.keys(Game.Objects).forEach((i) => {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
CacheObjects1[i].price = BuildingGetPrice(
|
CacheObjects1[i].price = BuildingGetPrice(
|
||||||
Game.Objects[i],
|
i,
|
||||||
Game.Objects[i].basePrice,
|
Game.Objects[i].basePrice,
|
||||||
Game.Objects[i].amount,
|
Game.Objects[i].amount,
|
||||||
Game.Objects[i].free,
|
Game.Objects[i].free,
|
||||||
1,
|
1,
|
||||||
);
|
);
|
||||||
CacheObjects10[i].price = BuildingGetPrice(
|
CacheObjects10[i].price = BuildingGetPrice(
|
||||||
Game.Objects[i],
|
i,
|
||||||
Game.Objects[i].basePrice,
|
Game.Objects[i].basePrice,
|
||||||
Game.Objects[i].amount,
|
Game.Objects[i].amount,
|
||||||
Game.Objects[i].free,
|
Game.Objects[i].free,
|
||||||
10,
|
10,
|
||||||
);
|
);
|
||||||
CacheObjects100[i].price = BuildingGetPrice(
|
CacheObjects100[i].price = BuildingGetPrice(
|
||||||
Game.Objects[i],
|
i,
|
||||||
Game.Objects[i].basePrice,
|
Game.Objects[i].basePrice,
|
||||||
Game.Objects[i].amount,
|
Game.Objects[i].amount,
|
||||||
Game.Objects[i].free,
|
Game.Objects[i].free,
|
||||||
100,
|
100,
|
||||||
);
|
);
|
||||||
|
CacheObjectsNextAchievement[i].price = BuildingGetPrice(
|
||||||
|
i,
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
CacheObjectsNextAchievement[i].AmountNeeded,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||||
import {
|
import {
|
||||||
CacheChainFrenzyMaxReward,
|
CacheChainFrenzyMaxReward,
|
||||||
CacheChainFrenzyRequired,
|
CacheChainFrenzyRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyRequiredNext,
|
CacheChainFrenzyRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyWrathMaxReward,
|
CacheChainFrenzyWrathMaxReward,
|
||||||
CacheChainFrenzyWrathRequired,
|
CacheChainFrenzyWrathRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyWrathRequiredNext,
|
CacheChainFrenzyWrathRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheChainMaxReward,
|
CacheChainMaxReward,
|
||||||
CacheChainRequired,
|
CacheChainRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainRequiredNext,
|
CacheChainRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheChainWrathMaxReward,
|
CacheChainWrathMaxReward,
|
||||||
CacheChainWrathRequired,
|
CacheChainWrathRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainWrathRequiredNext,
|
CacheChainWrathRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheDragonsFortuneMultAdjustment,
|
CacheDragonsFortuneMultAdjustment,
|
||||||
CacheGoldenCookiesMult,
|
CacheGoldenCookiesMult,
|
||||||
CacheNoGoldSwitchCookiesPS,
|
CacheNoGoldSwitchCookiesPS,
|
||||||
@@ -32,22 +31,15 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
|||||||
let moni = 0;
|
let moni = 0;
|
||||||
let nextMoni = 0;
|
let nextMoni = 0;
|
||||||
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 * mult) {
|
||||||
while (nextMoni < maxPayout) {
|
|
||||||
moni = Math.max(
|
moni = Math.max(
|
||||||
digit,
|
digit,
|
||||||
Math.min(
|
Math.min(Math.floor((1 / 9) * 10 ** chain * digit * mult), maxPayout * mult),
|
||||||
Math.floor((1 / 9) * 10 ** chain * digit * mult),
|
|
||||||
maxPayout * mult,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
nextMoni = Math.max(
|
nextMoni = Math.max(
|
||||||
digit,
|
digit,
|
||||||
Math.min(
|
Math.min(Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult), maxPayout * mult),
|
||||||
Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult),
|
|
||||||
maxPayout * mult,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
nextRequired = Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult);
|
nextRequired = Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult);
|
||||||
totalFromChain += moni;
|
totalFromChain += moni;
|
||||||
@@ -73,65 +65,28 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
|||||||
* @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain
|
* @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain
|
||||||
*/
|
*/
|
||||||
export function CacheChain() {
|
export function CacheChain() {
|
||||||
let maxPayout =
|
let maxPayout = CacheNoGoldSwitchCookiesPS * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment;
|
||||||
CacheNoGoldSwitchCookiesPS *
|
|
||||||
60 *
|
|
||||||
60 *
|
|
||||||
6 *
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
// Removes effect of Frenzy etc.
|
// Removes effect of Frenzy etc.
|
||||||
const cpsBuffMult = GetCPSBuffMult();
|
const cpsBuffMult = GetCPSBuffMult();
|
||||||
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
||||||
else maxPayout = 0;
|
else maxPayout = 0;
|
||||||
|
|
||||||
CacheChainMaxReward = MaxChainCookieReward(
|
CacheChainMaxReward = MaxChainCookieReward(7, maxPayout, CacheGoldenCookiesMult);
|
||||||
7,
|
|
||||||
maxPayout,
|
|
||||||
CacheGoldenCookiesMult,
|
|
||||||
);
|
|
||||||
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
CacheChainRequiredNext =
|
CacheChainRequiredNext = CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
|
||||||
|
|
||||||
CacheChainWrathMaxReward = MaxChainCookieReward(
|
CacheChainWrathMaxReward = MaxChainCookieReward(6, maxPayout, CacheWrathCookiesMult);
|
||||||
6,
|
CacheChainWrathRequired = (CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
maxPayout,
|
|
||||||
CacheWrathCookiesMult,
|
|
||||||
);
|
|
||||||
CacheChainWrathRequired =
|
|
||||||
(CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
|
||||||
CacheChainWrathRequiredNext =
|
CacheChainWrathRequiredNext =
|
||||||
CacheChainWrathMaxReward[2] /
|
CacheChainWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
60 /
|
|
||||||
60 /
|
|
||||||
6 /
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
|
|
||||||
CacheChainFrenzyMaxReward = MaxChainCookieReward(
|
CacheChainFrenzyMaxReward = MaxChainCookieReward(7, maxPayout * 7, CacheGoldenCookiesMult);
|
||||||
7,
|
CacheChainFrenzyRequired = (CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
maxPayout * 7,
|
|
||||||
CacheGoldenCookiesMult,
|
|
||||||
);
|
|
||||||
CacheChainFrenzyRequired =
|
|
||||||
(CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
|
||||||
CacheChainFrenzyRequiredNext =
|
CacheChainFrenzyRequiredNext =
|
||||||
CacheChainFrenzyMaxReward[2] /
|
CacheChainFrenzyMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
60 /
|
|
||||||
60 /
|
|
||||||
6 /
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
|
|
||||||
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(
|
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(6, maxPayout * 7, CacheWrathCookiesMult);
|
||||||
6,
|
CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
maxPayout * 7,
|
|
||||||
CacheWrathCookiesMult,
|
|
||||||
);
|
|
||||||
CacheChainFrenzyWrathRequired =
|
|
||||||
(CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
|
||||||
CacheChainFrenzyWrathRequiredNext =
|
CacheChainFrenzyWrathRequiredNext =
|
||||||
CacheChainFrenzyWrathMaxReward[2] /
|
CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
60 /
|
|
||||||
60 /
|
|
||||||
6 /
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import {
|
import {
|
||||||
CacheHCPerSecond,
|
CacheHCPerSecond, // eslint-disable-line no-unused-vars
|
||||||
CacheLastHeavenlyCheck,
|
CacheLastHeavenlyCheck,
|
||||||
CacheLastHeavenlyChips,
|
CacheLastHeavenlyChips,
|
||||||
HeavenlyChipsDiff,
|
HeavenlyChipsDiff,
|
||||||
@@ -16,15 +15,12 @@ export default function CacheHeavenlyChipsPS() {
|
|||||||
// Only calculate every new second
|
// Only calculate every new second
|
||||||
if ((Game.T / Game.fps) % 1 === 0) {
|
if ((Game.T / Game.fps) % 1 === 0) {
|
||||||
const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
||||||
const ascendNowToOwn = Math.floor(
|
const ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||||
Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned),
|
|
||||||
);
|
|
||||||
const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
const timeDiff = currDate - CacheLastHeavenlyCheck;
|
const timeDiff = currDate - CacheLastHeavenlyCheck;
|
||||||
const heavenlyChipsDiffAvg =
|
const heavenlyChipsDiffAvg = Math.max(0, ascendNowToGet - CacheLastHeavenlyChips) / timeDiff;
|
||||||
Math.max(0, ascendNowToGet - CacheLastHeavenlyChips) / timeDiff;
|
|
||||||
for (let i = 0; i < timeDiff; i++) {
|
for (let i = 0; i < timeDiff; i++) {
|
||||||
HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
|
||||||
import { crateMissing } from '../../Disp/MenuSections/CreateMissingUpgrades';
|
|
||||||
import {
|
import {
|
||||||
CacheMissingUpgrades,
|
CacheMissingUpgrades, // eslint-disable-line no-unused-vars
|
||||||
CacheMissingUpgradesCookies,
|
CacheMissingUpgradesCookies, // eslint-disable-line no-unused-vars
|
||||||
CacheMissingUpgradesPrestige,
|
CacheMissingUpgradesPrestige, // eslint-disable-line no-unused-vars
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,14 +35,12 @@ 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 (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug')
|
||||||
me.pool !== 'toggle' &&
|
|
||||||
me.pool !== 'unused' &&
|
|
||||||
me.pool !== 'debug'
|
|
||||||
)
|
|
||||||
CacheMissingUpgrades += str;
|
CacheMissingUpgrades += str;
|
||||||
|
/* eslint-enable no-unused-vars */
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
import { CacheSeaSpec } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
import { CacheSeaSpec } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the reward of popping a reindeer
|
* This functions caches the reward of popping a reindeer
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
/* 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';
|
||||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||||
import {
|
import {
|
||||||
CacheConjure,
|
CacheConjure,
|
||||||
CacheConjureReward,
|
CacheConjureReward, // eslint-disable-line no-unused-vars
|
||||||
CacheDragonsFortuneMultAdjustment,
|
CacheDragonsFortuneMultAdjustment,
|
||||||
CacheEdifice,
|
CacheEdifice,
|
||||||
CacheEdificeBuilding,
|
CacheEdificeBuilding, // eslint-disable-line no-unused-vars
|
||||||
CacheGoldenCookiesMult,
|
CacheGoldenCookiesMult,
|
||||||
CacheLucky,
|
CacheLucky,
|
||||||
CacheLuckyFrenzy,
|
CacheLuckyFrenzy,
|
||||||
CacheLuckyReward,
|
CacheLuckyReward, // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyRewardFrenzy,
|
CacheLuckyRewardFrenzy, // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyWrathReward,
|
CacheLuckyWrathReward, // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyWrathRewardFrenzy,
|
CacheLuckyWrathRewardFrenzy, // eslint-disable-line no-unused-vars
|
||||||
CacheNoGoldSwitchCookiesPS,
|
CacheNoGoldSwitchCookiesPS,
|
||||||
CacheWrathCookiesMult,
|
CacheWrathCookiesMult,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
@@ -32,10 +31,8 @@ export function CacheStatsCookies() {
|
|||||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyFrenzy = CacheLucky * 7;
|
CacheLuckyFrenzy = CacheLucky * 7;
|
||||||
CacheLuckyRewardFrenzy =
|
CacheLuckyRewardFrenzy = CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
CacheLuckyWrathRewardFrenzy = CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheLuckyWrathRewardFrenzy =
|
|
||||||
CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
|
||||||
CacheConjure = CacheLucky * 2;
|
CacheConjure = CacheLucky * 2;
|
||||||
CacheConjureReward = CacheConjure * 0.15;
|
CacheConjureReward = CacheConjure * 0.15;
|
||||||
|
|
||||||
@@ -85,7 +82,6 @@ export function CacheGoldenAndWrathCookiesMults() {
|
|||||||
// Otherwise, the aura effect will be factored in the base CPS making the multiplier not requiring adjustment.
|
// Otherwise, the aura effect will be factored in the base CPS making the multiplier not requiring adjustment.
|
||||||
CacheDragonsFortuneMultAdjustment = 1;
|
CacheDragonsFortuneMultAdjustment = 1;
|
||||||
if (Game.shimmerTypes.golden.n === 0) {
|
if (Game.shimmerTypes.golden.n === 0) {
|
||||||
CacheDragonsFortuneMultAdjustment *=
|
CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23;
|
||||||
1 + Game.auraMult("Dragon's Fortune") * 1.23;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
|
import { CacheObjectsNextAchievement } from '../VariablesAndData';
|
||||||
|
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This functions caches the amount of buildings needed till next achievement
|
||||||
|
* @param {boolean} forceRecalc Whether a recalcution should be forced (after CPS change)
|
||||||
|
*/
|
||||||
|
export default function AllAmountTillNextAchievement(forceRecalc) {
|
||||||
|
const result = {};
|
||||||
|
|
||||||
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
|
if (
|
||||||
|
Object.keys(CacheObjectsNextAchievement).length !== 0 &&
|
||||||
|
CacheObjectsNextAchievement[i].TotalNeeded > Game.Objects[i].amount &&
|
||||||
|
!forceRecalc
|
||||||
|
) {
|
||||||
|
result[i] = {
|
||||||
|
AmountNeeded: CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount,
|
||||||
|
TotalNeeded: CacheObjectsNextAchievement[i].TotalNeeded,
|
||||||
|
price: BuildingGetPrice(
|
||||||
|
i,
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
const tillNext = IndividualAmountTillNextAchievement(i);
|
||||||
|
result[i] = {
|
||||||
|
AmountNeeded: tillNext,
|
||||||
|
TotalNeeded: Game.Objects[i].amount + tillNext,
|
||||||
|
price: BuildingGetPrice(
|
||||||
|
i,
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
tillNext,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
CacheObjectsNextAchievement = result; // eslint-disable-line no-unused-vars
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||||
|
import { SimAchievementsOwned } from '../../Sim/VariablesAndData';
|
||||||
|
|
||||||
|
export default function IndividualAmountTillNextAchievement(building) {
|
||||||
|
const AchievementsAtStart = Game.AchievementsOwned;
|
||||||
|
let index = 100;
|
||||||
|
let lastIndexWithChange = 100;
|
||||||
|
while (index > -1) {
|
||||||
|
BuyBuildingsBonusIncome(building, index);
|
||||||
|
if (SimAchievementsOwned > AchievementsAtStart) {
|
||||||
|
lastIndexWithChange = index;
|
||||||
|
index -= 10;
|
||||||
|
} else if (index === 100) {
|
||||||
|
return 101;
|
||||||
|
} else {
|
||||||
|
index += 1;
|
||||||
|
while (index <= lastIndexWithChange) {
|
||||||
|
BuyBuildingsBonusIncome(building, index);
|
||||||
|
if (SimAchievementsOwned > AchievementsAtStart) {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
index += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 101;
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ export let CacheLastChoEgg = 0;
|
|||||||
export let CacheObjects1 = {};
|
export let CacheObjects1 = {};
|
||||||
export let CacheObjects10 = {};
|
export let CacheObjects10 = {};
|
||||||
export let CacheObjects100 = {};
|
export let CacheObjects100 = {};
|
||||||
|
export let CacheObjectsNextAchievement = {};
|
||||||
|
|
||||||
export let CacheWrinklersTotal = 0;
|
export let CacheWrinklersTotal = 0;
|
||||||
export let CacheWrinklersNormal = 0;
|
export let CacheWrinklersNormal = 0;
|
||||||
@@ -39,6 +40,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 = {};
|
||||||
@@ -67,6 +69,8 @@ export let CacheTimeTillNextPrestige = 0;
|
|||||||
|
|
||||||
/** Stores lowest PP value */
|
/** Stores lowest PP value */
|
||||||
export let CacheMinPP = 0;
|
export let CacheMinPP = 0;
|
||||||
|
/** Stores lowest PP value category */
|
||||||
|
export let CacheMinPPBulk = 0;
|
||||||
/** Stores all PP values of all buildings for all buy settings (1, 10, 100) */
|
/** Stores all PP values of all buildings for all buy settings (1, 10, 100) */
|
||||||
export let CachePPArray = [];
|
export let CachePPArray = [];
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/* 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';
|
||||||
import {
|
import {
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersNormal,
|
CacheWrinklersNormal, // eslint-disable-line no-unused-vars
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal, // eslint-disable-line no-unused-vars
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,8 +34,7 @@ export default function CacheWrinklers() {
|
|||||||
CacheWrinklersTotal += sucked;
|
CacheWrinklersTotal += sucked;
|
||||||
if (Game.wrinklers[i].type === 0) {
|
if (Game.wrinklers[i].type === 0) {
|
||||||
CacheWrinklersNormal += sucked;
|
CacheWrinklersNormal += sucked;
|
||||||
if (sucked > CacheWrinklersFattest[0])
|
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
|
||||||
CacheWrinklersFattest = [sucked, i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function CheckNotificationPermissions(ToggleOnOff) {
|
|||||||
|
|
||||||
// Check if the browser supports notifications and which type
|
// Check if the browser supports notifications and which type
|
||||||
if (!('Notification' in window)) {
|
if (!('Notification' in window)) {
|
||||||
console.log('This browser does not support notifications.');
|
console.log('This browser does not support notifications.'); // eslint-disable-line no-console
|
||||||
} else if (checkNotificationPromise()) {
|
} else if (checkNotificationPromise()) {
|
||||||
Notification.requestPermission().then();
|
Notification.requestPermission().then();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,97 +0,0 @@
|
|||||||
import ConfigDefault from '../../Data/SettingsDefault';
|
|
||||||
import ConfigData from '../../Data/SettingsData';
|
|
||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
import save from '../../InitSaveLoad/save';
|
|
||||||
import CMLoop from '../../Main/Loop';
|
|
||||||
|
|
||||||
/** Functions related to saving, loading and restoring all settings */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function saves the config of CookieMonster without saving any of the other save-data
|
|
||||||
* This allows saving in between the autosave intervals
|
|
||||||
* It is called by CM.Config.LoadConfig(), CM.Config.RestoreDefault(), CM.Config.ToggleConfig(),
|
|
||||||
* CM.ToggleConfigVolume() and changes in options with type "url", "color" or "numscale"
|
|
||||||
*/
|
|
||||||
export function SaveConfig() {
|
|
||||||
const saveString = b64_to_utf8(
|
|
||||||
unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0],
|
|
||||||
);
|
|
||||||
const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
|
||||||
if (CookieMonsterSave !== null) {
|
|
||||||
const newSaveString = saveString.replace(
|
|
||||||
CookieMonsterSave[0],
|
|
||||||
`CookieMonster:${save()}`,
|
|
||||||
);
|
|
||||||
localStorage.setItem(
|
|
||||||
'CookieClickerGame',
|
|
||||||
escape(`${utf8_to_b64(newSaveString)}!END!`),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function loads the config of CookieMonster saved in localStorage and loads it into CMOptions
|
|
||||||
* It is called by CM.Main.DelayInit() and CM.Config.RestoreDefault()
|
|
||||||
*/
|
|
||||||
export function LoadConfig(settings) {
|
|
||||||
// This removes cookies left from earlier versions of CookieMonster
|
|
||||||
if (typeof localStorage.CMConfig !== 'undefined') {
|
|
||||||
delete localStorage.CMConfig;
|
|
||||||
}
|
|
||||||
if (settings !== undefined) {
|
|
||||||
CMOptions = settings;
|
|
||||||
|
|
||||||
// Check values
|
|
||||||
let mod = false;
|
|
||||||
Object.keys(ConfigDefault).forEach((i) => {
|
|
||||||
if (typeof CMOptions[i] === 'undefined') {
|
|
||||||
mod = true;
|
|
||||||
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') {
|
|
||||||
Object.keys(ConfigDefault.Header).forEach((j) => {
|
|
||||||
if (
|
|
||||||
typeof CMOptions[i][j] === 'undefined' ||
|
|
||||||
!(CMOptions[i][j] > -1 && CMOptions[i][j] < 2)
|
|
||||||
) {
|
|
||||||
mod = true;
|
|
||||||
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();
|
|
||||||
CMLoop(); // Do loop once
|
|
||||||
Object.keys(ConfigDefault).forEach((i) => {
|
|
||||||
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
|
||||||
ConfigData[i].func();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Default values
|
|
||||||
LoadConfig(ConfigDefault);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +1,35 @@
|
|||||||
/** Called by the "func" of individual settings */
|
/** Called by the "func" of individual settings */
|
||||||
|
|
||||||
import UpdateBackground from '../Disp/HelperFunctions/UpdateBackground';
|
import UpdateBackground from '../Disp/HelperFunctions/UpdateBackground';
|
||||||
import { CMOptions } from './VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function changes the position of both the bottom and timer bar
|
* This function changes the position of both the bottom and timer bar
|
||||||
*/
|
*/
|
||||||
export function UpdateBotTimerBarPosition() {
|
export function UpdateBotTimerBarPosition() {
|
||||||
if (
|
if (
|
||||||
CMOptions.BotBar === 1 &&
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar === 1 &&
|
||||||
CMOptions.TimerBar === 1 &&
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBar === 1 &&
|
||||||
CMOptions.TimerBarPos === 1
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarPos === 1
|
||||||
) {
|
) {
|
||||||
l('CMBotBar').style.bottom = l('CMTimerBar').style.height;
|
l('CMBotBar').style.bottom = l('CMTimerBar').style.height;
|
||||||
l('game').style.bottom = `${
|
l('game').style.bottom = `${Number(l('CMTimerBar').style.height.replace('px', '')) + 70}px`;
|
||||||
Number(l('CMTimerBar').style.height.replace('px', '')) + 70
|
} else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar === 1) {
|
||||||
}px`;
|
|
||||||
} else if (CMOptions.BotBar === 1) {
|
|
||||||
l('CMBotBar').style.bottom = '0px';
|
l('CMBotBar').style.bottom = '0px';
|
||||||
l('game').style.bottom = '70px';
|
l('game').style.bottom = '70px';
|
||||||
} else if (CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) {
|
} else if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBar === 1 &&
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarPos === 1
|
||||||
|
) {
|
||||||
l('game').style.bottom = l('CMTimerBar').style.height;
|
l('game').style.bottom = l('CMTimerBar').style.height;
|
||||||
} else {
|
} else {
|
||||||
// No bars
|
// No bars
|
||||||
l('game').style.bottom = '0px';
|
l('game').style.bottom = '0px';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 0) {
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBar === 1 &&
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarPos === 0
|
||||||
|
) {
|
||||||
l('sectionLeft').style.top = l('CMTimerBar').style.height;
|
l('sectionLeft').style.top = l('CMTimerBar').style.height;
|
||||||
} else {
|
} else {
|
||||||
l('sectionLeft').style.top = '';
|
l('sectionLeft').style.top = '';
|
||||||
@@ -39,7 +42,8 @@ export function UpdateBotTimerBarPosition() {
|
|||||||
* This function changes the visibility of the timer bar
|
* This function changes the visibility of the timer bar
|
||||||
*/
|
*/
|
||||||
export function ToggleTimerBar() {
|
export function ToggleTimerBar() {
|
||||||
if (CMOptions.TimerBar === 1) l('CMTimerBar').style.display = '';
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBar === 1)
|
||||||
|
l('CMTimerBar').style.display = '';
|
||||||
else l('CMTimerBar').style.display = 'none';
|
else l('CMTimerBar').style.display = 'none';
|
||||||
UpdateBotTimerBarPosition();
|
UpdateBotTimerBarPosition();
|
||||||
}
|
}
|
||||||
@@ -48,7 +52,7 @@ export function ToggleTimerBar() {
|
|||||||
* This function changes the position of the timer bar
|
* This function changes the position of the timer bar
|
||||||
*/
|
*/
|
||||||
export function ToggleTimerBarPos() {
|
export function ToggleTimerBarPos() {
|
||||||
if (CMOptions.TimerBarPos === 0) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarPos === 0) {
|
||||||
l('CMTimerBar').style.width = '30%';
|
l('CMTimerBar').style.width = '30%';
|
||||||
l('CMTimerBar').style.bottom = '';
|
l('CMTimerBar').style.bottom = '';
|
||||||
l('game').insertBefore(l('CMTimerBar'), l('sectionLeft'));
|
l('game').insertBefore(l('CMTimerBar'), l('sectionLeft'));
|
||||||
|
|||||||
@@ -1,55 +1,18 @@
|
|||||||
import ConfigData from '../Data/SettingsData';
|
import { saveAndLoadingFunctions } from '@cookiemonsterteam/cookiemonsterframework/src/index';
|
||||||
import { SaveConfig } from './SaveLoadReload/SaveLoadReloadSettings';
|
|
||||||
import { CMOptions } from './VariablesAndData';
|
|
||||||
|
|
||||||
/** Functions related to toggling or changing an individual setting */
|
/** Functions related to toggling or changing an individual setting */
|
||||||
|
|
||||||
/** Used to name certain DOM or outside facing elements and refer to them */
|
/** Used to name certain DOM or outside facing elements and refer to them */
|
||||||
export const ConfigPrefix = 'CMConfig';
|
export const ConfigPrefix = 'CMConfig';
|
||||||
|
|
||||||
/**
|
|
||||||
* This function toggles options by incrementing them with 1 and handling changes
|
|
||||||
* It is called by the onclick event of options of the "bool" type
|
|
||||||
* @param {string} config The name of the option
|
|
||||||
*/
|
|
||||||
export function ToggleConfig(config) {
|
|
||||||
CMOptions[config] += 1;
|
|
||||||
|
|
||||||
if (CMOptions[config] === ConfigData[config].label.length) {
|
|
||||||
CMOptions[config] = 0;
|
|
||||||
if (ConfigData[config].toggle)
|
|
||||||
l(ConfigPrefix + config).className = 'option off';
|
|
||||||
} else l(ConfigPrefix + config).className = 'option';
|
|
||||||
|
|
||||||
if (typeof ConfigData[config].func !== 'undefined') {
|
|
||||||
ConfigData[config].func();
|
|
||||||
}
|
|
||||||
|
|
||||||
l(ConfigPrefix + config).innerHTML =
|
|
||||||
ConfigData[config].label[CMOptions[config]];
|
|
||||||
SaveConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function sets the value of the specified volume-option and updates the display in the options menu
|
|
||||||
* It is called by the oninput and onchange event of "vol" type options
|
|
||||||
* @param {string} config The name of the option
|
|
||||||
*/
|
|
||||||
export function ToggleConfigVolume(config) {
|
|
||||||
if (l(`slider${config}`) !== null) {
|
|
||||||
l(`slider${config}right`).innerHTML = `${l(`slider${config}`).value}%`;
|
|
||||||
CMOptions[config] = Math.round(l(`slider${config}`).value);
|
|
||||||
}
|
|
||||||
SaveConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggles header options by incrementing them with 1 and handling changes
|
* This function toggles header options by incrementing them with 1 and handling changes
|
||||||
* It is called by the onclick event of the +/- next to headers
|
* It is called by the onclick event of the +/- next to headers
|
||||||
* @param {string} config The name of the header
|
* @param {string} config The name of the header
|
||||||
*/
|
*/
|
||||||
export function ToggleHeader(config) {
|
export function ToggleHeader(config) {
|
||||||
CMOptions.Header[config] += 1;
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers[config] += 1;
|
||||||
if (CMOptions.Header[config] > 1) CMOptions.Header[config] = 0;
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers[config] > 1)
|
||||||
SaveConfig();
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers[config] = 0;
|
||||||
|
saveAndLoadingFunctions.saveFramework();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar';
|
import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar';
|
||||||
import { UpdateBotTimerBarPosition } from '../SpecificToggles';
|
import { UpdateBotTimerBarPosition } from '../SpecificToggles';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggle the bottom bar
|
* This function toggle the bottom bar
|
||||||
* It is called by CM.Disp.UpdateAscendState() and a change in CMOptions.BotBar
|
* It is called by CM.Disp.UpdateAscendState() and a change in Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar
|
||||||
*/
|
*/
|
||||||
export default function ToggleBotBar() {
|
export default function ToggleBotBar() {
|
||||||
if (CMOptions.BotBar === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar === 1) {
|
||||||
l('CMBotBar').style.display = '';
|
l('CMBotBar').style.display = '';
|
||||||
UpdateBotBar();
|
UpdateBotBar();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { CMSayTime } from '../../Disp/VariablesAndData';
|
import { CMSayTime } from '../../Disp/VariablesAndData';
|
||||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function changes some of the time-displays in the game to be more detailed
|
* This function changes some of the time-displays in the game to be more detailed
|
||||||
* It is called by a change in CM.Options.DetailedTime
|
* It is called by a change in CM.Options.DetailedTime
|
||||||
*/
|
*/
|
||||||
export default function ToggleDetailedTime() {
|
export default function ToggleDetailedTime() {
|
||||||
if (CMOptions.DetailedTime === 1) Game.sayTime = CMSayTime;
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.DetailedTime === 1)
|
||||||
|
Game.sayTime = CMSayTime;
|
||||||
else Game.sayTime = BackupFunctions.sayTime;
|
else Game.sayTime = BackupFunctions.sayTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
/* 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';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggles GC Timers are visible
|
* This function toggles GC Timers are visible
|
||||||
* It is called by a change in CM.Options.GCTimer
|
* It is called by a change in CM.Options.GCTimer
|
||||||
*/
|
*/
|
||||||
export default function ToggleGCTimer() {
|
export default function ToggleGCTimer() {
|
||||||
if (CMOptions.GCTimer === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.GCTimer === 1) {
|
||||||
Object.keys(GCTimers).forEach((i) => {
|
Object.keys(GCTimers).forEach((i) => {
|
||||||
GCTimers[i].style.display = 'block';
|
GCTimers[i].style.display = 'block';
|
||||||
GCTimers[i].style.left = CacheGoldenShimmersByID[i].l.style.left;
|
GCTimers[i].style.left = CacheGoldenShimmersByID[i].l.style.left;
|
||||||
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// eslint-disable-next-line no-return-assign
|
||||||
Object.keys(GCTimers).forEach((i) => (GCTimers[i].style.display = 'none'));
|
Object.keys(GCTimers).forEach((i) => (GCTimers[i].style.display = 'none'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function updates the display setting of the two objects created by CM.Disp.CreateWrinklerButtons()
|
* This function updates the display setting of the two objects created by CM.Disp.CreateWrinklerButtons()
|
||||||
* It is called by changes in CM.Options.WrinklerButtons
|
* It is called by changes in CM.Options.WrinklerButtons
|
||||||
*/
|
*/
|
||||||
export default function ToggleSectionHideButtons() {
|
export default function ToggleSectionHideButtons() {
|
||||||
if (CMOptions.HideSectionsButtons) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.HideSectionsButtons) {
|
||||||
l('CMSectionHidButtons').style.display = '';
|
l('CMSectionHidButtons').style.display = '';
|
||||||
} else {
|
} else {
|
||||||
l('CMSectionHidButtons').style.display = 'none';
|
l('CMSectionHidButtons').style.display = 'none';
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggles the position of the warnings created by CM.Disp.TooltipCreateWarningSection()
|
* This function toggles the position of the warnings created by CM.Disp.TooltipCreateWarningSection()
|
||||||
* It is called by a change in CM.Options.ToolWarnPos
|
* It is called by a change in CM.Options.ToolWarnPos
|
||||||
@@ -7,7 +5,7 @@ import { CMOptions } from '../VariablesAndData';
|
|||||||
*/
|
*/
|
||||||
export default function ToggleToolWarnPos() {
|
export default function ToggleToolWarnPos() {
|
||||||
if (l('CMDispTooltipWarningParent') !== null) {
|
if (l('CMDispTooltipWarningParent') !== null) {
|
||||||
if (CMOptions.ToolWarnPos === 0) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ToolWarnPos === 0) {
|
||||||
l('CMDispTooltipWarningParent').style.top = 'auto';
|
l('CMDispTooltipWarningParent').style.top = 'auto';
|
||||||
l('CMDispTooltipWarningParent').style.margin = '4px -4px';
|
l('CMDispTooltipWarningParent').style.margin = '4px -4px';
|
||||||
l('CMDispTooltipWarningParent').style.padding = '3px 4px';
|
l('CMDispTooltipWarningParent').style.padding = '3px 4px';
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
||||||
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.UpBarColour
|
||||||
*/
|
*/
|
||||||
export default function ToggleUpgradeBarAndColor() {
|
export default function ToggleUpgradeBarAndColour() {
|
||||||
if (CMOptions.UpBarColor === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour === 1) {
|
||||||
// Colours and bar on
|
// Colours and bar on
|
||||||
l('CMUpgradeBar').style.display = '';
|
l('CMUpgradeBar').style.display = '';
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
} else if (CMOptions.UpBarColor === 2) {
|
} else if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour === 2
|
||||||
|
) {
|
||||||
// Colours on and bar off
|
// Colours on and bar off
|
||||||
l('CMUpgradeBar').style.display = 'none';
|
l('CMUpgradeBar').style.display = 'none';
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggles the position of the upgrade bar from fixed or non-fixed mode
|
* This function toggles the position of the upgrade bar from fixed or non-fixed mode
|
||||||
* It is called by a change in CM.Options.UpgradeBarFixedPos
|
* It is called by a change in CM.Options.UpgradeBarFixedPos
|
||||||
*/
|
*/
|
||||||
export default function ToggleUpgradeBarFixedPos() {
|
export default function ToggleUpgradeBarFixedPos() {
|
||||||
if (CMOptions.UpgradeBarFixedPos === 1) {
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpgradeBarFixedPos === 1
|
||||||
|
) {
|
||||||
// Fix to top of screen when scrolling
|
// Fix to top of screen when scrolling
|
||||||
l('CMUpgradeBar').style.position = 'sticky';
|
l('CMUpgradeBar').style.position = 'sticky';
|
||||||
l('CMUpgradeBar').style.top = '0px';
|
l('CMUpgradeBar').style.top = '0px';
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function updates the display setting of the two objects created by CM.Disp.CreateWrinklerButtons()
|
* This function updates the display setting of the two objects created by CM.Disp.CreateWrinklerButtons()
|
||||||
* 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 (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.WrinklerButtons &&
|
||||||
|
Game.elderWrath
|
||||||
|
) {
|
||||||
l('PopAllNormalWrinklerButton').style.display = '';
|
l('PopAllNormalWrinklerButton').style.display = '';
|
||||||
l('PopFattestWrinklerButton').style.display = '';
|
l('PopFattestWrinklerButton').style.display = '';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
/* eslint-disable prefer-const */
|
|
||||||
|
|
||||||
export let CMOptions = {};
|
|
||||||
export const ConfigPrefix = 'CMConfig';
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import init from './InitSaveLoad/init';
|
import init from './InitSaveLoad/init';
|
||||||
import load from './InitSaveLoad/load';
|
import load from './InitSaveLoad/load';
|
||||||
import save from './InitSaveLoad/save';
|
import save from './InitSaveLoad/save';
|
||||||
@@ -10,3 +9,7 @@ const CM = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Game.registerMod('CookieMonster', CM);
|
Game.registerMod('CookieMonster', CM);
|
||||||
|
|
||||||
|
// Game.registerMod also calls CM.load() which calls the loop hook
|
||||||
|
// Thus sounds normally play at start up as Season and Garden states are checked
|
||||||
|
window.cookieMonsterFrameworkData.isInitializing = false;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Data copied directly from the game */
|
/** Data copied directly from the game */
|
||||||
|
|
||||||
/** Array of the names of all fortune cookies obtainable from the ticker */
|
/** Array of the names of all fortune cookies obtainable from the ticker */
|
||||||
export const Fortunes = [
|
export const Fortunes: string[] = [
|
||||||
'Fortune #001',
|
'Fortune #001',
|
||||||
'Fortune #002',
|
'Fortune #002',
|
||||||
'Fortune #003',
|
'Fortune #003',
|
||||||
@@ -28,7 +28,7 @@ export const Fortunes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Halloween cookies */
|
/** Array of the names of all Halloween cookies */
|
||||||
export const HalloCookies = [
|
export const HalloCookies: string[] = [
|
||||||
'Skull cookies',
|
'Skull cookies',
|
||||||
'Ghost cookies',
|
'Ghost cookies',
|
||||||
'Bat cookies',
|
'Bat cookies',
|
||||||
@@ -39,7 +39,7 @@ export const HalloCookies = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Christmas cookies */
|
/** Array of the names of all Christmas cookies */
|
||||||
export const ChristCookies = [
|
export const ChristCookies: string[] = [
|
||||||
'Christmas tree biscuits',
|
'Christmas tree biscuits',
|
||||||
'Snowflake biscuits',
|
'Snowflake biscuits',
|
||||||
'Snowman biscuits',
|
'Snowman biscuits',
|
||||||
@@ -50,7 +50,7 @@ export const ChristCookies = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Valentine cookies */
|
/** Array of the names of all Valentine cookies */
|
||||||
export const ValCookies = [
|
export const ValCookies: string[] = [
|
||||||
'Pure heart biscuits',
|
'Pure heart biscuits',
|
||||||
'Ardent heart biscuits',
|
'Ardent heart biscuits',
|
||||||
'Sour heart biscuits',
|
'Sour heart biscuits',
|
||||||
@@ -61,7 +61,7 @@ export const ValCookies = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all plant drops */
|
/** Array of the names of all plant drops */
|
||||||
export const PlantDrops = [
|
export const PlantDrops: string[] = [
|
||||||
'Elderwort biscuits',
|
'Elderwort biscuits',
|
||||||
'Bakeberry cookies',
|
'Bakeberry cookies',
|
||||||
'Duketater cookies',
|
'Duketater cookies',
|
||||||
@@ -72,7 +72,7 @@ export const PlantDrops = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** All possible effects plants and other items can have with a display-title */
|
/** All possible effects plants and other items can have with a display-title */
|
||||||
export const Effects = {
|
export const Effects: { [index: string]: string } = {
|
||||||
buildingCost: 'Building prices',
|
buildingCost: 'Building prices',
|
||||||
click: 'Cookies per click',
|
click: 'Cookies per click',
|
||||||
cps: 'Total CPS',
|
cps: 'Total CPS',
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
/** Data related directly to Cookie Monster */
|
|
||||||
|
|
||||||
export const VersionMajor = '2.031';
|
|
||||||
export const VersionMinor = '6';
|
|
||||||
|
|
||||||
/** Information about Cookie Monster to be displayed in the info section */
|
|
||||||
export const ModDescription = `<div class="listing">
|
|
||||||
<a href="https://github.com/Aktanusa/CookieMonster" target="blank">Cookie Monster</a>
|
|
||||||
offers a wide range of tools and statistics to enhance your game experience.
|
|
||||||
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.</br>
|
|
||||||
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
|
|
||||||
Please also report any bugs you may find over there!</br>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
|
||||||
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>
|
|
||||||
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>
|
|
||||||
This update also implements the following functions:</br>
|
|
||||||
- Added a tooltip displaying the reward to the extra pop wrinkler buttons</br>
|
|
||||||
- Added tooltips to the Gods in the Pantheon</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 test the volume and sound of notifications in the settings screen</br>
|
|
||||||
- The bottom bar will now flicker less and each column has received a bit of padding</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>
|
|
||||||
This update fixes the following bugs:</br>
|
|
||||||
- Incorrect amount for "required for max plant reward" in statistics page</br>
|
|
||||||
- Fixed the tooltips of the '?' buttons in the statistics page not showing</br>
|
|
||||||
- Fixed some unclear settings descriptions </br>
|
|
||||||
</br>
|
|
||||||
Please submit any bug reports or feature requests to the <a href="https://github.com/Aktanusa/CookieMonster">GitHub page!</a>
|
|
||||||
</br>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
25
src/Data/Moddata.ts
Normal file
25
src/Data/Moddata.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/** Data related directly to Cookie Monster */
|
||||||
|
|
||||||
|
export const VersionMajor = '2.031';
|
||||||
|
export const VersionMinor = '10';
|
||||||
|
|
||||||
|
/** Information about Cookie Monster to be displayed in the info section */
|
||||||
|
export const ModDescription = `<a href="https://github.com/CookieMonsterTeam/CookieMonster" target="blank">Cookie Monster</a>
|
||||||
|
offers a wide range of tools and statistics to enhance your game experience.
|
||||||
|
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.</br>
|
||||||
|
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
|
||||||
|
Please also report any bugs you may find over there!</br>
|
||||||
|
`;
|
||||||
|
|
||||||
|
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||||
|
export const LatestReleaseNotes = `This update implements the following functions:</br>
|
||||||
|
- This updates adds a number of performance improvements which make CookieMonster about 33% more efficient</br>
|
||||||
|
- Added a button to all buildings in the middle section that can "lock" the building. This makes the building unclickable, which might be useful for frantic clicking during cookie storms</br>
|
||||||
|
- Added a percentage to the Golden Cookie timer bar</br>
|
||||||
|
</br>
|
||||||
|
This update fixes the following bugs:
|
||||||
|
- Fix considerable lag on the Ascension screen when using the monospace font</br>
|
||||||
|
- Fix sound playing at start-up</br>
|
||||||
|
- Fix building tooltips and warnings not updating correctly</br>
|
||||||
|
- Fix upgrade bar not displaying</br>
|
||||||
|
- Fix loading of mod when no save was found</br>`;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
/** Data related directly to the scales used by Cookie Monster */
|
/** Data related directly to the scales used by Cookie Monster */
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Metric" scale */
|
/** Array of abbreviations used in the "Metric" scale */
|
||||||
export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
export const metric: string[] = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Short" scale */
|
/** Array of abbreviations used in the "Short" scale */
|
||||||
export const shortScale = [
|
export const shortScale: string[] = [
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'M',
|
'M',
|
||||||
@@ -34,7 +34,7 @@ export const shortScale = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
||||||
export const shortScaleAbbreviated = [
|
export const shortScaleAbbreviated: string[] = [
|
||||||
'',
|
'',
|
||||||
'K',
|
'K',
|
||||||
'M',
|
'M',
|
||||||
@@ -1,18 +1,20 @@
|
|||||||
/** Data related to the display titles of certain sections in menu screens */
|
/** Data related to the display titles of certain sections in menu screens */
|
||||||
|
|
||||||
/** 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: { [index: string]: string } = {
|
||||||
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',
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Display titles of the headers of the notification section of the Cookie Monster settings */
|
/** Display titles of the headers of the notification section of the Cookie Monster settings */
|
||||||
export const ConfigGroupsNotification = {
|
export const ConfigGroupsNotification: { [index: string]: string } = {
|
||||||
NotificationGeneral: 'General Notifications',
|
NotificationGeneral: 'General Notifications',
|
||||||
NotificationGC: 'Golden Cookie',
|
NotificationGC: 'Golden Cookie',
|
||||||
NotificationFC: 'Fortune Cookie',
|
NotificationFC: 'Fortune Cookie',
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/* eslint-disable max-classes-per-file */
|
|
||||||
/** This describes all forms of settings used by Cookie Monster */
|
|
||||||
|
|
||||||
/** The basic setting class */
|
|
||||||
export class Setting {
|
|
||||||
constructor(type, group) {
|
|
||||||
this.type = type;
|
|
||||||
this.group = group;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The standard toggle setting class */
|
|
||||||
export class SettingStandard extends Setting {
|
|
||||||
constructor(type, group, label, desc, toggle, func = null) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
this.toggle = toggle;
|
|
||||||
if (func) {
|
|
||||||
this.func = func;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** The colour picker setting class */
|
|
||||||
export class SettingColours extends Setting {
|
|
||||||
constructor(type, group, desc, func) {
|
|
||||||
super(type, group);
|
|
||||||
this.desc = desc;
|
|
||||||
this.func = func;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The volume level setting class */
|
|
||||||
export class SettingVolume extends Setting {
|
|
||||||
constructor(type, group, label, desc) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
for (let i = 0; i < 101; i++) {
|
|
||||||
this.label[i] = `${i}%`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The number input setting class */
|
|
||||||
export class SettingInputNumber extends Setting {
|
|
||||||
constructor(type, group, label, desc, min, max) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
this.min = min;
|
|
||||||
this.max = max;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,765 +0,0 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
|
||||||
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
|
||||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
|
||||||
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
|
||||||
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
|
||||||
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons';
|
|
||||||
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
|
||||||
import ToggleUpgradeBarAndColor from '../Config/Toggles/ToggleUpgradeBarAndColor';
|
|
||||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
|
||||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
|
||||||
import { CMOptions } from '../Config/VariablesAndData';
|
|
||||||
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
|
||||||
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
|
||||||
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
|
||||||
import UpdateColors from '../Disp/HelperFunctions/UpdateColors';
|
|
||||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
|
||||||
import { SimDoSims } from '../Sim/VariablesAndData';
|
|
||||||
import {
|
|
||||||
SettingStandard,
|
|
||||||
SettingColours,
|
|
||||||
SettingVolume,
|
|
||||||
SettingInputNumber,
|
|
||||||
} from './SettingClasses';
|
|
||||||
|
|
||||||
/** This includes all options of CookieMonster and their relevant data */
|
|
||||||
const Config = {
|
|
||||||
// Barscolors
|
|
||||||
BotBar: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
['Bottom Bar OFF', 'Bottom Bar ON'],
|
|
||||||
'Building Information',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
ToggleBotBar();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TimerBar: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
['Timer Bar OFF', 'Timer Bar ON'],
|
|
||||||
'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
ToggleTimerBar();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TimerBarPos: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'],
|
|
||||||
'Placement of the Timer Bar',
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
ToggleTimerBarPos();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TimerBarOverlay: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
[
|
|
||||||
'Timer Bar Overlay OFF',
|
|
||||||
'Timer Bar Overlay Only Seconds',
|
|
||||||
'Timer Bar Overlay Full',
|
|
||||||
],
|
|
||||||
'Overlay on timers displaying seconds and/or percentage left',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
SortBuildings: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
[
|
|
||||||
'Sort Buildings: Default',
|
|
||||||
'Sort Buildings: PP of x1 purchase',
|
|
||||||
'Sort Buildings: PP of selected bulk mode',
|
|
||||||
],
|
|
||||||
'Sort the display of buildings in either default order or by PP',
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
UpdateBuildings();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SortUpgrades: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
['Sort Upgrades: Default', 'Sort Upgrades: PP'],
|
|
||||||
'Sort the display of upgrades in either default order or by PP',
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
UpdateUpgrades();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
BuildColor: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
['Building Colors OFF', 'Building Colors ON'],
|
|
||||||
'Color code buildings',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
UpdateBuildings();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
PPDisplayTime: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
['PP As Value (Standard)', 'PP As Time Unit'],
|
|
||||||
'Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.',
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
UpBarColor: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
[
|
|
||||||
'Upgrade Colors/Bar OFF',
|
|
||||||
'Upgrade Colors with Bar ON',
|
|
||||||
'Upgrade Colors without Bar ON',
|
|
||||||
],
|
|
||||||
'Color code upgrades and optionally add a counter bar',
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
ToggleUpgradeBarAndColor();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Colors: new SettingColours(
|
|
||||||
'color',
|
|
||||||
'BarsColors',
|
|
||||||
{
|
|
||||||
Blue:
|
|
||||||
'Color Blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
|
|
||||||
Green:
|
|
||||||
'Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
|
|
||||||
Yellow:
|
|
||||||
'Color Yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels',
|
|
||||||
Orange:
|
|
||||||
'Color Orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
|
|
||||||
Red:
|
|
||||||
'Color Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
|
|
||||||
Purple:
|
|
||||||
'Color Purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels',
|
|
||||||
Gray:
|
|
||||||
'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
|
||||||
Pink: 'Color Pink. Used for Dragonflight bar',
|
|
||||||
Brown: 'Color Brown. Used for Dragon Harvest bar',
|
|
||||||
},
|
|
||||||
function () {
|
|
||||||
UpdateColors();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
UpgradeBarFixedPos: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'BarsColors',
|
|
||||||
['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'],
|
|
||||||
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
ToggleUpgradeBarFixedPos();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
// Calculation
|
|
||||||
CalcWrink: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
[
|
|
||||||
'Calculate with Wrinklers OFF',
|
|
||||||
'Calculate with Wrinklers ON',
|
|
||||||
'Calculate with Single Fattest Wrinkler ON',
|
|
||||||
],
|
|
||||||
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
SimDoSims = true;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
CPSMode: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
['Current Cookies Per Second', 'Average Cookies Per Second'],
|
|
||||||
'Calculate times using current Cookies Per Second or average Cookies Per Second',
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
AvgCPSHist: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
[
|
|
||||||
'Average CPS for past 10s',
|
|
||||||
'Average CPS for past 15s',
|
|
||||||
'Average CPS for past 30s',
|
|
||||||
'Average CPS for past 1m',
|
|
||||||
'Average CPS for past 5m',
|
|
||||||
'Average CPS for past 10m',
|
|
||||||
'Average CPS for past 15m',
|
|
||||||
'Average CPS for past 30m',
|
|
||||||
],
|
|
||||||
'How much time average Cookies Per Second should consider',
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
AvgClicksHist: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
[
|
|
||||||
'Average Cookie Clicks for past 1s',
|
|
||||||
'Average Cookie Clicks for past 5s',
|
|
||||||
'Average Cookie Clicks for past 10s',
|
|
||||||
'Average Cookie Clicks for past 15s',
|
|
||||||
'Average Cookie Clicks for past 30s',
|
|
||||||
],
|
|
||||||
'How much time average Cookie Clicks should consider',
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
PPExcludeTop: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
[
|
|
||||||
"Don't Ignore Any",
|
|
||||||
'Ignore 1st Best',
|
|
||||||
'Ignore 1st and 2nd Best',
|
|
||||||
'Ignore 1st, 2nd and 3rd Best',
|
|
||||||
],
|
|
||||||
'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
PPSecondsLowerLimit: new SettingInputNumber(
|
|
||||||
'numscale',
|
|
||||||
'Calculation',
|
|
||||||
'Lower limit for PP (in seconds): ',
|
|
||||||
'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',
|
|
||||||
0,
|
|
||||||
Infinity,
|
|
||||||
),
|
|
||||||
PPOnlyConsiderBuyable: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
["Don't Ignore Non-Buyable", 'Ignore Non-Buyable'],
|
|
||||||
"Makes CookieMonster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
ToolWarnBon: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
[
|
|
||||||
'Calculate Tooltip Warning With Bonus CPS OFF',
|
|
||||||
'Calculate Tooltip Warning With Bonus CPS ON',
|
|
||||||
],
|
|
||||||
'Calculate the warning with or without the bonus CPS you get from buying',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
|
|
||||||
// Notification
|
|
||||||
Title: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationGeneral',
|
|
||||||
['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'],
|
|
||||||
'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns; "!" means that Golden Cookie/Reindeer can spawn',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
GeneralSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationGeneral',
|
|
||||||
['Consider Game Volume Setting OFF', 'Consider Game Volume Setting ON'],
|
|
||||||
'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
GCNotification: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationGC',
|
|
||||||
['Notification OFF', 'Notification ON'],
|
|
||||||
'Create a notification when Golden Cookie spawns',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
CheckNotificationPermissions(CMOptions.GCNotification);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
GCFlash: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationGC',
|
|
||||||
['Flash OFF', 'Flash ON'],
|
|
||||||
'Flash screen on Golden Cookie',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
GCSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationGC',
|
|
||||||
['Sound OFF', 'Sound ON'],
|
|
||||||
'Play a sound on Golden Cookie',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
GCVolume: new SettingVolume('vol', 'NotificationGC', [], 'Volume'),
|
|
||||||
GCSoundURL: new SettingStandard(
|
|
||||||
'url',
|
|
||||||
'NotificationGC',
|
|
||||||
'Sound URL:',
|
|
||||||
'URL of the sound to be played when a Golden Cookie spawns',
|
|
||||||
),
|
|
||||||
FortuneNotification: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationFC',
|
|
||||||
['Notification OFF', 'Notification ON'],
|
|
||||||
'Create a notification when Fortune Cookie is on the Ticker',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
FortuneFlash: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationFC',
|
|
||||||
['Flash OFF', 'Flash ON'],
|
|
||||||
'Flash screen on Fortune Cookie',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
FortuneSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationFC',
|
|
||||||
['Sound OFF', 'Sound ON'],
|
|
||||||
'Play a sound on Fortune Cookie',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
FortuneVolume: new SettingVolume('vol', 'NotificationFC', [], 'Volume'),
|
|
||||||
|
|
||||||
FortuneSoundURL: new SettingStandard(
|
|
||||||
'url',
|
|
||||||
'NotificationFC',
|
|
||||||
'Sound URL:',
|
|
||||||
'URL of the sound to be played when the Ticker has a Fortune Cookie',
|
|
||||||
),
|
|
||||||
SeaNotification: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationSea',
|
|
||||||
['Notification OFF', 'Notification ON'],
|
|
||||||
'Create a notification on Season Popup',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
CheckNotificationPermissions(CMOptions.SeaNotification);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SeaFlash: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationSea',
|
|
||||||
['Flash OFF', 'Flash ON'],
|
|
||||||
'Flash screen on Season Popup',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
SeaSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationSea',
|
|
||||||
['Sound OFF', 'Sound ON'],
|
|
||||||
'Play a sound on Season Popup',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
SeaVolume: new SettingVolume('vol', 'NotificationSea', [], 'Volume'),
|
|
||||||
SeaSoundURL: new SettingStandard(
|
|
||||||
'url',
|
|
||||||
'NotificationSea',
|
|
||||||
'Sound URL:',
|
|
||||||
'URL of the sound to be played when a Season Special spawns',
|
|
||||||
),
|
|
||||||
GardFlash: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationGard',
|
|
||||||
['Garden Tick Flash OFF', 'Flash ON'],
|
|
||||||
'Flash screen on Garden Tick',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
GardSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationGard',
|
|
||||||
['Sound OFF', 'Sound ON'],
|
|
||||||
'Play a sound on Garden Tick',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
GardVolume: new SettingVolume('vol', 'NotificationGard', [], 'Volume'),
|
|
||||||
GardSoundURL: new SettingStandard(
|
|
||||||
'url',
|
|
||||||
'NotificationGard',
|
|
||||||
'Garden Tick Sound URL:',
|
|
||||||
'URL of the sound to be played when the garden ticks',
|
|
||||||
),
|
|
||||||
MagicNotification: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationMagi',
|
|
||||||
['Notification OFF', 'Notification ON'],
|
|
||||||
'Create a notification when magic reaches maximum',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
CheckNotificationPermissions(CMOptions.MagicNotification);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
MagicFlash: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationMagi',
|
|
||||||
['Flash OFF', 'Flash ON'],
|
|
||||||
'Flash screen when magic reaches maximum',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
MagicSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationMagi',
|
|
||||||
['Sound OFF', 'Sound ON'],
|
|
||||||
'Play a sound when magic reaches maximum',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
MagicVolume: new SettingVolume('vol', 'NotificationMagi', [], 'Volume'),
|
|
||||||
MagicSoundURL: new SettingStandard(
|
|
||||||
'url',
|
|
||||||
'NotificationMagi',
|
|
||||||
'Sound URL:',
|
|
||||||
'URL of the sound to be played when magic reaches maxium',
|
|
||||||
),
|
|
||||||
WrinklerNotification: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationWrink',
|
|
||||||
['Notification OFF', 'Notification ON'],
|
|
||||||
'Create a notification when a Wrinkler appears',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
WrinklerFlash: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationWrink',
|
|
||||||
['Flash OFF', 'Flash ON'],
|
|
||||||
'Flash screen when a Wrinkler appears',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
WrinklerSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationWrink',
|
|
||||||
['Sound OFF', 'Sound ON'],
|
|
||||||
'Play a sound when a Wrinkler appears',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
WrinklerVolume: new SettingVolume('vol', 'NotificationWrink', [], 'Volume'),
|
|
||||||
WrinklerSoundURL: new SettingStandard(
|
|
||||||
'url',
|
|
||||||
'NotificationWrink',
|
|
||||||
'Sound URL:',
|
|
||||||
'URL of the sound to be played when a Wrinkler appears',
|
|
||||||
),
|
|
||||||
WrinklerMaxNotification: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationWrinkMax',
|
|
||||||
['Notification OFF', 'Notification ON'],
|
|
||||||
'Create a notification when the maximum amount of Wrinklers has appeared',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
WrinklerMaxFlash: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationWrinkMax',
|
|
||||||
['Flash OFF', 'Flash ON'],
|
|
||||||
'Flash screen when the maximum amount of Wrinklers has appeared',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
WrinklerMaxSound: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'NotificationWrinkMax',
|
|
||||||
['Sound OFF', 'Sound ON'],
|
|
||||||
'Play a sound when the maximum amount of Wrinklers has appeared',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
WrinklerMaxVolume: new SettingVolume(
|
|
||||||
'vol',
|
|
||||||
'NotificationWrinkMax',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
WrinklerMaxSoundURL: new SettingStandard(
|
|
||||||
'url',
|
|
||||||
'NotificationWrinkMax',
|
|
||||||
'Sound URL:',
|
|
||||||
'URL of the sound to be played when the maximum amount of Wrinklers has appeared',
|
|
||||||
),
|
|
||||||
|
|
||||||
// Tooltip
|
|
||||||
TooltipBuildUpgrade: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
[
|
|
||||||
'Building/Upgrade Tooltip Information OFF',
|
|
||||||
'Building/Upgrade Tooltip Information ON',
|
|
||||||
],
|
|
||||||
'Extra information in Building/Upgrade tooltips',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
TooltipAmor: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
[
|
|
||||||
'Buildings Tooltip Amortization Information OFF',
|
|
||||||
'Buildings Tooltip Amortization Information ON',
|
|
||||||
],
|
|
||||||
'Add amortization information to buildings tooltip',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
ToolWarnLucky: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'],
|
|
||||||
'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
ToolWarnLuckyFrenzy: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'],
|
|
||||||
'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
ToolWarnConjure: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Tooltip Conjure Warning OFF', 'Tooltip Conjure Warning ON'],
|
|
||||||
'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
ToolWarnConjureFrenzy: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Tooltip Conjure Frenzy Warning OFF', 'Tooltip Conjure Frenzy Warning ON'],
|
|
||||||
'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
ToolWarnEdifice: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Tooltip Edifice Warning OFF', 'Tooltip Edifice Warning ON'],
|
|
||||||
'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
ToolWarnUser: new SettingInputNumber(
|
|
||||||
'numscale',
|
|
||||||
'Tooltip',
|
|
||||||
'Tooltip Warning At x times CPS: ',
|
|
||||||
'Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether',
|
|
||||||
0,
|
|
||||||
Infinity,
|
|
||||||
),
|
|
||||||
ToolWarnPos: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'],
|
|
||||||
'Placement of the warning boxes',
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
ToggleToolWarnPos();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TooltipGrim: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'],
|
|
||||||
'Extra information in tooltip for grimoire',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
TooltipWrink: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'],
|
|
||||||
'Shows the amount of cookies a wrinkler will give when popping it',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
TooltipLump: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'],
|
|
||||||
'Shows the current Sugar Lump type in Sugar lump tooltip.',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
TooltipPlots: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'],
|
|
||||||
'Shows a tooltip for plants that have a cookie reward.',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
TooltipPantheon: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
[
|
|
||||||
'Show Extra Info Pantheon Tooltip OFF',
|
|
||||||
'Show Extra Info Pantheon Tooltip ON',
|
|
||||||
],
|
|
||||||
'Shows additional info in the pantheon tooltip',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
DragonAuraInfo: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'],
|
|
||||||
'Shows information about changes in CPS and costs in the dragon aura interface.',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
TooltipAscendButton: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Tooltip',
|
|
||||||
['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'],
|
|
||||||
'Shows additional info in the ascend tooltip',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
|
|
||||||
// Statistics
|
|
||||||
Stats: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Statistics',
|
|
||||||
['Statistics OFF', 'Statistics ON'],
|
|
||||||
'Extra Cookie Monster statistics!',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
MissingUpgrades: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Statistics',
|
|
||||||
['Missing Upgrades OFF', 'Missing Upgrades ON'],
|
|
||||||
'Shows Missing upgrades in Stats Menu. This feature can be laggy for users with a low amount of unlocked achievements.',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
UpStats: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Statistics',
|
|
||||||
['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'],
|
|
||||||
'Default Game rate is once every 5 seconds',
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
TimeFormat: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Statistics',
|
|
||||||
['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'],
|
|
||||||
'Change the time format',
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
DetailedTime: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Statistics',
|
|
||||||
['Detailed Time OFF', 'Detailed Time ON'],
|
|
||||||
'Change how time is displayed in certain statistics and tooltips',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
ToggleDetailedTime();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
GrimoireBar: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Statistics',
|
|
||||||
['Grimoire Magic Meter Timer OFF', 'Grimoire Magic Meter Timer ON'],
|
|
||||||
'A timer on how long before the Grimoire magic meter is full',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
HeavenlyChipsTarget: new SettingInputNumber(
|
|
||||||
'numscale',
|
|
||||||
'Statistics',
|
|
||||||
'Heavenly Chips Target: ',
|
|
||||||
'Use this to set a Heavenly Chips target that will be counted towards in the "prestige" statsistics sections',
|
|
||||||
1,
|
|
||||||
Infinity,
|
|
||||||
),
|
|
||||||
ShowMissedGC: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Statistics',
|
|
||||||
['Missed GC OFF', 'Missed GC ON'],
|
|
||||||
'Show a stat in the statistics screen that counts how many Golden Cookies you have missed',
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
|
|
||||||
// Notation
|
|
||||||
Scale: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Notation',
|
|
||||||
[
|
|
||||||
"Game's Setting Scale",
|
|
||||||
'Metric',
|
|
||||||
'Short Scale',
|
|
||||||
'Short Scale (Abbreviated)',
|
|
||||||
'Scientific Notation',
|
|
||||||
'Engineering Notation',
|
|
||||||
],
|
|
||||||
'Change how long numbers are handled',
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
RefreshScale();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ScaleDecimals: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Notation',
|
|
||||||
['1 decimals', '2 decimals', '3 decimals'],
|
|
||||||
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
RefreshScale();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ScaleSeparator: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Notation',
|
|
||||||
['. for decimals (Standard)', '. for thousands'],
|
|
||||||
'Set the separator used for decimals and thousands',
|
|
||||||
false,
|
|
||||||
function () {
|
|
||||||
RefreshScale();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ScaleCutoff: new SettingInputNumber(
|
|
||||||
'numscale',
|
|
||||||
'Notation',
|
|
||||||
'Notation Cut-off Point: ',
|
|
||||||
'The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations',
|
|
||||||
1,
|
|
||||||
999999999,
|
|
||||||
),
|
|
||||||
|
|
||||||
// Miscellaneous
|
|
||||||
GCTimer: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Miscellaneous',
|
|
||||||
['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'],
|
|
||||||
'A timer on the Golden Cookie when it has been spawned',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
ToggleGCTimer();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Favicon: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Miscellaneous',
|
|
||||||
['Favicon OFF', 'Favicon ON'],
|
|
||||||
'Update favicon with Golden/Wrath Cookie',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
UpdateFavicon();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
WrinklerButtons: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Miscellaneous',
|
|
||||||
['Extra Wrinkler Buttons OFF', 'Extra Wrinkler Buttons ON'],
|
|
||||||
'Show buttons for popping wrinklers at bottom of cookie section',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
ToggleWrinklerButtons();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
HideSectionsButtons: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Miscellaneous',
|
|
||||||
['Hide Upgrades/Buildings Button OFF', 'Hide Upgrades/Buildings Button ON'],
|
|
||||||
'Show buttons for hiding and showing the upgrades and buildings section in the right column',
|
|
||||||
true,
|
|
||||||
function () {
|
|
||||||
ToggleSectionHideButtons();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
BulkBuyBlock: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Miscellaneous',
|
|
||||||
['Block Bulk Buying OFF', 'Block Bulk Buying ON'],
|
|
||||||
"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Config;
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
/** This array describes all default settings */
|
|
||||||
const ConfigDefault = {
|
|
||||||
BotBar: 1,
|
|
||||||
TimerBar: 1,
|
|
||||||
TimerBarPos: 0,
|
|
||||||
TimerBarOverlay: 2,
|
|
||||||
BuildColor: 1,
|
|
||||||
PPDisplayTime: 0,
|
|
||||||
UpBarColor: 1,
|
|
||||||
UpgradeBarFixedPos: 1,
|
|
||||||
CalcWrink: 0,
|
|
||||||
CPSMode: 1,
|
|
||||||
AvgCPSHist: 3,
|
|
||||||
AvgClicksHist: 0,
|
|
||||||
PPExcludeTop: 0,
|
|
||||||
PPSecondsLowerLimit: 0,
|
|
||||||
PPOnlyConsiderBuyable: 0,
|
|
||||||
ToolWarnBon: 1,
|
|
||||||
Title: 1,
|
|
||||||
GeneralSound: 1,
|
|
||||||
GCNotification: 0,
|
|
||||||
GCFlash: 1,
|
|
||||||
GCSound: 1,
|
|
||||||
GCVolume: 100,
|
|
||||||
GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
|
|
||||||
FortuneNotification: 0,
|
|
||||||
FortuneFlash: 1,
|
|
||||||
FortuneSound: 1,
|
|
||||||
FortuneVolume: 100,
|
|
||||||
FortuneSoundURL:
|
|
||||||
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
|
||||||
SeaNotification: 0,
|
|
||||||
SeaFlash: 1,
|
|
||||||
SeaSound: 1,
|
|
||||||
SeaVolume: 100,
|
|
||||||
SeaSoundURL:
|
|
||||||
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
|
||||||
GardFlash: 1,
|
|
||||||
GardSound: 1,
|
|
||||||
GardVolume: 100,
|
|
||||||
GardSoundURL: 'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
|
|
||||||
MagicNotification: 0,
|
|
||||||
MagicFlash: 1,
|
|
||||||
MagicSound: 1,
|
|
||||||
MagicVolume: 100,
|
|
||||||
MagicSoundURL:
|
|
||||||
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
|
||||||
WrinklerNotification: 0,
|
|
||||||
WrinklerFlash: 1,
|
|
||||||
WrinklerSound: 1,
|
|
||||||
WrinklerVolume: 100,
|
|
||||||
WrinklerSoundURL:
|
|
||||||
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
|
||||||
WrinklerMaxNotification: 0,
|
|
||||||
WrinklerMaxFlash: 1,
|
|
||||||
WrinklerMaxSound: 1,
|
|
||||||
WrinklerMaxVolume: 100,
|
|
||||||
WrinklerMaxSoundURL:
|
|
||||||
'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
|
||||||
TooltipBuildUpgrade: 1,
|
|
||||||
TooltipAmor: 0,
|
|
||||||
ToolWarnLucky: 1,
|
|
||||||
ToolWarnLuckyFrenzy: 1,
|
|
||||||
ToolWarnConjure: 1,
|
|
||||||
ToolWarnConjureFrenzy: 1,
|
|
||||||
ToolWarnEdifice: 1,
|
|
||||||
ToolWarnUser: 0,
|
|
||||||
ToolWarnPos: 1,
|
|
||||||
TooltipGrim: 1,
|
|
||||||
TooltipWrink: 1,
|
|
||||||
TooltipLump: 1,
|
|
||||||
TooltipPlots: 1,
|
|
||||||
TooltipPantheon: 1,
|
|
||||||
DragonAuraInfo: 1,
|
|
||||||
TooltipAscendButton: 1,
|
|
||||||
Stats: 1,
|
|
||||||
MissingUpgrades: 1,
|
|
||||||
UpStats: 1,
|
|
||||||
TimeFormat: 0,
|
|
||||||
DetailedTime: 1,
|
|
||||||
GrimoireBar: 1,
|
|
||||||
HeavenlyChipsTarget: 1,
|
|
||||||
ShowMissedGC: 1,
|
|
||||||
Scale: 2,
|
|
||||||
ScaleDecimals: 2,
|
|
||||||
ScaleSeparator: 0,
|
|
||||||
ScaleCutoff: 999999,
|
|
||||||
Colors: {
|
|
||||||
Blue: '#4bb8f0',
|
|
||||||
Green: '#00ff00',
|
|
||||||
Yellow: '#ffff00',
|
|
||||||
Orange: '#ff7f00',
|
|
||||||
Red: '#ff0000',
|
|
||||||
Purple: '#ff00ff',
|
|
||||||
Gray: '#b3b3b3',
|
|
||||||
Pink: '#ff1493',
|
|
||||||
Brown: '#8b4513',
|
|
||||||
},
|
|
||||||
SortBuildings: 0,
|
|
||||||
SortUpgrades: 0,
|
|
||||||
GCTimer: 1,
|
|
||||||
Favicon: 1,
|
|
||||||
WrinklerButtons: 1,
|
|
||||||
HideSectionsButtons: 0,
|
|
||||||
BulkBuyBlock: 0,
|
|
||||||
Header: {
|
|
||||||
BarsColors: 1,
|
|
||||||
Calculation: 1,
|
|
||||||
Notification: 1,
|
|
||||||
NotificationGeneral: 1,
|
|
||||||
NotificationGC: 1,
|
|
||||||
NotificationFC: 1,
|
|
||||||
NotificationSea: 1,
|
|
||||||
NotificationGard: 1,
|
|
||||||
NotificationMagi: 1,
|
|
||||||
NotificationWrink: 1,
|
|
||||||
NotificationWrinkMax: 1,
|
|
||||||
Tooltip: 1,
|
|
||||||
Statistics: 1,
|
|
||||||
Notation: 1,
|
|
||||||
Miscellaneous: 1,
|
|
||||||
Lucky: 1,
|
|
||||||
Chain: 1,
|
|
||||||
Spells: 1,
|
|
||||||
Garden: 1,
|
|
||||||
Prestige: 1,
|
|
||||||
Wrink: 1,
|
|
||||||
Sea: 1,
|
|
||||||
Misc: 1,
|
|
||||||
InfoTab: 1,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ConfigDefault;
|
|
||||||
33
src/Data/headers.js
Normal file
33
src/Data/headers.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/** This includes all headers of Cookie Monster and their relevant data */
|
||||||
|
const headers = {
|
||||||
|
Favourite: 1,
|
||||||
|
Calculation: 1,
|
||||||
|
Notation: 1,
|
||||||
|
Colours: 1,
|
||||||
|
BarsDisplay: 1,
|
||||||
|
Tooltip: 1,
|
||||||
|
Statistics: 1,
|
||||||
|
Notification: 1,
|
||||||
|
NotificationGeneral: 1,
|
||||||
|
NotificationGC: 1,
|
||||||
|
NotificationFC: 1,
|
||||||
|
NotificationSea: 1,
|
||||||
|
NotificationGard: 1,
|
||||||
|
NotificationMagi: 1,
|
||||||
|
NotificationWrink: 1,
|
||||||
|
NotificationWrinkMax: 1,
|
||||||
|
Miscellaneous: 1,
|
||||||
|
Lucky: 1,
|
||||||
|
Chain: 1,
|
||||||
|
Spells: 1,
|
||||||
|
Garden: 1,
|
||||||
|
Prestige: 1,
|
||||||
|
Wrink: 1,
|
||||||
|
Sea: 1,
|
||||||
|
Achievs: 1,
|
||||||
|
Misc: 1,
|
||||||
|
infoMenu: 1,
|
||||||
|
optionsMenu: 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default headers;
|
||||||
958
src/Data/settings.js
Normal file
958
src/Data/settings.js
Normal file
@@ -0,0 +1,958 @@
|
|||||||
|
import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index';
|
||||||
|
|
||||||
|
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
||||||
|
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
||||||
|
import { SimDoSims } from '../Sim/VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
||||||
|
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
||||||
|
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
||||||
|
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons';
|
||||||
|
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
||||||
|
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
|
||||||
|
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||||
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
|
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
||||||
|
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||||
|
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||||
|
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
||||||
|
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
||||||
|
|
||||||
|
/** This includes all options of CookieMonster and their relevant data */
|
||||||
|
const settings = {
|
||||||
|
// Calculation
|
||||||
|
CPSMode: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Calculation',
|
||||||
|
['Current cookies per second', 'Average cookies per second'],
|
||||||
|
'Calculate times using current cookies per second or average cookies per second',
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
AvgCPSHist: new settingClasses.SettingStandard(
|
||||||
|
3,
|
||||||
|
'bool',
|
||||||
|
'Calculation',
|
||||||
|
[
|
||||||
|
'Average CPS in past 10s',
|
||||||
|
'Average CPS in past 15s',
|
||||||
|
'Average CPS in past 30s',
|
||||||
|
'Average CPS in past 1m',
|
||||||
|
'Average CPS in past 5m',
|
||||||
|
'Average CPS in past 10m',
|
||||||
|
'Average CPS in past 15m',
|
||||||
|
'Average CPS in past 30m',
|
||||||
|
],
|
||||||
|
'How much time average Cookies Per Second should consider',
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
AvgClicksHist: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Calculation',
|
||||||
|
[
|
||||||
|
'Average clicks in past 1s',
|
||||||
|
'Average clicks in past 5s',
|
||||||
|
'Average clicks in past 10s',
|
||||||
|
'Average clicks in past 15s',
|
||||||
|
'Average clicks in past 30s',
|
||||||
|
],
|
||||||
|
'How much time average Cookie Clicks should consider',
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
CalcWrink: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Calculation',
|
||||||
|
[
|
||||||
|
'Calculate with wrinklers OFF',
|
||||||
|
'Calculate with wrinklers ON',
|
||||||
|
'Calculate with single fattest wrinkler ON',
|
||||||
|
],
|
||||||
|
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
SimDoSims = true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
// Notation
|
||||||
|
Scale: new settingClasses.SettingStandardWithFunc(
|
||||||
|
2,
|
||||||
|
'bool',
|
||||||
|
'Notation',
|
||||||
|
[
|
||||||
|
"Game's setting scale",
|
||||||
|
'Metric',
|
||||||
|
'Short scale',
|
||||||
|
'Short scale (Abbreviated)',
|
||||||
|
'Scientific notation',
|
||||||
|
'Engineering notation',
|
||||||
|
],
|
||||||
|
'Change how long numbers are formatted',
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
RefreshScale();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ScaleDecimals: new settingClasses.SettingStandardWithFunc(
|
||||||
|
2,
|
||||||
|
'bool',
|
||||||
|
'Notation',
|
||||||
|
['1 decimals', '2 decimals', '3 decimals'],
|
||||||
|
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
RefreshScale();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ScaleSeparator: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Notation',
|
||||||
|
['. for decimals (standard)', '. for thousands'],
|
||||||
|
'Set the separator used for decimals and thousands',
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
RefreshScale();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ScaleCutoff: new settingClasses.SettingInputNumber(
|
||||||
|
999999,
|
||||||
|
'numscale',
|
||||||
|
'Notation',
|
||||||
|
'Notation cut-off point: ',
|
||||||
|
'The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations',
|
||||||
|
1,
|
||||||
|
999999999,
|
||||||
|
),
|
||||||
|
TimeFormat: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Notation',
|
||||||
|
['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'],
|
||||||
|
'Change the time format',
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
DetailedTime: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Notation',
|
||||||
|
['Detailed time OFF', 'Detailed time ON'],
|
||||||
|
'Change how time is displayed in certain statistics and tooltips',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
ToggleDetailedTime();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
PPDisplayTime: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Notation',
|
||||||
|
['PP as value (standard)', 'PP as time unit'],
|
||||||
|
'Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.',
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
|
||||||
|
// Colours
|
||||||
|
BuildColour: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Colours',
|
||||||
|
['Building colours OFF', 'Building colours ON'],
|
||||||
|
'Colour code buildings',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
UpdateBuildings();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
PPOnlyConsiderBuyable: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Colours',
|
||||||
|
["Don't ignore non-buyable", 'Ignore non-buyable'],
|
||||||
|
"Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
PPExcludeTop: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Colours',
|
||||||
|
[
|
||||||
|
"Don't ignore any",
|
||||||
|
'Ignore 1st best',
|
||||||
|
'Ignore 1st and 2nd best',
|
||||||
|
'Ignore 1st, 2nd and 3rd best',
|
||||||
|
],
|
||||||
|
'Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
PPRigidelMode: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Colours',
|
||||||
|
['Rigidel mode OFF', 'Rigidel mode ON'],
|
||||||
|
'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
PPSecondsLowerLimit: new settingClasses.SettingInputNumber(
|
||||||
|
0,
|
||||||
|
'numscale',
|
||||||
|
'Colours',
|
||||||
|
'Lower limit for PP (in seconds): ',
|
||||||
|
'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',
|
||||||
|
0,
|
||||||
|
Infinity,
|
||||||
|
),
|
||||||
|
ColourBlue: new settingClasses.SettingColours(
|
||||||
|
'#4bb8f0',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
|
||||||
|
),
|
||||||
|
ColourGreen: new settingClasses.SettingColours(
|
||||||
|
'#00ff00',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
|
||||||
|
),
|
||||||
|
ColourYellow: new settingClasses.SettingColours(
|
||||||
|
'#ffff00',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels',
|
||||||
|
),
|
||||||
|
ColourOrange: new settingClasses.SettingColours(
|
||||||
|
'#ff7f00',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
|
||||||
|
),
|
||||||
|
ColourRed: new settingClasses.SettingColours(
|
||||||
|
'#ff0000',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
|
||||||
|
),
|
||||||
|
ColourPurple: new settingClasses.SettingColours(
|
||||||
|
'#ff00ff',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels',
|
||||||
|
),
|
||||||
|
ColourGray: new settingClasses.SettingColours(
|
||||||
|
'#b3b3b3',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
||||||
|
),
|
||||||
|
ColourPink: new settingClasses.SettingColours(
|
||||||
|
'#ff1493',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is pink. Used for Dragonflight bar',
|
||||||
|
),
|
||||||
|
ColourBrown: new settingClasses.SettingColours(
|
||||||
|
'#8b4513',
|
||||||
|
'colour',
|
||||||
|
'Colours',
|
||||||
|
'Standard colour is brown. Used for Dragon Harvest bar',
|
||||||
|
),
|
||||||
|
|
||||||
|
// BarsDisplay
|
||||||
|
BotBar: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Bottom bar OFF', 'Bottom bar ON'],
|
||||||
|
'Building information',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
ToggleBotBar();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TimerBar: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Timer bar OFF', 'Timer bar ON'],
|
||||||
|
'Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
ToggleTimerBar();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TimerBarPos: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Timer bar position (top left)', 'Timer bar position (bottom)'],
|
||||||
|
'Placement of the timer bar',
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
ToggleTimerBarPos();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TimerBarOverlay: new settingClasses.SettingStandard(
|
||||||
|
2,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Timer bar overlay OFF', 'Timer bar overlay only seconds', 'Timer bar overlay full'],
|
||||||
|
'Overlay on timers displaying seconds and/or percentage left',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
AutosaveTimerBar: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Autosave timer bar OFF', 'Autosave timer bar ON'],
|
||||||
|
'Show a timer counting down till next autosave in the timer bar',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
UpBarColour: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Upgrade colours/bar OFF', 'Upgrade colours with bar ON', 'Upgrade colours without bar ON'],
|
||||||
|
'Colour code upgrades and optionally add a counter bar',
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
ToggleUpgradeBarAndColour();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
UpgradeBarFixedPos: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'],
|
||||||
|
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
ToggleUpgradeBarFixedPos();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SortBuildings: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
[
|
||||||
|
'Sort buildings: default',
|
||||||
|
'Sort buildings: PP of x1 purchase',
|
||||||
|
'Sort buildings: PP of selected bulk mode',
|
||||||
|
'Sort buildings: price until next achievement',
|
||||||
|
],
|
||||||
|
'Sort the display of buildings in default order, by PP, or until next achievement',
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
UpdateBuildings();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SortUpgrades: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Sort upgrades: default', 'Sort upgrades: PP'],
|
||||||
|
'Sort the display of upgrades in either default order or by PP',
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
UpdateUpgrades();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
UpgradesNeverCollapse: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Upgrades always expanded OFF', 'Upgrades always expanded ON'],
|
||||||
|
'Toggle to make the upgrades sections always expanded to the size needed to display all upgrades',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
UpdateUpgradeSectionsHeight();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
DragonAuraInfo: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Extra dragon aura info OFF', 'Extra dragon aura info ON'],
|
||||||
|
'Shows information about changes in CPS and costs in the dragon aura interface.',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
GrimoireBar: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Grimoire magic meter timer OFF', 'Grimoire magic meter timer ON'],
|
||||||
|
'A timer overlay showing how long till the Grimoire magic meter is full',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
GCTimer: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Golden cookie timer OFF', 'Golden cookie timer ON'],
|
||||||
|
'A timer on the golden cookie when it has been spawned',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
ToggleGCTimer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Favicon: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Favicon OFF', 'Favicon ON'],
|
||||||
|
'Update favicon with golden/wrath cookie',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
UpdateFavicon();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
WrinklerButtons: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
|
||||||
|
'Show buttons for popping wrinklers at bottom of cookie section',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
ToggleWrinklerButtons();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
HideSectionsButtons: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'],
|
||||||
|
'Show buttons for hiding and showing the buildings and upgrades sections in the right column',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
ToggleSectionHideButtons();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
// Tooltip
|
||||||
|
TooltipBuildUpgrade: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Building/upgrade tooltip information OFF', 'Building/upgrade tooltip information ON'],
|
||||||
|
'Extra information in building/upgrade tooltips',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
TooltipAmor: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
[
|
||||||
|
'Buildings tooltip amortization information OFF',
|
||||||
|
'Buildings tooltip amortization information ON',
|
||||||
|
],
|
||||||
|
'Add amortization information to buildings tooltip',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ToolWarnLucky: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Tooltip lucky warning OFF', 'Tooltip lucky warning ON'],
|
||||||
|
'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ToolWarnLuckyFrenzy: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Tooltip lucky frenzy warning OFF', 'Tooltip lucky frenzy warning ON'],
|
||||||
|
'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ToolWarnConjure: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Tooltip conjure warning OFF', 'Tooltip conjure warning ON'],
|
||||||
|
'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ToolWarnConjureFrenzy: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Tooltip conjure frenzy warning OFF', 'Tooltip conjure frenzy warning ON'],
|
||||||
|
'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ToolWarnEdifice: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Tooltip edifice warning OFF', 'Tooltip edifice warning ON'],
|
||||||
|
'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ToolWarnUser: new settingClasses.SettingInputNumber(
|
||||||
|
0,
|
||||||
|
'numscale',
|
||||||
|
'Tooltip',
|
||||||
|
'Tooltip warning at x times CPS: ',
|
||||||
|
'Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether',
|
||||||
|
0,
|
||||||
|
Infinity,
|
||||||
|
),
|
||||||
|
ToolWarnBon: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Calculate tooltip warning with bonus CPS OFF', 'Calculate tooltip warning with bonus CPS ON'],
|
||||||
|
'Calculate the warning with or without the bonus CPS you get from buying',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ToolWarnPos: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
|
||||||
|
'Placement of the warning boxes',
|
||||||
|
false,
|
||||||
|
() => {
|
||||||
|
ToggleToolWarnPos();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TooltipGrim: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Grimoire tooltip information OFF', 'Grimoire tooltip information ON'],
|
||||||
|
'Extra information in tooltip for grimoire',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
TooltipWrink: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Wrinkler tooltip OFF', 'Wrinkler tooltip ON'],
|
||||||
|
'Shows the amount of cookies a wrinkler will give when popping it',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
TooltipLump: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Sugar lump tooltip OFF', 'Sugar lump tooltip ON'],
|
||||||
|
'Shows the current Sugar Lump type in Sugar lump tooltip.',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
TooltipPlots: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Garden plots tooltip OFF', 'Garden plots tooltip ON'],
|
||||||
|
'Shows a tooltip for plants that have a cookie reward.',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
TooltipPantheon: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Pantheon tooltip OFF', 'Pantheon tooltip ON'],
|
||||||
|
'Shows additional info in the pantheon tooltip',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
TooltipAscendButton: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'],
|
||||||
|
'Shows additional info in the ascend tooltip',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
|
||||||
|
// Statistics
|
||||||
|
Stats: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Statistics',
|
||||||
|
['Statistics OFF', 'Statistics ON'],
|
||||||
|
'Extra Cookie Monster statistics!',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
MissingUpgrades: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Statistics',
|
||||||
|
['Missing upgrades OFF', 'Missing upgrades ON'],
|
||||||
|
'Shows missing upgrades in statistics menu',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
MissingAchievements: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'Statistics',
|
||||||
|
['Missing Achievements OFF', 'Missing Normal Achievements ON'],
|
||||||
|
'Shows missing normal achievements in statistics menu.',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
UpStats: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Statistics',
|
||||||
|
['Statistics update rate (default)', 'Statistics update rate (1s)'],
|
||||||
|
'Default rate is once every 5 seconds',
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
HeavenlyChipsTarget: new settingClasses.SettingInputNumber(
|
||||||
|
1,
|
||||||
|
'numscale',
|
||||||
|
'Statistics',
|
||||||
|
'Heavenly chips target: ',
|
||||||
|
'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections',
|
||||||
|
1,
|
||||||
|
Infinity,
|
||||||
|
),
|
||||||
|
ShowMissedGC: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Statistics',
|
||||||
|
['Missed GC OFF', 'Missed GC ON'],
|
||||||
|
'Show a stat in the statistics screen that counts how many golden cookies you have missed',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
|
||||||
|
// Notification
|
||||||
|
Title: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationGeneral',
|
||||||
|
['Title OFF', 'Title ON', 'Title pinned tab highlight'],
|
||||||
|
'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
GeneralSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationGeneral',
|
||||||
|
['Consider game volume setting OFF', 'Consider game volume setting ON'],
|
||||||
|
'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
GCNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'NotificationGC',
|
||||||
|
['Notification OFF', 'Notification ON'],
|
||||||
|
'Create a notification when golden cookie spawns',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.GCNotification,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
GCFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationGC',
|
||||||
|
['Flash OFF', 'Flash ON'],
|
||||||
|
'Flash screen on golden cookie',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ColourGCFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
|
'colour',
|
||||||
|
'NotificationGC',
|
||||||
|
'The colour of the GC flash, standard colour is white',
|
||||||
|
),
|
||||||
|
GCSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationGC',
|
||||||
|
['Sound OFF', 'Sound ON'],
|
||||||
|
'Play a sound on golden cookie',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
GCVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationGC', [], 'Volume'),
|
||||||
|
GCSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
|
||||||
|
'url',
|
||||||
|
'NotificationGC',
|
||||||
|
'Sound URL:',
|
||||||
|
'URL of the sound to be played when a golden cookie spawns',
|
||||||
|
),
|
||||||
|
FortuneNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'NotificationFC',
|
||||||
|
['Notification OFF', 'Notification ON'],
|
||||||
|
'Create a notification when fortune cookie is on the ticker',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.FortuneNotification,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
FortuneFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationFC',
|
||||||
|
['Flash OFF', 'Flash ON'],
|
||||||
|
'Flash screen on fortune cookie spawn',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ColourFortuneFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
|
'colour',
|
||||||
|
'NotificationFC',
|
||||||
|
'The colour of the fortune flash, standard colour is white',
|
||||||
|
),
|
||||||
|
FortuneSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationFC',
|
||||||
|
['Sound OFF', 'Sound ON'],
|
||||||
|
'Play a sound on fortune cookie spawn',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
FortuneVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationFC', [], 'Volume'),
|
||||||
|
FortuneSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
||||||
|
'url',
|
||||||
|
'NotificationFC',
|
||||||
|
'Sound URL:',
|
||||||
|
'URL of the sound to be played when the ticker has a fortune cookie',
|
||||||
|
),
|
||||||
|
SeaNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'NotificationSea',
|
||||||
|
['Notification OFF', 'Notification ON'],
|
||||||
|
'Create a notification on season popup',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SeaNotification,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SeaFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationSea',
|
||||||
|
['Flash OFF', 'Flash ON'],
|
||||||
|
'Flash screen on season popup',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ColourSeaFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
|
'colour',
|
||||||
|
'NotificationSea',
|
||||||
|
'The colour of the season popup flash, standard colour is white',
|
||||||
|
),
|
||||||
|
SeaSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationSea',
|
||||||
|
['Sound OFF', 'Sound ON'],
|
||||||
|
'Play a sound on season popup',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
SeaVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationSea', [], 'Volume'),
|
||||||
|
SeaSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
||||||
|
'url',
|
||||||
|
'NotificationSea',
|
||||||
|
'Sound URL:',
|
||||||
|
'URL of the sound to be played when on season popup spawns',
|
||||||
|
),
|
||||||
|
GardFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationGard',
|
||||||
|
['Garden Tick Flash OFF', 'Flash ON'],
|
||||||
|
'Flash screen on garden tick',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ColourGardFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
|
'colour',
|
||||||
|
'NotificationGard',
|
||||||
|
'The colour of the garden flash, standard colour is white',
|
||||||
|
),
|
||||||
|
GardSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationGard',
|
||||||
|
['Sound OFF', 'Sound ON'],
|
||||||
|
'Play a sound on garden tick',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
GardVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationGard', [], 'Volume'),
|
||||||
|
GardSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
|
||||||
|
'url',
|
||||||
|
'NotificationGard',
|
||||||
|
'Garden Tick Sound URL:',
|
||||||
|
'URL of the sound to be played when the garden ticks',
|
||||||
|
),
|
||||||
|
MagicNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'NotificationMagi',
|
||||||
|
['Notification OFF', 'Notification ON'],
|
||||||
|
'Create a notification when magic reaches maximum',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.MagicNotification,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
MagicFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationMagi',
|
||||||
|
['Flash OFF', 'Flash ON'],
|
||||||
|
'Flash screen when magic reaches maximum',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ColourMagicFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
|
'colour',
|
||||||
|
'NotificationMagi',
|
||||||
|
'The colour of the magic flash, standard colour is white',
|
||||||
|
),
|
||||||
|
MagicSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationMagi',
|
||||||
|
['Sound OFF', 'Sound ON'],
|
||||||
|
'Play a sound when magic reaches maximum',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
MagicVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationMagi', [], 'Volume'),
|
||||||
|
MagicSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
||||||
|
'url',
|
||||||
|
'NotificationMagi',
|
||||||
|
'Sound URL:',
|
||||||
|
'URL of the sound to be played when magic reaches maxium',
|
||||||
|
),
|
||||||
|
WrinklerNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'NotificationWrink',
|
||||||
|
['Notification OFF', 'Notification ON'],
|
||||||
|
'Create a notification when a wrinkler appears',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.WrinklerNotification,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
WrinklerFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationWrink',
|
||||||
|
['Flash OFF', 'Flash ON'],
|
||||||
|
'Flash screen when a wrinkler appears',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ColourWrinklerFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
|
'colour',
|
||||||
|
'NotificationWrink',
|
||||||
|
'The colour of the wrinkler flash, standard colour is white',
|
||||||
|
),
|
||||||
|
WrinklerSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationWrink',
|
||||||
|
['Sound OFF', 'Sound ON'],
|
||||||
|
'Play a sound when a wrinkler appears',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
WrinklerVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationWrink', [], 'Volume'),
|
||||||
|
WrinklerSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
||||||
|
'url',
|
||||||
|
'NotificationWrink',
|
||||||
|
'Sound URL:',
|
||||||
|
'URL of the sound to be played when a wrinkler appears',
|
||||||
|
),
|
||||||
|
WrinklerMaxNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
|
'bool',
|
||||||
|
'NotificationWrinkMax',
|
||||||
|
['Notification OFF', 'Notification ON'],
|
||||||
|
'Create a notification when the maximum amount of wrinklers has appeared',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.WrinklerMaxNotification,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
WrinklerMaxFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationWrinkMax',
|
||||||
|
['Flash OFF', 'Flash ON'],
|
||||||
|
'Flash screen when the maximum amount of Wrinklers has appeared',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
ColourWrinklerMaxFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
|
'colour',
|
||||||
|
'NotificationWrinkMax',
|
||||||
|
'The colour of the maximum wrinkler flash, standard colour is white',
|
||||||
|
),
|
||||||
|
WrinklerMaxSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'NotificationWrinkMax',
|
||||||
|
['Sound OFF', 'Sound ON'],
|
||||||
|
'Play a sound when the maximum amount of wrinklers has appeared',
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
WrinklerMaxVolume: new settingClasses.SettingVolume(
|
||||||
|
100,
|
||||||
|
'vol',
|
||||||
|
'NotificationWrinkMax',
|
||||||
|
[],
|
||||||
|
'Volume',
|
||||||
|
),
|
||||||
|
WrinklerMaxSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
||||||
|
'url',
|
||||||
|
'NotificationWrinkMax',
|
||||||
|
'Sound URL:',
|
||||||
|
'URL of the sound to be played when the maximum amount of wrinklers has appeared',
|
||||||
|
),
|
||||||
|
|
||||||
|
// Miscellaneous
|
||||||
|
BulkBuyBlock: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Miscellaneous',
|
||||||
|
['Block bulk buying OFF', 'Block bulk buying ON'],
|
||||||
|
"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
FavouriteSettings: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
|
'bool',
|
||||||
|
'Miscellaneous',
|
||||||
|
[
|
||||||
|
'Favourite settings section OFF',
|
||||||
|
'Favourite settings section ON',
|
||||||
|
'Favourite settings section ON (Locked)',
|
||||||
|
],
|
||||||
|
"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
Game.UpdateMenu();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
export default settings;
|
||||||
101
src/Disp/BeautifyAndFormatting/Beautify.js
Normal file
101
src/Disp/BeautifyAndFormatting/Beautify.js
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/** General functions to format or beautify strings */
|
||||||
|
|
||||||
|
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts';
|
||||||
|
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns formats number based on the Scale setting
|
||||||
|
* @param {number} num Number to be beautified
|
||||||
|
* @param {any} floats Used in some scenario's by CM.Backup.Beautify (Game's original function)
|
||||||
|
* @param {number} forced Used to force (type 3) in certains cases
|
||||||
|
* @returns {string} Formatted number
|
||||||
|
*/
|
||||||
|
export default function Beautify(num, floats, forced) {
|
||||||
|
const decimals =
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ScaleDecimals + 1;
|
||||||
|
if (num === Infinity) {
|
||||||
|
return 'Infinity';
|
||||||
|
}
|
||||||
|
if (typeof num === 'undefined') {
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 0) {
|
||||||
|
return BackupFunctions.Beautify(num, floats);
|
||||||
|
}
|
||||||
|
if (Number.isFinite(num)) {
|
||||||
|
if (num < 0) {
|
||||||
|
return `-${Beautify(Math.abs(num))}`;
|
||||||
|
}
|
||||||
|
let answer = '';
|
||||||
|
if (num === 0) {
|
||||||
|
return num.toString();
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
num > 0.001 &&
|
||||||
|
num < Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ScaleCutoff
|
||||||
|
) {
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ScaleSeparator)
|
||||||
|
answer = num.toLocaleString('nl');
|
||||||
|
else answer = num.toLocaleString('en');
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 4 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 4
|
||||||
|
) {
|
||||||
|
// Scientific notation, 123456789 => 1.235E+8
|
||||||
|
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
||||||
|
} else {
|
||||||
|
const exponential = num.toExponential().toString();
|
||||||
|
const AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf('e') + 1) / 3);
|
||||||
|
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(decimals);
|
||||||
|
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
||||||
|
if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 1 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 1
|
||||||
|
) {
|
||||||
|
// Metric scale, 123456789 => 123.457 M
|
||||||
|
if (num >= 0.01 && num < Number(`1e${metric.length * 3}`)) {
|
||||||
|
answer += ` ${metric[AmountOfTenPowerThree]}`;
|
||||||
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
|
} else if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 2 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 2
|
||||||
|
) {
|
||||||
|
// Short scale, 123456789 => 123.457 M
|
||||||
|
if (num >= 0.01 && num < Number(`1e${shortScale.length * 3}`)) {
|
||||||
|
answer += ` ${shortScale[AmountOfTenPowerThree]}`;
|
||||||
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
|
} else if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 3 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 3
|
||||||
|
) {
|
||||||
|
// Short scale, 123456789 => 123.457 M
|
||||||
|
if (num >= 0.01 && num < Number(`1e${shortScaleAbbreviated.length * 3}`)) {
|
||||||
|
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
||||||
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
|
} else if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 5 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 5
|
||||||
|
) {
|
||||||
|
// Engineering notation, 123456789 => 123.457E+6
|
||||||
|
answer += `E${AmountOfTenPowerThree * 3}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (answer === '') {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
||||||
|
answer = BackupFunctions.Beautify(num, floats);
|
||||||
|
}
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ScaleSeparator)
|
||||||
|
answer = answer.replace('.', ',');
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
||||||
|
return BackupFunctions.Beautify(num, floats);
|
||||||
|
}
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
/* eslint-disable no-nested-ternary */
|
|
||||||
/** General functions to format or beautify strings */
|
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales';
|
|
||||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
|
||||||
import {
|
|
||||||
ColorGreen,
|
|
||||||
ColorOrange,
|
|
||||||
ColorRed,
|
|
||||||
ColorYellow,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns formats number based on the Scale setting
|
|
||||||
* @param {number} num Number to be beautified
|
|
||||||
* @param {any} floats Used in some scenario's by CM.Backup.Beautify (Game's original function)
|
|
||||||
* @param {number} forced Used to force (type 3) in certains cases
|
|
||||||
* @returns {string} Formatted number
|
|
||||||
*/
|
|
||||||
export function Beautify(num, floats, forced) {
|
|
||||||
const decimals = CMOptions.ScaleDecimals + 1;
|
|
||||||
if (num === Infinity) {
|
|
||||||
return 'Infinity';
|
|
||||||
}
|
|
||||||
if (typeof num === 'undefined') {
|
|
||||||
return '0';
|
|
||||||
}
|
|
||||||
if (CMOptions.Scale === 0) {
|
|
||||||
return BackupFunctions.Beautify(num, floats);
|
|
||||||
}
|
|
||||||
if (Number.isFinite(num)) {
|
|
||||||
let answer = '';
|
|
||||||
if (num === 0) {
|
|
||||||
return num.toString();
|
|
||||||
}
|
|
||||||
if (num > 0.001 && num < CMOptions.ScaleCutoff) {
|
|
||||||
if (CMOptions.ScaleSeparator) answer = num.toLocaleString('nl');
|
|
||||||
else answer = num.toLocaleString('en');
|
|
||||||
return answer;
|
|
||||||
}
|
|
||||||
if ((CMOptions.Scale === 4 && !forced) || forced === 4) {
|
|
||||||
// Scientific notation, 123456789 => 1.235E+8
|
|
||||||
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
|
||||||
} else {
|
|
||||||
const exponential = num.toExponential().toString();
|
|
||||||
const AmountOfTenPowerThree = Math.floor(
|
|
||||||
exponential.slice(exponential.indexOf('e') + 1) / 3,
|
|
||||||
);
|
|
||||||
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(
|
|
||||||
decimals,
|
|
||||||
);
|
|
||||||
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
|
||||||
if ((CMOptions.Scale === 1 && !forced) || forced === 1) {
|
|
||||||
// Metric scale, 123456789 => 123.457 M
|
|
||||||
if (num >= 0.01 && num < Number(`1e${metric.length * 3}`)) {
|
|
||||||
answer += ` ${metric[AmountOfTenPowerThree]}`;
|
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
|
||||||
} else if ((CMOptions.Scale === 2 && !forced) || forced === 2) {
|
|
||||||
// Short scale, 123456789 => 123.457 M
|
|
||||||
if (num >= 0.01 && num < Number(`1e${shortScale.length * 3}`)) {
|
|
||||||
answer += ` ${shortScale[AmountOfTenPowerThree]}`;
|
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
|
||||||
} else if ((CMOptions.Scale === 3 && !forced) || forced === 3) {
|
|
||||||
// Short scale, 123456789 => 123.457 M
|
|
||||||
if (
|
|
||||||
num >= 0.01 &&
|
|
||||||
num < Number(`1e${shortScaleAbbreviated.length * 3}`)
|
|
||||||
) {
|
|
||||||
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
|
||||||
} else if ((CMOptions.Scale === 5 && !forced) || forced === 5) {
|
|
||||||
// Engineering notation, 123456789 => 123.457E+6
|
|
||||||
answer += `E${AmountOfTenPowerThree * 3}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (answer === '') {
|
|
||||||
console.log(
|
|
||||||
`Could not beautify number with Cookie Monster Beautify: ${num}`,
|
|
||||||
);
|
|
||||||
answer = BackupFunctions.Beautify(num, floats);
|
|
||||||
}
|
|
||||||
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
|
||||||
return answer;
|
|
||||||
}
|
|
||||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
|
||||||
return BackupFunctions.Beautify(num, floats);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns time as a string depending on TimeFormat setting
|
|
||||||
* @param {number} time Time to be formatted
|
|
||||||
* @param {number} longFormat 1 or 0
|
|
||||||
* @returns {string} Formatted time
|
|
||||||
*/
|
|
||||||
export function FormatTime(time, longFormat) {
|
|
||||||
let formattedTime = time;
|
|
||||||
if (time === Infinity) return time;
|
|
||||||
if (time < 0) return 'Negative time period';
|
|
||||||
formattedTime = Math.ceil(time);
|
|
||||||
const y = Math.floor(formattedTime / 31557600);
|
|
||||||
const d = Math.floor((formattedTime % 31557600) / 86400);
|
|
||||||
const h = Math.floor((formattedTime % 86400) / 3600);
|
|
||||||
const m = Math.floor((formattedTime % 3600) / 60);
|
|
||||||
const s = Math.floor(formattedTime % 60);
|
|
||||||
let str = '';
|
|
||||||
if (CMOptions.TimeFormat) {
|
|
||||||
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
|
||||||
str += `${(y < 10 ? '0' : '') + y}:`;
|
|
||||||
str += `${(d < 10 ? '0' : '') + d}:`;
|
|
||||||
str += `${(h < 10 ? '0' : '') + h}:`;
|
|
||||||
str += `${(m < 10 ? '0' : '') + m}:`;
|
|
||||||
str += (s < 10 ? '0' : '') + s;
|
|
||||||
} else {
|
|
||||||
if (formattedTime > 777600000)
|
|
||||||
return longFormat ? 'Over 9000 days!' : '>9000d';
|
|
||||||
str +=
|
|
||||||
y > 0
|
|
||||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `
|
|
||||||
: '';
|
|
||||||
str +=
|
|
||||||
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : '';
|
|
||||||
if (str.length > 0 || h > 0)
|
|
||||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
|
|
||||||
if (str.length > 0 || m > 0)
|
|
||||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
|
|
||||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the color to be used for time-strings
|
|
||||||
* @param {number} time Time to be coloured
|
|
||||||
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
|
||||||
*/
|
|
||||||
export function GetTimeColor(time) {
|
|
||||||
let color;
|
|
||||||
let text;
|
|
||||||
if (time <= 0) {
|
|
||||||
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
|
||||||
else text = 'Done!';
|
|
||||||
color = ColorGreen;
|
|
||||||
} else {
|
|
||||||
text = FormatTime(time);
|
|
||||||
if (time > 300) color = ColorRed;
|
|
||||||
else if (time > 60) color = ColorOrange;
|
|
||||||
else color = ColorYellow;
|
|
||||||
}
|
|
||||||
return { text, color };
|
|
||||||
}
|
|
||||||
40
src/Disp/BeautifyAndFormatting/FormatTime.js
Normal file
40
src/Disp/BeautifyAndFormatting/FormatTime.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* This function returns time as a string depending on TimeFormat setting
|
||||||
|
* @param {number} time Time to be formatted
|
||||||
|
* @param {number} longFormat 1 or 0
|
||||||
|
* @returns {string} Formatted time
|
||||||
|
*/
|
||||||
|
export default function FormatTime(time, longFormat) {
|
||||||
|
let formattedTime = time;
|
||||||
|
if (time === Infinity) return time;
|
||||||
|
if (time < 0) return 'Negative time period';
|
||||||
|
formattedTime = Math.ceil(time);
|
||||||
|
const y = Math.floor(formattedTime / 31536000);
|
||||||
|
const d = Math.floor((formattedTime % 31536000) / 86400);
|
||||||
|
const h = Math.floor(((formattedTime % 31536000) % 86400) / 3600);
|
||||||
|
const m = Math.floor((((formattedTime % 31536000) % 86400) % 3600) / 60);
|
||||||
|
const s = Math.floor((((formattedTime % 31536000) % 86400) % 3600) % 60);
|
||||||
|
let str = '';
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat) {
|
||||||
|
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
||||||
|
str += `${(y < 10 ? '0' : '') + y}:`;
|
||||||
|
str += `${(d < 10 ? '0' : '') + d}:`;
|
||||||
|
str += `${(h < 10 ? '0' : '') + h}:`;
|
||||||
|
str += `${(m < 10 ? '0' : '') + m}:`;
|
||||||
|
str += (s < 10 ? '0' : '') + s;
|
||||||
|
} else {
|
||||||
|
if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||||
|
str +=
|
||||||
|
y > 0
|
||||||
|
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
|
||||||
|
: '';
|
||||||
|
if (str.length > 0 || d > 0)
|
||||||
|
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
if (str.length > 0 || h > 0)
|
||||||
|
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
if (str.length > 0 || m > 0)
|
||||||
|
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
24
src/Disp/BeautifyAndFormatting/GetTimeColour.js
Normal file
24
src/Disp/BeautifyAndFormatting/GetTimeColour.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData';
|
||||||
|
import FormatTime from './FormatTime';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns the colour to be used for time-strings
|
||||||
|
* @param {number} time Time to be coloured
|
||||||
|
* @returns {{string, string}} {text, colour} Both the formatted time and colour as strings in an array
|
||||||
|
*/
|
||||||
|
export default function GetTimeColour(time) {
|
||||||
|
let colour;
|
||||||
|
let text;
|
||||||
|
if (time <= 0) {
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat)
|
||||||
|
text = '00:00:00:00:00';
|
||||||
|
else text = 'Done!';
|
||||||
|
colour = ColourGreen;
|
||||||
|
} else {
|
||||||
|
text = FormatTime(time);
|
||||||
|
if (time > 300) colour = ColourRed;
|
||||||
|
else if (time > 60) colour = ColourOrange;
|
||||||
|
else colour = ColourYellow;
|
||||||
|
}
|
||||||
|
return { text, colour };
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
/* eslint-disable no-nested-ternary */
|
|
||||||
import {
|
import {
|
||||||
|
CacheMinPPBulk,
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
import { 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 +15,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;
|
||||||
@@ -29,12 +29,21 @@ export default function UpdateBuildings() {
|
|||||||
else if (target === 10) target = CacheObjects10;
|
else if (target === 10) target = CacheObjects10;
|
||||||
else if (target === 100) target = CacheObjects100;
|
else if (target === 100) target = CacheObjects100;
|
||||||
|
|
||||||
|
// Remove colour if applied
|
||||||
|
l(`storeBulk1`).style.removeProperty('color');
|
||||||
|
l(`storeBulk10`).style.removeProperty('color');
|
||||||
|
l(`storeBulk100`).style.removeProperty('color');
|
||||||
|
|
||||||
if (Game.buyMode === 1) {
|
if (Game.buyMode === 1) {
|
||||||
if (CMOptions.BuildColor === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.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];
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||||
|
`Colour${target[i].colour}`
|
||||||
|
];
|
||||||
});
|
});
|
||||||
|
l(`storeBulk${CacheMinPPBulk}`).style.color =
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ColourGreen;
|
||||||
} else {
|
} else {
|
||||||
Object.keys(Game.Objects).forEach((i) => {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
l(`productPrice${Game.Objects[i].id}`).style.removeProperty('color');
|
l(`productPrice${Game.Objects[i].id}`).style.removeProperty('color');
|
||||||
@@ -58,60 +67,79 @@ export default function UpdateBuildings() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build array of pointers, sort by pp, use array index (+2) as the grid row number
|
// Build array of pointers and sort according to the user's configured sort option.
|
||||||
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
// This regulates sorting of buildings.
|
||||||
// This regulates sorting of buildings
|
|
||||||
if (Game.buyMode === 1 && CMOptions.SortBuildings) {
|
|
||||||
let arr;
|
let arr;
|
||||||
if (CMOptions.SortBuildings === 1) {
|
if (
|
||||||
|
Game.buyMode !== 1 ||
|
||||||
|
!Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings
|
||||||
|
) {
|
||||||
arr = Object.keys(CacheObjects1).map((k) => {
|
arr = Object.keys(CacheObjects1).map((k) => {
|
||||||
const o = CacheObjects1[k];
|
const o = {};
|
||||||
o.name = k;
|
|
||||||
o.id = Game.Objects[k].id;
|
|
||||||
return o;
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
|
||||||
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
|
||||||
? 1
|
|
||||||
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
|
||||||
? -1
|
|
||||||
: a.pp < b.pp
|
|
||||||
? -1
|
|
||||||
: 0;
|
|
||||||
});
|
|
||||||
} else if (CMOptions.SortBuildings === 2) {
|
|
||||||
arr = Object.keys(target).map((k) => {
|
|
||||||
const o = target[k];
|
|
||||||
o.name = k;
|
|
||||||
o.id = Game.Objects[k].id;
|
|
||||||
return o;
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
|
||||||
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
|
||||||
? 1
|
|
||||||
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
|
||||||
? -1
|
|
||||||
: a.pp < b.pp
|
|
||||||
? -1
|
|
||||||
: 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let x = 0; x < arr.length; x++) {
|
|
||||||
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const arr = Object.keys(CacheObjects1).map((k) => {
|
|
||||||
const o = CacheObjects1[k];
|
|
||||||
o.name = k;
|
o.name = k;
|
||||||
o.id = Game.Objects[k].id;
|
o.id = Game.Objects[k].id;
|
||||||
return o;
|
return o;
|
||||||
});
|
});
|
||||||
|
// Sort using default order.
|
||||||
arr.sort((a, b) => a.id - b.id);
|
arr.sort((a, b) => a.id - b.id);
|
||||||
|
} else if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 1
|
||||||
|
) {
|
||||||
|
arr = Object.keys(CacheObjects1).map((k) => {
|
||||||
|
const o = {};
|
||||||
|
o.name = k;
|
||||||
|
o.pp = CacheObjects1[k].pp;
|
||||||
|
o.colour = CacheObjects1[k].colour;
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
// Sort by pp colour group, then by pp.
|
||||||
|
arr.sort((a, b) =>
|
||||||
|
ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
|
||||||
|
? a.pp - b.pp
|
||||||
|
: ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
|
||||||
|
);
|
||||||
|
} else if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 2
|
||||||
|
) {
|
||||||
|
arr = Object.keys(target).map((k) => {
|
||||||
|
const o = {};
|
||||||
|
o.name = k;
|
||||||
|
o.pp = target[k].pp;
|
||||||
|
o.colour = target[k].colour;
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
// Sort by pp colour group, then by pp.
|
||||||
|
arr.sort((a, b) =>
|
||||||
|
ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
|
||||||
|
? a.pp - b.pp
|
||||||
|
: ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
|
||||||
|
);
|
||||||
|
} else if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 3
|
||||||
|
) {
|
||||||
|
arr = Object.keys(CacheObjectsNextAchievement).map((k) => {
|
||||||
|
const o = {};
|
||||||
|
o.name = k;
|
||||||
|
o.id = Game.Objects[k].id;
|
||||||
|
o.amountUntilNext = CacheObjectsNextAchievement[k].AmountNeeded;
|
||||||
|
o.priceUntilNext = CacheObjectsNextAchievement[k].price;
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
// First, sort using default order.
|
||||||
|
arr.sort((a, b) => a.id - b.id);
|
||||||
|
// Sort by price until next achievement.
|
||||||
|
// Buildings that aren't within 100 of an achievement are placed at the end, still in
|
||||||
|
// default order relative to each other because sort() is guaranteed stable.
|
||||||
|
arr.sort(
|
||||||
|
(a, b) =>
|
||||||
|
(a.amountUntilNext !== 101 ? a.priceUntilNext : Infinity) -
|
||||||
|
(b.amountUntilNext !== 101 ? b.priceUntilNext : Infinity),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use array index (+2) as the grid row number.
|
||||||
|
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
||||||
for (let x = 0; x < arr.length; x++) {
|
for (let x = 0; x < arr.length; x++) {
|
||||||
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
28
src/Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js
Normal file
28
src/Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* This function toggles the upgrade to be always expanded
|
||||||
|
* It is called by a change in CM.Options.ToolWarnPos
|
||||||
|
* and upon creation of the warning tooltip by CM.Disp.UpdateTooltipWarnings()
|
||||||
|
*/
|
||||||
|
export default function UpdateUpgradeSectionsHeight() {
|
||||||
|
Object.values(document.getElementsByClassName('storeSection')).forEach((section) => {
|
||||||
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpgradesNeverCollapse ||
|
||||||
|
section.id === 'products'
|
||||||
|
) {
|
||||||
|
section.style.height = 'auto'; // eslint-disable-line no-param-reassign
|
||||||
|
} else if (section.id === 'vaultUpgrades') {
|
||||||
|
section.style.height = ''; // eslint-disable-line no-param-reassign
|
||||||
|
section.style.minHeight = '0px'; // eslint-disable-line no-param-reassign
|
||||||
|
} else if (section.id === 'upgrades') {
|
||||||
|
section.style.height = ''; // eslint-disable-line no-param-reassign
|
||||||
|
if (section.className.includes('hasMenu')) {
|
||||||
|
section.style.minHeight = '82px'; // eslint-disable-line no-param-reassign
|
||||||
|
} else {
|
||||||
|
section.style.minHeight = '60px'; // eslint-disable-line no-param-reassign
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
section.style.height = ''; // eslint-disable-line no-param-reassign
|
||||||
|
section.style.minHeight = '60px'; // eslint-disable-line no-param-reassign
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,11 +24,11 @@ function CreateUpgradeBarLegend() {
|
|||||||
title.textContent = 'Legend';
|
title.textContent = 'Legend';
|
||||||
legend.appendChild(title);
|
legend.appendChild(title);
|
||||||
|
|
||||||
const legendLine = function (color, text) {
|
const legendLine = function (colour, text) {
|
||||||
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 + colour;
|
||||||
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,13 @@ function CreateUpgradeBarLegend() {
|
|||||||
return div;
|
return div;
|
||||||
};
|
};
|
||||||
|
|
||||||
legend.appendChild(legendLine(ColorBlue, 'Better than best PP building'));
|
legend.appendChild(legendLine(ColourBlue, 'Better than the best PP of a building option'));
|
||||||
legend.appendChild(legendLine(ColorGreen, 'Same as best PP building'));
|
legend.appendChild(legendLine(ColourGreen, 'Same as the best PP building option'));
|
||||||
legend.appendChild(
|
legend.appendChild(legendLine(ColourYellow, 'Within the top 10 of PP for buildings'));
|
||||||
legendLine(
|
legend.appendChild(legendLine(ColourOrange, 'Within the top 20 of PP for buildings'));
|
||||||
ColorYellow,
|
legend.appendChild(legendLine(ColourRed, 'Within the top 30 of PP for buildings'));
|
||||||
'Between best and worst PP buildings closer to best',
|
legend.appendChild(legendLine(ColourPurple, 'Outside of the top 30 of PP for buildings'));
|
||||||
),
|
legend.appendChild(legendLine(ColourGray, 'Negative or infinity PP'));
|
||||||
);
|
|
||||||
legend.appendChild(
|
|
||||||
legendLine(
|
|
||||||
ColorOrange,
|
|
||||||
'Between best and worst PP buildings closer to worst',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
legend.appendChild(legendLine(ColorRed, 'Same as worst PP building'));
|
|
||||||
legend.appendChild(legendLine(ColorPurple, 'Worse than worst PP building'));
|
|
||||||
legend.appendChild(legendLine(ColorGray, 'Negative or infinity PP'));
|
|
||||||
return legend;
|
return legend;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,25 +70,22 @@ export default function CreateUpgradeBar() {
|
|||||||
Game.tooltip.draw(this, escape(placeholder.innerHTML), 'store');
|
Game.tooltip.draw(this, escape(placeholder.innerHTML), 'store');
|
||||||
};
|
};
|
||||||
|
|
||||||
const upgradeNumber = function (id, color) {
|
const upgradeNumber = function (id, colour) {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.id = id;
|
span.id = id;
|
||||||
span.className = ColorTextPre + color;
|
span.className = ColourTextPre + colour;
|
||||||
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, l('upgrades').parentNode.childNodes[3]);
|
||||||
UpgradeBar,
|
|
||||||
l('upgrades').parentNode.childNodes[3],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,25 @@
|
|||||||
/* eslint-disable no-nested-ternary */
|
|
||||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
import { CacheUpgrades } from '../../Cache/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 (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour > 0) {
|
||||||
let blue = 0;
|
let blue = 0;
|
||||||
let green = 0;
|
let green = 0;
|
||||||
let yellow = 0;
|
let yellow = 0;
|
||||||
@@ -32,31 +30,28 @@ 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(ColourBackPre) !== -1) {
|
||||||
l(`upgrade${i}`).childNodes[j].className.indexOf(ColorBackPre) !== -1
|
l(`upgrade${i}`).childNodes[j].className = ColourBackPre + CacheUpgrades[me.name].colour;
|
||||||
) {
|
addedColour = true;
|
||||||
l(`upgrade${i}`).childNodes[j].className =
|
|
||||||
ColorBackPre + CacheUpgrades[me.name].color;
|
|
||||||
addedColor = 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].colour;
|
||||||
l(`upgrade${i}`).appendChild(div);
|
l(`upgrade${i}`).appendChild(div);
|
||||||
}
|
}
|
||||||
if (CacheUpgrades[me.name].color === ColorBlue) blue += 1;
|
if (CacheUpgrades[me.name].colour === ColourBlue) blue += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorGreen) green += 1;
|
else if (CacheUpgrades[me.name].colour === ColourGreen) green += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorYellow) yellow += 1;
|
else if (CacheUpgrades[me.name].colour === ColourYellow) yellow += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorOrange) orange += 1;
|
else if (CacheUpgrades[me.name].colour === ColourOrange) orange += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorRed) red += 1;
|
else if (CacheUpgrades[me.name].colour === ColourRed) red += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorPurple) purple += 1;
|
else if (CacheUpgrades[me.name].colour === ColourPurple) purple += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorGray) gray += 1;
|
else if (CacheUpgrades[me.name].colour === ColourGray) gray += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
l('CMUpgradeBarBlue').textContent = blue;
|
l('CMUpgradeBarBlue').textContent = blue;
|
||||||
@@ -76,19 +71,17 @@ export default function UpdateUpgrades() {
|
|||||||
o.name = Game.UpgradesInStore[x].name;
|
o.name = Game.UpgradesInStore[x].name;
|
||||||
o.price = Game.UpgradesInStore[x].basePrice;
|
o.price = Game.UpgradesInStore[x].basePrice;
|
||||||
o.pp = CacheUpgrades[o.name].pp;
|
o.pp = CacheUpgrades[o.name].pp;
|
||||||
|
o.colour = CacheUpgrades[o.name].colour;
|
||||||
arr.push(o);
|
arr.push(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CMOptions.SortUpgrades) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortUpgrades) {
|
||||||
arr.sort(function (a, b) {
|
// Sort by pp colour group, then by pp.
|
||||||
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
arr.sort((a, b) =>
|
||||||
? 1
|
ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
|
||||||
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
? a.pp - b.pp
|
||||||
? -1
|
: ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
|
||||||
: a.pp < b.pp
|
);
|
||||||
? -1
|
|
||||||
: 0;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
arr.sort((a, b) => a.price - b.price);
|
arr.sort((a, b) => a.price - b.price);
|
||||||
}
|
}
|
||||||
@@ -97,7 +90,6 @@ export default function UpdateUpgrades() {
|
|||||||
return arr2.findIndex((e) => e.name === upgrade.name);
|
return arr2.findIndex((e) => e.name === upgrade.name);
|
||||||
};
|
};
|
||||||
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
||||||
l(`upgrade${x}`).style.order =
|
l(`upgrade${x}`).style.order = nameChecker(arr, Game.UpgradesInStore[x]) + 1;
|
||||||
nameChecker(arr, Game.UpgradesInStore[x]) + 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,29 +2,25 @@
|
|||||||
|
|
||||||
import CacheDragonCost from '../../Cache/Dragon/Dragon';
|
import CacheDragonCost from '../../Cache/Dragon/Dragon';
|
||||||
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
||||||
import {
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
||||||
* @param {number} aura The number of the aura currently selected by the mouse/user
|
* @param {number} aura The number of the aura currently selected by the mouse/user
|
||||||
*/
|
*/
|
||||||
export function AddAuraInfo(aura) {
|
export function AddAuraInfo(aura) {
|
||||||
if (CMOptions.DragonAuraInfo === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.DragonAuraInfo === 1) {
|
||||||
const [bonusCPS, priceOfChange] = CalculateChangeAura(aura);
|
const [bonusCPS, priceOfChange] = CalculateChangeAura(aura);
|
||||||
const timeToRecover = FormatTime(
|
const timeToRecover = FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs));
|
||||||
priceOfChange / (bonusCPS + Game.cookiesPs),
|
let bonusCPSPercentage;
|
||||||
);
|
if (Game.cookiesPs === 0) bonusCPSPercentage = Beautify(Infinity);
|
||||||
const bonusCPSPercentage = Beautify(bonusCPS / Game.cookiesPs);
|
else 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';
|
||||||
l('dragonAuraInfo').appendChild(document.createElement('div')).className =
|
l('dragonAuraInfo').appendChild(document.createElement('div')).className = 'line';
|
||||||
'line';
|
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.style.minWidth = '200px';
|
div.style.minWidth = '200px';
|
||||||
div.style.textAlign = 'center';
|
div.style.textAlign = 'center';
|
||||||
|
|||||||
@@ -1,40 +1,36 @@
|
|||||||
import { CMOptions } from '../Config/VariablesAndData';
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
import { Beautify } from './BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from './BeautifyAndFormatting/Beautify';
|
||||||
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
||||||
|
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||||
import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
||||||
import { UpdateBotBar } from './InfoBars/BottomBar';
|
import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||||
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
||||||
import RefreshMenu from './MenuSections/Refreshmenu';
|
import RefreshMenu from './MenuSections/Refreshmenu';
|
||||||
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
||||||
import {
|
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips';
|
||||||
CheckWrinklerTooltip,
|
|
||||||
UpdateWrinklerTooltip,
|
|
||||||
} from './Tooltips/WrinklerTooltips';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 &&
|
||||||
Game.drawT % 10 === 0 && // with autosave ON and every 10 ticks
|
Game.drawT % 10 === 0 && // with autosave ON and every 10 ticks
|
||||||
Game.onMenu === 'stats' &&
|
Game.onMenu === 'stats' &&
|
||||||
CMOptions.Stats // while being on the stats menu only
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Stats // while being on the stats menu only
|
||||||
) {
|
) {
|
||||||
const timer = document.getElementById('CMStatsAutosaveTimer');
|
const timer = document.getElementById('CMStatsAutosaveTimer');
|
||||||
if (timer) {
|
if (timer) {
|
||||||
timer.innerText = Game.sayTime(
|
timer.innerText = Game.sayTime(Game.fps * 60 - (Game.T % (Game.fps * 60)), 4);
|
||||||
Game.fps * 60 - (Game.T % (Game.fps * 60)),
|
|
||||||
4,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update colors
|
// Update colours
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
|
UpdateUpgradeSectionsHeight();
|
||||||
|
|
||||||
// Redraw timers
|
// Redraw timers
|
||||||
UpdateTimerBar();
|
UpdateTimerBar();
|
||||||
@@ -52,11 +48,13 @@ 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...
|
||||||
let str = l('cookies').innerHTML.replace(
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale && !Game.OnAscend) {
|
||||||
/.*(?=<br>)/i,
|
let str = l('cookies').innerHTML.replace(/.*(?=<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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
/* 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 { GCTimers } from '../VariablesAndData';
|
import { GCTimers } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,21 +19,21 @@ export default function CreateGCTimer(cookie) {
|
|||||||
GCTimer.style.fontSize = '35px';
|
GCTimer.style.fontSize = '35px';
|
||||||
GCTimer.style.cursor = 'pointer';
|
GCTimer.style.cursor = 'pointer';
|
||||||
GCTimer.style.display = 'block';
|
GCTimer.style.display = 'block';
|
||||||
if (CMOptions.GCTimer === 0) GCTimer.style.display = 'none';
|
GCTimer.style.pointerEvents = 'none';
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.GCTimer === 0)
|
||||||
|
GCTimer.style.display = 'none';
|
||||||
GCTimer.style.left = cookie.l.style.left;
|
GCTimer.style.left = cookie.l.style.left;
|
||||||
GCTimer.style.top = cookie.l.style.top;
|
GCTimer.style.top = cookie.l.style.top;
|
||||||
GCTimer.onclick = function () {
|
GCTimer.onclick = function () {
|
||||||
cookie.pop();
|
cookie.pop();
|
||||||
};
|
};
|
||||||
GCTimer.onmouseover = function () {
|
GCTimer.onmouseover = function () {
|
||||||
cookie.l.style.filter =
|
cookie.l.style.filter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; // eslint-disable-line no-param-reassign
|
||||||
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
cookie.l.style.webkitFilter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; // eslint-disable-line no-param-reassign
|
||||||
cookie.l.style.webkitFilter =
|
|
||||||
'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;
|
||||||
|
|||||||
@@ -5,11 +5,7 @@
|
|||||||
* @param {number} targetMagic The target magic level
|
* @param {number} targetMagic The target magic level
|
||||||
* @returns {number} count / Game.fps The time it takes to reach targetMagic
|
* @returns {number} count / Game.fps The time it takes to reach targetMagic
|
||||||
*/
|
*/
|
||||||
export default function CalculateGrimoireRefillTime(
|
export default function CalculateGrimoireRefillTime(currentMagic, maxMagic, targetMagic) {
|
||||||
currentMagic,
|
|
||||||
maxMagic,
|
|
||||||
targetMagic,
|
|
||||||
) {
|
|
||||||
let magic = currentMagic;
|
let magic = currentMagic;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
while (magic < targetMagic) {
|
while (magic < targetMagic) {
|
||||||
|
|||||||
@@ -4,27 +4,24 @@ import {
|
|||||||
CacheCurrWrinklerCPSMult,
|
CacheCurrWrinklerCPSMult,
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns the cps as either current or average CPS depending on CM.Options.CPSMode
|
* This function returns the cps as either current or average CPS depending on CM.Options.CPSMode
|
||||||
* @returns {number} The average or current cps
|
* @returns {number} The average or current cps
|
||||||
*/
|
*/
|
||||||
export default function GetCPS() {
|
export default function GetCPS() {
|
||||||
if (CMOptions.CPSMode) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CPSMode) {
|
||||||
return CacheAverageCPS;
|
return CacheAverageCPS;
|
||||||
}
|
}
|
||||||
if (CMOptions.CalcWrink === 0) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 0) {
|
||||||
return Game.cookiesPs * (1 - Game.cpsSucked);
|
return Game.cookiesPs * (1 - Game.cpsSucked);
|
||||||
}
|
}
|
||||||
if (CMOptions.CalcWrink === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 1) {
|
||||||
return (
|
return Game.cookiesPs * (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05));
|
||||||
Game.cookiesPs *
|
|
||||||
(CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
if (CacheWrinklersFattest[1] !== null)
|
||||||
if (
|
if (
|
||||||
CMOptions.CalcWrink === 2 &&
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 2 &&
|
||||||
Game.wrinklers[CacheWrinklersFattest[1]].type === 1
|
Game.wrinklers[CacheWrinklersFattest[1]].type === 1
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
@@ -35,7 +32,6 @@ export default function GetCPS() {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
Game.cookiesPs *
|
Game.cookiesPs *
|
||||||
(CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount +
|
(CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount + (1 - CacheCurrWrinklerCount * 0.05))
|
||||||
(1 - CacheCurrWrinklerCount * 0.05))
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
import {
|
|
||||||
ColorGray,
|
|
||||||
ColorGreen,
|
|
||||||
ColorOrange,
|
|
||||||
ColorPurple,
|
|
||||||
ColorRed,
|
|
||||||
ColorYellow,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns Name and Color as object for sugar lump type that is given as input param.
|
|
||||||
* It is called by CM.Disp.UpdateTooltipSugarLump()
|
|
||||||
* @param {string} type Sugar Lump Type.
|
|
||||||
* @returns {{string}, {string}} text, color An array containing the text and display-color of the sugar lump
|
|
||||||
*/
|
|
||||||
export default function GetLumpColor(type) {
|
|
||||||
if (type === 0) {
|
|
||||||
return { text: 'Normal', color: ColorGray };
|
|
||||||
}
|
|
||||||
if (type === 1) {
|
|
||||||
return { text: 'Bifurcated', color: ColorGreen };
|
|
||||||
}
|
|
||||||
if (type === 2) {
|
|
||||||
return { text: 'Golden', color: ColorYellow };
|
|
||||||
}
|
|
||||||
if (type === 3) {
|
|
||||||
return { text: 'Meaty', color: ColorOrange };
|
|
||||||
}
|
|
||||||
if (type === 4) {
|
|
||||||
return { text: 'Caramelized', color: ColorPurple };
|
|
||||||
}
|
|
||||||
return { text: 'Unknown Sugar Lump', color: ColorRed };
|
|
||||||
}
|
|
||||||
33
src/Disp/HelperFunctions/GetLumpColour.js
Normal file
33
src/Disp/HelperFunctions/GetLumpColour.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import {
|
||||||
|
ColourGray,
|
||||||
|
ColourGreen,
|
||||||
|
ColourOrange,
|
||||||
|
ColourPurple,
|
||||||
|
ColourRed,
|
||||||
|
ColourYellow,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns Name and Colour as object for sugar lump type that is given as input param.
|
||||||
|
* It is called by CM.Disp.UpdateTooltipSugarLump()
|
||||||
|
* @param {string} type Sugar Lump Type.
|
||||||
|
* @returns {{string}, {string}} text, colour An array containing the text and display-colour of the sugar lump
|
||||||
|
*/
|
||||||
|
export default function GetLumpColour(type) {
|
||||||
|
if (type === 0) {
|
||||||
|
return { text: 'Normal', colour: ColourGray };
|
||||||
|
}
|
||||||
|
if (type === 1) {
|
||||||
|
return { text: 'Bifurcated', colour: ColourGreen };
|
||||||
|
}
|
||||||
|
if (type === 2) {
|
||||||
|
return { text: 'Golden', colour: ColourYellow };
|
||||||
|
}
|
||||||
|
if (type === 3) {
|
||||||
|
return { text: 'Meaty', colour: ColourOrange };
|
||||||
|
}
|
||||||
|
if (type === 4) {
|
||||||
|
return { text: 'Caramelized', colour: ColourPurple };
|
||||||
|
}
|
||||||
|
return { text: 'Unknown Sugar Lump', colour: ColourRed };
|
||||||
|
}
|
||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData';
|
||||||
CacheWrinklersFattest,
|
|
||||||
CacheWrinklersTotal,
|
|
||||||
} from '../../Cache/VariablesAndData';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns the total amount stored in the Wrinkler Bank
|
* This function returns the total amount stored in the Wrinkler Bank
|
||||||
@@ -10,10 +6,10 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinklersTotal)
|
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinklersTotal)
|
||||||
*/
|
*/
|
||||||
export default function GetWrinkConfigBank() {
|
export default function GetWrinkConfigBank() {
|
||||||
if (CMOptions.CalcWrink === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 1) {
|
||||||
return CacheWrinklersTotal;
|
return CacheWrinklersTotal;
|
||||||
}
|
}
|
||||||
if (CMOptions.CalcWrink === 2) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 2) {
|
||||||
return CacheWrinklersFattest[0];
|
return CacheWrinklersFattest[0];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ToggleTimerBar } from '../../Config/SpecificToggles';
|
import { ToggleTimerBar } from '../../Config/SpecificToggles';
|
||||||
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar';
|
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import UpdateBackground from './UpdateBackground';
|
import UpdateBackground from './UpdateBackground';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,8 +10,10 @@ import UpdateBackground from './UpdateBackground';
|
|||||||
export default function UpdateAscendState() {
|
export default function UpdateAscendState() {
|
||||||
if (Game.OnAscend) {
|
if (Game.OnAscend) {
|
||||||
l('game').style.bottom = '0px';
|
l('game').style.bottom = '0px';
|
||||||
if (CMOptions.BotBar === 1) l('CMBotBar').style.display = 'none';
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar === 1)
|
||||||
if (CMOptions.TimerBar === 1) l('CMTimerBar').style.display = 'none';
|
l('CMBotBar').style.display = 'none';
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBar === 1)
|
||||||
|
l('CMTimerBar').style.display = 'none';
|
||||||
} else {
|
} else {
|
||||||
ToggleBotBar();
|
ToggleBotBar();
|
||||||
ToggleTimerBar();
|
ToggleTimerBar();
|
||||||
|
|||||||
@@ -5,10 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
export default function UpdateBackground() {
|
export default function UpdateBackground() {
|
||||||
Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth;
|
Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth;
|
||||||
Game.Background.canvas.height =
|
Game.Background.canvas.height = Game.Background.canvas.parentNode.offsetHeight;
|
||||||
Game.Background.canvas.parentNode.offsetHeight;
|
Game.LeftBackground.canvas.width = Game.LeftBackground.canvas.parentNode.offsetWidth;
|
||||||
Game.LeftBackground.canvas.width =
|
Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight;
|
||||||
Game.LeftBackground.canvas.parentNode.offsetWidth;
|
Game.DrawBackground();
|
||||||
Game.LeftBackground.canvas.height =
|
|
||||||
Game.LeftBackground.canvas.parentNode.offsetHeight;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
|
||||||
38
src/Disp/HelperFunctions/UpdateColours.js
Normal file
38
src/Disp/HelperFunctions/UpdateColours.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
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: ${
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||||
|
`Colour${ColoursOrdering[i]}`
|
||||||
|
]
|
||||||
|
}; }\n`;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
|
str += `.${ColourBackPre}${ColoursOrdering[i]} { background-color: ${
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||||
|
`Colour${ColoursOrdering[i]}`
|
||||||
|
]
|
||||||
|
}; }\n`;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
|
str += `.${ColourBorderPre}${ColoursOrdering[i]} { border: 1px solid ${
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||||
|
`Colour${ColoursOrdering[i]}`
|
||||||
|
]
|
||||||
|
}; }\n`;
|
||||||
|
}
|
||||||
|
l('CMCSS').textContent = str;
|
||||||
|
UpdateBuildings(); // Class has been already set
|
||||||
|
}
|
||||||
@@ -1,25 +1,14 @@
|
|||||||
/** Functions related to the Bottom Bar */
|
/** Functions related to the Bottom Bar */
|
||||||
|
|
||||||
import {
|
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
||||||
CacheObjects1,
|
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
|
||||||
CacheObjects10,
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
CacheObjects100,
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
} from '../../Cache/VariablesAndData';
|
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
|
||||||
import {
|
|
||||||
Beautify,
|
|
||||||
FormatTime,
|
|
||||||
GetTimeColor,
|
|
||||||
} 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 { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData';
|
||||||
ColorBlue,
|
|
||||||
ColorTextPre,
|
|
||||||
ColorYellow,
|
|
||||||
LastTargetBotBar,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,8 +25,7 @@ export function CreateBotBar() {
|
|||||||
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';
|
||||||
BotBar.style.textShadow =
|
BotBar.style.textShadow = '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black';
|
||||||
'-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black';
|
|
||||||
|
|
||||||
const table = BotBar.appendChild(document.createElement('table'));
|
const table = BotBar.appendChild(document.createElement('table'));
|
||||||
table.style.width = '100%';
|
table.style.width = '100%';
|
||||||
@@ -45,22 +33,22 @@ export function CreateBotBar() {
|
|||||||
table.style.whiteSpace = 'nowrap';
|
table.style.whiteSpace = 'nowrap';
|
||||||
const tbody = table.appendChild(document.createElement('tbody'));
|
const tbody = table.appendChild(document.createElement('tbody'));
|
||||||
|
|
||||||
const firstCol = function (text, color) {
|
const firstCol = function (text, colour) {
|
||||||
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 + colour;
|
||||||
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);
|
||||||
|
|
||||||
@@ -73,7 +61,11 @@ export function CreateBotBar() {
|
|||||||
* This function updates the bonus-, pp-, and time-rows in the the bottom bar
|
* This function updates the bonus-, pp-, and time-rows in the the bottom bar
|
||||||
*/
|
*/
|
||||||
export function UpdateBotBar() {
|
export function UpdateBotBar() {
|
||||||
if (CMOptions.BotBar === 1 && CacheObjects1 && Game.buyMode === 1) {
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar === 1 &&
|
||||||
|
CacheObjects1 &&
|
||||||
|
Game.buyMode === 1
|
||||||
|
) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
Object.keys(CacheObjects1).forEach((i) => {
|
Object.keys(CacheObjects1).forEach((i) => {
|
||||||
let target = Game.buyBulk;
|
let target = Game.buyBulk;
|
||||||
@@ -89,37 +81,29 @@ export function UpdateBotBar() {
|
|||||||
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[
|
||||||
count
|
count
|
||||||
].childNodes[1].textContent = Game.Objects[i].amount;
|
].childNodes[1].textContent = Game.Objects[i].amount;
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[count].textContent = Beautify(
|
||||||
count
|
target[i].bonus,
|
||||||
].textContent = Beautify(target[i].bonus, 2);
|
2,
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
);
|
||||||
count
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className =
|
||||||
].className = ColorTextPre + target[i].color;
|
ColourTextPre + target[i].colour;
|
||||||
let PPString;
|
let PPString;
|
||||||
if (CMOptions.PPDisplayTime)
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPDisplayTime)
|
||||||
PPString = FormatTime(Math.round(target[i].pp));
|
PPString = FormatTime(Math.round(target[i].pp));
|
||||||
else PPString = Beautify(Math.round(target[i].pp), 2);
|
else PPString = Beautify(Math.round(target[i].pp), 2);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].textContent = PPString;
|
||||||
count
|
const timeColour = GetTimeColour(
|
||||||
].textContent = PPString;
|
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
const timeColor = GetTimeColor(
|
|
||||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
|
||||||
GetCPS(),
|
|
||||||
);
|
);
|
||||||
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className =
|
||||||
|
ColourTextPre + timeColour.colour;
|
||||||
|
if (timeColour.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) {
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
count
|
count
|
||||||
].className = ColorTextPre + timeColor.color;
|
].textContent = `${timeColour.text} (with Wrink)`;
|
||||||
if (
|
|
||||||
timeColor.text === 'Done!' &&
|
|
||||||
Game.cookies < Game.Objects[i].bulkPrice
|
|
||||||
) {
|
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
|
||||||
count
|
|
||||||
].textContent = `${timeColor.text} (with Wrink)`;
|
|
||||||
} else
|
} else
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent =
|
||||||
count
|
timeColour.text;
|
||||||
].textContent = timeColor.text;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/** 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
|
||||||
* @param {string} id An id to identify the timer
|
* @param {string} id An id to identify the timer
|
||||||
* @param {string} name The title of the timer
|
* @param {string} name The title of the timer
|
||||||
* @param [{{string}, {string}}, ...] bars ([id, color]) The id and colours of individual parts of the timer
|
* @param [{{string}, {string}}, ...] bars ([id, colour]) The id and colours of individual parts of the timer
|
||||||
*/
|
*/
|
||||||
export function CreateTimer(id, name, bars) {
|
export function CreateTimer(id, name, bars) {
|
||||||
const timerBar = document.createElement('div');
|
const timerBar = document.createElement('div');
|
||||||
@@ -36,20 +36,20 @@ export function CreateTimer(id, name, bars) {
|
|||||||
div.appendChild(type);
|
div.appendChild(type);
|
||||||
|
|
||||||
for (let i = 0; i < bars.length; i++) {
|
for (let i = 0; i < bars.length; i++) {
|
||||||
const colorBar = document.createElement('span');
|
const colourBar = document.createElement('span');
|
||||||
colorBar.id = bars[i].id;
|
colourBar.id = bars[i].id;
|
||||||
colorBar.style.display = 'inline-block';
|
colourBar.style.display = 'inline-block';
|
||||||
colorBar.style.height = '10px';
|
colourBar.style.height = '10px';
|
||||||
colorBar.style.verticalAlign = 'text-top';
|
colourBar.style.verticalAlign = 'text-top';
|
||||||
colorBar.style.textAlign = 'center';
|
colourBar.style.textAlign = 'center';
|
||||||
if (bars.length - 1 === i) {
|
if (bars.length - 1 === i) {
|
||||||
colorBar.style.borderTopRightRadius = '10px';
|
colourBar.style.borderTopRightRadius = '10px';
|
||||||
colorBar.style.borderBottomRightRadius = '10px';
|
colourBar.style.borderBottomRightRadius = '10px';
|
||||||
}
|
}
|
||||||
if (typeof bars[i].color !== 'undefined') {
|
if (typeof bars[i].colour !== 'undefined') {
|
||||||
colorBar.className = ColorBackPre + bars[i].color;
|
colourBar.className = ColourBackPre + bars[i].colour;
|
||||||
}
|
}
|
||||||
div.appendChild(colorBar);
|
div.appendChild(colourBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
const timer = document.createElement('span');
|
const timer = document.createElement('span');
|
||||||
@@ -77,13 +77,11 @@ export function CreateBotBarBuildingColumn(buildingName) {
|
|||||||
const i = buildingName;
|
const i = buildingName;
|
||||||
const header = type.appendChild(document.createElement('td'));
|
const header = type.appendChild(document.createElement('td'));
|
||||||
header.appendChild(
|
header.appendChild(
|
||||||
document.createTextNode(
|
document.createTextNode(`${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`),
|
||||||
`${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
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';
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
/** Functions related to the Timer Bar */
|
/** Functions related to the Timer Bar */
|
||||||
|
|
||||||
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
|
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
|
||||||
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';
|
||||||
@@ -25,17 +24,23 @@ export function CreateTimerBar() {
|
|||||||
TimerBar.style.fontWeight = 'bold';
|
TimerBar.style.fontWeight = 'bold';
|
||||||
TimerBar.style.backgroundColor = 'black';
|
TimerBar.style.backgroundColor = 'black';
|
||||||
|
|
||||||
|
// Create standard Autosave bar
|
||||||
|
const CMTimerBarAutosave = CreateTimer('CMTimerBarAutosave', 'Autosave', [
|
||||||
|
{ id: 'CMTimerBarAutosaveBar', colour: ColourPurple },
|
||||||
|
]);
|
||||||
|
TimerBar.appendChild(CMTimerBarAutosave);
|
||||||
|
|
||||||
// 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', colour: ColourGray },
|
||||||
{ id: 'CMTimerBarGCBar', color: ColorPurple },
|
{ id: 'CMTimerBarGCBar', colour: 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', colour: ColourGray },
|
||||||
{ id: 'CMTimerBarRenBar', color: ColorOrange },
|
{ id: 'CMTimerBarRenBar', colour: ColourOrange },
|
||||||
]);
|
]);
|
||||||
TimerBar.appendChild(CMTimerBarRen);
|
TimerBar.appendChild(CMTimerBarRen);
|
||||||
const TimerBarBuffTimers = document.createElement('div');
|
const TimerBarBuffTimers = document.createElement('div');
|
||||||
@@ -49,36 +54,48 @@ export function CreateTimerBar() {
|
|||||||
* This function updates indivudual timers in the timer bar
|
* This function updates indivudual timers in the timer bar
|
||||||
*/
|
*/
|
||||||
export function UpdateTimerBar() {
|
export function UpdateTimerBar() {
|
||||||
if (CMOptions.TimerBar === 1) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBar === 1) {
|
||||||
// label width: 113, timer width: 30, div margin: 20
|
// label width: 113, timer width: 30, div margin: 20
|
||||||
const maxWidthTwoBar = l('CMTimerBar').offsetWidth - 163;
|
const maxWidthTwoBar = l('CMTimerBar').offsetWidth - 163;
|
||||||
// label width: 113, div margin: 20, calculate timer width at runtime
|
// label width: 113, div margin: 20, calculate timer width at runtime
|
||||||
const maxWidthOneBar = l('CMTimerBar').offsetWidth - 133;
|
const maxWidthOneBar = l('CMTimerBar').offsetWidth - 133;
|
||||||
let numberOfTimers = 0;
|
let numberOfTimers = 0;
|
||||||
|
|
||||||
// Regulates visibility of Golden Cookie timer
|
|
||||||
if (
|
if (
|
||||||
Game.shimmerTypes.golden.spawned === 0 &&
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AutosaveTimerBar &&
|
||||||
!Game.Has('Golden switch [off]')
|
Game.prefs.autosave
|
||||||
) {
|
) {
|
||||||
|
const timeTillNextAutosave =
|
||||||
|
(Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60))) / Game.fps;
|
||||||
|
l('CMTimerBarAutosave').style.display = '';
|
||||||
|
l('CMTimerBarAutosaveBar').style.width = `${Math.round(
|
||||||
|
(timeTillNextAutosave *
|
||||||
|
(maxWidthOneBar - Math.ceil(timeTillNextAutosave).toString().length * 8)) /
|
||||||
|
60,
|
||||||
|
)}px`;
|
||||||
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarOverlay >= 1
|
||||||
|
) {
|
||||||
|
l('CMTimerBarAutosaveBar').textContent = Math.ceil(timeTillNextAutosave);
|
||||||
|
} else l('CMTimerBarAutosaveBar').textContent = '';
|
||||||
|
l('CMTimerBarAutosaveTime').textContent = Math.ceil(timeTillNextAutosave);
|
||||||
|
numberOfTimers += 1;
|
||||||
|
} else l('CMTimerBarAutosave').style.display = 'none';
|
||||||
|
|
||||||
|
// Regulates visibility of Golden Cookie timer
|
||||||
|
if (Game.shimmerTypes.golden.spawned === 0 && !Game.Has('Golden switch [off]')) {
|
||||||
l('CMTimerBarGC').style.display = '';
|
l('CMTimerBarGC').style.display = '';
|
||||||
l('CMTimerBarGCMinBar').style.width = `${Math.round(
|
l('CMTimerBarGCMinBar').style.width = `${Math.round(
|
||||||
(Math.max(
|
(Math.max(0, Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) *
|
||||||
0,
|
|
||||||
Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time,
|
|
||||||
) *
|
|
||||||
maxWidthTwoBar) /
|
maxWidthTwoBar) /
|
||||||
Game.shimmerTypes.golden.maxTime,
|
Game.shimmerTypes.golden.maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
if (CMOptions.TimerBarOverlay >= 1)
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarOverlay >= 1)
|
||||||
l('CMTimerBarGCMinBar').textContent = Math.ceil(
|
l('CMTimerBarGCMinBar').textContent = Math.ceil(
|
||||||
(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) /
|
(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||||
Game.fps,
|
|
||||||
);
|
);
|
||||||
else l('CMTimerBarGCMinBar').textContent = '';
|
else l('CMTimerBarGCMinBar').textContent = '';
|
||||||
if (
|
if (Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime) {
|
||||||
Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime
|
|
||||||
) {
|
|
||||||
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px';
|
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px';
|
||||||
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px';
|
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px';
|
||||||
} else {
|
} else {
|
||||||
@@ -93,7 +110,7 @@ export function UpdateTimerBar() {
|
|||||||
maxWidthTwoBar) /
|
maxWidthTwoBar) /
|
||||||
Game.shimmerTypes.golden.maxTime,
|
Game.shimmerTypes.golden.maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
if (CMOptions.TimerBarOverlay >= 1)
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarOverlay >= 1)
|
||||||
l('CMTimerBarGCBar').textContent = Math.ceil(
|
l('CMTimerBarGCBar').textContent = Math.ceil(
|
||||||
Math.min(
|
Math.min(
|
||||||
Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime,
|
Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime,
|
||||||
@@ -101,57 +118,60 @@ export function UpdateTimerBar() {
|
|||||||
) / Game.fps,
|
) / Game.fps,
|
||||||
);
|
);
|
||||||
else l('CMTimerBarGCBar').textContent = '';
|
else l('CMTimerBarGCBar').textContent = '';
|
||||||
l('CMTimerBarGCTime').textContent = Math.ceil(
|
const chanceToSpawn =
|
||||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) /
|
Math.max(
|
||||||
Game.fps,
|
0,
|
||||||
);
|
(Game.shimmerTypes.golden.time - Game.shimmerTypes.golden.minTime) /
|
||||||
|
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime),
|
||||||
|
) ** 5;
|
||||||
|
l('CMTimerBarGCTime').textContent = `${Math.ceil(
|
||||||
|
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||||
|
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
|
||||||
|
style: 'percent',
|
||||||
|
})}`;
|
||||||
numberOfTimers += 1;
|
numberOfTimers += 1;
|
||||||
} else l('CMTimerBarGC').style.display = 'none';
|
} else l('CMTimerBarGC').style.display = 'none';
|
||||||
|
|
||||||
// Regulates visibility of Reindeer timer
|
// Regulates visibility of Reindeer timer
|
||||||
if (
|
if (Game.season === 'christmas' && Game.shimmerTypes.reindeer.spawned === 0) {
|
||||||
Game.season === 'christmas' &&
|
|
||||||
Game.shimmerTypes.reindeer.spawned === 0
|
|
||||||
) {
|
|
||||||
l('CMTimerBarRen').style.display = '';
|
l('CMTimerBarRen').style.display = '';
|
||||||
l('CMTimerBarRenMinBar').style.width = `${Math.round(
|
l('CMTimerBarRenMinBar').style.width = `${Math.round(
|
||||||
(Math.max(
|
(Math.max(0, Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) *
|
||||||
0,
|
|
||||||
Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time,
|
|
||||||
) *
|
|
||||||
maxWidthTwoBar) /
|
maxWidthTwoBar) /
|
||||||
Game.shimmerTypes.reindeer.maxTime,
|
Game.shimmerTypes.reindeer.maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
if (CMOptions.TimerBarOverlay >= 1)
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarOverlay >= 1)
|
||||||
l('CMTimerBarRenMinBar').textContent = Math.ceil(
|
l('CMTimerBarRenMinBar').textContent = Math.ceil(
|
||||||
(Game.shimmerTypes.reindeer.minTime -
|
(Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||||
Game.shimmerTypes.reindeer.time) /
|
|
||||||
Game.fps,
|
|
||||||
);
|
);
|
||||||
else l('CMTimerBarRenMinBar').textContent = '';
|
else l('CMTimerBarRenMinBar').textContent = '';
|
||||||
l('CMTimerBarRenBar').style.width = `${Math.round(
|
l('CMTimerBarRenBar').style.width = `${Math.round(
|
||||||
(Math.min(
|
(Math.min(
|
||||||
Game.shimmerTypes.reindeer.maxTime -
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime,
|
||||||
Game.shimmerTypes.reindeer.minTime,
|
|
||||||
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time,
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time,
|
||||||
) *
|
) *
|
||||||
maxWidthTwoBar) /
|
maxWidthTwoBar) /
|
||||||
Game.shimmerTypes.reindeer.maxTime,
|
Game.shimmerTypes.reindeer.maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
if (CMOptions.TimerBarOverlay >= 1)
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarOverlay >= 1)
|
||||||
l('CMTimerBarRenBar').textContent = Math.ceil(
|
l('CMTimerBarRenBar').textContent = Math.ceil(
|
||||||
Math.min(
|
Math.min(
|
||||||
Game.shimmerTypes.reindeer.maxTime -
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime,
|
||||||
Game.shimmerTypes.reindeer.minTime,
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time,
|
||||||
Game.shimmerTypes.reindeer.maxTime -
|
|
||||||
Game.shimmerTypes.reindeer.time,
|
|
||||||
) / Game.fps,
|
) / Game.fps,
|
||||||
);
|
);
|
||||||
else l('CMTimerBarRenBar').textContent = '';
|
else l('CMTimerBarRenBar').textContent = '';
|
||||||
l('CMTimerBarRenTime').textContent = Math.ceil(
|
const chanceToSpawn =
|
||||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) /
|
Math.max(
|
||||||
Game.fps,
|
0,
|
||||||
);
|
(Game.shimmerTypes.reindeer.time - Game.shimmerTypes.reindeer.minTime) /
|
||||||
|
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime),
|
||||||
|
) ** 5;
|
||||||
|
l('CMTimerBarRenTime').textContent = `${Math.ceil(
|
||||||
|
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||||
|
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
|
||||||
|
style: 'percent',
|
||||||
|
})}`;
|
||||||
numberOfTimers += 1;
|
numberOfTimers += 1;
|
||||||
} else {
|
} else {
|
||||||
l('CMTimerBarRen').style.display = 'none';
|
l('CMTimerBarRen').style.display = 'none';
|
||||||
@@ -166,27 +186,26 @@ 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 colours
|
||||||
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 (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarOverlay === 2
|
||||||
|
)
|
||||||
timer.lastChild.children[1].textContent = `${Math.round(
|
timer.lastChild.children[1].textContent = `${Math.round(
|
||||||
100 * (Game.buffs[i].time / Game.buffs[i].maxTime),
|
100 * (Game.buffs[i].time / Game.buffs[i].maxTime),
|
||||||
)}%`;
|
)}%`;
|
||||||
else timer.lastChild.children[1].textContent = '';
|
else timer.lastChild.children[1].textContent = '';
|
||||||
timer.lastChild.children[1].style.width = `${Math.round(
|
timer.lastChild.children[1].style.width = `${Math.round(
|
||||||
(Game.buffs[i].time *
|
(Game.buffs[i].time *
|
||||||
(maxWidthOneBar -
|
(maxWidthOneBar - Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8)) /
|
||||||
Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8)) /
|
|
||||||
Game.buffs[i].maxTime,
|
Game.buffs[i].maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
timer.lastChild.children[2].textContent = Math.ceil(
|
timer.lastChild.children[2].textContent = Math.ceil(Game.buffs[i].time / Game.fps);
|
||||||
Game.buffs[i].time / Game.fps,
|
|
||||||
);
|
|
||||||
numberOfTimers += 1;
|
numberOfTimers += 1;
|
||||||
BuffTimerBars[Game.buffs[i].name] = timer;
|
BuffTimerBars[Game.buffs[i].name] = timer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,9 @@ export default function CreateSectionHideButtons() {
|
|||||||
l('vaultUpgrades').style.display = 'none';
|
l('vaultUpgrades').style.display = 'none';
|
||||||
} else {
|
} else {
|
||||||
l('upgrades').style.display = 'flex';
|
l('upgrades').style.display = 'flex';
|
||||||
if (l('toggleUpgrades').children.length !== 0)
|
if (l('toggleUpgrades').children.length !== 0) l('toggleUpgrades').style.display = 'block';
|
||||||
l('toggleUpgrades').style.display = 'block';
|
if (l('techUpgrades').children.length !== 0) l('techUpgrades').style.display = 'block';
|
||||||
if (l('techUpgrades').children.length !== 0)
|
if (l('vaultUpgrades').children.length !== 0) l('vaultUpgrades').style.display = 'block';
|
||||||
l('techUpgrades').style.display = 'block';
|
|
||||||
if (l('vaultUpgrades').children.length !== 0)
|
|
||||||
l('vaultUpgrades').style.display = 'block';
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
a.textContent = 'Hide/Show Upgrades';
|
a.textContent = 'Hide/Show Upgrades';
|
||||||
@@ -28,8 +25,7 @@ export default function CreateSectionHideButtons() {
|
|||||||
const b = document.createElement('a');
|
const b = document.createElement('a');
|
||||||
b.className = 'option';
|
b.className = 'option';
|
||||||
b.onclick = function () {
|
b.onclick = function () {
|
||||||
if (l('products').style.display === 'grid')
|
if (l('products').style.display === 'grid') l('products').style.display = 'none';
|
||||||
l('products').style.display = 'none';
|
|
||||||
else l('products').style.display = 'grid';
|
else l('products').style.display = 'grid';
|
||||||
};
|
};
|
||||||
b.textContent = 'Hide/Show Buildings';
|
b.textContent = 'Hide/Show Buildings';
|
||||||
|
|||||||
@@ -18,13 +18,7 @@ export default function CreateWrinklerButtons() {
|
|||||||
};
|
};
|
||||||
popAllA.onmouseover = function () {
|
popAllA.onmouseover = function () {
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopAllNormal'), 'this');
|
||||||
this,
|
|
||||||
function () {
|
|
||||||
return CreateTooltip('wb', 'PopAll');
|
|
||||||
},
|
|
||||||
'this',
|
|
||||||
);
|
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
};
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popAllA);
|
l('sectionLeftExtra').children[0].append(popAllA);
|
||||||
@@ -33,21 +27,14 @@ export default function CreateWrinklerButtons() {
|
|||||||
popFattestA.textContent = 'Pop Single Fattest';
|
popFattestA.textContent = 'Pop Single Fattest';
|
||||||
popFattestA.className = 'option';
|
popFattestA.className = 'option';
|
||||||
popFattestA.onclick = function () {
|
popFattestA.onclick = function () {
|
||||||
if (CacheWrinklersFattest[1] !== null)
|
if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
||||||
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
|
||||||
};
|
};
|
||||||
popFattestA.onmouseout = function () {
|
popFattestA.onmouseout = function () {
|
||||||
Game.tooltip.shouldHide = 1;
|
Game.tooltip.shouldHide = 1;
|
||||||
};
|
};
|
||||||
popFattestA.onmouseover = function () {
|
popFattestA.onmouseover = function () {
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopFattest'), 'this');
|
||||||
this,
|
|
||||||
function () {
|
|
||||||
return CreateTooltip('wb', 'PopFattest');
|
|
||||||
},
|
|
||||||
'this',
|
|
||||||
);
|
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
};
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popFattestA);
|
l('sectionLeftExtra').children[0].append(popFattestA);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* This function creates a white square over the full screen and appends it to l('wrapper')
|
* This function creates a white square over the full screen and appends it to l('wrapper')
|
||||||
*/
|
*/
|
||||||
export default function CreateWhiteScreen() {
|
export default function CreateFlashScreen() {
|
||||||
const WhiteScreen = document.createElement('div');
|
const WhiteScreen = document.createElement('div');
|
||||||
WhiteScreen.id = 'CMWhiteScreen';
|
WhiteScreen.id = 'CMFlashScreen';
|
||||||
WhiteScreen.style.width = '100%';
|
WhiteScreen.style.width = '100%';
|
||||||
WhiteScreen.style.height = '100%';
|
WhiteScreen.style.height = '100%';
|
||||||
WhiteScreen.style.backgroundColor = 'white';
|
WhiteScreen.style.backgroundColor = 'white';
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import AddMenuStats from './Statistics/AddStatsPage';
|
||||||
import AddMenuStats from './AddStatsPage';
|
|
||||||
import AddMenuInfo from './InfoPage';
|
|
||||||
import AddMenuPref from './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
|
||||||
@@ -10,16 +7,10 @@ export default function AddMenu() {
|
|||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.className = 'title';
|
title.className = 'title';
|
||||||
|
|
||||||
if (Game.onMenu === 'prefs') {
|
if (Game.onMenu === 'stats') {
|
||||||
title.textContent = 'Cookie Monster Settings';
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Stats) {
|
||||||
AddMenuPref(title);
|
|
||||||
} else if (Game.onMenu === 'stats') {
|
|
||||||
if (CMOptions.Stats) {
|
|
||||||
title.textContent = 'Cookie Monster Statistics';
|
title.textContent = 'Cookie Monster Statistics';
|
||||||
AddMenuStats(title);
|
AddMenuStats(title);
|
||||||
}
|
}
|
||||||
} else if (Game.onMenu === 'log') {
|
|
||||||
title.textContent = 'Cookie Monster '; // To create space between name and button
|
|
||||||
AddMenuInfo(title);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,178 +0,0 @@
|
|||||||
/** Main function to create the sections of Cookie Monster on the Statistics page */
|
|
||||||
|
|
||||||
import { AddMissingUpgrades } from './CreateMissingUpgrades';
|
|
||||||
import * as CreateSections from './CreateStatsSections';
|
|
||||||
import * as CreateElements from './CreateDOMElements';
|
|
||||||
import * as GameData from '../../Data/Gamedata';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
import {
|
|
||||||
CacheAverageClicks,
|
|
||||||
CacheWrinklersFattest,
|
|
||||||
CacheWrinklersNormal,
|
|
||||||
CacheWrinklersTotal,
|
|
||||||
} from '../../Cache/VariablesAndData';
|
|
||||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
|
||||||
import { ClickTimes, CookieTimes } from '../VariablesAndData';
|
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds stats created by CookieMonster to the stats page
|
|
||||||
* It is called by CM.Disp.AddMenu
|
|
||||||
* @param {object} title On object that includes the title of the menu
|
|
||||||
*/
|
|
||||||
export default function AddMenuStats(title) {
|
|
||||||
const stats = document.createElement('div');
|
|
||||||
stats.className = 'subsection';
|
|
||||||
stats.appendChild(title);
|
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Lucky Cookies', 'Lucky'));
|
|
||||||
if (CMOptions.Header.Lucky) {
|
|
||||||
stats.appendChild(CreateSections.LuckySection());
|
|
||||||
}
|
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Chain Cookies', 'Chain'));
|
|
||||||
if (CMOptions.Header.Chain) {
|
|
||||||
stats.appendChild(CreateSections.ChainSection());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Game.Objects['Wizard tower'].minigameLoaded) {
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Spells', 'Spells'));
|
|
||||||
if (CMOptions.Header.Spells) {
|
|
||||||
stats.appendChild(CreateSections.SpellsSection());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Game.Objects.Farm.minigameLoaded) {
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Garden', 'Garden'));
|
|
||||||
if (CMOptions.Header.Garden) {
|
|
||||||
stats.appendChild(CreateSections.GardenSection());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Prestige', 'Prestige'));
|
|
||||||
if (CMOptions.Header.Prestige) {
|
|
||||||
stats.appendChild(CreateSections.PrestigeSection());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Game.cpsSucked > 0) {
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Wrinklers', 'Wrink'));
|
|
||||||
if (CMOptions.Header.Wrink) {
|
|
||||||
const popAllFrag = document.createDocumentFragment();
|
|
||||||
popAllFrag.appendChild(
|
|
||||||
document.createTextNode(
|
|
||||||
`${Beautify(CacheWrinklersTotal)} / ${Beautify(
|
|
||||||
CacheWrinklersNormal,
|
|
||||||
)} `,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
const popAllA = document.createElement('a');
|
|
||||||
popAllA.textContent = 'Pop All Normal';
|
|
||||||
popAllA.className = 'option';
|
|
||||||
popAllA.onclick = function () {
|
|
||||||
PopAllNormalWrinklers();
|
|
||||||
};
|
|
||||||
popAllFrag.appendChild(popAllA);
|
|
||||||
stats.appendChild(
|
|
||||||
CreateElements.StatsListing(
|
|
||||||
'basic',
|
|
||||||
'Rewards of Popping (All/Normal)',
|
|
||||||
popAllFrag,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
const popFattestFrag = document.createDocumentFragment();
|
|
||||||
popFattestFrag.appendChild(
|
|
||||||
document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `),
|
|
||||||
);
|
|
||||||
const popFattestA = document.createElement('a');
|
|
||||||
popFattestA.textContent = 'Pop Single Fattest';
|
|
||||||
popFattestA.className = 'option';
|
|
||||||
popFattestA.onclick = function () {
|
|
||||||
if (CacheWrinklersFattest[1] !== null)
|
|
||||||
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
|
||||||
};
|
|
||||||
popFattestFrag.appendChild(popFattestA);
|
|
||||||
stats.appendChild(
|
|
||||||
CreateElements.StatsListing(
|
|
||||||
'basic',
|
|
||||||
`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${
|
|
||||||
CacheWrinklersFattest[1] !== null
|
|
||||||
? CacheWrinklersFattest[1]
|
|
||||||
: 'None'
|
|
||||||
})`,
|
|
||||||
popFattestFrag,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stats.appendChild(CreateSections.SeasonSection());
|
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
|
||||||
if (CMOptions.Header.Misc) {
|
|
||||||
stats.appendChild(
|
|
||||||
CreateElements.StatsListing(
|
|
||||||
'basic',
|
|
||||||
`Average Cookies Per Second (Past ${
|
|
||||||
CookieTimes[CMOptions.AvgCPSHist] < 60
|
|
||||||
? `${CookieTimes[CMOptions.AvgCPSHist]} seconds`
|
|
||||||
: CookieTimes[CMOptions.AvgCPSHist] / 60 +
|
|
||||||
(CMOptions.AvgCPSHist === 3 ? ' minute' : ' minutes')
|
|
||||||
})`,
|
|
||||||
document.createTextNode(Beautify(GetCPS(), 3)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
stats.appendChild(
|
|
||||||
CreateElements.StatsListing(
|
|
||||||
'basic',
|
|
||||||
`Average Cookie Clicks Per Second (Past ${
|
|
||||||
ClickTimes[CMOptions.AvgClicksHist]
|
|
||||||
}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`,
|
|
||||||
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
if (Game.Has('Fortune cookies')) {
|
|
||||||
const fortunes = [];
|
|
||||||
Object.keys(GameData.Fortunes).forEach((i) => {
|
|
||||||
if (!Game.Has(GameData.Fortunes[i])) {
|
|
||||||
fortunes.push(GameData.Fortunes[i]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (fortunes.length !== 0)
|
|
||||||
stats.appendChild(
|
|
||||||
CreateElements.StatsListing(
|
|
||||||
'basic',
|
|
||||||
'Fortune Upgrades Left to Buy',
|
|
||||||
CreateElements.StatsMissDisp(fortunes),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (CMOptions.ShowMissedGC) {
|
|
||||||
stats.appendChild(
|
|
||||||
CreateElements.StatsListing(
|
|
||||||
'basic',
|
|
||||||
'Missed Golden Cookies',
|
|
||||||
document.createTextNode(Beautify(Game.missedGoldenClicks)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (Game.prefs.autosave) {
|
|
||||||
const timer = document.createElement('span');
|
|
||||||
timer.id = 'CMStatsAutosaveTimer';
|
|
||||||
timer.innerText = Game.sayTime(
|
|
||||||
Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60)),
|
|
||||||
4,
|
|
||||||
);
|
|
||||||
stats.appendChild(
|
|
||||||
CreateElements.StatsListing('basic', 'Time till autosave', timer),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
l('menu').insertBefore(stats, l('menu').childNodes[2]);
|
|
||||||
|
|
||||||
if (CMOptions.MissingUpgrades) {
|
|
||||||
AddMissingUpgrades();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/** Functions related to the Stats page */
|
|
||||||
|
|
||||||
import { ToggleHeader } from '../../Config/ToggleSetting';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds stats created by CookieMonster to the stats page
|
|
||||||
* @param {object} title On object that includes the title of the menu
|
|
||||||
*/
|
|
||||||
export default function AddMenuInfo(title) {
|
|
||||||
const info = document.createElement('div');
|
|
||||||
info.className = 'subsection';
|
|
||||||
|
|
||||||
const span = document.createElement('span');
|
|
||||||
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.InfoTab ? '-' : '+';
|
|
||||||
span.onclick = function () {
|
|
||||||
ToggleHeader('InfoTab');
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
title.appendChild(span);
|
|
||||||
info.appendChild(title);
|
|
||||||
|
|
||||||
if (CMOptions.Header.InfoTab) {
|
|
||||||
const description = document.createElement('div');
|
|
||||||
description.innerHTML = ModDescription;
|
|
||||||
info.appendChild(description);
|
|
||||||
const notes = document.createElement('div');
|
|
||||||
notes.innerHTML = LatestReleaseNotes;
|
|
||||||
info.appendChild(notes);
|
|
||||||
}
|
|
||||||
|
|
||||||
const menu = l('menu').children[1];
|
|
||||||
menu.insertBefore(info, menu.children[1]);
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function refreshes the stats page, CM.Options.UpStats determines the rate at which that happens
|
* This function refreshes the stats page, CM.Options.UpStats determines the rate at which that happens
|
||||||
* It is called by CM.Disp.Draw()
|
* It is called by CM.Disp.Draw()
|
||||||
*/
|
*/
|
||||||
export default function RefreshMenu() {
|
export default function RefreshMenu() {
|
||||||
if (
|
if (
|
||||||
CMOptions.UpStats &&
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpStats &&
|
||||||
Game.onMenu === 'stats' &&
|
Game.onMenu === 'stats' &&
|
||||||
(Game.drawT - 1) % (Game.fps * 5) !== 0 &&
|
(Game.drawT - 1) % (Game.fps * 5) !== 0 &&
|
||||||
(Game.drawT - 1) % Game.fps === 0
|
(Game.drawT - 1) % Game.fps === 0
|
||||||
|
|||||||
@@ -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
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user