Compare commits
246 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60f19e5084 | ||
|
|
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 |
@@ -8,8 +8,7 @@
|
|||||||
"l": "readonly",
|
"l": "readonly",
|
||||||
"b64_to_utf8": "readonly",
|
"b64_to_utf8": "readonly",
|
||||||
"utf8_to_b64": "readonly",
|
"utf8_to_b64": "readonly",
|
||||||
"BeautifyAll": "readonly",
|
"BeautifyAll": "readonly"
|
||||||
"PlaySound": "readonly"
|
|
||||||
},
|
},
|
||||||
"extends": ["airbnb-base", "prettier"],
|
"extends": ["airbnb-base", "prettier"],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
|
|||||||
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"
|
||||||
29
.github/workflows/CI.yml
vendored
29
.github/workflows/CI.yml
vendored
@@ -1,11 +1,21 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on: pull_request
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
- gh-pages
|
||||||
|
pull_request:
|
||||||
jobs:
|
jobs:
|
||||||
Check_linting_test_and_build:
|
Check_linting_test_and_build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GITHUB_REGISTERY_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 12
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run ESLint
|
- name: Run ESLint
|
||||||
@@ -14,19 +24,20 @@ jobs:
|
|||||||
run: npx mocha
|
run: npx mocha
|
||||||
- name: Check if CookieMonsterDev.js is built correctly
|
- name: Check if CookieMonsterDev.js is built correctly
|
||||||
run: |
|
run: |
|
||||||
npx webpack -o ./tmp --env production
|
npx webpack -o ./tmp --env minimize
|
||||||
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
|
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
|
||||||
echo '### SUCCESS: CookieMonsterDev is correctly built! ###'
|
echo '### SUCCESS: CookieMonsterDev is built correctly! ###'
|
||||||
else
|
else
|
||||||
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
|
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- name: Check if CookieMonster.js is built correctly
|
- name: Check if CookieMonster.js is built correctly
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: |
|
||||||
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 dist/CookieMonster.js); then
|
npx webpack -o ./tmp --env minimize --env finalfile
|
||||||
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
|
||||||
|
echo '### SUCCESS: CookieMonster is built correctly! ###'
|
||||||
else
|
else
|
||||||
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to copy CookieMonsterDev.js into CookieMonster.js before merging to master! ###'
|
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
|
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}'
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"recursive": true,
|
"recursive": true,
|
||||||
"require": ["esm", "ts-node/register"],
|
"require": ["esm", "ts-node/register"]
|
||||||
"reporter": "min"
|
|
||||||
}
|
}
|
||||||
|
|||||||
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}
|
||||||
41
README.md
41
README.md
@@ -1,23 +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. It compares the PP across all possible buy options: if a buy 10 option is better than any of the buy 1 options Cookie Monster will colour them accordingly.
|
<details>
|
||||||
Cookie Monster uses the following standard colours:
|
<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
|
||||||
@@ -27,6 +32,8 @@ Cookie Monster uses the following standard colours:
|
|||||||
* 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
|
||||||
@@ -37,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');
|
||||||
}());
|
}());
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -51,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
|
||||||
|
|||||||
5
dist/CookieMonster.js
vendored
5
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
2
dist/CookieMonsterDev.js
vendored
2
dist/CookieMonsterDev.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonsterDev.js.map
vendored
2
dist/CookieMonsterDev.js.map
vendored
File diff suppressed because one or more lines are too long
3167
package-lock.json
generated
3167
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.7",
|
"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,16 +11,17 @@
|
|||||||
"Orteil"
|
"Orteil"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"eslint-src": "eslint src test",
|
"build-dev": "run-s eslint test pack-prod",
|
||||||
"build": "run-s eslint-src pack-prod test",
|
"build-final": "run-s eslint test pack-final",
|
||||||
"build-test": "run-s pack-dev",
|
"build-test": "webpack",
|
||||||
"pack-prod": "webpack --env production",
|
"eslint": "eslint src test",
|
||||||
"pack-dev": "webpack",
|
"pack-prod": "webpack --env minimize",
|
||||||
|
"pack-final": "webpack --env minimize --env finalfile",
|
||||||
"test": "mocha"
|
"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": {
|
||||||
@@ -39,28 +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": {
|
||||||
"@types/chai": "^4.2.16",
|
"@types/chai": "^4.2.19",
|
||||||
"@types/mocha": "^8.2.2",
|
"@types/mocha": "^9.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
"@typescript-eslint/eslint-plugin": "^4.28.4",
|
||||||
"@typescript-eslint/parser": "^4.21.0",
|
"@typescript-eslint/parser": "^4.28.4",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"eslint": "^7.23.0",
|
"eslint": "^7.31.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.23.4",
|
||||||
"esm": "^3.2.25",
|
"esm": "^3.2.25",
|
||||||
"mocha": "^8.3.2",
|
"mocha": "^8.4.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"prettier": "2.2.1",
|
"prettier": "2.3.2",
|
||||||
"ts-loader": "^8.1.0",
|
"ts-loader": "^9.2.3",
|
||||||
"ts-node": "^9.1.1",
|
"ts-node": "^10.0.0",
|
||||||
"typescript": "^4.2.3",
|
"typescript": "^4.3.4",
|
||||||
"webpack": "^5.24.4",
|
"webpack": "^5.45.1",
|
||||||
"webpack-cli": "^4.5.0"
|
"webpack-cli": "^4.7.2"
|
||||||
},
|
},
|
||||||
"ccrepo": {
|
"ccrepo": {
|
||||||
"icon": [
|
"icon": [
|
||||||
@@ -70,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,10 +1,10 @@
|
|||||||
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,9 +60,9 @@ export class CMAvgQueue {
|
|||||||
* Called by CM.Cache.InitCache()
|
* Called by CM.Cache.InitCache()
|
||||||
*/
|
*/
|
||||||
export function InitCookiesDiff() {
|
export function InitCookiesDiff() {
|
||||||
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]); // eslint-disable-line no-unused-vars
|
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
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,
|
||||||
@@ -39,7 +38,7 @@ export default function CacheAvgCPS() {
|
|||||||
if ((Game.T / Game.fps) % 1 === 0) {
|
if ((Game.T / Game.fps) % 1 === 0) {
|
||||||
let choEggTotal = Game.cookies + CacheSellForChoEgg;
|
let choEggTotal = Game.cookies + CacheSellForChoEgg;
|
||||||
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
|
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
|
||||||
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal); // eslint-disable-line no-unused-vars
|
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
||||||
choEggTotal *= 0.05;
|
choEggTotal *= 0.05;
|
||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
@@ -67,23 +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 += CacheAverageGainWrinkFattest;
|
CacheAverageCPS += CacheAverageGainWrink;
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 2)
|
||||||
|
CacheAverageCPS += CacheAverageGainWrinkFattest;
|
||||||
|
|
||||||
const choEgg = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
const choEgg = 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 + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
|
CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
|
||||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS; // eslint-disable-line no-unused-vars
|
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
CacheAverageClicks = ClicksDiff.calcAverage(ClickTimes[CMOptions.AvgClicksHist]);
|
CacheAverageClicks = ClicksDiff.calcAverage(
|
||||||
|
ClickTimes[Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData';
|
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the current Wrinkler CPS multiplier
|
* This functions caches the current Wrinkler CPS multiplier
|
||||||
@@ -19,8 +19,8 @@ export default function CacheCurrWrinklerCPS() {
|
|||||||
else if (godLvl === 2) godMult *= 1.1;
|
else if (godLvl === 2) godMult *= 1.1;
|
||||||
else if (godLvl === 3) godMult *= 1.05;
|
else if (godLvl === 3) godMult *= 1.05;
|
||||||
}
|
}
|
||||||
CacheCurrWrinklerCount = count; // eslint-disable-line no-unused-vars
|
CacheCurrWrinklerCount = count;
|
||||||
CacheCurrWrinklerCPSMult = // eslint-disable-line no-unused-vars
|
CacheCurrWrinklerCPSMult =
|
||||||
count *
|
count *
|
||||||
(count * 0.05 * 1.1) *
|
(count * 0.05 * 1.1) *
|
||||||
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
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
|
||||||
@@ -9,5 +9,5 @@ import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
|||||||
export default function CacheNoGoldSwitchCPS() {
|
export default function CacheNoGoldSwitchCPS() {
|
||||||
if (Game.Has('Golden switch [off]')) {
|
if (Game.Has('Golden switch [off]')) {
|
||||||
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
||||||
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs; // eslint-disable-line no-unused-vars
|
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
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
|
||||||
@@ -20,5 +20,5 @@ export default function CacheSellAllForChoEgg() {
|
|||||||
}
|
}
|
||||||
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
||||||
sellTotal += SellBuildingsForChoEgg();
|
sellTotal += SellBuildingsForChoEgg();
|
||||||
CacheSellForChoEgg = sellTotal; // eslint-disable-line no-unused-vars
|
CacheSellForChoEgg = sellTotal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
|||||||
import CacheSeasonSpec from './Stats/Reindeer';
|
import CacheSeasonSpec from './Stats/Reindeer';
|
||||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
|
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
|
||||||
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
||||||
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData';
|
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,8 +26,8 @@ export default function InitCache() {
|
|||||||
CacheSeasonSpec();
|
CacheSeasonSpec();
|
||||||
InitCookiesDiff();
|
InitCookiesDiff();
|
||||||
/** Used by CM.Cache.CacheHeavenlyChipsPS() */
|
/** Used by CM.Cache.CacheHeavenlyChipsPS() */
|
||||||
HeavenlyChipsDiff = new CMAvgQueue(5); // eslint-disable-line no-unused-vars
|
HeavenlyChipsDiff = new CMAvgQueue(5);
|
||||||
CacheAverageCookiesFromClicks = new CMAvgQueue(ClickTimes[ClickTimes.length - 1] * 20); // eslint-disable-line no-unused-vars
|
CacheAverageCookiesFromClicks = new CMAvgQueue(ClickTimes[ClickTimes.length - 1] * 20);
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
AllAmountTillNextAchievement();
|
AllAmountTillNextAchievement();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ 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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,6 +17,7 @@ export default function LoopCache() {
|
|||||||
CacheWrinklers();
|
CacheWrinklers();
|
||||||
|
|
||||||
CachePP();
|
CachePP();
|
||||||
|
AllAmountTillNextAchievement(false);
|
||||||
CacheCurrWrinklerCPS();
|
CacheCurrWrinklerCPS();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
@@ -25,5 +27,5 @@ export default function LoopCache() {
|
|||||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1,
|
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1,
|
||||||
) -
|
) -
|
||||||
(Game.cookiesEarned + Game.cookiesReset);
|
(Game.cookiesEarned + Game.cookiesReset);
|
||||||
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS()); // eslint-disable-line no-unused-vars
|
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData';
|
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the currently selected Dragon Auras
|
* This functions caches the currently selected Dragon Auras
|
||||||
*/
|
*/
|
||||||
export default function CacheDragonAuras() {
|
export default function CacheDragonAuras() {
|
||||||
CacheDragonAura = Game.dragonAura; // eslint-disable-line no-unused-vars
|
CacheDragonAura = Game.dragonAura;
|
||||||
CacheDragonAura2 = Game.dragonAura2; // eslint-disable-line no-unused-vars
|
CacheDragonAura2 = Game.dragonAura2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify';
|
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 { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData';
|
import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
@@ -56,7 +56,7 @@ export default function CacheDragonCost() {
|
|||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount -= 1;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
}
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`; // eslint-disable-line no-unused-vars
|
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColourGray } 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,28 +18,56 @@ import ColourOfPP from './ColourOfPP';
|
|||||||
*/
|
*/
|
||||||
function CacheColour(target, amount) {
|
function CacheColour(target, amount) {
|
||||||
Object.keys(target).forEach((i) => {
|
Object.keys(target).forEach((i) => {
|
||||||
if (CMOptions.PPRigidelMode && amount === 1) {
|
if (
|
||||||
target[i].color = ColourGray; // eslint-disable-line no-param-reassign
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPRigidelMode &&
|
||||||
|
amount === 1
|
||||||
|
) {
|
||||||
|
target[i].colour = ColourGray; // eslint-disable-line no-param-reassign
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
target[i].color = ColourOfPP(target[i], Game.Objects[i].getSumPrice(amount));
|
target[i].colour = ColourOfPP(
|
||||||
|
target[i],
|
||||||
|
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 = ColourGray; // eslint-disable-line no-param-reassign
|
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 = // eslint-disable-line no-param-reassign
|
target[i].pp = // eslint-disable-line no-param-reassign
|
||||||
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs +
|
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs +
|
||||||
price / target[i].bonus;
|
price / target[i].bonus;
|
||||||
} else target[i].pp = price / target[i].bonus; // eslint-disable-line no-param-reassign
|
} else target[i].pp = price / target[i].bonus; // eslint-disable-line no-param-reassign
|
||||||
if (!(CMOptions.PPRigidelMode && amount === 1)) CachePPArray.push([target[i].pp, amount]);
|
if (
|
||||||
|
!(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPRigidelMode &&
|
||||||
|
amount === 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
CachePPArray.push([target[i].pp, amount, price]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,25 +78,30 @@ 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]; // eslint-disable-line no-unused-vars
|
CacheMinPP = CachePPArray[indexOfMin][0];
|
||||||
|
CacheMinPPBulk = CachePPArray[indexOfMin][1];
|
||||||
|
|
||||||
CacheColour(CacheObjects1, 1);
|
CacheColour(CacheObjects1, 1);
|
||||||
CacheColour(CacheObjects10, 10);
|
CacheColour(CacheObjects10, 10);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||||
import {
|
import {
|
||||||
ColourBlue,
|
ColourBlue,
|
||||||
@@ -16,26 +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 = ColourGray;
|
if (me.pp <= 0 || me.pp === Infinity) colour = ColourGray;
|
||||||
else if (me.pp < CacheMinPP) color = ColourBlue;
|
else if (me.pp < CacheMinPP) colour = ColourBlue;
|
||||||
else if (me.pp === CacheMinPP) color = ColourGreen;
|
else if (me.pp === CacheMinPP) colour = ColourGreen;
|
||||||
else if (me.pp < CachePPArray[10][0]) color = ColourYellow;
|
else if (me.pp < CachePPArray[10][0]) colour = ColourYellow;
|
||||||
else if (me.pp < CachePPArray[20][0]) color = ColourOrange;
|
else if (me.pp < CachePPArray[20][0]) colour = ColourOrange;
|
||||||
else if (me.pp < CachePPArray[30][0]) color = ColourRed;
|
else if (me.pp < CachePPArray[30][0]) colour = ColourRed;
|
||||||
else color = ColourPurple;
|
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)) color = ColourBlue;
|
Number(
|
||||||
|
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 = ColourRed;
|
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]));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,6 @@ export default function CacheUpgradePP() {
|
|||||||
} else CacheUpgrades[i].pp = Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
} else 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], Game.Upgrades[i].getPrice());
|
CacheUpgrades[i].colour = ColourOfPP(CacheUpgrades[i], Game.Upgrades[i].getPrice());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/** Section: Functions related to caching income */
|
/** Section: Functions related to caching income */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
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';
|
||||||
@@ -8,7 +7,7 @@ import {
|
|||||||
CacheAverageGainBank,
|
CacheAverageGainBank,
|
||||||
CacheAverageGainWrink,
|
CacheAverageGainWrink,
|
||||||
CacheAverageGainWrinkFattest,
|
CacheAverageGainWrinkFattest,
|
||||||
CacheDoRemakeBuildPrices,
|
CacheDoRemakeBuildPrices, // eslint-disable-line no-unused-vars
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
@@ -28,7 +27,7 @@ function CacheBuildingIncome(amount) {
|
|||||||
result[i] = {};
|
result[i] = {};
|
||||||
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
||||||
if (amount !== 1) {
|
if (amount !== 1) {
|
||||||
CacheDoRemakeBuildPrices = 1; // eslint-disable-line no-unused-vars
|
CacheDoRemakeBuildPrices = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
@@ -39,20 +38,25 @@ function CacheBuildingIncome(amount) {
|
|||||||
* 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[i].bonus -= CacheAverageGainWrink;
|
CacheUpgrades[upgradeName] = {
|
||||||
else if (CMOptions.CalcWrink === 2) CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest;
|
bonus: Game.cookiesPs - CacheAverageGainBank,
|
||||||
if (!Number.isFinite(CacheUpgrades[i].bonus)) CacheUpgrades[i].bonus = 0;
|
};
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 1)
|
||||||
|
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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,28 +65,28 @@ 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(
|
CacheObjectsNextAchievement[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,17 +1,17 @@
|
|||||||
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,
|
||||||
@@ -72,21 +72,21 @@ export function CacheChain() {
|
|||||||
else maxPayout = 0;
|
else maxPayout = 0;
|
||||||
|
|
||||||
CacheChainMaxReward = MaxChainCookieReward(7, maxPayout, CacheGoldenCookiesMult);
|
CacheChainMaxReward = MaxChainCookieReward(7, maxPayout, CacheGoldenCookiesMult);
|
||||||
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult; // eslint-disable-line no-unused-vars
|
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
CacheChainRequiredNext = CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; // eslint-disable-line no-unused-vars
|
CacheChainRequiredNext = CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
|
|
||||||
CacheChainWrathMaxReward = MaxChainCookieReward(6, maxPayout, CacheWrathCookiesMult);
|
CacheChainWrathMaxReward = MaxChainCookieReward(6, maxPayout, CacheWrathCookiesMult);
|
||||||
CacheChainWrathRequired = (CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult; // eslint-disable-line no-unused-vars
|
CacheChainWrathRequired = (CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
CacheChainWrathRequiredNext = // eslint-disable-line no-unused-vars
|
CacheChainWrathRequiredNext =
|
||||||
CacheChainWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
CacheChainWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
|
|
||||||
CacheChainFrenzyMaxReward = MaxChainCookieReward(7, maxPayout * 7, CacheGoldenCookiesMult);
|
CacheChainFrenzyMaxReward = MaxChainCookieReward(7, maxPayout * 7, CacheGoldenCookiesMult);
|
||||||
CacheChainFrenzyRequired = (CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult; // eslint-disable-line no-unused-vars
|
CacheChainFrenzyRequired = (CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
CacheChainFrenzyRequiredNext = // eslint-disable-line no-unused-vars
|
CacheChainFrenzyRequiredNext =
|
||||||
CacheChainFrenzyMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
CacheChainFrenzyMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
|
|
||||||
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(6, maxPayout * 7, CacheWrathCookiesMult);
|
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(6, maxPayout * 7, CacheWrathCookiesMult);
|
||||||
CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult; // eslint-disable-line no-unused-vars
|
CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
CacheChainFrenzyWrathRequiredNext = // eslint-disable-line no-unused-vars
|
CacheChainFrenzyWrathRequiredNext =
|
||||||
CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
CacheHCPerSecond,
|
CacheHCPerSecond, // eslint-disable-line no-unused-vars
|
||||||
CacheLastHeavenlyCheck,
|
CacheLastHeavenlyCheck,
|
||||||
CacheLastHeavenlyChips,
|
CacheLastHeavenlyChips,
|
||||||
HeavenlyChipsDiff,
|
HeavenlyChipsDiff,
|
||||||
@@ -30,6 +30,6 @@ export default function CacheHeavenlyChipsPS() {
|
|||||||
CacheLastHeavenlyChips = ascendNowToGet;
|
CacheLastHeavenlyChips = ascendNowToGet;
|
||||||
|
|
||||||
// Get average gain over period of 5 seconds
|
// Get average gain over period of 5 seconds
|
||||||
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5); // eslint-disable-line no-unused-vars
|
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
|
import { crateMissing } from '../../Disp/MenuSections/Statistics/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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CacheSeaSpec } from '../VariablesAndData';
|
import { CacheSeaSpec } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the reward of popping a reindeer
|
* This functions caches the reward of popping a reindeer
|
||||||
@@ -11,6 +11,6 @@ export default function CacheSeasonSpec() {
|
|||||||
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
||||||
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
||||||
CacheSeaSpec = Math.max(25, val);
|
CacheSeaSpec = Math.max(25, val);
|
||||||
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2; // eslint-disable-line no-unused-vars
|
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,17 @@ 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';
|
||||||
@@ -28,13 +28,13 @@ export function CacheStatsCookies() {
|
|||||||
const cpsBuffMult = GetCPSBuffMult();
|
const cpsBuffMult = GetCPSBuffMult();
|
||||||
if (cpsBuffMult > 0) CacheLucky /= cpsBuffMult;
|
if (cpsBuffMult > 0) CacheLucky /= cpsBuffMult;
|
||||||
else CacheLucky = 0;
|
else CacheLucky = 0;
|
||||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyFrenzy = CacheLucky * 7;
|
CacheLuckyFrenzy = CacheLucky * 7;
|
||||||
CacheLuckyRewardFrenzy = CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13; // eslint-disable-line no-unused-vars
|
CacheLuckyRewardFrenzy = CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheLuckyWrathRewardFrenzy = CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13; // eslint-disable-line no-unused-vars
|
CacheLuckyWrathRewardFrenzy = CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheConjure = CacheLucky * 2;
|
CacheConjure = CacheLucky * 2;
|
||||||
CacheConjureReward = CacheConjure * 0.15; // eslint-disable-line no-unused-vars
|
CacheConjureReward = CacheConjure * 0.15;
|
||||||
|
|
||||||
CacheEdifice = 0;
|
CacheEdifice = 0;
|
||||||
let max = 0;
|
let max = 0;
|
||||||
@@ -50,7 +50,7 @@ export function CacheStatsCookies() {
|
|||||||
Game.Objects[i].price * 2 > CacheEdifice
|
Game.Objects[i].price * 2 > CacheEdifice
|
||||||
) {
|
) {
|
||||||
CacheEdifice = Game.Objects[i].price * 2;
|
CacheEdifice = Game.Objects[i].price * 2;
|
||||||
CacheEdificeBuilding = i; // eslint-disable-line no-unused-vars
|
CacheEdificeBuilding = i;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,43 @@
|
|||||||
|
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
import { CacheObjectsNextAchievement } from '../VariablesAndData';
|
import { CacheObjectsNextAchievement } from '../VariablesAndData';
|
||||||
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement';
|
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement';
|
||||||
|
|
||||||
export default function AllAmountTillNextAchievement() {
|
/**
|
||||||
|
* 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 = {};
|
const result = {};
|
||||||
|
|
||||||
Object.keys(Game.Objects).forEach((i) => {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
if (
|
if (
|
||||||
Object.keys(CacheObjectsNextAchievement).length !== 0 &&
|
Object.keys(CacheObjectsNextAchievement).length !== 0 &&
|
||||||
CacheObjectsNextAchievement[i].TotalNeeded > Game.Objects[i].amount
|
CacheObjectsNextAchievement[i].TotalNeeded > Game.Objects[i].amount &&
|
||||||
|
!forceRecalc
|
||||||
) {
|
) {
|
||||||
result[i] = {
|
result[i] = {
|
||||||
AmountNeeded: CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount,
|
AmountNeeded: CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount,
|
||||||
TotalNeeded: CacheObjectsNextAchievement[i].TotalNeeded,
|
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 {
|
} else {
|
||||||
const tillNext = IndividualAmountTillNextAchievement(i);
|
const tillNext = IndividualAmountTillNextAchievement(i);
|
||||||
result[i] = {
|
result[i] = {
|
||||||
AmountNeeded: tillNext,
|
AmountNeeded: tillNext,
|
||||||
TotalNeeded: Game.Objects[i].amount + tillNext,
|
TotalNeeded: Game.Objects[i].amount + tillNext,
|
||||||
|
price: BuildingGetPrice(
|
||||||
|
i,
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
tillNext,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,11 +3,25 @@ import { SimAchievementsOwned } from '../../Sim/VariablesAndData';
|
|||||||
|
|
||||||
export default function IndividualAmountTillNextAchievement(building) {
|
export default function IndividualAmountTillNextAchievement(building) {
|
||||||
const AchievementsAtStart = Game.AchievementsOwned;
|
const AchievementsAtStart = Game.AchievementsOwned;
|
||||||
for (let index = 0; index < 101; index++) {
|
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);
|
BuyBuildingsBonusIncome(building, index);
|
||||||
if (SimAchievementsOwned > AchievementsAtStart) {
|
if (SimAchievementsOwned > AchievementsAtStart) {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
index += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 101;
|
return 101;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,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 = [];
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,9 +31,9 @@ export default function CacheWrinklers() {
|
|||||||
else if (godLvl === 2) sucked *= 1.1;
|
else if (godLvl === 2) sucked *= 1.1;
|
||||||
else if (godLvl === 3) sucked *= 1.05;
|
else if (godLvl === 3) sucked *= 1.05;
|
||||||
}
|
}
|
||||||
CacheWrinklersTotal += sucked; // eslint-disable-line no-unused-vars
|
CacheWrinklersTotal += sucked;
|
||||||
if (Game.wrinklers[i].type === 0) {
|
if (Game.wrinklers[i].type === 0) {
|
||||||
CacheWrinklersNormal += sucked; // eslint-disable-line no-unused-vars
|
CacheWrinklersNormal += sucked;
|
||||||
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
|
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
import ConfigDefault from '../../Data/SettingsDefault.ts';
|
|
||||||
import ConfigData from '../../Data/SettingsData';
|
|
||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
import save from '../../InitSaveLoad/save';
|
|
||||||
import CMLoopHook from '../../Main/LoopHook';
|
|
||||||
import UpdateColours from '../../Disp/HelperFunctions/UpdateColours';
|
|
||||||
|
|
||||||
/** 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;
|
|
||||||
|
|
||||||
if (typeof CMOptions.Colors !== 'undefined') {
|
|
||||||
delete CMOptions.Colors;
|
|
||||||
}
|
|
||||||
if (typeof CMOptions.Colours !== 'undefined') {
|
|
||||||
delete CMOptions.Colours;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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') {
|
|
||||||
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];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (mod) SaveConfig();
|
|
||||||
CMLoopHook(); // Do loop once
|
|
||||||
Object.keys(ConfigDefault).forEach((i) => {
|
|
||||||
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
|
||||||
ConfigData[i].func();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Default values
|
|
||||||
LoadConfig(ConfigDefault);
|
|
||||||
}
|
|
||||||
Game.UpdateMenu();
|
|
||||||
UpdateColours();
|
|
||||||
}
|
|
||||||
@@ -1,26 +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 (CMOptions.BotBar === 1 && CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) {
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar === 1 &&
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBar === 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 = `${Number(l('CMTimerBar').style.height.replace('px', '')) + 70}px`;
|
l('game').style.bottom = `${Number(l('CMTimerBar').style.height.replace('px', '')) + 70}px`;
|
||||||
} else if (CMOptions.BotBar === 1) {
|
} else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.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 = '';
|
||||||
@@ -33,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();
|
||||||
}
|
}
|
||||||
@@ -42,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,52 +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();
|
|
||||||
}
|
|
||||||
|
|
||||||
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,11 +0,0 @@
|
|||||||
import { FavouriteSettings } from '../../Disp/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function toggles whether a setting is part of the favourites section in setting or not
|
|
||||||
* @param {string} config The name of the toggleable config option
|
|
||||||
*/
|
|
||||||
export default function ToggleFavouriteSetting(config) {
|
|
||||||
if (FavouriteSettings.includes(config))
|
|
||||||
FavouriteSettings = FavouriteSettings.filter((ele) => ele !== config);
|
|
||||||
else FavouriteSettings.push(config);
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
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;
|
||||||
|
|||||||
@@ -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,16 +1,17 @@
|
|||||||
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 && Game.elderWrath) {
|
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,2 +0,0 @@
|
|||||||
export let CMOptions = {}; // eslint-disable-line prefer-const
|
|
||||||
export const ConfigPrefix = 'CMConfig';
|
|
||||||
@@ -9,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,31 +1,25 @@
|
|||||||
/** Data related directly to Cookie Monster */
|
/** Data related directly to Cookie Monster */
|
||||||
|
|
||||||
export const VersionMajor = '2.031';
|
export const VersionMajor = '2.031';
|
||||||
export const VersionMinor = '8';
|
export const VersionMinor = '10';
|
||||||
|
|
||||||
/** Information about Cookie Monster to be displayed in the info section */
|
/** Information about Cookie Monster to be displayed in the info section */
|
||||||
export const ModDescription = `<div class="listing">
|
export const ModDescription = `<a href="https://github.com/CookieMonsterTeam/CookieMonster" target="blank">Cookie Monster</a>
|
||||||
<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.
|
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>
|
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>
|
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>
|
Please also report any bugs you may find over there!</br>
|
||||||
</div>
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||||
export const LatestReleaseNotes = `<div class="listing">
|
export const LatestReleaseNotes = `This update implements the following functions:</br>
|
||||||
<b>We have moved Cookie Monster to a new location!</b></br>
|
- This updates adds a number of performance improvements which make CookieMonster about 33% more efficient</br>
|
||||||
Please update the link you are using to load Cookie Monster to https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js and let everybody know this is the new place to find Cookie Monster!</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>
|
||||||
These are the release notes for the latest update (v 2.031.8).</br>
|
- Added a percentage to the Golden Cookie timer bar</br>
|
||||||
</br>
|
</br>
|
||||||
This update implements the following functions:</br>
|
This update fixes the following bugs:
|
||||||
- The tooltip of buildings now shows how many buildings need to be bought before a new achievement is reached and the cost and PP of this</br>
|
- Fix considerable lag on the Ascension screen when using the monospace font</br>
|
||||||
- New setting to force the upgrades sections to always show all available upgrades, stopping them from collapsing and expanding</br>
|
- Fix sound playing at start-up</br>
|
||||||
</br>
|
- Fix building tooltips and warnings not updating correctly</br>
|
||||||
This update fixes the following bugs:</br>
|
- Fix upgrade bar not displaying</br>
|
||||||
- Settings menu now correctly updates after changing a setting</br>
|
- Fix loading of mod when no save was found</br>`;
|
||||||
- Fixed incorrect calculation of dates in rare cases</br>
|
|
||||||
- Remove golden cookie timers when you ascend</br>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
/** The basic setting class */
|
|
||||||
export default class Setting {
|
|
||||||
type: string;
|
|
||||||
|
|
||||||
group: string;
|
|
||||||
|
|
||||||
constructor(type: string, group: string) {
|
|
||||||
this.type = type;
|
|
||||||
this.group = group;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import Setting from './BaseSetting';
|
|
||||||
|
|
||||||
/** The colour picker setting class */
|
|
||||||
export default class SettingColours extends Setting {
|
|
||||||
desc: string;
|
|
||||||
|
|
||||||
constructor(type: string, group: string, desc: string) {
|
|
||||||
super(type, group);
|
|
||||||
this.desc = desc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import Setting from './BaseSetting';
|
|
||||||
|
|
||||||
/** The number input setting class */
|
|
||||||
export default class SettingInputNumber extends Setting {
|
|
||||||
label: string[];
|
|
||||||
|
|
||||||
desc: string;
|
|
||||||
|
|
||||||
min: number;
|
|
||||||
|
|
||||||
max: number;
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
type: string,
|
|
||||||
group: string,
|
|
||||||
label: string[],
|
|
||||||
desc: string,
|
|
||||||
min: number,
|
|
||||||
max: number,
|
|
||||||
) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
this.min = min;
|
|
||||||
this.max = max;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import Setting from './BaseSetting';
|
|
||||||
|
|
||||||
/** The standard toggle setting class */
|
|
||||||
export default class SettingStandard extends Setting {
|
|
||||||
label: string[];
|
|
||||||
|
|
||||||
desc: string;
|
|
||||||
|
|
||||||
toggle: boolean;
|
|
||||||
|
|
||||||
func: () => void;
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
type: string,
|
|
||||||
group: string,
|
|
||||||
label: string[],
|
|
||||||
desc: string,
|
|
||||||
toggle: boolean,
|
|
||||||
func?: () => void,
|
|
||||||
) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
this.toggle = toggle;
|
|
||||||
if (func !== undefined) {
|
|
||||||
this.func = func;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import Setting from './BaseSetting';
|
|
||||||
|
|
||||||
/** The volume level setting class */
|
|
||||||
export default class SettingVolume extends Setting {
|
|
||||||
label: string[];
|
|
||||||
|
|
||||||
desc: string;
|
|
||||||
|
|
||||||
constructor(type: string, group: string, label: string[], desc: string) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
for (let i = 0; i < 101; i++) {
|
|
||||||
this.label[i] = `${i}%`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
/** This array describes all default settings */
|
|
||||||
const ConfigDefault: {
|
|
||||||
[index: string]: string | number | { [index: string]: number };
|
|
||||||
} = {
|
|
||||||
CPSMode: 1,
|
|
||||||
AvgCPSHist: 3,
|
|
||||||
AvgClicksHist: 0,
|
|
||||||
CalcWrink: 0,
|
|
||||||
Scale: 2,
|
|
||||||
ScaleDecimals: 2,
|
|
||||||
ScaleSeparator: 0,
|
|
||||||
ScaleCutoff: 999999,
|
|
||||||
TimeFormat: 0,
|
|
||||||
DetailedTime: 1,
|
|
||||||
PPDisplayTime: 0,
|
|
||||||
BuildColour: 1,
|
|
||||||
PPOnlyConsiderBuyable: 0,
|
|
||||||
PPExcludeTop: 0,
|
|
||||||
PPRigidelMode: 0,
|
|
||||||
PPSecondsLowerLimit: 0,
|
|
||||||
ColourBlue: '#4bb8f0',
|
|
||||||
ColourGreen: '#00ff00',
|
|
||||||
ColourYellow: '#ffff00',
|
|
||||||
ColourOrange: '#ff7f00',
|
|
||||||
ColourRed: '#ff0000',
|
|
||||||
ColourPurple: '#ff00ff',
|
|
||||||
ColourGray: '#b3b3b3',
|
|
||||||
ColourPink: '#ff1493',
|
|
||||||
ColourBrown: '#8b4513',
|
|
||||||
BotBar: 1,
|
|
||||||
TimerBar: 1,
|
|
||||||
TimerBarPos: 0,
|
|
||||||
TimerBarOverlay: 2,
|
|
||||||
UpBarColour: 1,
|
|
||||||
UpgradeBarFixedPos: 1,
|
|
||||||
SortBuildings: 0,
|
|
||||||
SortUpgrades: 0,
|
|
||||||
UpgradesNeverCollapse: 0,
|
|
||||||
DragonAuraInfo: 1,
|
|
||||||
GrimoireBar: 1,
|
|
||||||
GCTimer: 1,
|
|
||||||
Favicon: 1,
|
|
||||||
WrinklerButtons: 1,
|
|
||||||
HideSectionsButtons: 0,
|
|
||||||
TooltipBuildUpgrade: 1,
|
|
||||||
TooltipAmor: 0,
|
|
||||||
ToolWarnLucky: 1,
|
|
||||||
ToolWarnLuckyFrenzy: 1,
|
|
||||||
ToolWarnConjure: 1,
|
|
||||||
ToolWarnConjureFrenzy: 1,
|
|
||||||
ToolWarnEdifice: 1,
|
|
||||||
ToolWarnUser: 0,
|
|
||||||
ToolWarnBon: 1,
|
|
||||||
ToolWarnPos: 1,
|
|
||||||
TooltipGrim: 1,
|
|
||||||
TooltipWrink: 1,
|
|
||||||
TooltipLump: 1,
|
|
||||||
TooltipPlots: 1,
|
|
||||||
TooltipPantheon: 1,
|
|
||||||
TooltipAscendButton: 1,
|
|
||||||
Stats: 1,
|
|
||||||
MissingUpgrades: 1,
|
|
||||||
MissingAchievements: 0,
|
|
||||||
UpStats: 1,
|
|
||||||
HeavenlyChipsTarget: 1,
|
|
||||||
ShowMissedGC: 1,
|
|
||||||
Title: 1,
|
|
||||||
GeneralSound: 1,
|
|
||||||
GCNotification: 0,
|
|
||||||
GCFlash: 1,
|
|
||||||
ColourGCFlash: '#ffffff',
|
|
||||||
GCSound: 1,
|
|
||||||
GCVolume: 100,
|
|
||||||
GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
|
|
||||||
FortuneNotification: 0,
|
|
||||||
FortuneFlash: 1,
|
|
||||||
ColourFortuneFlash: '#ffffff',
|
|
||||||
FortuneSound: 1,
|
|
||||||
FortuneVolume: 100,
|
|
||||||
FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
|
||||||
SeaNotification: 0,
|
|
||||||
SeaFlash: 1,
|
|
||||||
ColourSeaFlash: '#ffffff',
|
|
||||||
SeaSound: 1,
|
|
||||||
SeaVolume: 100,
|
|
||||||
SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
|
||||||
GardFlash: 1,
|
|
||||||
ColourGardFlash: '#ffffff',
|
|
||||||
GardSound: 1,
|
|
||||||
GardVolume: 100,
|
|
||||||
GardSoundURL: 'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
|
|
||||||
MagicNotification: 0,
|
|
||||||
MagicFlash: 1,
|
|
||||||
ColourMagicFlash: '#ffffff',
|
|
||||||
MagicSound: 1,
|
|
||||||
MagicVolume: 100,
|
|
||||||
MagicSoundURL: 'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
|
||||||
WrinklerNotification: 0,
|
|
||||||
WrinklerFlash: 1,
|
|
||||||
ColourWrinklerFlash: '#ffffff',
|
|
||||||
WrinklerSound: 1,
|
|
||||||
WrinklerVolume: 100,
|
|
||||||
WrinklerSoundURL: 'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
|
||||||
WrinklerMaxNotification: 0,
|
|
||||||
WrinklerMaxFlash: 1,
|
|
||||||
ColourWrinklerMaxFlash: '#ffffff',
|
|
||||||
WrinklerMaxSound: 1,
|
|
||||||
WrinklerMaxVolume: 100,
|
|
||||||
WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
|
||||||
BulkBuyBlock: 0,
|
|
||||||
FavouriteSettings: 1,
|
|
||||||
Header: {
|
|
||||||
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,
|
|
||||||
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;
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
|
import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index';
|
||||||
|
|
||||||
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
||||||
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
||||||
|
import { SimDoSims } from '../Sim/VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
||||||
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
||||||
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
||||||
@@ -8,29 +11,25 @@ import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
|||||||
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
|
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
|
||||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
import { CMOptions } from '../Config/VariablesAndData';
|
|
||||||
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
||||||
|
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||||
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||||
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
||||||
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
||||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
|
||||||
import { SimDoSims } from '../Sim/VariablesAndData';
|
|
||||||
import SettingColours from './SettingClasses/SettingColours.ts';
|
|
||||||
import SettingInputNumber from './SettingClasses/SettingInputNumber.ts';
|
|
||||||
import SettingStandard from './SettingClasses/SettingStandard.ts';
|
|
||||||
import SettingVolume from './SettingClasses/SettingVolume.ts';
|
|
||||||
|
|
||||||
/** This includes all options of CookieMonster and their relevant data */
|
/** This includes all options of CookieMonster and their relevant data */
|
||||||
const Config = {
|
const settings = {
|
||||||
// Calculation
|
// Calculation
|
||||||
CPSMode: new SettingStandard(
|
CPSMode: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
['Current cookies per second', 'Average cookies per second'],
|
['Current cookies per second', 'Average cookies per second'],
|
||||||
'Calculate times using current cookies per second or average cookies per second',
|
'Calculate times using current cookies per second or average cookies per second',
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
AvgCPSHist: new SettingStandard(
|
AvgCPSHist: new settingClasses.SettingStandard(
|
||||||
|
3,
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
[
|
[
|
||||||
@@ -46,7 +45,8 @@ const Config = {
|
|||||||
'How much time average Cookies Per Second should consider',
|
'How much time average Cookies Per Second should consider',
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
AvgClicksHist: new SettingStandard(
|
AvgClicksHist: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
[
|
[
|
||||||
@@ -59,7 +59,8 @@ const Config = {
|
|||||||
'How much time average Cookie Clicks should consider',
|
'How much time average Cookie Clicks should consider',
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
CalcWrink: new SettingStandard(
|
CalcWrink: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
[
|
[
|
||||||
@@ -70,12 +71,13 @@ const Config = {
|
|||||||
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
|
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
|
||||||
true,
|
true,
|
||||||
() => {
|
() => {
|
||||||
SimDoSims = true; // eslint-disable-line no-unused-vars
|
SimDoSims = true;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
// Notation
|
// Notation
|
||||||
Scale: new SettingStandard(
|
Scale: new settingClasses.SettingStandardWithFunc(
|
||||||
|
2,
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
[
|
[
|
||||||
@@ -92,7 +94,8 @@ const Config = {
|
|||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ScaleDecimals: new SettingStandard(
|
ScaleDecimals: new settingClasses.SettingStandardWithFunc(
|
||||||
|
2,
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
['1 decimals', '2 decimals', '3 decimals'],
|
['1 decimals', '2 decimals', '3 decimals'],
|
||||||
@@ -102,7 +105,8 @@ const Config = {
|
|||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ScaleSeparator: new SettingStandard(
|
ScaleSeparator: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
['. for decimals (standard)', '. for thousands'],
|
['. for decimals (standard)', '. for thousands'],
|
||||||
@@ -112,7 +116,8 @@ const Config = {
|
|||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ScaleCutoff: new SettingInputNumber(
|
ScaleCutoff: new settingClasses.SettingInputNumber(
|
||||||
|
999999,
|
||||||
'numscale',
|
'numscale',
|
||||||
'Notation',
|
'Notation',
|
||||||
'Notation cut-off point: ',
|
'Notation cut-off point: ',
|
||||||
@@ -120,14 +125,16 @@ const Config = {
|
|||||||
1,
|
1,
|
||||||
999999999,
|
999999999,
|
||||||
),
|
),
|
||||||
TimeFormat: new SettingStandard(
|
TimeFormat: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'],
|
['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'],
|
||||||
'Change the time format',
|
'Change the time format',
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
DetailedTime: new SettingStandard(
|
DetailedTime: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
['Detailed time OFF', 'Detailed time ON'],
|
['Detailed time OFF', 'Detailed time ON'],
|
||||||
@@ -137,7 +144,8 @@ const Config = {
|
|||||||
ToggleDetailedTime();
|
ToggleDetailedTime();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
PPDisplayTime: new SettingStandard(
|
PPDisplayTime: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
['PP as value (standard)', 'PP as time unit'],
|
['PP as value (standard)', 'PP as time unit'],
|
||||||
@@ -146,7 +154,8 @@ const Config = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Colours
|
// Colours
|
||||||
BuildColour: new SettingStandard(
|
BuildColour: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Colours',
|
'Colours',
|
||||||
['Building colours OFF', 'Building colours ON'],
|
['Building colours OFF', 'Building colours ON'],
|
||||||
@@ -156,14 +165,16 @@ const Config = {
|
|||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
PPOnlyConsiderBuyable: new SettingStandard(
|
PPOnlyConsiderBuyable: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Colours',
|
'Colours',
|
||||||
["Don't ignore non-buyable", 'Ignore non-buyable'],
|
["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'",
|
"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,
|
true,
|
||||||
),
|
),
|
||||||
PPExcludeTop: new SettingStandard(
|
PPExcludeTop: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Colours',
|
'Colours',
|
||||||
[
|
[
|
||||||
@@ -175,14 +186,16 @@ const Config = {
|
|||||||
'Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
'Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
PPRigidelMode: new SettingStandard(
|
PPRigidelMode: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Colours',
|
'Colours',
|
||||||
['Rigidel mode OFF', 'Rigidel mode ON'],
|
['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',
|
'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,
|
true,
|
||||||
),
|
),
|
||||||
PPSecondsLowerLimit: new SettingInputNumber(
|
PPSecondsLowerLimit: new settingClasses.SettingInputNumber(
|
||||||
|
0,
|
||||||
'numscale',
|
'numscale',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Lower limit for PP (in seconds): ',
|
'Lower limit for PP (in seconds): ',
|
||||||
@@ -190,54 +203,64 @@ const Config = {
|
|||||||
0,
|
0,
|
||||||
Infinity,
|
Infinity,
|
||||||
),
|
),
|
||||||
ColourBlue: new SettingColours(
|
ColourBlue: new settingClasses.SettingColours(
|
||||||
|
'#4bb8f0',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
|
'Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
|
||||||
),
|
),
|
||||||
ColourGreen: new SettingColours(
|
ColourGreen: new settingClasses.SettingColours(
|
||||||
|
'#00ff00',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
|
'Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
|
||||||
),
|
),
|
||||||
ColourYellow: new SettingColours(
|
ColourYellow: new settingClasses.SettingColours(
|
||||||
|
'#ffff00',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels',
|
'Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels',
|
||||||
),
|
),
|
||||||
ColourOrange: new SettingColours(
|
ColourOrange: new settingClasses.SettingColours(
|
||||||
|
'#ff7f00',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
|
'Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
|
||||||
),
|
),
|
||||||
ColourRed: new SettingColours(
|
ColourRed: new settingClasses.SettingColours(
|
||||||
|
'#ff0000',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
|
'Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
|
||||||
),
|
),
|
||||||
ColourPurple: new SettingColours(
|
ColourPurple: new settingClasses.SettingColours(
|
||||||
|
'#ff00ff',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels',
|
'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 SettingColours(
|
ColourGray: new settingClasses.SettingColours(
|
||||||
|
'#b3b3b3',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
'Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
||||||
),
|
),
|
||||||
ColourPink: new SettingColours(
|
ColourPink: new settingClasses.SettingColours(
|
||||||
|
'#ff1493',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is pink. Used for Dragonflight bar',
|
'Standard colour is pink. Used for Dragonflight bar',
|
||||||
),
|
),
|
||||||
ColourBrown: new SettingColours(
|
ColourBrown: new settingClasses.SettingColours(
|
||||||
|
'#8b4513',
|
||||||
'colour',
|
'colour',
|
||||||
'Colours',
|
'Colours',
|
||||||
'Standard colour is brown. Used for Dragon Harvest bar',
|
'Standard colour is brown. Used for Dragon Harvest bar',
|
||||||
),
|
),
|
||||||
|
|
||||||
// BarsDisplay
|
// BarsDisplay
|
||||||
BotBar: new SettingStandard(
|
BotBar: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Bottom bar OFF', 'Bottom bar ON'],
|
['Bottom bar OFF', 'Bottom bar ON'],
|
||||||
@@ -247,7 +270,8 @@ const Config = {
|
|||||||
ToggleBotBar();
|
ToggleBotBar();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TimerBar: new SettingStandard(
|
TimerBar: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Timer bar OFF', 'Timer bar ON'],
|
['Timer bar OFF', 'Timer bar ON'],
|
||||||
@@ -257,7 +281,8 @@ const Config = {
|
|||||||
ToggleTimerBar();
|
ToggleTimerBar();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TimerBarPos: new SettingStandard(
|
TimerBarPos: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Timer bar position (top left)', 'Timer bar position (bottom)'],
|
['Timer bar position (top left)', 'Timer bar position (bottom)'],
|
||||||
@@ -267,14 +292,24 @@ const Config = {
|
|||||||
ToggleTimerBarPos();
|
ToggleTimerBarPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TimerBarOverlay: new SettingStandard(
|
TimerBarOverlay: new settingClasses.SettingStandard(
|
||||||
|
2,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Timer bar overlay OFF', 'Timer bar overlay only seconds', 'Timer bar overlay full'],
|
['Timer bar overlay OFF', 'Timer bar overlay only seconds', 'Timer bar overlay full'],
|
||||||
'Overlay on timers displaying seconds and/or percentage left',
|
'Overlay on timers displaying seconds and/or percentage left',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
UpBarColour: new SettingStandard(
|
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',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Upgrade colours/bar OFF', 'Upgrade colours with bar ON', 'Upgrade colours without bar ON'],
|
['Upgrade colours/bar OFF', 'Upgrade colours with bar ON', 'Upgrade colours without bar ON'],
|
||||||
@@ -284,7 +319,8 @@ const Config = {
|
|||||||
ToggleUpgradeBarAndColour();
|
ToggleUpgradeBarAndColour();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
UpgradeBarFixedPos: new SettingStandard(
|
UpgradeBarFixedPos: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'],
|
['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'],
|
||||||
@@ -294,21 +330,24 @@ const Config = {
|
|||||||
ToggleUpgradeBarFixedPos();
|
ToggleUpgradeBarFixedPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SortBuildings: new SettingStandard(
|
SortBuildings: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
[
|
[
|
||||||
'Sort buildings: default',
|
'Sort buildings: default',
|
||||||
'Sort buildings: PP of x1 purchase',
|
'Sort buildings: PP of x1 purchase',
|
||||||
'Sort buildings: PP of selected bulk mode',
|
'Sort buildings: PP of selected bulk mode',
|
||||||
|
'Sort buildings: price until next achievement',
|
||||||
],
|
],
|
||||||
'Sort the display of buildings in either default order or by PP',
|
'Sort the display of buildings in default order, by PP, or until next achievement',
|
||||||
false,
|
false,
|
||||||
() => {
|
() => {
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SortUpgrades: new SettingStandard(
|
SortUpgrades: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Sort upgrades: default', 'Sort upgrades: PP'],
|
['Sort upgrades: default', 'Sort upgrades: PP'],
|
||||||
@@ -318,7 +357,8 @@ const Config = {
|
|||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
UpgradesNeverCollapse: new SettingStandard(
|
UpgradesNeverCollapse: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Upgrades always expanded OFF', 'Upgrades always expanded ON'],
|
['Upgrades always expanded OFF', 'Upgrades always expanded ON'],
|
||||||
@@ -328,21 +368,24 @@ const Config = {
|
|||||||
UpdateUpgradeSectionsHeight();
|
UpdateUpgradeSectionsHeight();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
DragonAuraInfo: new SettingStandard(
|
DragonAuraInfo: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Extra dragon aura info OFF', 'Extra dragon aura info ON'],
|
['Extra dragon aura info OFF', 'Extra dragon aura info ON'],
|
||||||
'Shows information about changes in CPS and costs in the dragon aura interface.',
|
'Shows information about changes in CPS and costs in the dragon aura interface.',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
GrimoireBar: new SettingStandard(
|
GrimoireBar: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Grimoire magic meter timer OFF', 'Grimoire magic meter timer ON'],
|
['Grimoire magic meter timer OFF', 'Grimoire magic meter timer ON'],
|
||||||
'A timer on how long before the Grimoire magic meter is full',
|
'A timer overlay showing how long till the Grimoire magic meter is full',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
GCTimer: new SettingStandard(
|
GCTimer: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Golden cookie timer OFF', 'Golden cookie timer ON'],
|
['Golden cookie timer OFF', 'Golden cookie timer ON'],
|
||||||
@@ -352,7 +395,8 @@ const Config = {
|
|||||||
ToggleGCTimer();
|
ToggleGCTimer();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Favicon: new SettingStandard(
|
Favicon: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Favicon OFF', 'Favicon ON'],
|
['Favicon OFF', 'Favicon ON'],
|
||||||
@@ -362,7 +406,8 @@ const Config = {
|
|||||||
UpdateFavicon();
|
UpdateFavicon();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
WrinklerButtons: new SettingStandard(
|
WrinklerButtons: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
|
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
|
||||||
@@ -372,7 +417,8 @@ const Config = {
|
|||||||
ToggleWrinklerButtons();
|
ToggleWrinklerButtons();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
HideSectionsButtons: new SettingStandard(
|
HideSectionsButtons: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'],
|
['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'],
|
||||||
@@ -384,14 +430,16 @@ const Config = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Tooltip
|
// Tooltip
|
||||||
TooltipBuildUpgrade: new SettingStandard(
|
TooltipBuildUpgrade: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Building/upgrade tooltip information OFF', 'Building/upgrade tooltip information ON'],
|
['Building/upgrade tooltip information OFF', 'Building/upgrade tooltip information ON'],
|
||||||
'Extra information in building/upgrade tooltips',
|
'Extra information in building/upgrade tooltips',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
TooltipAmor: new SettingStandard(
|
TooltipAmor: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
[
|
[
|
||||||
@@ -401,42 +449,48 @@ const Config = {
|
|||||||
'Add amortization information to buildings tooltip',
|
'Add amortization information to buildings tooltip',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ToolWarnLucky: new SettingStandard(
|
ToolWarnLucky: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Tooltip lucky warning OFF', 'Tooltip lucky warning ON'],
|
['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',
|
'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ToolWarnLuckyFrenzy: new SettingStandard(
|
ToolWarnLuckyFrenzy: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Tooltip lucky frenzy warning OFF', 'Tooltip lucky frenzy warning ON'],
|
['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',
|
'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ToolWarnConjure: new SettingStandard(
|
ToolWarnConjure: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Tooltip conjure warning OFF', 'Tooltip conjure warning ON'],
|
['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',
|
'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ToolWarnConjureFrenzy: new SettingStandard(
|
ToolWarnConjureFrenzy: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Tooltip conjure frenzy warning OFF', 'Tooltip conjure frenzy warning ON'],
|
['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',
|
'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ToolWarnEdifice: new SettingStandard(
|
ToolWarnEdifice: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Tooltip edifice warning OFF', 'Tooltip edifice warning ON'],
|
['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',
|
'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,
|
true,
|
||||||
),
|
),
|
||||||
ToolWarnUser: new SettingInputNumber(
|
ToolWarnUser: new settingClasses.SettingInputNumber(
|
||||||
|
0,
|
||||||
'numscale',
|
'numscale',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
'Tooltip warning at x times CPS: ',
|
'Tooltip warning at x times CPS: ',
|
||||||
@@ -444,14 +498,16 @@ const Config = {
|
|||||||
0,
|
0,
|
||||||
Infinity,
|
Infinity,
|
||||||
),
|
),
|
||||||
ToolWarnBon: new SettingStandard(
|
ToolWarnBon: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Calculate tooltip warning with bonus CPS OFF', 'Calculate tooltip warning with bonus CPS ON'],
|
['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',
|
'Calculate the warning with or without the bonus CPS you get from buying',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ToolWarnPos: new SettingStandard(
|
ToolWarnPos: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
|
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
|
||||||
@@ -461,42 +517,48 @@ const Config = {
|
|||||||
ToggleToolWarnPos();
|
ToggleToolWarnPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TooltipGrim: new SettingStandard(
|
TooltipGrim: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Grimoire tooltip information OFF', 'Grimoire tooltip information ON'],
|
['Grimoire tooltip information OFF', 'Grimoire tooltip information ON'],
|
||||||
'Extra information in tooltip for grimoire',
|
'Extra information in tooltip for grimoire',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
TooltipWrink: new SettingStandard(
|
TooltipWrink: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Wrinkler tooltip OFF', 'Wrinkler tooltip ON'],
|
['Wrinkler tooltip OFF', 'Wrinkler tooltip ON'],
|
||||||
'Shows the amount of cookies a wrinkler will give when popping it',
|
'Shows the amount of cookies a wrinkler will give when popping it',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
TooltipLump: new SettingStandard(
|
TooltipLump: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Sugar lump tooltip OFF', 'Sugar lump tooltip ON'],
|
['Sugar lump tooltip OFF', 'Sugar lump tooltip ON'],
|
||||||
'Shows the current Sugar Lump type in Sugar lump tooltip.',
|
'Shows the current Sugar Lump type in Sugar lump tooltip.',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
TooltipPlots: new SettingStandard(
|
TooltipPlots: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Garden plots tooltip OFF', 'Garden plots tooltip ON'],
|
['Garden plots tooltip OFF', 'Garden plots tooltip ON'],
|
||||||
'Shows a tooltip for plants that have a cookie reward.',
|
'Shows a tooltip for plants that have a cookie reward.',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
TooltipPantheon: new SettingStandard(
|
TooltipPantheon: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Pantheon tooltip OFF', 'Pantheon tooltip ON'],
|
['Pantheon tooltip OFF', 'Pantheon tooltip ON'],
|
||||||
'Shows additional info in the pantheon tooltip',
|
'Shows additional info in the pantheon tooltip',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
TooltipAscendButton: new SettingStandard(
|
TooltipAscendButton: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'],
|
['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'],
|
||||||
@@ -505,35 +567,40 @@ const Config = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Statistics
|
// Statistics
|
||||||
Stats: new SettingStandard(
|
Stats: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Statistics',
|
'Statistics',
|
||||||
['Statistics OFF', 'Statistics ON'],
|
['Statistics OFF', 'Statistics ON'],
|
||||||
'Extra Cookie Monster statistics!',
|
'Extra Cookie Monster statistics!',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
MissingUpgrades: new SettingStandard(
|
MissingUpgrades: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Statistics',
|
'Statistics',
|
||||||
['Missing upgrades OFF', 'Missing upgrades ON'],
|
['Missing upgrades OFF', 'Missing upgrades ON'],
|
||||||
'Shows missing upgrades in statistics menu',
|
'Shows missing upgrades in statistics menu',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
MissingAchievements: new SettingStandard(
|
MissingAchievements: new settingClasses.SettingStandard(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'Statistics',
|
'Statistics',
|
||||||
['Missing Achievements OFF', 'Missing Normal Achievements ON'],
|
['Missing Achievements OFF', 'Missing Normal Achievements ON'],
|
||||||
'Shows missing normal achievements in statistics menu.',
|
'Shows missing normal achievements in statistics menu.',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
UpStats: new SettingStandard(
|
UpStats: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Statistics',
|
'Statistics',
|
||||||
['Statistics update rate (default)', 'Statistics update rate (1s)'],
|
['Statistics update rate (default)', 'Statistics update rate (1s)'],
|
||||||
'Default rate is once every 5 seconds',
|
'Default rate is once every 5 seconds',
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
HeavenlyChipsTarget: new SettingInputNumber(
|
HeavenlyChipsTarget: new settingClasses.SettingInputNumber(
|
||||||
|
1,
|
||||||
'numscale',
|
'numscale',
|
||||||
'Statistics',
|
'Statistics',
|
||||||
'Heavenly chips target: ',
|
'Heavenly chips target: ',
|
||||||
@@ -541,7 +608,8 @@ const Config = {
|
|||||||
1,
|
1,
|
||||||
Infinity,
|
Infinity,
|
||||||
),
|
),
|
||||||
ShowMissedGC: new SettingStandard(
|
ShowMissedGC: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Statistics',
|
'Statistics',
|
||||||
['Missed GC OFF', 'Missed GC ON'],
|
['Missed GC OFF', 'Missed GC ON'],
|
||||||
@@ -550,257 +618,311 @@ const Config = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Notification
|
// Notification
|
||||||
Title: new SettingStandard(
|
Title: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationGeneral',
|
'NotificationGeneral',
|
||||||
['Title OFF', 'Title ON', 'Title pinned tab highlight'],
|
['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',
|
'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,
|
true,
|
||||||
),
|
),
|
||||||
GeneralSound: new SettingStandard(
|
GeneralSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationGeneral',
|
'NotificationGeneral',
|
||||||
['Consider game volume setting OFF', 'Consider game volume setting ON'],
|
['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',
|
'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,
|
true,
|
||||||
),
|
),
|
||||||
GCNotification: new SettingStandard(
|
GCNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationGC',
|
'NotificationGC',
|
||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when golden cookie spawns',
|
'Create a notification when golden cookie spawns',
|
||||||
true,
|
true,
|
||||||
() => {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.GCNotification);
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.GCNotification,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
GCFlash: new SettingStandard(
|
GCFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationGC',
|
'NotificationGC',
|
||||||
['Flash OFF', 'Flash ON'],
|
['Flash OFF', 'Flash ON'],
|
||||||
'Flash screen on golden cookie',
|
'Flash screen on golden cookie',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ColourGCFlash: new SettingColours(
|
ColourGCFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
'colour',
|
'colour',
|
||||||
'NotificationGC',
|
'NotificationGC',
|
||||||
'The colour of the GC flash, standard colour is white',
|
'The colour of the GC flash, standard colour is white',
|
||||||
),
|
),
|
||||||
GCSound: new SettingStandard(
|
GCSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationGC',
|
'NotificationGC',
|
||||||
['Sound OFF', 'Sound ON'],
|
['Sound OFF', 'Sound ON'],
|
||||||
'Play a sound on golden cookie',
|
'Play a sound on golden cookie',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
GCVolume: new SettingVolume('vol', 'NotificationGC', [], 'Volume'),
|
GCVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationGC', [], 'Volume'),
|
||||||
GCSoundURL: new SettingStandard(
|
GCSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
|
||||||
'url',
|
'url',
|
||||||
'NotificationGC',
|
'NotificationGC',
|
||||||
'Sound URL:',
|
'Sound URL:',
|
||||||
'URL of the sound to be played when a golden cookie spawns',
|
'URL of the sound to be played when a golden cookie spawns',
|
||||||
),
|
),
|
||||||
FortuneNotification: new SettingStandard(
|
FortuneNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationFC',
|
'NotificationFC',
|
||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when fortune cookie is on the ticker',
|
'Create a notification when fortune cookie is on the ticker',
|
||||||
true,
|
true,
|
||||||
() => {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.FortuneNotification,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
FortuneFlash: new SettingStandard(
|
FortuneFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationFC',
|
'NotificationFC',
|
||||||
['Flash OFF', 'Flash ON'],
|
['Flash OFF', 'Flash ON'],
|
||||||
'Flash screen on fortune cookie spawn',
|
'Flash screen on fortune cookie spawn',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ColourFortuneFlash: new SettingColours(
|
ColourFortuneFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
'colour',
|
'colour',
|
||||||
'NotificationFC',
|
'NotificationFC',
|
||||||
'The colour of the fortune flash, standard colour is white',
|
'The colour of the fortune flash, standard colour is white',
|
||||||
),
|
),
|
||||||
FortuneSound: new SettingStandard(
|
FortuneSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationFC',
|
'NotificationFC',
|
||||||
['Sound OFF', 'Sound ON'],
|
['Sound OFF', 'Sound ON'],
|
||||||
'Play a sound on fortune cookie spawn',
|
'Play a sound on fortune cookie spawn',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
FortuneVolume: new SettingVolume('vol', 'NotificationFC', [], 'Volume'),
|
FortuneVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationFC', [], 'Volume'),
|
||||||
FortuneSoundURL: new SettingStandard(
|
FortuneSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
||||||
'url',
|
'url',
|
||||||
'NotificationFC',
|
'NotificationFC',
|
||||||
'Sound URL:',
|
'Sound URL:',
|
||||||
'URL of the sound to be played when the ticker has a fortune cookie',
|
'URL of the sound to be played when the ticker has a fortune cookie',
|
||||||
),
|
),
|
||||||
SeaNotification: new SettingStandard(
|
SeaNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationSea',
|
'NotificationSea',
|
||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification on season popup',
|
'Create a notification on season popup',
|
||||||
true,
|
true,
|
||||||
() => {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.SeaNotification);
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SeaNotification,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SeaFlash: new SettingStandard(
|
SeaFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationSea',
|
'NotificationSea',
|
||||||
['Flash OFF', 'Flash ON'],
|
['Flash OFF', 'Flash ON'],
|
||||||
'Flash screen on season popup',
|
'Flash screen on season popup',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ColourSeaFlash: new SettingColours(
|
ColourSeaFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
'colour',
|
'colour',
|
||||||
'NotificationSea',
|
'NotificationSea',
|
||||||
'The colour of the season popup flash, standard colour is white',
|
'The colour of the season popup flash, standard colour is white',
|
||||||
),
|
),
|
||||||
SeaSound: new SettingStandard(
|
SeaSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationSea',
|
'NotificationSea',
|
||||||
['Sound OFF', 'Sound ON'],
|
['Sound OFF', 'Sound ON'],
|
||||||
'Play a sound on season popup',
|
'Play a sound on season popup',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
SeaVolume: new SettingVolume('vol', 'NotificationSea', [], 'Volume'),
|
SeaVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationSea', [], 'Volume'),
|
||||||
SeaSoundURL: new SettingStandard(
|
SeaSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
||||||
'url',
|
'url',
|
||||||
'NotificationSea',
|
'NotificationSea',
|
||||||
'Sound URL:',
|
'Sound URL:',
|
||||||
'URL of the sound to be played when on season popup spawns',
|
'URL of the sound to be played when on season popup spawns',
|
||||||
),
|
),
|
||||||
GardFlash: new SettingStandard(
|
GardFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationGard',
|
'NotificationGard',
|
||||||
['Garden Tick Flash OFF', 'Flash ON'],
|
['Garden Tick Flash OFF', 'Flash ON'],
|
||||||
'Flash screen on garden tick',
|
'Flash screen on garden tick',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ColourGardFlash: new SettingColours(
|
ColourGardFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
'colour',
|
'colour',
|
||||||
'NotificationGard',
|
'NotificationGard',
|
||||||
'The colour of the garden flash, standard colour is white',
|
'The colour of the garden flash, standard colour is white',
|
||||||
),
|
),
|
||||||
GardSound: new SettingStandard(
|
GardSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationGard',
|
'NotificationGard',
|
||||||
['Sound OFF', 'Sound ON'],
|
['Sound OFF', 'Sound ON'],
|
||||||
'Play a sound on garden tick',
|
'Play a sound on garden tick',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
GardVolume: new SettingVolume('vol', 'NotificationGard', [], 'Volume'),
|
GardVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationGard', [], 'Volume'),
|
||||||
GardSoundURL: new SettingStandard(
|
GardSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
|
||||||
'url',
|
'url',
|
||||||
'NotificationGard',
|
'NotificationGard',
|
||||||
'Garden Tick Sound URL:',
|
'Garden Tick Sound URL:',
|
||||||
'URL of the sound to be played when the garden ticks',
|
'URL of the sound to be played when the garden ticks',
|
||||||
),
|
),
|
||||||
MagicNotification: new SettingStandard(
|
MagicNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationMagi',
|
'NotificationMagi',
|
||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when magic reaches maximum',
|
'Create a notification when magic reaches maximum',
|
||||||
true,
|
true,
|
||||||
() => {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.MagicNotification);
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.MagicNotification,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
MagicFlash: new SettingStandard(
|
MagicFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationMagi',
|
'NotificationMagi',
|
||||||
['Flash OFF', 'Flash ON'],
|
['Flash OFF', 'Flash ON'],
|
||||||
'Flash screen when magic reaches maximum',
|
'Flash screen when magic reaches maximum',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ColourMagicFlash: new SettingColours(
|
ColourMagicFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
'colour',
|
'colour',
|
||||||
'NotificationMagi',
|
'NotificationMagi',
|
||||||
'The colour of the magic flash, standard colour is white',
|
'The colour of the magic flash, standard colour is white',
|
||||||
),
|
),
|
||||||
MagicSound: new SettingStandard(
|
MagicSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationMagi',
|
'NotificationMagi',
|
||||||
['Sound OFF', 'Sound ON'],
|
['Sound OFF', 'Sound ON'],
|
||||||
'Play a sound when magic reaches maximum',
|
'Play a sound when magic reaches maximum',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
MagicVolume: new SettingVolume('vol', 'NotificationMagi', [], 'Volume'),
|
MagicVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationMagi', [], 'Volume'),
|
||||||
MagicSoundURL: new SettingStandard(
|
MagicSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
||||||
'url',
|
'url',
|
||||||
'NotificationMagi',
|
'NotificationMagi',
|
||||||
'Sound URL:',
|
'Sound URL:',
|
||||||
'URL of the sound to be played when magic reaches maxium',
|
'URL of the sound to be played when magic reaches maxium',
|
||||||
),
|
),
|
||||||
WrinklerNotification: new SettingStandard(
|
WrinklerNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationWrink',
|
'NotificationWrink',
|
||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when a wrinkler appears',
|
'Create a notification when a wrinkler appears',
|
||||||
true,
|
true,
|
||||||
() => {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.WrinklerNotification,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
WrinklerFlash: new SettingStandard(
|
WrinklerFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationWrink',
|
'NotificationWrink',
|
||||||
['Flash OFF', 'Flash ON'],
|
['Flash OFF', 'Flash ON'],
|
||||||
'Flash screen when a wrinkler appears',
|
'Flash screen when a wrinkler appears',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ColourWrinklerFlash: new SettingColours(
|
ColourWrinklerFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
'colour',
|
'colour',
|
||||||
'NotificationWrink',
|
'NotificationWrink',
|
||||||
'The colour of the wrinkler flash, standard colour is white',
|
'The colour of the wrinkler flash, standard colour is white',
|
||||||
),
|
),
|
||||||
WrinklerSound: new SettingStandard(
|
WrinklerSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationWrink',
|
'NotificationWrink',
|
||||||
['Sound OFF', 'Sound ON'],
|
['Sound OFF', 'Sound ON'],
|
||||||
'Play a sound when a wrinkler appears',
|
'Play a sound when a wrinkler appears',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
WrinklerVolume: new SettingVolume('vol', 'NotificationWrink', [], 'Volume'),
|
WrinklerVolume: new settingClasses.SettingVolume(100, 'vol', 'NotificationWrink', [], 'Volume'),
|
||||||
WrinklerSoundURL: new SettingStandard(
|
WrinklerSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
||||||
'url',
|
'url',
|
||||||
'NotificationWrink',
|
'NotificationWrink',
|
||||||
'Sound URL:',
|
'Sound URL:',
|
||||||
'URL of the sound to be played when a wrinkler appears',
|
'URL of the sound to be played when a wrinkler appears',
|
||||||
),
|
),
|
||||||
WrinklerMaxNotification: new SettingStandard(
|
WrinklerMaxNotification: new settingClasses.SettingStandardWithFunc(
|
||||||
|
0,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationWrinkMax',
|
'NotificationWrinkMax',
|
||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when the maximum amount of wrinklers has appeared',
|
'Create a notification when the maximum amount of wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
() => {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
CheckNotificationPermissions(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.WrinklerMaxNotification,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
WrinklerMaxFlash: new SettingStandard(
|
WrinklerMaxFlash: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationWrinkMax',
|
'NotificationWrinkMax',
|
||||||
['Flash OFF', 'Flash ON'],
|
['Flash OFF', 'Flash ON'],
|
||||||
'Flash screen when the maximum amount of Wrinklers has appeared',
|
'Flash screen when the maximum amount of Wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
ColourWrinklerMaxFlash: new SettingColours(
|
ColourWrinklerMaxFlash: new settingClasses.SettingColours(
|
||||||
|
'#ffffff',
|
||||||
'colour',
|
'colour',
|
||||||
'NotificationWrinkMax',
|
'NotificationWrinkMax',
|
||||||
'The colour of the maximum wrinkler flash, standard colour is white',
|
'The colour of the maximum wrinkler flash, standard colour is white',
|
||||||
),
|
),
|
||||||
WrinklerMaxSound: new SettingStandard(
|
WrinklerMaxSound: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'NotificationWrinkMax',
|
'NotificationWrinkMax',
|
||||||
['Sound OFF', 'Sound ON'],
|
['Sound OFF', 'Sound ON'],
|
||||||
'Play a sound when the maximum amount of wrinklers has appeared',
|
'Play a sound when the maximum amount of wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
WrinklerMaxVolume: new SettingVolume('vol', 'NotificationWrinkMax', [], 'Volume'),
|
WrinklerMaxVolume: new settingClasses.SettingVolume(
|
||||||
WrinklerMaxSoundURL: new SettingStandard(
|
100,
|
||||||
|
'vol',
|
||||||
|
'NotificationWrinkMax',
|
||||||
|
[],
|
||||||
|
'Volume',
|
||||||
|
),
|
||||||
|
WrinklerMaxSoundURL: new settingClasses.SettingStandard(
|
||||||
|
'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
||||||
'url',
|
'url',
|
||||||
'NotificationWrinkMax',
|
'NotificationWrinkMax',
|
||||||
'Sound URL:',
|
'Sound URL:',
|
||||||
@@ -808,14 +930,16 @@ const Config = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
BulkBuyBlock: new SettingStandard(
|
BulkBuyBlock: new settingClasses.SettingStandard(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Miscellaneous',
|
'Miscellaneous',
|
||||||
['Block bulk buying OFF', 'Block bulk buying ON'],
|
['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.",
|
"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,
|
true,
|
||||||
),
|
),
|
||||||
FavouriteSettings: new SettingStandard(
|
FavouriteSettings: new settingClasses.SettingStandardWithFunc(
|
||||||
|
1,
|
||||||
'bool',
|
'bool',
|
||||||
'Miscellaneous',
|
'Miscellaneous',
|
||||||
[
|
[
|
||||||
@@ -831,4 +955,4 @@ const Config = {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Config;
|
export default settings;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
/** General functions to format or beautify strings */
|
/** General functions to format or beautify strings */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts';
|
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts';
|
||||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||||
|
|
||||||
@@ -12,14 +11,15 @@ import { BackupFunctions } from '../../Main/VariablesAndData';
|
|||||||
* @returns {string} Formatted number
|
* @returns {string} Formatted number
|
||||||
*/
|
*/
|
||||||
export default function Beautify(num, floats, forced) {
|
export default function Beautify(num, floats, forced) {
|
||||||
const decimals = CMOptions.ScaleDecimals + 1;
|
const decimals =
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ScaleDecimals + 1;
|
||||||
if (num === Infinity) {
|
if (num === Infinity) {
|
||||||
return 'Infinity';
|
return 'Infinity';
|
||||||
}
|
}
|
||||||
if (typeof num === 'undefined') {
|
if (typeof num === 'undefined') {
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
if (CMOptions.Scale === 0) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 0) {
|
||||||
return BackupFunctions.Beautify(num, floats);
|
return BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
if (Number.isFinite(num)) {
|
if (Number.isFinite(num)) {
|
||||||
@@ -30,12 +30,20 @@ export default function Beautify(num, floats, forced) {
|
|||||||
if (num === 0) {
|
if (num === 0) {
|
||||||
return num.toString();
|
return num.toString();
|
||||||
}
|
}
|
||||||
if (num > 0.001 && num < CMOptions.ScaleCutoff) {
|
if (
|
||||||
if (CMOptions.ScaleSeparator) answer = num.toLocaleString('nl');
|
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');
|
else answer = num.toLocaleString('en');
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
if ((CMOptions.Scale === 4 && !forced) || forced === 4) {
|
if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 4 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 4
|
||||||
|
) {
|
||||||
// Scientific notation, 123456789 => 1.235E+8
|
// Scientific notation, 123456789 => 1.235E+8
|
||||||
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
||||||
} else {
|
} else {
|
||||||
@@ -43,22 +51,38 @@ export default function Beautify(num, floats, forced) {
|
|||||||
const AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf('e') + 1) / 3);
|
const AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf('e') + 1) / 3);
|
||||||
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(decimals);
|
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(decimals);
|
||||||
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
||||||
if ((CMOptions.Scale === 1 && !forced) || forced === 1) {
|
if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 1 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 1
|
||||||
|
) {
|
||||||
// Metric scale, 123456789 => 123.457 M
|
// Metric scale, 123456789 => 123.457 M
|
||||||
if (num >= 0.01 && num < Number(`1e${metric.length * 3}`)) {
|
if (num >= 0.01 && num < Number(`1e${metric.length * 3}`)) {
|
||||||
answer += ` ${metric[AmountOfTenPowerThree]}`;
|
answer += ` ${metric[AmountOfTenPowerThree]}`;
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} 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) {
|
} else if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 2 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 2
|
||||||
|
) {
|
||||||
// Short scale, 123456789 => 123.457 M
|
// Short scale, 123456789 => 123.457 M
|
||||||
if (num >= 0.01 && num < Number(`1e${shortScale.length * 3}`)) {
|
if (num >= 0.01 && num < Number(`1e${shortScale.length * 3}`)) {
|
||||||
answer += ` ${shortScale[AmountOfTenPowerThree]}`;
|
answer += ` ${shortScale[AmountOfTenPowerThree]}`;
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} 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) {
|
} else if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 3 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 3
|
||||||
|
) {
|
||||||
// Short scale, 123456789 => 123.457 M
|
// Short scale, 123456789 => 123.457 M
|
||||||
if (num >= 0.01 && num < Number(`1e${shortScaleAbbreviated.length * 3}`)) {
|
if (num >= 0.01 && num < Number(`1e${shortScaleAbbreviated.length * 3}`)) {
|
||||||
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} 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) {
|
} else if (
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale === 5 &&
|
||||||
|
!forced) ||
|
||||||
|
forced === 5
|
||||||
|
) {
|
||||||
// Engineering notation, 123456789 => 123.457E+6
|
// Engineering notation, 123456789 => 123.457E+6
|
||||||
answer += `E${AmountOfTenPowerThree * 3}`;
|
answer += `E${AmountOfTenPowerThree * 3}`;
|
||||||
}
|
}
|
||||||
@@ -68,7 +92,8 @@ export default function Beautify(num, floats, forced) {
|
|||||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
||||||
answer = BackupFunctions.Beautify(num, floats);
|
answer = BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ScaleSeparator)
|
||||||
|
answer = answer.replace('.', ',');
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns time as a string depending on TimeFormat setting
|
* This function returns time as a string depending on TimeFormat setting
|
||||||
* @param {number} time Time to be formatted
|
* @param {number} time Time to be formatted
|
||||||
@@ -17,7 +15,7 @@ export default function FormatTime(time, longFormat) {
|
|||||||
const m = Math.floor((((formattedTime % 31536000) % 86400) % 3600) / 60);
|
const m = Math.floor((((formattedTime % 31536000) % 86400) % 3600) / 60);
|
||||||
const s = Math.floor((((formattedTime % 31536000) % 86400) % 3600) % 60);
|
const s = Math.floor((((formattedTime % 31536000) % 86400) % 3600) % 60);
|
||||||
let str = '';
|
let str = '';
|
||||||
if (CMOptions.TimeFormat) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat) {
|
||||||
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
||||||
str += `${(y < 10 ? '0' : '') + y}:`;
|
str += `${(y < 10 ? '0' : '') + y}:`;
|
||||||
str += `${(d < 10 ? '0' : '') + d}:`;
|
str += `${(d < 10 ? '0' : '') + d}:`;
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData';
|
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData';
|
||||||
import FormatTime from './FormatTime';
|
import FormatTime from './FormatTime';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns the color to be used for time-strings
|
* This function returns the colour to be used for time-strings
|
||||||
* @param {number} time Time to be coloured
|
* @param {number} time Time to be coloured
|
||||||
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
* @returns {{string, string}} {text, colour} Both the formatted time and colour as strings in an array
|
||||||
*/
|
*/
|
||||||
export default function GetTimeColour(time) {
|
export default function GetTimeColour(time) {
|
||||||
let color;
|
let colour;
|
||||||
let text;
|
let text;
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat)
|
||||||
|
text = '00:00:00:00:00';
|
||||||
else text = 'Done!';
|
else text = 'Done!';
|
||||||
color = ColourGreen;
|
colour = ColourGreen;
|
||||||
} else {
|
} else {
|
||||||
text = FormatTime(time);
|
text = FormatTime(time);
|
||||||
if (time > 300) color = ColourRed;
|
if (time > 300) colour = ColourRed;
|
||||||
else if (time > 60) color = ColourOrange;
|
else if (time > 60) colour = ColourOrange;
|
||||||
else color = ColourYellow;
|
else colour = ColourYellow;
|
||||||
}
|
}
|
||||||
return { text, color };
|
return { text, colour };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
import {
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
CacheMinPPBulk,
|
||||||
|
CacheObjects1,
|
||||||
|
CacheObjects10,
|
||||||
|
CacheObjects100,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
|
} from '../../Cache/VariablesAndData';
|
||||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
||||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
||||||
@@ -24,11 +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.BuildColour === 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 = CMOptions[`Colour${target[i].color}`];
|
l(`productPrice${Game.Objects[i].id}`).style.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');
|
||||||
@@ -52,62 +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((a, b) =>
|
|
||||||
ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
|
||||||
ColoursOrdering.indexOf(b.color)
|
|
||||||
? 1
|
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
|
||||||
? -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((a, b) =>
|
|
||||||
ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
|
||||||
ColoursOrdering.indexOf(b.color)
|
|
||||||
? 1
|
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
|
||||||
? -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}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggles the upgrade to be always expanded
|
* This function toggles the upgrade to be always expanded
|
||||||
* It is called by a change in CM.Options.ToolWarnPos
|
* It is called by a change in CM.Options.ToolWarnPos
|
||||||
@@ -7,7 +5,10 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
*/
|
*/
|
||||||
export default function UpdateUpgradeSectionsHeight() {
|
export default function UpdateUpgradeSectionsHeight() {
|
||||||
Object.values(document.getElementsByClassName('storeSection')).forEach((section) => {
|
Object.values(document.getElementsByClassName('storeSection')).forEach((section) => {
|
||||||
if (CMOptions.UpgradesNeverCollapse || section.id === 'products') {
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpgradesNeverCollapse ||
|
||||||
|
section.id === 'products'
|
||||||
|
) {
|
||||||
section.style.height = 'auto'; // eslint-disable-line no-param-reassign
|
section.style.height = 'auto'; // eslint-disable-line no-param-reassign
|
||||||
} else if (section.id === 'vaultUpgrades') {
|
} else if (section.id === 'vaultUpgrades') {
|
||||||
section.style.height = ''; // eslint-disable-line no-param-reassign
|
section.style.height = ''; // eslint-disable-line no-param-reassign
|
||||||
|
|||||||
@@ -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 = ColourBackPre + 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';
|
||||||
@@ -70,10 +70,10 @@ 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 = ColourTextPre + 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';
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import {
|
import {
|
||||||
ColourBackPre,
|
ColourBackPre,
|
||||||
ColourBlue,
|
ColourBlue,
|
||||||
@@ -20,7 +19,7 @@ import {
|
|||||||
*/
|
*/
|
||||||
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.UpBarColour > 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;
|
||||||
@@ -34,7 +33,7 @@ export default function UpdateUpgrades() {
|
|||||||
let addedColour = 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 (l(`upgrade${i}`).childNodes[j].className.indexOf(ColourBackPre) !== -1) {
|
if (l(`upgrade${i}`).childNodes[j].className.indexOf(ColourBackPre) !== -1) {
|
||||||
l(`upgrade${i}`).childNodes[j].className = ColourBackPre + CacheUpgrades[me.name].color;
|
l(`upgrade${i}`).childNodes[j].className = ColourBackPre + CacheUpgrades[me.name].colour;
|
||||||
addedColour = true;
|
addedColour = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -43,16 +42,16 @@ export default function UpdateUpgrades() {
|
|||||||
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 = ColourBackPre + 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 === ColourBlue) blue += 1;
|
if (CacheUpgrades[me.name].colour === ColourBlue) blue += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColourGreen) green += 1;
|
else if (CacheUpgrades[me.name].colour === ColourGreen) green += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColourYellow) yellow += 1;
|
else if (CacheUpgrades[me.name].colour === ColourYellow) yellow += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColourOrange) orange += 1;
|
else if (CacheUpgrades[me.name].colour === ColourOrange) orange += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColourRed) red += 1;
|
else if (CacheUpgrades[me.name].colour === ColourRed) red += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColourPurple) purple += 1;
|
else if (CacheUpgrades[me.name].colour === ColourPurple) purple += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColourGray) gray += 1;
|
else if (CacheUpgrades[me.name].colour === ColourGray) gray += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
l('CMUpgradeBarBlue').textContent = blue;
|
l('CMUpgradeBarBlue').textContent = blue;
|
||||||
@@ -72,19 +71,16 @@ 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.color = CacheUpgrades[o.name].color;
|
o.colour = CacheUpgrades[o.name].colour;
|
||||||
arr.push(o);
|
arr.push(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CMOptions.SortUpgrades) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortUpgrades) {
|
||||||
|
// Sort by pp colour group, then by pp.
|
||||||
arr.sort((a, b) =>
|
arr.sort((a, b) =>
|
||||||
ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
|
||||||
? 1
|
? a.pp - b.pp
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
: ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
|
||||||
? -1
|
|
||||||
: a.pp < b.pp
|
|
||||||
? -1
|
|
||||||
: 0,
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
arr.sort((a, b) => a.price - b.price);
|
arr.sort((a, b) => a.price - b.price);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
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 Beautify from '../BeautifyAndFormatting/Beautify';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
@@ -12,7 +11,7 @@ import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
|||||||
* @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(priceOfChange / (bonusCPS + Game.cookiesPs));
|
const timeToRecover = FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs));
|
||||||
let bonusCPSPercentage;
|
let bonusCPSPercentage;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
import { CMOptions } from '../Config/VariablesAndData';
|
|
||||||
import Beautify from './BeautifyAndFormatting/Beautify';
|
import Beautify from './BeautifyAndFormatting/Beautify';
|
||||||
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
||||||
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||||
@@ -20,7 +19,7 @@ export default function CMDrawHook() {
|
|||||||
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) {
|
||||||
@@ -28,7 +27,7 @@ export default function CMDrawHook() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update colors
|
// Update colours
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
UpdateUpgradeSectionsHeight();
|
UpdateUpgradeSectionsHeight();
|
||||||
@@ -53,7 +52,7 @@ export default function CMDrawHook() {
|
|||||||
ToggleWrinklerButtons();
|
ToggleWrinklerButtons();
|
||||||
|
|
||||||
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
||||||
if (CMOptions.Scale) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale && !Game.OnAscend) {
|
||||||
let str = l('cookies').innerHTML.replace(/.*(?=<br>)/i, Beautify(Game.cookies));
|
let str = l('cookies').innerHTML.replace(/.*(?=<br>)/i, 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,6 +1,5 @@
|
|||||||
/** 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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,7 +19,9 @@ 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 () {
|
||||||
|
|||||||
@@ -4,24 +4,26 @@ 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 Game.cookiesPs * (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05));
|
return Game.cookiesPs * (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05));
|
||||||
}
|
}
|
||||||
if (CacheWrinklersFattest[1] !== null)
|
if (CacheWrinklersFattest[1] !== null)
|
||||||
if (CMOptions.CalcWrink === 2 && Game.wrinklers[CacheWrinklersFattest[1]].type === 1) {
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 2 &&
|
||||||
|
Game.wrinklers[CacheWrinklersFattest[1]].type === 1
|
||||||
|
) {
|
||||||
return (
|
return (
|
||||||
Game.cookiesPs *
|
Game.cookiesPs *
|
||||||
((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount +
|
((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount +
|
||||||
|
|||||||
@@ -11,23 +11,23 @@ import {
|
|||||||
* This function returns Name and Colour as object for sugar lump type that is given as input param.
|
* 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()
|
* It is called by CM.Disp.UpdateTooltipSugarLump()
|
||||||
* @param {string} type Sugar Lump Type.
|
* @param {string} type Sugar Lump Type.
|
||||||
* @returns {{string}, {string}} text, color An array containing the text and display-color of the sugar lump
|
* @returns {{string}, {string}} text, colour An array containing the text and display-colour of the sugar lump
|
||||||
*/
|
*/
|
||||||
export default function GetLumpColour(type) {
|
export default function GetLumpColour(type) {
|
||||||
if (type === 0) {
|
if (type === 0) {
|
||||||
return { text: 'Normal', color: ColourGray };
|
return { text: 'Normal', colour: ColourGray };
|
||||||
}
|
}
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
return { text: 'Bifurcated', color: ColourGreen };
|
return { text: 'Bifurcated', colour: ColourGreen };
|
||||||
}
|
}
|
||||||
if (type === 2) {
|
if (type === 2) {
|
||||||
return { text: 'Golden', color: ColourYellow };
|
return { text: 'Golden', colour: ColourYellow };
|
||||||
}
|
}
|
||||||
if (type === 3) {
|
if (type === 3) {
|
||||||
return { text: 'Meaty', color: ColourOrange };
|
return { text: 'Meaty', colour: ColourOrange };
|
||||||
}
|
}
|
||||||
if (type === 4) {
|
if (type === 4) {
|
||||||
return { text: 'Caramelized', color: ColourPurple };
|
return { text: 'Caramelized', colour: ColourPurple };
|
||||||
}
|
}
|
||||||
return { text: 'Unknown Sugar Lump', color: ColourRed };
|
return { text: 'Unknown Sugar Lump', colour: ColourRed };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData';
|
import { 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
|
||||||
@@ -7,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();
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
||||||
import {
|
import {
|
||||||
ColourBackPre,
|
ColourBackPre,
|
||||||
@@ -15,17 +14,23 @@ export default function UpdateColours() {
|
|||||||
let str = '';
|
let str = '';
|
||||||
for (let i = 0; i < ColoursOrdering.length; i++) {
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
str += `.${ColourTextPre}${ColoursOrdering[i]} { color: ${
|
str += `.${ColourTextPre}${ColoursOrdering[i]} { color: ${
|
||||||
CMOptions[`Colour${ColoursOrdering[i]}`]
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||||
|
`Colour${ColoursOrdering[i]}`
|
||||||
|
]
|
||||||
}; }\n`;
|
}; }\n`;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < ColoursOrdering.length; i++) {
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
str += `.${ColourBackPre}${ColoursOrdering[i]} { background-color: ${
|
str += `.${ColourBackPre}${ColoursOrdering[i]} { background-color: ${
|
||||||
CMOptions[`Colour${ColoursOrdering[i]}`]
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||||
|
`Colour${ColoursOrdering[i]}`
|
||||||
|
]
|
||||||
}; }\n`;
|
}; }\n`;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < ColoursOrdering.length; i++) {
|
for (let i = 0; i < ColoursOrdering.length; i++) {
|
||||||
str += `.${ColourBorderPre}${ColoursOrdering[i]} { border: 1px solid ${
|
str += `.${ColourBorderPre}${ColoursOrdering[i]} { border: 1px solid ${
|
||||||
CMOptions[`Colour${ColoursOrdering[i]}`]
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||||
|
`Colour${ColoursOrdering[i]}`
|
||||||
|
]
|
||||||
}; }\n`;
|
}; }\n`;
|
||||||
}
|
}
|
||||||
l('CMCSS').textContent = str;
|
l('CMCSS').textContent = str;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/** Functions related to the Bottom Bar */
|
/** Functions related to the Bottom Bar */
|
||||||
|
|
||||||
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
|
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
|
||||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
@@ -34,10 +33,10 @@ 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 = ColourTextPre + color;
|
td.className = ColourTextPre + colour;
|
||||||
td.textContent = text;
|
td.textContent = text;
|
||||||
return td;
|
return td;
|
||||||
};
|
};
|
||||||
@@ -62,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;
|
||||||
@@ -83,16 +86,17 @@ export function UpdateBotBar() {
|
|||||||
2,
|
2,
|
||||||
);
|
);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className =
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className =
|
||||||
ColourTextPre + target[i].color;
|
ColourTextPre + target[i].colour;
|
||||||
let PPString;
|
let PPString;
|
||||||
if (CMOptions.PPDisplayTime) PPString = FormatTime(Math.round(target[i].pp));
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPDisplayTime)
|
||||||
|
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[count].textContent = PPString;
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].textContent = PPString;
|
||||||
const timeColour = GetTimeColour(
|
const timeColour = GetTimeColour(
|
||||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
);
|
);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className =
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className =
|
||||||
ColourTextPre + timeColour.color;
|
ColourTextPre + timeColour.colour;
|
||||||
if (timeColour.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) {
|
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
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ 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 = ColourBackPre + 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');
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/** 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 {
|
||||||
BuffColours,
|
BuffColours,
|
||||||
ColourBackPre,
|
ColourBackPre,
|
||||||
@@ -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: ColourGray },
|
{ id: 'CMTimerBarGCMinBar', colour: ColourGray },
|
||||||
{ id: 'CMTimerBarGCBar', color: ColourPurple },
|
{ 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: ColourGray },
|
{ id: 'CMTimerBarRenMinBar', colour: ColourGray },
|
||||||
{ id: 'CMTimerBarRenBar', color: ColourOrange },
|
{ id: 'CMTimerBarRenBar', colour: ColourOrange },
|
||||||
]);
|
]);
|
||||||
TimerBar.appendChild(CMTimerBarRen);
|
TimerBar.appendChild(CMTimerBarRen);
|
||||||
const TimerBarBuffTimers = document.createElement('div');
|
const TimerBarBuffTimers = document.createElement('div');
|
||||||
@@ -49,13 +54,34 @@ 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;
|
||||||
|
|
||||||
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AutosaveTimerBar &&
|
||||||
|
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
|
// Regulates visibility of Golden Cookie timer
|
||||||
if (Game.shimmerTypes.golden.spawned === 0 && !Game.Has('Golden switch [off]')) {
|
if (Game.shimmerTypes.golden.spawned === 0 && !Game.Has('Golden switch [off]')) {
|
||||||
l('CMTimerBarGC').style.display = '';
|
l('CMTimerBarGC').style.display = '';
|
||||||
@@ -64,7 +90,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('CMTimerBarGCMinBar').textContent = Math.ceil(
|
l('CMTimerBarGCMinBar').textContent = Math.ceil(
|
||||||
(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / Game.fps,
|
(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||||
);
|
);
|
||||||
@@ -84,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,
|
||||||
@@ -92,9 +118,17 @@ export function UpdateTimerBar() {
|
|||||||
) / Game.fps,
|
) / Game.fps,
|
||||||
);
|
);
|
||||||
else l('CMTimerBarGCBar').textContent = '';
|
else l('CMTimerBarGCBar').textContent = '';
|
||||||
l('CMTimerBarGCTime').textContent = Math.ceil(
|
const chanceToSpawn =
|
||||||
|
Math.max(
|
||||||
|
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,
|
(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';
|
||||||
|
|
||||||
@@ -106,7 +140,7 @@ export function UpdateTimerBar() {
|
|||||||
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.time) / Game.fps,
|
(Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||||
);
|
);
|
||||||
@@ -119,7 +153,7 @@ export function UpdateTimerBar() {
|
|||||||
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.minTime,
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime,
|
||||||
@@ -127,9 +161,17 @@ export function UpdateTimerBar() {
|
|||||||
) / Game.fps,
|
) / Game.fps,
|
||||||
);
|
);
|
||||||
else l('CMTimerBarRenBar').textContent = '';
|
else l('CMTimerBarRenBar').textContent = '';
|
||||||
l('CMTimerBarRenTime').textContent = Math.ceil(
|
const chanceToSpawn =
|
||||||
|
Math.max(
|
||||||
|
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,
|
(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';
|
||||||
@@ -145,13 +187,15 @@ export function UpdateTimerBar() {
|
|||||||
]);
|
]);
|
||||||
timer.style.display = '';
|
timer.style.display = '';
|
||||||
let classColour = '';
|
let classColour = '';
|
||||||
// Gives specific timers specific colors
|
// Gives specific timers specific colours
|
||||||
if (typeof BuffColours[Game.buffs[i].name] !== 'undefined') {
|
if (typeof BuffColours[Game.buffs[i].name] !== 'undefined') {
|
||||||
classColour = BuffColours[Game.buffs[i].name];
|
classColour = BuffColours[Game.buffs[i].name];
|
||||||
} else classColour = ColourPurple;
|
} else classColour = ColourPurple;
|
||||||
timer.lastChild.children[1].className = ColourBackPre + classColour;
|
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),
|
||||||
)}%`;
|
)}%`;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default function CreateWrinklerButtons() {
|
|||||||
};
|
};
|
||||||
popAllA.onmouseover = function () {
|
popAllA.onmouseover = function () {
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopAll'), 'this');
|
Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopAllNormal'), 'this');
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
};
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popAllA);
|
l('sectionLeftExtra').children[0].append(popAllA);
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import AddMenuStats from './Statistics/AddStatsPage';
|
import AddMenuStats from './Statistics/AddStatsPage';
|
||||||
import AddMenuInfo from './Info/InfoPage';
|
|
||||||
import AddMenuPref from './Settings/SettingsPage';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function adds the calll the functions to add extra info to the stats and options pages
|
* This function adds the calll the functions to add extra info to the stats and options pages
|
||||||
@@ -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,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.ts';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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,22 +0,0 @@
|
|||||||
/** Creates a Prompt similar to the base game without some of the stuff breaking them */
|
|
||||||
export default function CookieMonsterPrompt(content, options) {
|
|
||||||
Game.promptWrapL.className = 'framed';
|
|
||||||
const str = content;
|
|
||||||
Game.promptL.innerHTML = `${str}<div class="optionBox"></div>`;
|
|
||||||
Object.keys(options).forEach((i) => {
|
|
||||||
const option = document.createElement('a');
|
|
||||||
option.id = `promptOption${i}`;
|
|
||||||
option.className = 'option';
|
|
||||||
option.onclick = function () {
|
|
||||||
PlaySound('snd/tick.mp3');
|
|
||||||
options[i][1]();
|
|
||||||
};
|
|
||||||
option.textContent = options[i][0];
|
|
||||||
Game.promptL.children[1].appendChild(option);
|
|
||||||
});
|
|
||||||
Game.promptAnchorL.style.display = 'block';
|
|
||||||
Game.darkenL.style.display = 'block';
|
|
||||||
Game.promptL.focus();
|
|
||||||
Game.promptOn = 1;
|
|
||||||
Game.UpdatePrompt();
|
|
||||||
}
|
|
||||||
@@ -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,35 +0,0 @@
|
|||||||
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function creates a header-object for the options page
|
|
||||||
* @param {string} config The name of the Config-group
|
|
||||||
* @param {string} text The to-be displayed name of the header
|
|
||||||
* @returns {object} div The header object
|
|
||||||
*/
|
|
||||||
export default function CreatePrefHeader(config, text) {
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.className = 'title';
|
|
||||||
|
|
||||||
div.style.opacity = '0.7';
|
|
||||||
div.style.fontSize = '17px';
|
|
||||||
div.appendChild(document.createTextNode(`${text} `));
|
|
||||||
const span = document.createElement('span'); // Creates the +/- button
|
|
||||||
span.style.cursor = 'pointer';
|
|
||||||
span.style.display = 'inline-block';
|
|
||||||
span.style.height = '14px';
|
|
||||||
span.style.width = '14px';
|
|
||||||
span.style.borderRadius = '7px';
|
|
||||||
span.style.textAlign = 'center';
|
|
||||||
span.style.backgroundColor = '#C0C0C0';
|
|
||||||
span.style.color = 'black';
|
|
||||||
span.style.fontSize = '13px';
|
|
||||||
span.style.verticalAlign = 'middle';
|
|
||||||
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
|
||||||
span.onclick = function () {
|
|
||||||
ToggleHeader(config);
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
div.appendChild(span);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
@@ -1,228 +0,0 @@
|
|||||||
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
|
||||||
import ToggleFavouriteSetting from '../../../Config/Toggles/ToggleFavourites';
|
|
||||||
import { SaveConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
|
||||||
import { ConfigPrefix, ToggleConfig, ToggleConfigVolume } from '../../../Config/ToggleSetting';
|
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
|
||||||
import {} from '../../../Data/Sectionheaders.ts';
|
|
||||||
import Config from '../../../Data/SettingsData';
|
|
||||||
import RefreshScale from '../../HelperFunctions/RefreshScale';
|
|
||||||
import UpdateColours from '../../HelperFunctions/UpdateColours';
|
|
||||||
import Flash from '../../Notifications/Flash';
|
|
||||||
import PlaySound from '../../Notifications/Sound';
|
|
||||||
import { FavouriteSettings, SimpleTooltipElements } from '../../VariablesAndData';
|
|
||||||
import CookieMonsterPrompt from '../Prompt';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function creates the favourite setting star object
|
|
||||||
* @param {string} config The name of the option
|
|
||||||
* @returns {object} div The option object
|
|
||||||
*/
|
|
||||||
function CreateFavouriteStar(config) {
|
|
||||||
const FavStar = document.createElement('a');
|
|
||||||
if (FavouriteSettings.includes(config)) {
|
|
||||||
FavStar.innerText = '★';
|
|
||||||
FavStar.style.color = 'yellow';
|
|
||||||
} else FavStar.innerText = '☆';
|
|
||||||
FavStar.className = 'option';
|
|
||||||
FavStar.onclick = function () {
|
|
||||||
ToggleFavouriteSetting(config);
|
|
||||||
SaveConfig();
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
FavStar.onmouseover = function () {
|
|
||||||
Game.tooltip.draw(this, escape(SimpleTooltipElements.FavouriteSettingPlaceholder.innerHTML));
|
|
||||||
};
|
|
||||||
FavStar.onmouseout = function () {
|
|
||||||
Game.tooltip.hide();
|
|
||||||
};
|
|
||||||
FavStar.appendChild(document.createTextNode(' '));
|
|
||||||
return FavStar;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function creates an option-object for the options page
|
|
||||||
* @param {string} config The name of the option
|
|
||||||
* @returns {object} div The option object
|
|
||||||
*/
|
|
||||||
export default function CreatePrefOption(config) {
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.className = 'listing';
|
|
||||||
if (CMOptions.FavouriteSettings === 1) {
|
|
||||||
div.appendChild(CreateFavouriteStar(config));
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'bool') {
|
|
||||||
const a = document.createElement('a');
|
|
||||||
if (Config[config].toggle && CMOptions[config] === 0) {
|
|
||||||
a.className = 'option off';
|
|
||||||
} else {
|
|
||||||
a.className = 'option';
|
|
||||||
}
|
|
||||||
a.id = ConfigPrefix + config;
|
|
||||||
a.onclick = function () {
|
|
||||||
ToggleConfig(config);
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
a.textContent = Config[config].label[CMOptions[config]];
|
|
||||||
div.appendChild(a);
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config[config].desc;
|
|
||||||
label.style.lineHeight = '1.6';
|
|
||||||
div.appendChild(label);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'vol') {
|
|
||||||
const volume = document.createElement('div');
|
|
||||||
volume.className = 'sliderBox';
|
|
||||||
const title = document.createElement('div');
|
|
||||||
title.style.float = 'left';
|
|
||||||
title.innerHTML = Config[config].desc;
|
|
||||||
volume.appendChild(title);
|
|
||||||
const percent = document.createElement('div');
|
|
||||||
percent.id = `slider${config}right`;
|
|
||||||
percent.style.float = 'right';
|
|
||||||
percent.innerHTML = `${CMOptions[config]}%`;
|
|
||||||
volume.appendChild(percent);
|
|
||||||
const slider = document.createElement('input');
|
|
||||||
slider.className = 'slider';
|
|
||||||
slider.id = `slider${config}`;
|
|
||||||
slider.style.clear = 'both';
|
|
||||||
slider.type = 'range';
|
|
||||||
slider.min = '0';
|
|
||||||
slider.max = '100';
|
|
||||||
slider.step = '1';
|
|
||||||
slider.value = CMOptions[config];
|
|
||||||
slider.oninput = function () {
|
|
||||||
ToggleConfigVolume(config);
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
slider.onchange = function () {
|
|
||||||
ToggleConfigVolume(config);
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
volume.appendChild(slider);
|
|
||||||
div.appendChild(volume);
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.className = 'option';
|
|
||||||
a.onclick = function () {
|
|
||||||
PlaySound(
|
|
||||||
CMOptions[config.replace('Volume', 'SoundURL')],
|
|
||||||
config.replace('Volume', 'Sound'),
|
|
||||||
config,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
a.textContent = 'Test sound';
|
|
||||||
div.appendChild(a);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'url') {
|
|
||||||
const span = document.createElement('span');
|
|
||||||
span.className = 'option';
|
|
||||||
span.textContent = `${Config[config].label} `;
|
|
||||||
span.style.lineHeight = '1.6';
|
|
||||||
div.appendChild(span);
|
|
||||||
const input = document.createElement('input');
|
|
||||||
input.id = ConfigPrefix + config;
|
|
||||||
input.className = 'option';
|
|
||||||
input.type = 'text';
|
|
||||||
input.readOnly = true;
|
|
||||||
input.setAttribute('value', CMOptions[config]);
|
|
||||||
input.style.width = '300px';
|
|
||||||
div.appendChild(input);
|
|
||||||
div.appendChild(document.createTextNode(' '));
|
|
||||||
const inputPrompt = document.createElement('input');
|
|
||||||
inputPrompt.id = `${ConfigPrefix + config}Prompt`;
|
|
||||||
inputPrompt.className = 'option';
|
|
||||||
inputPrompt.type = 'text';
|
|
||||||
inputPrompt.setAttribute('value', CMOptions[config]);
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.className = 'option';
|
|
||||||
a.onclick = function () {
|
|
||||||
CookieMonsterPrompt(inputPrompt.outerHTML, [
|
|
||||||
[
|
|
||||||
'Save',
|
|
||||||
function () {
|
|
||||||
CMOptions[config] = l(`${ConfigPrefix}${config}Prompt`).value;
|
|
||||||
SaveConfig();
|
|
||||||
Game.ClosePrompt();
|
|
||||||
Game.UpdateMenu();
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'Cancel',
|
|
||||||
function () {
|
|
||||||
Game.ClosePrompt();
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
a.textContent = 'Edit';
|
|
||||||
div.appendChild(a);
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config[config].desc;
|
|
||||||
label.style.lineHeight = '1.6';
|
|
||||||
div.appendChild(label);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'colour') {
|
|
||||||
const innerSpan = document.createElement('span');
|
|
||||||
innerSpan.className = 'option';
|
|
||||||
const input = document.createElement('input');
|
|
||||||
input.id = config;
|
|
||||||
input.style.width = '65px';
|
|
||||||
input.setAttribute('value', CMOptions[config]);
|
|
||||||
innerSpan.appendChild(input);
|
|
||||||
const change = function () {
|
|
||||||
CMOptions[this.targetElement.id] = this.toHEXString();
|
|
||||||
UpdateColours();
|
|
||||||
SaveConfig();
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line no-new
|
|
||||||
new JsColor(input, { hash: true, position: 'right', onInput: change });
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config[config].desc;
|
|
||||||
label.style.lineHeight = '1.6';
|
|
||||||
innerSpan.appendChild(label);
|
|
||||||
if (config.includes('Flash')) {
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.className = 'option';
|
|
||||||
a.onclick = function () {
|
|
||||||
Flash(3, config.replace('Colour', ''), true);
|
|
||||||
};
|
|
||||||
a.textContent = 'Test flash';
|
|
||||||
innerSpan.appendChild(a);
|
|
||||||
}
|
|
||||||
div.appendChild(innerSpan);
|
|
||||||
jscolor.init();
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
if (Config[config].type === 'numscale') {
|
|
||||||
const span = document.createElement('span');
|
|
||||||
span.className = 'option';
|
|
||||||
span.textContent = `${Config[config].label} `;
|
|
||||||
span.style.lineHeight = '1.6';
|
|
||||||
div.appendChild(span);
|
|
||||||
const input = document.createElement('input');
|
|
||||||
input.id = ConfigPrefix + config;
|
|
||||||
input.className = 'option';
|
|
||||||
input.type = 'number';
|
|
||||||
input.value = CMOptions[config];
|
|
||||||
input.min = Config[config].min;
|
|
||||||
input.max = Config[config].max;
|
|
||||||
input.oninput = function () {
|
|
||||||
CMOptions[config] = this.value;
|
|
||||||
SaveConfig();
|
|
||||||
RefreshScale();
|
|
||||||
Game.UpdateMenu();
|
|
||||||
};
|
|
||||||
div.appendChild(input);
|
|
||||||
div.appendChild(document.createTextNode(' '));
|
|
||||||
const label = document.createElement('label');
|
|
||||||
label.textContent = Config[config].desc;
|
|
||||||
label.style.lineHeight = '1.6';
|
|
||||||
div.appendChild(label);
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
import { LoadConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
|
||||||
import { ConfigGroups, ConfigGroupsNotification } from '../../../Data/Sectionheaders.ts';
|
|
||||||
import Config from '../../../Data/SettingsData';
|
|
||||||
import ConfigDefault from '../../../Data/SettingsDefault.ts';
|
|
||||||
import { FavouriteSettings } from '../../VariablesAndData';
|
|
||||||
import CreatePrefHeader from './CreateHeader';
|
|
||||||
import CreatePrefOption from './CreateOption';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds the options/settings of CookieMonster to the options page
|
|
||||||
* It is called by CM.Disp.AddMenu
|
|
||||||
* @param {object} title On object that includes the title of the menu
|
|
||||||
*/
|
|
||||||
export default function AddMenuPref(title) {
|
|
||||||
const frag = document.createDocumentFragment();
|
|
||||||
frag.appendChild(title);
|
|
||||||
|
|
||||||
Object.keys(ConfigGroups).forEach((group) => {
|
|
||||||
if (group === 'Favourite') {
|
|
||||||
if (FavouriteSettings.length !== 0 && CMOptions.FavouriteSettings > 0) {
|
|
||||||
frag.appendChild(CreatePrefHeader(group, ConfigGroups[group])); // (group, display-name of group)
|
|
||||||
if (CMOptions.Header[group])
|
|
||||||
for (let index = 0; index < FavouriteSettings.length; index++) {
|
|
||||||
frag.appendChild(CreatePrefOption(FavouriteSettings[index]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
frag.appendChild(CreatePrefHeader(group, ConfigGroups[group])); // (group, display-name of group)
|
|
||||||
if (CMOptions.Header[group]) {
|
|
||||||
// 0 is show, 1 is collapsed
|
|
||||||
// Make sub-sections of Notification section
|
|
||||||
if (group === 'Notification') {
|
|
||||||
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
|
||||||
const subGroupObject = CreatePrefHeader(subGroup, ConfigGroupsNotification[subGroup]); // (group, display-name of group)
|
|
||||||
subGroupObject.style.fontSize = '15px';
|
|
||||||
subGroupObject.style.opacity = '0.5';
|
|
||||||
frag.appendChild(subGroupObject);
|
|
||||||
if (CMOptions.Header[subGroup]) {
|
|
||||||
Object.keys(Config).forEach((option) => {
|
|
||||||
if (Config[option].group === subGroup) frag.appendChild(CreatePrefOption(option));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Object.keys(Config).forEach((option) => {
|
|
||||||
if (Config[option].group === group) frag.appendChild(CreatePrefOption(option));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const resDef = document.createElement('div');
|
|
||||||
resDef.className = 'listing';
|
|
||||||
const resDefBut = document.createElement('a');
|
|
||||||
resDefBut.className = 'option';
|
|
||||||
resDefBut.onclick = function () {
|
|
||||||
LoadConfig(ConfigDefault);
|
|
||||||
};
|
|
||||||
resDefBut.textContent = 'Restore Default';
|
|
||||||
resDef.appendChild(resDefBut);
|
|
||||||
frag.appendChild(resDef);
|
|
||||||
|
|
||||||
l('menu').childNodes[2].insertBefore(
|
|
||||||
frag,
|
|
||||||
l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -4,11 +4,11 @@ import { AddMissingUpgrades } from './CreateMissingUpgrades';
|
|||||||
import * as CreateSections from './CreateStatsSections';
|
import * as CreateSections from './CreateStatsSections';
|
||||||
import * as CreateElements from './CreateDOMElements';
|
import * as CreateElements from './CreateDOMElements';
|
||||||
import * as GameData from '../../../Data/Gamedata.ts';
|
import * as GameData from '../../../Data/Gamedata.ts';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks,
|
CacheAverageClicks,
|
||||||
CacheAverageCookiesFromClicks,
|
CacheAverageCookiesFromClicks,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersNormal,
|
CacheWrinklersNormal,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
@@ -30,37 +30,37 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(title);
|
stats.appendChild(title);
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Lucky Cookies', 'Lucky'));
|
stats.appendChild(CreateElements.StatsHeader('Lucky Cookies', 'Lucky'));
|
||||||
if (CMOptions.Header.Lucky) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Lucky) {
|
||||||
stats.appendChild(CreateSections.LuckySection());
|
stats.appendChild(CreateSections.LuckySection());
|
||||||
}
|
}
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Chain Cookies', 'Chain'));
|
stats.appendChild(CreateElements.StatsHeader('Chain Cookies', 'Chain'));
|
||||||
if (CMOptions.Header.Chain) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Chain) {
|
||||||
stats.appendChild(CreateSections.ChainSection());
|
stats.appendChild(CreateSections.ChainSection());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.Objects['Wizard tower'].minigameLoaded) {
|
if (Game.Objects['Wizard tower'].minigameLoaded) {
|
||||||
stats.appendChild(CreateElements.StatsHeader('Spells', 'Spells'));
|
stats.appendChild(CreateElements.StatsHeader('Spells', 'Spells'));
|
||||||
if (CMOptions.Header.Spells) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Spells) {
|
||||||
stats.appendChild(CreateSections.SpellsSection());
|
stats.appendChild(CreateSections.SpellsSection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.Objects.Farm.minigameLoaded) {
|
if (Game.Objects.Farm.minigameLoaded) {
|
||||||
stats.appendChild(CreateElements.StatsHeader('Garden', 'Garden'));
|
stats.appendChild(CreateElements.StatsHeader('Garden', 'Garden'));
|
||||||
if (CMOptions.Header.Garden) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Garden) {
|
||||||
stats.appendChild(CreateSections.GardenSection());
|
stats.appendChild(CreateSections.GardenSection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Prestige', 'Prestige'));
|
stats.appendChild(CreateElements.StatsHeader('Prestige', 'Prestige'));
|
||||||
if (CMOptions.Header.Prestige) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Prestige) {
|
||||||
stats.appendChild(CreateSections.PrestigeSection());
|
stats.appendChild(CreateSections.PrestigeSection());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.cpsSucked > 0) {
|
if (Game.cpsSucked > 0) {
|
||||||
stats.appendChild(CreateElements.StatsHeader('Wrinklers', 'Wrink'));
|
stats.appendChild(CreateElements.StatsHeader('Wrinklers', 'Wrink'));
|
||||||
if (CMOptions.Header.Wrink) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Wrink) {
|
||||||
const popAllFrag = document.createDocumentFragment();
|
const popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(
|
popAllFrag.appendChild(
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
@@ -100,16 +100,47 @@ export default function AddMenuStats(title) {
|
|||||||
|
|
||||||
stats.appendChild(CreateSections.SeasonSection());
|
stats.appendChild(CreateSections.SeasonSection());
|
||||||
|
|
||||||
|
stats.appendChild(CreateElements.StatsHeader('Achievements', 'Achievs'));
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Achievs) {
|
||||||
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
|
const ObjectsTillNext = CacheObjectsNextAchievement[i];
|
||||||
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
i,
|
||||||
|
ObjectsTillNext.AmountNeeded < 101
|
||||||
|
? document.createTextNode(
|
||||||
|
`Next achievement in ${ObjectsTillNext.AmountNeeded}, price: ${Beautify(
|
||||||
|
ObjectsTillNext.price,
|
||||||
|
)}`,
|
||||||
|
)
|
||||||
|
: document.createTextNode('No new achievement for next 100 buildings'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
||||||
if (CMOptions.Header.Misc) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Misc) {
|
||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Average cookies per second (past ${
|
`Average cookies per second (past ${
|
||||||
CookieTimes[CMOptions.AvgCPSHist] < 60
|
CookieTimes[
|
||||||
? `${CookieTimes[CMOptions.AvgCPSHist]} seconds`
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgCPSHist
|
||||||
: CookieTimes[CMOptions.AvgCPSHist] / 60 +
|
] < 60
|
||||||
(CMOptions.AvgCPSHist === 3 ? ' minute' : ' minutes')
|
? `${
|
||||||
|
CookieTimes[
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgCPSHist
|
||||||
|
]
|
||||||
|
} seconds`
|
||||||
|
: CookieTimes[
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgCPSHist
|
||||||
|
] /
|
||||||
|
60 +
|
||||||
|
(Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgCPSHist === 3
|
||||||
|
? ' minute'
|
||||||
|
: ' minutes')
|
||||||
})`,
|
})`,
|
||||||
document.createTextNode(Beautify(GetCPS(), 3)),
|
document.createTextNode(Beautify(GetCPS(), 3)),
|
||||||
),
|
),
|
||||||
@@ -117,8 +148,14 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Average cookie clicks per second (past ${ClickTimes[CMOptions.AvgClicksHist]}${
|
`Average cookie clicks per second (past ${
|
||||||
CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'
|
ClickTimes[
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist
|
||||||
|
]
|
||||||
|
}${
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist === 0
|
||||||
|
? ' second'
|
||||||
|
: ' seconds'
|
||||||
})`,
|
})`,
|
||||||
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
||||||
),
|
),
|
||||||
@@ -126,13 +163,22 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Cookies from clicking (past ${ClickTimes[CMOptions.AvgClicksHist]}${
|
`Cookies from clicking (past ${
|
||||||
CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'
|
ClickTimes[
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist
|
||||||
|
]
|
||||||
|
}${
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist === 0
|
||||||
|
? ' second'
|
||||||
|
: ' seconds'
|
||||||
})`,
|
})`,
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
Beautify(
|
Beautify(
|
||||||
CacheAverageCookiesFromClicks.calcSum(
|
CacheAverageCookiesFromClicks.calcSum(
|
||||||
CacheAverageClicks * ClickTimes[CMOptions.AvgClicksHist],
|
CacheAverageClicks *
|
||||||
|
ClickTimes[
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -154,7 +200,7 @@ export default function AddMenuStats(title) {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (CMOptions.ShowMissedGC) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ShowMissedGC) {
|
||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
@@ -176,10 +222,10 @@ export default function AddMenuStats(title) {
|
|||||||
|
|
||||||
l('menu').insertBefore(stats, l('menu').childNodes[2]);
|
l('menu').insertBefore(stats, l('menu').childNodes[2]);
|
||||||
|
|
||||||
if (CMOptions.MissingUpgrades) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.MissingUpgrades) {
|
||||||
AddMissingUpgrades();
|
AddMissingUpgrades();
|
||||||
}
|
}
|
||||||
if (CMOptions.MissingAchievements) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.MissingAchievements) {
|
||||||
AddMissingAchievements();
|
AddMissingAchievements();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Section: Functions related to the creation of basic DOM elements page */
|
/** Section: Functions related to the creation of basic DOM elements page */
|
||||||
|
|
||||||
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
|
||||||
import { SimpleTooltipElements } from '../../VariablesAndData';
|
import { SimpleTooltipElements } from '../../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,7 +30,9 @@ export function StatsHeader(text, config) {
|
|||||||
span.style.color = 'black';
|
span.style.color = 'black';
|
||||||
span.style.fontSize = '13px';
|
span.style.fontSize = '13px';
|
||||||
span.style.verticalAlign = 'middle';
|
span.style.verticalAlign = 'middle';
|
||||||
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
span.textContent = Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers[config]
|
||||||
|
? '-'
|
||||||
|
: '+';
|
||||||
span.onclick = function () {
|
span.onclick = function () {
|
||||||
ToggleHeader(config);
|
ToggleHeader(config);
|
||||||
Game.UpdateMenu();
|
Game.UpdateMenu();
|
||||||
@@ -84,6 +86,30 @@ export function StatsListing(type, name, text, placeholder) {
|
|||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates an stats-listing-object for the stats page for missing items displays
|
||||||
|
* It is called by CM.Disp.AddMenuStats()
|
||||||
|
* @param {string} type The type fo the listing
|
||||||
|
* @param {string} name The name of the option
|
||||||
|
* @param {object} text The text-object of the option
|
||||||
|
* @param {bool} current Whether the season of the item is the current season
|
||||||
|
* @returns {object} div The option object
|
||||||
|
*/
|
||||||
|
export function StatsMissDispListing(type, name, text, current) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'listing';
|
||||||
|
|
||||||
|
const listingName = document.createElement('b');
|
||||||
|
listingName.textContent = name;
|
||||||
|
if (current === true)
|
||||||
|
listingName.style.color =
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ColourGreen;
|
||||||
|
div.appendChild(listingName);
|
||||||
|
div.appendChild(document.createTextNode(': '));
|
||||||
|
div.appendChild(text);
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a tooltip containing all missing holiday items contained in the list theMissDisp
|
* This function creates a tooltip containing all missing holiday items contained in the list theMissDisp
|
||||||
* @param {list} theMissDisp A list of the missing holiday items
|
* @param {list} theMissDisp A list of the missing holiday items
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
function CrateTooltipLockedAchievements(me) {
|
function CrateTooltipLockedAchievements(me) {
|
||||||
const tags = [];
|
const tags = [];
|
||||||
if (me.pool === 'shadow') tags.push('Shadow Achievement', '#9700cf');
|
if (me.pool === 'shadow') tags.push('Shadow Achievement', '#9700cf');
|
||||||
@@ -51,7 +49,7 @@ export default function AddMissingAchievements() {
|
|||||||
achievs = i.parentElement.querySelectorAll('div.listing.crateBox')[0];
|
achievs = i.parentElement.querySelectorAll('div.listing.crateBox')[0];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (CMOptions.MissingAchievements) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.MissingAchievements) {
|
||||||
Object.values(achievs.children).forEach((achievsCrate) => {
|
Object.values(achievs.children).forEach((achievsCrate) => {
|
||||||
if (!achievsCrate.className.includes('enabled')) {
|
if (!achievsCrate.className.includes('enabled')) {
|
||||||
const id = achievsCrate.onclick.toString().split(/\[(.*)\]/gi)[1];
|
const id = achievsCrate.onclick.toString().split(/\[(.*)\]/gi)[1];
|
||||||
|
|||||||
@@ -36,12 +36,16 @@ import {
|
|||||||
CacheWrathCookiesMult,
|
CacheWrathCookiesMult,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
} from '../../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
|
||||||
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
|
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
||||||
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
import {
|
||||||
|
StatsListing,
|
||||||
|
StatsHeader,
|
||||||
|
StatsMissDisp,
|
||||||
|
StatsMissDispListing,
|
||||||
|
} from './CreateDOMElements';
|
||||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
|
|
||||||
@@ -562,7 +566,9 @@ export function PrestigeSection() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const HCTarget = Number(CMOptions.HeavenlyChipsTarget);
|
const HCTarget = Number(
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.HeavenlyChipsTarget,
|
||||||
|
);
|
||||||
if (!Number.isNaN(HCTarget)) {
|
if (!Number.isNaN(HCTarget)) {
|
||||||
const CookiesTillTarget =
|
const CookiesTillTarget =
|
||||||
HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||||
@@ -694,13 +700,14 @@ export function SeasonSection() {
|
|||||||
|
|
||||||
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
||||||
section.appendChild(StatsHeader('Season Specials', 'Sea'));
|
section.appendChild(StatsHeader('Season Specials', 'Sea'));
|
||||||
if (CMOptions.Header.Sea) {
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.Sea) {
|
||||||
if (missingHalloweenCookies.length !== 0) {
|
if (missingHalloweenCookies.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Halloween cookies left to buy',
|
'Halloween cookies left to buy',
|
||||||
StatsMissDisp(missingHalloweenCookies),
|
StatsMissDisp(missingHalloweenCookies),
|
||||||
|
Game.season === 'halloween',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
let failRateHalloween = 0.95;
|
let failRateHalloween = 0.95;
|
||||||
@@ -715,7 +722,7 @@ export function SeasonSection() {
|
|||||||
}
|
}
|
||||||
const obtainedCookiesChance = missingHalloweenCookies.length / 7;
|
const obtainedCookiesChance = missingHalloweenCookies.length / 7;
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
@@ -723,15 +730,17 @@ export function SeasonSection() {
|
|||||||
(1 - failRateHalloween * 0.9) * obtainedCookiesChance * 100,
|
(1 - failRateHalloween * 0.9) * obtainedCookiesChance * 100,
|
||||||
)}%`,
|
)}%`,
|
||||||
),
|
),
|
||||||
|
Game.season === 'halloween',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (missingChristmasCookies.length !== 0) {
|
if (missingChristmasCookies.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Christmas cookies left to buy',
|
'Christmas cookies left to buy',
|
||||||
StatsMissDisp(missingChristmasCookies),
|
StatsMissDisp(missingChristmasCookies),
|
||||||
|
Game.season === 'christmas',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
let failRateChristmas = 0.8;
|
let failRateChristmas = 0.8;
|
||||||
@@ -746,21 +755,23 @@ export function SeasonSection() {
|
|||||||
}
|
}
|
||||||
const obtainedCookiesChance = missingChristmasCookies.length / 7;
|
const obtainedCookiesChance = missingChristmasCookies.length / 7;
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a cookie from reindeer',
|
'Chance of receiving a cookie from reindeer',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify((1 - failRateChristmas) * obtainedCookiesChance * 100)}%`,
|
`${Beautify((1 - failRateChristmas) * obtainedCookiesChance * 100)}%`,
|
||||||
),
|
),
|
||||||
|
Game.season === 'christmas',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (missingValentineCookies.length !== 0) {
|
if (missingValentineCookies.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Valentine cookies left to buy',
|
'Valentine cookies left to buy',
|
||||||
StatsMissDisp(missingValentineCookies),
|
StatsMissDisp(missingValentineCookies),
|
||||||
|
Game.season === 'valentines',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -790,40 +801,53 @@ export function SeasonSection() {
|
|||||||
};
|
};
|
||||||
if (missingNormalEggs.length !== 0) {
|
if (missingNormalEggs.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Normal easter eggs left to unlock',
|
'Normal easter eggs left to unlock',
|
||||||
StatsMissDisp(missingNormalEggs),
|
StatsMissDisp(missingNormalEggs),
|
||||||
|
Game.season === 'easter',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving an egg from wrinkler/golden cookie',
|
'Chance of receiving an egg from wrinkler/golden cookie',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify(dropRateEgg(0.9)[0] * 100)}%`,
|
`${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify(dropRateEgg(0.9)[0] * 100)}%`,
|
||||||
),
|
),
|
||||||
|
Game.season === 'easter',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (missingRareEggs.length !== 0) {
|
if (missingRareEggs.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing('basic', 'Rare easter eggs left to unlock', StatsMissDisp(missingRareEggs)),
|
StatsMissDispListing(
|
||||||
|
'basic',
|
||||||
|
'Rare easter eggs left to unlock',
|
||||||
|
StatsMissDisp(missingRareEggs),
|
||||||
|
Game.season === 'easter',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a rare egg from wrinkler/golden cookie',
|
'Chance of receiving a rare egg from wrinkler/golden cookie',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify(dropRateEgg(0.9)[1] * 100)}%`,
|
`${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify(dropRateEgg(0.9)[1] * 100)}%`,
|
||||||
),
|
),
|
||||||
|
Game.season === 'easter',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.season === 'christmas')
|
if (Game.season === 'christmas')
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing('basic', 'Reindeer reward', document.createTextNode(Beautify(CacheSeaSpec))),
|
StatsMissDispListing(
|
||||||
|
'basic',
|
||||||
|
'Reindeer reward',
|
||||||
|
document.createTextNode(Beautify(CacheSeaSpec)),
|
||||||
|
true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (choEgg) {
|
if (choEgg) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
|
|||||||
21
src/Disp/MenuSections/createMenuInfo.js
Normal file
21
src/Disp/MenuSections/createMenuInfo.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { menuFunctions } from '@cookiemonsterteam/cookiemonsterframework';
|
||||||
|
import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata.ts';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the <div> to be added to the Info section
|
||||||
|
* @returns {object} menuDiv Object of the <div> of Cookie Monster in info tab
|
||||||
|
*/
|
||||||
|
export default function createMenuInfo() {
|
||||||
|
const menuDiv = menuFunctions.createModMenuSection(
|
||||||
|
'cookieMonsterMod',
|
||||||
|
'Cookie Monster',
|
||||||
|
'infoMenu',
|
||||||
|
);
|
||||||
|
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.infoMenu) {
|
||||||
|
menuDiv.appendChild(menuFunctions.listings.createInfoListing(ModDescription));
|
||||||
|
menuDiv.appendChild(menuFunctions.listings.createInfoListing(LatestReleaseNotes));
|
||||||
|
}
|
||||||
|
|
||||||
|
return menuDiv;
|
||||||
|
}
|
||||||
96
src/Disp/MenuSections/createMenuOptions.js
Normal file
96
src/Disp/MenuSections/createMenuOptions.js
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
import { menuFunctions as mF } from '@cookiemonsterteam/cookiemonsterframework';
|
||||||
|
import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders.ts';
|
||||||
|
import settings from '../../Data/settings';
|
||||||
|
import UpdateColours from '../HelperFunctions/UpdateColours';
|
||||||
|
import RefreshScale from '../HelperFunctions/RefreshScale';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the <div> to be added to the Options section
|
||||||
|
* @returns {object} menuDiv Object of the <div> of Cookie Monster in options tab
|
||||||
|
*/
|
||||||
|
export default function createMenuOptions() {
|
||||||
|
const menuDiv = mF.createModMenuSection('cookieMonsterMod', 'Cookie Monster', 'optionsMenu');
|
||||||
|
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers.optionsMenu) {
|
||||||
|
Object.keys(ConfigGroups).forEach((group) => {
|
||||||
|
if (group === 'Favourite') {
|
||||||
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.favouriteSettings.length !==
|
||||||
|
0 &&
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.FavouriteSettings > 0
|
||||||
|
) {
|
||||||
|
menuDiv.appendChild(
|
||||||
|
mF.listings.createOptionsSubHeader('cookieMonsterMod', group, ConfigGroups[group]),
|
||||||
|
);
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers[group])
|
||||||
|
for (
|
||||||
|
let index = 0;
|
||||||
|
index <
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.favouriteSettings.length;
|
||||||
|
index++
|
||||||
|
) {
|
||||||
|
menuDiv.appendChild(
|
||||||
|
mF.listings.createOptionsListing(
|
||||||
|
'cookieMonsterMod',
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.favouriteSettings[
|
||||||
|
index
|
||||||
|
],
|
||||||
|
settings,
|
||||||
|
UpdateColours,
|
||||||
|
RefreshScale,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
menuDiv.appendChild(
|
||||||
|
mF.listings.createOptionsSubHeader('cookieMonsterMod', group, ConfigGroups[group]),
|
||||||
|
);
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers[group]) {
|
||||||
|
// 0 is show, 1 is collapsed
|
||||||
|
// Make sub-sections of Notification section
|
||||||
|
if (group === 'Notification') {
|
||||||
|
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
||||||
|
const subGroupObject = mF.listings.createOptionsSubHeader(
|
||||||
|
'cookieMonsterMod',
|
||||||
|
subGroup,
|
||||||
|
ConfigGroupsNotification[subGroup],
|
||||||
|
);
|
||||||
|
subGroupObject.style.fontSize = '15px';
|
||||||
|
subGroupObject.style.opacity = '0.5';
|
||||||
|
menuDiv.appendChild(subGroupObject);
|
||||||
|
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.headers[subGroup]) {
|
||||||
|
Object.keys(settings).forEach((option) => {
|
||||||
|
if (settings[option].group === subGroup)
|
||||||
|
menuDiv.appendChild(
|
||||||
|
mF.listings.createOptionsListing(
|
||||||
|
'cookieMonsterMod',
|
||||||
|
option,
|
||||||
|
settings,
|
||||||
|
UpdateColours,
|
||||||
|
RefreshScale,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Object.keys(settings).forEach((option) => {
|
||||||
|
if (settings[option].group === group)
|
||||||
|
menuDiv.appendChild(
|
||||||
|
mF.listings.createOptionsListing(
|
||||||
|
'cookieMonsterMod',
|
||||||
|
option,
|
||||||
|
settings,
|
||||||
|
UpdateColours,
|
||||||
|
RefreshScale,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return menuDiv;
|
||||||
|
}
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { isInitializing } from '../../InitSaveLoad/Variables';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function creates a flash depending on configs. It is called by all functions
|
|
||||||
* that check game-events and which have settings for Flashes (e.g., Golden Cookies appearing, Magic meter being full)
|
|
||||||
* @param {number} mode Sets the intensity of the flash, used to recursively dim flash
|
|
||||||
* All calls of function have use mode === 3
|
|
||||||
* @param {string} config The setting in CM.Options that is checked before creating the flash
|
|
||||||
* @param {bool} forced Whether the sound should play regardless of settings, used to test the sound
|
|
||||||
*/
|
|
||||||
export default function Flash(mode, config, forced) {
|
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
|
||||||
if (
|
|
||||||
((CMOptions[config] === 1 || forced) && mode === 3 && isInitializing === false) ||
|
|
||||||
mode === 1
|
|
||||||
) {
|
|
||||||
l('CMFlashScreen').style.backgroundColor = CMOptions[`Colour${config}`];
|
|
||||||
l('CMFlashScreen').style.opacity = '0.5';
|
|
||||||
if (mode === 3) {
|
|
||||||
l('CMFlashScreen').style.display = 'inline';
|
|
||||||
setTimeout(() => {
|
|
||||||
Flash(2, config, true);
|
|
||||||
}, 1000 / Game.fps);
|
|
||||||
} else {
|
|
||||||
setTimeout(() => {
|
|
||||||
Flash(0, config, true);
|
|
||||||
}, 1000 / Game.fps);
|
|
||||||
}
|
|
||||||
} else if (mode === 2) {
|
|
||||||
l('CMFlashScreen').style.opacity = '1';
|
|
||||||
setTimeout(() => {
|
|
||||||
Flash(1, config, true);
|
|
||||||
}, 1000 / Game.fps);
|
|
||||||
} else if (mode === 0) l('CMFlashScreen').style.display = 'none';
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
/** Functions related to the flashes/sound/notifications */
|
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { isInitializing } from '../../InitSaveLoad/Variables';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function creates a notifcation depending on configs. It is called by all functions
|
|
||||||
* that check game-events and which have settings for notifications (e.g., Golden Cookies appearing, Magic meter being full)
|
|
||||||
* @param {string} notifyConfig The setting in CM.Options that is checked before creating the notification
|
|
||||||
* @param {string} title The title of the to-be created notifications
|
|
||||||
* @param {string} message The text of the to-be created notifications
|
|
||||||
*/
|
|
||||||
export default function CreateNotification(notifyConfig, title, message) {
|
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
|
||||||
if (
|
|
||||||
CMOptions[notifyConfig] === 1 &&
|
|
||||||
document.visibilityState === 'hidden' &&
|
|
||||||
isInitializing === false
|
|
||||||
) {
|
|
||||||
const CookieIcon = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
|
||||||
// eslint-disable-next-line no-new
|
|
||||||
new Notification(title, { body: message, badge: CookieIcon });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { isInitializing } from '../../InitSaveLoad/Variables';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function plays a sound depending on configs. It is called by all functions
|
|
||||||
* that check game-events and which have settings for sound (e.g., Golden Cookies appearing, Magic meter being full)
|
|
||||||
* @param {variable} url A variable that gives the url for the sound (e.g., CM.Options.GCSoundURL)
|
|
||||||
* @param {string} sndConfig The setting in CM.Options that is checked before creating the sound
|
|
||||||
* @param {string} volConfig The setting in CM.Options that is checked to determine volume
|
|
||||||
* @param {bool} forced Whether the sound should play regardless of settings, used to test the sound
|
|
||||||
*/
|
|
||||||
export default function PlaySound(url, sndConfig, volConfig, forced) {
|
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
|
||||||
if ((CMOptions[sndConfig] === 1 || forced) && isInitializing === false) {
|
|
||||||
// eslint-disable-next-line new-cap
|
|
||||||
const sound = new Audio(url);
|
|
||||||
if (CMOptions.GeneralSound) sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
|
||||||
else sound.volume = CMOptions[volConfig] / 100;
|
|
||||||
sound.play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
import { CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { LastGoldenCookieState } from '../../Main/VariablesAndData';
|
import { LastGoldenCookieState } from '../../Main/VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,9 +17,15 @@ export function CreateFavicon() {
|
|||||||
* By relying on CM.Cache.spawnedGoldenShimmer it only changes for non-user spawned cookie
|
* By relying on CM.Cache.spawnedGoldenShimmer it only changes for non-user spawned cookie
|
||||||
*/
|
*/
|
||||||
export function UpdateFavicon() {
|
export function UpdateFavicon() {
|
||||||
if (CMOptions.Favicon === 1 && LastGoldenCookieState > 0) {
|
if (
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Favicon === 1 &&
|
||||||
|
LastGoldenCookieState > 0
|
||||||
|
) {
|
||||||
if (CacheSpawnedGoldenShimmer.wrath)
|
if (CacheSpawnedGoldenShimmer.wrath)
|
||||||
l('CMFavicon').href = 'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico';
|
l('CMFavicon').href =
|
||||||
else l('CMFavicon').href = 'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico';
|
'https://CookieMonsterTeam.github.io/CookieMonster/favicon/wrathCookie.ico';
|
||||||
|
else
|
||||||
|
l('CMFavicon').href =
|
||||||
|
'https://CookieMonsterTeam.github.io/CookieMonster/favicon/goldenCookie.ico';
|
||||||
} else l('CMFavicon').href = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
} else l('CMFavicon').href = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Functions related to updating the tab in the browser's tab-bar */
|
/** Functions related to updating the tab in the browser's tab-bar */
|
||||||
|
|
||||||
import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData';
|
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData';
|
||||||
import { Title } from '../VariablesAndData';
|
import { Title } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -10,9 +10,12 @@ import { Title } from '../VariablesAndData';
|
|||||||
* It is called on every loop by Game.Logic() which also sets CM.Disp.Title to Game.cookies
|
* It is called on every loop by Game.Logic() which also sets CM.Disp.Title to Game.cookies
|
||||||
*/
|
*/
|
||||||
export default function UpdateTitle() {
|
export default function UpdateTitle() {
|
||||||
if (Game.OnAscend || CMOptions.Title === 0) {
|
if (
|
||||||
|
Game.OnAscend ||
|
||||||
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Title === 0
|
||||||
|
) {
|
||||||
document.title = Title;
|
document.title = Title;
|
||||||
} else if (CMOptions.Title === 1) {
|
} else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Title === 1) {
|
||||||
let addFC = false;
|
let addFC = false;
|
||||||
let addSP = false;
|
let addSP = false;
|
||||||
let titleGC;
|
let titleGC;
|
||||||
@@ -50,7 +53,7 @@ export default function UpdateTitle() {
|
|||||||
str = str.substring(str.lastIndexOf(']') + 1);
|
str = str.substring(str.lastIndexOf(']') + 1);
|
||||||
}
|
}
|
||||||
document.title = `${titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '')} ${str}`;
|
document.title = `${titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '')} ${str}`;
|
||||||
} else if (CMOptions.Title === 2) {
|
} else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Title === 2) {
|
||||||
let str = '';
|
let str = '';
|
||||||
let spawn = false;
|
let spawn = false;
|
||||||
if (CacheSpawnedGoldenShimmer) {
|
if (CacheSpawnedGoldenShimmer) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import {
|
|||||||
CacheLastHeavenlyChips,
|
CacheLastHeavenlyChips,
|
||||||
CacheTimeTillNextPrestige,
|
CacheTimeTillNextPrestige,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,16 +20,15 @@ export default function ReplaceAscendTooltip() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const startDate = Game.sayTime(((Date.now() - Game.startDate) / 1000) * Game.fps, -1);
|
const startDate = Game.sayTime(((Date.now() - Game.startDate) / 1000) * Game.fps, -1);
|
||||||
let str = '';
|
let str = `You've been on this run for <b>${
|
||||||
str += `You've been on this run for <b>${
|
|
||||||
startDate === '' ? 'not very long' : startDate
|
startDate === '' ? 'not very long' : startDate
|
||||||
}</b>.<br>`;
|
}</b>.<br>
|
||||||
str += '<div class="line"></div>';
|
<div class="line"></div>`;
|
||||||
if (Game.prestige > 0) {
|
if (Game.prestige > 0) {
|
||||||
str += `Your prestige level is currently <b>${Beautify(Game.prestige)}</b>.<br>(CpS +${Beautify(
|
str += `Your prestige level is currently <b>${Beautify(Game.prestige)}</b>.<br>(CpS +${Beautify(
|
||||||
Game.prestige,
|
Game.prestige,
|
||||||
)}%)`;
|
)}%)
|
||||||
str += '<div class="line"></div>';
|
<div class="line"></div>`;
|
||||||
}
|
}
|
||||||
if (CacheLastHeavenlyChips < 1) str += 'Ascending now would grant you no prestige.';
|
if (CacheLastHeavenlyChips < 1) str += 'Ascending now would grant you no prestige.';
|
||||||
else if (CacheLastHeavenlyChips < 2)
|
else if (CacheLastHeavenlyChips < 2)
|
||||||
@@ -42,10 +40,10 @@ export default function ReplaceAscendTooltip() {
|
|||||||
)} prestige levels</b> (+${Beautify(CacheLastHeavenlyChips)}% CpS)<br>and <b>${Beautify(
|
)} prestige levels</b> (+${Beautify(CacheLastHeavenlyChips)}% CpS)<br>and <b>${Beautify(
|
||||||
CacheLastHeavenlyChips,
|
CacheLastHeavenlyChips,
|
||||||
)} heavenly chips</b> to spend.`;
|
)} heavenly chips</b> to spend.`;
|
||||||
str += '<div class="line"></div>';
|
str += `<div class="line"></div>
|
||||||
str += `You need <b>${Beautify(cookiesToNext)} more cookies</b> for the next level.<br>`;
|
You need <b>${Beautify(cookiesToNext)} more cookies</b> for the next level.<br>
|
||||||
str += `${
|
${
|
||||||
CMOptions.TooltipAscendButton
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipAscendButton
|
||||||
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify(
|
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify(
|
||||||
CacheHCPerSecond,
|
CacheHCPerSecond,
|
||||||
2,
|
2,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import {
|
import {
|
||||||
ColourTextPre,
|
ColourTextPre,
|
||||||
ColourBorderPre,
|
ColourBorderPre,
|
||||||
@@ -54,18 +53,18 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.style.bottom = 'auto';
|
TooltipWarn.style.bottom = 'auto';
|
||||||
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
||||||
|
|
||||||
const create = function (boxId, color, labelTextFront, labelTextBack, deficitId) {
|
const create = function (boxId, colour, labelTextFront, labelTextBack, deficitId) {
|
||||||
const box = document.createElement('div');
|
const box = document.createElement('div');
|
||||||
box.id = boxId;
|
box.id = boxId;
|
||||||
box.style.display = 'none';
|
box.style.display = 'none';
|
||||||
box.style.transition = 'opacity 0.1s ease-out';
|
box.style.transition = 'opacity 0.1s ease-out';
|
||||||
box.className = ColourBorderPre + color;
|
box.className = ColourBorderPre + colour;
|
||||||
box.style.padding = '2px';
|
box.style.padding = '2px';
|
||||||
box.style.background = '#000 url(img/darkNoise.png)';
|
box.style.background = '#000 url(img/darkNoise.png)';
|
||||||
const labelDiv = document.createElement('div');
|
const labelDiv = document.createElement('div');
|
||||||
box.appendChild(labelDiv);
|
box.appendChild(labelDiv);
|
||||||
const labelSpan = document.createElement('span');
|
const labelSpan = document.createElement('span');
|
||||||
labelSpan.className = ColourTextPre + color;
|
labelSpan.className = ColourTextPre + colour;
|
||||||
labelSpan.style.fontWeight = 'bold';
|
labelSpan.style.fontWeight = 'bold';
|
||||||
labelSpan.textContent = labelTextFront;
|
labelSpan.textContent = labelTextFront;
|
||||||
labelDiv.appendChild(labelSpan);
|
labelDiv.appendChild(labelSpan);
|
||||||
@@ -134,7 +133,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
'CMDispTooltipWarnUser',
|
'CMDispTooltipWarnUser',
|
||||||
ColourRed,
|
ColourRed,
|
||||||
'Warning: ',
|
'Warning: ',
|
||||||
`Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`,
|
`Purchase of this item will put you under the number of Cookies equal to ${Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ToolWarnUser} seconds of CPS`,
|
||||||
'CMDispTooltipWarnUserText',
|
'CMDispTooltipWarnUserText',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function updates the location of the tooltip
|
* This function updates the location of the tooltip
|
||||||
* It is called by Game.tooltip.update() because of CM.Main.ReplaceNative()
|
* It is called by Game.tooltip.update() because of CM.Main.ReplaceNative()
|
||||||
@@ -8,8 +6,8 @@ export default function UpdateTooltipLocation() {
|
|||||||
if (Game.tooltip.origin === 'store') {
|
if (Game.tooltip.origin === 'store') {
|
||||||
let warnOffset = 0;
|
let warnOffset = 0;
|
||||||
if (
|
if (
|
||||||
CMOptions.ToolWarnLucky === 1 &&
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ToolWarnLucky === 1 &&
|
||||||
CMOptions.ToolWarnPos === 1 &&
|
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ToolWarnPos === 1 &&
|
||||||
l('CMDispTooltipWarningParent') !== null
|
l('CMDispTooltipWarningParent') !== null
|
||||||
) {
|
) {
|
||||||
warnOffset = l('CMDispTooltipWarningParent').clientHeight - 4;
|
warnOffset = l('CMDispTooltipWarningParent').clientHeight - 4;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user