Compare commits

...

274 Commits

Author SHA1 Message Date
dependabot[bot]
8747da2c11 Bump @eslint/js from 9.21.0 to 9.27.0
Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.21.0 to 9.27.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/commits/v9.27.0/packages/js)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 9.27.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 02:40:27 +00:00
WiseDragoon
bd772e3712 Update CalculateLuckyLevels.js (#1217)
* Update CalculateLuckyLevels.js

Fixed infinite loop when currentLevel is too big

* Update CalculateLuckyLevels.js Dev build

* Update CalculateLuckyLevels.js Final build
2025-03-16 20:43:05 +01:00
Kevin Radloff
69b923de89 Show spells cast progress towards next achievement in stats 2025-03-03 20:44:43 +01:00
Kevin Radloff
4e6c828f8b Minor refactor to remove unused probability functions and combine functions that were only used in one spot. 2025-02-26 21:42:20 +01:00
Kevin Radloff
270190feae Change <0% GC/reindeer chance formatting to show <1% instead. 2025-02-26 21:42:20 +01:00
dependabot[bot]
13dd628623 Bump @eslint/compat from 1.2.6 to 1.2.7
Bumps [@eslint/compat](https://github.com/eslint/rewrite) from 1.2.6 to 1.2.7.
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/compat-v1.2.6...compat-v1.2.7)

---
updated-dependencies:
- dependency-name: "@eslint/compat"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:29:59 +01:00
dependabot[bot]
5604a63652 Bump prettier from 3.5.1 to 3.5.2
Bumps [prettier](https://github.com/prettier/prettier) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.5.1...3.5.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:29:34 +01:00
dependabot[bot]
3f867b9023 Bump globals from 15.15.0 to 16.0.0
Bumps [globals](https://github.com/sindresorhus/globals) from 15.15.0 to 16.0.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v15.15.0...v16.0.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:26:04 +01:00
dependabot[bot]
d4e243f2b7 Bump eslint from 9.20.1 to 9.21.0
Bumps [eslint](https://github.com/eslint/eslint) from 9.20.1 to 9.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.20.1...v9.21.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:23:46 +01:00
Kevin Radloff
989e984eb5 Remove Cookie Clicker version check and the need for user confirmation. 2025-02-17 21:45:00 +01:00
dependabot[bot]
6e4644c3cc Bump chai from 4.5.0 to 5.2.0
Bumps [chai](https://github.com/chaijs/chai) from 4.5.0 to 5.2.0.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.5.0...v5.2.0)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-16 15:01:00 +01:00
Daniël van Noord
379593f7fc Remove more whitespace 2025-02-16 14:56:41 +01:00
Kevin Radloff
16ec2ff06a Specify node 22, npm update, and remove some whitespace. 2025-02-16 14:56:41 +01:00
Kevin Radloff
933a017335 Attempt to fix pre-commit hooks. 2025-02-16 14:56:41 +01:00
Kevin Radloff
492abb66dc Try out removing prettier args from pre-commit config. 2025-02-16 14:56:41 +01:00
Kevin Radloff
a1aaa3de8f Update dependencies and remove unneeded things. This allows building on node v22. Also rely on configs for eslint/prettier so CI and command line runs are guaranteed to be consistent. 2025-02-16 14:56:41 +01:00
Numbernaut
9e98208c19 Fixed Golden Cookie percentage calculation to cdf #921 (#1190)
* Added cummulative probability handling

* executed build-dev command

* executed build-final command
2024-09-08 11:17:00 +02:00
srs420
ca1c28d1fc Add stock market tooltip info (#1189)
* Add info to stock market tooltips

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add up and down arrows to expected value

---------

Co-authored-by: srs42006 <45675882+srs42006@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-02 09:22:02 +02:00
dependabot[bot]
ce14fa6190 Bump chai and @types/chai
Bumps [chai](https://github.com/chaijs/chai) and [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai). These dependencies needed to be updated together.

Updates `chai` from 4.3.6 to 4.3.7
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/4.x.x/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.3.6...v4.3.7)

Updates `@types/chai` from 4.3.1 to 4.3.4
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 10:01:08 +02:00
dependabot[bot]
ec2c498b71 Bump eslint-config-prettier from 8.5.0 to 8.8.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.5.0 to 8.8.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.5.0...v8.8.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 09:59:43 +02:00
dependabot[bot]
657ca1a963 Bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 09:59:29 +02:00
pre-commit-ci[bot]
f6ebfef6cd [pre-commit.ci] pre-commit autoupdate (#1169) 2024-05-11 09:59:08 +02:00
Jeong Hansol
133ed74877 Calculations of lucky levels (#1179) 2024-05-11 09:57:46 +02:00
pre-commit-ci[bot]
8e975c2b20 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.6 → v3.0.2](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.6...v3.0.2)
2023-08-22 09:37:29 +02:00
Grace Carr
d8b9d2f20c Revert "update calculations for lucky levels (#1161)"
This reverts commit 9f78e14bec.
2023-07-17 20:18:06 +02:00
Grace Carr
9f78e14bec update calculations for lucky levels (#1161)
* update calculations for lucky levels

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-17 09:40:29 +02:00
jessedufrene
7269577009 Add cookieclicker.ee to supported userscript sites 2023-06-22 21:26:58 +02:00
Stefan Ravn van Overeem
8d89f23c35 Support 2.052 (#1153)
* Support 2.052

Support new upgrades and achievements in 2.052:
- Fortune #020
- Kitten strategists
- Septcentennial (Have 700 of everything)
- Oft we mar what's well (700 upgrades)
- Undecillion fingers
- 900 and 1000 cursors
- Omniplast mouse

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-07 13:19:49 +02:00
dependabot[bot]
78f62affc5 Bump eslint-plugin-import from 2.26.0 to 2.27.5 (#1146)
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.26.0 to 2.27.5.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.26.0...v2.27.5)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
2023-04-18 17:05:42 +02:00
pre-commit-ci[bot]
4b8c35f271 [pre-commit.ci] pre-commit autoupdate (#1116)
updates:
- [github.com/pre-commit/mirrors-prettier: v2.7.1 → v3.0.0-alpha.6](https://github.com/pre-commit/mirrors-prettier/compare/v2.7.1...v3.0.0-alpha.6)
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
2023-04-18 14:49:38 +00:00
dependabot[bot]
1d19545a43 Bump prettier from 2.7.1 to 2.8.7
Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 to 2.8.7.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.7.1...2.8.7)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-18 16:47:29 +02:00
Costas Basdekis
76d531a5b0 Fix buying with block protection & exact cookies
The check was wrong, since it wouldn't allow you to buy a building
for the exact amount of cookies in your bank, for example when
you're trying to buy your first cursor after clicking exactly 15 times.
2023-03-15 09:04:21 +01:00
dependabot[bot]
54bb9f793b Bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:55:20 +01:00
dependabot[bot]
70cc97b0e0 Bump webpack from 5.73.0 to 5.76.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.73.0 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.73.0...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:53:50 +01:00
dependabot[bot]
adf6544e21 Bump eslint from 8.20.0 to 8.36.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.20.0 to 8.36.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.20.0...v8.36.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:53:12 +01:00
dependabot[bot]
93702eefbe Bump terser from 5.8.0 to 5.14.2
Bumps [terser](https://github.com/terser/terser) from 5.8.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 09:07:44 +02:00
dependabot[bot]
88eb28c5dd Bump eslint from 8.19.0 to 8.20.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.19.0 to 8.20.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.19.0...v8.20.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 04:58:47 +02:00
dependabot[bot]
049d0153fb Bump eslint from 8.18.0 to 8.19.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.18.0 to 8.19.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.18.0...v8.19.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-08 15:10:48 +02:00
dependabot[bot]
131547ec00 Bump shell-quote from 1.7.2 to 1.7.3
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 14:07:20 +02:00
dependabot[bot]
5e92bb5fa5 Bump eslint from 7.32.0 to 8.18.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.32.0 to 8.18.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.32.0...v8.18.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-19 21:04:50 +02:00
Daniël van Noord
5ebfdfd48e Add additional hooks to pre-commit 2022-06-19 21:02:02 +02:00
Daniël van Noord
1f685f823a Rebuild files 2022-06-19 20:59:45 +02:00
Daniël van Noord
197b744f56 Add exclude to prettier 2022-06-19 20:59:41 +02:00
Daniël van Noord
ab73a78a01 Add prettier to pre-commit and run it 2022-06-19 20:57:42 +02:00
Daniël van Noord
8cfc980546 Remove everything related to TypeScript 2022-06-19 20:50:56 +02:00
dependabot[bot]
3fddc1d249 Bump prettier from 2.6.2 to 2.7.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.6.2 to 2.7.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.6.2...2.7.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-19 20:42:34 +02:00
dependabot[bot]
2555828eb9 Bump webpack-cli from 4.9.2 to 4.10.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.9.2 to 4.10.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.9.2...webpack-cli@4.10.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-16 14:40:04 +02:00
dependabot[bot]
66b2c567c2 Bump ts-node from 10.8.0 to 10.8.1
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.8.0 to 10.8.1.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.8.0...v10.8.1)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:12:28 +02:00
dependabot[bot]
dd66674169 Bump typescript from 4.7.2 to 4.7.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.2 to 4.7.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.7.2...v4.7.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:05:31 +02:00
dependabot[bot]
cfca658703 Bump webpack from 5.72.1 to 5.73.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.72.1 to 5.73.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.72.1...v5.73.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:04:16 +02:00
dependabot[bot]
a607842fdd Bump chai from 4.3.4 to 4.3.6
Bumps [chai](https://github.com/chaijs/chai) from 4.3.4 to 4.3.6.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/4.x.x/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.3.4...v4.3.6)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:02:56 +02:00
dependabot[bot]
501b2df220 Bump eslint-config-prettier from 8.3.0 to 8.5.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.3.0 to 8.5.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.3.0...v8.5.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:02:18 +02:00
domoddball
1027d48b51 Resolve conjured baked goods tooltip miscalculation #1074 (#1087) 2022-06-04 10:42:18 +02:00
domoddball
fdcbbd7ab2 Add support for unshackled upgrades (#1086) 2022-06-03 12:19:06 +02:00
domoddball
9bfb8a44f9 Resolve Grimoire magic bar text rendering bug #1083 (#1084) 2022-06-02 08:26:04 +02:00
domoddball
fec312df1c Updates for cookieclicker v2.048 #1049 (#1079)
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
2022-06-01 19:10:16 +02:00
dependabot[bot]
1f23e58984 Bump ts-loader from 9.2.5 to 9.3.0
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.5 to 9.3.0.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.5...v9.3.0)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:59:31 +02:00
dependabot[bot]
b1812afa2f Bump webpack from 5.72.0 to 5.72.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.72.0 to 5.72.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.72.0...v5.72.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:59:20 +02:00
dependabot[bot]
22b8c8a61c Bump ts-node from 10.2.1 to 10.8.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.2.1 to 10.8.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.2.1...v10.8.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:53:31 +02:00
dependabot[bot]
25838daede Bump webpack-cli from 4.8.0 to 4.9.2
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.8.0 to 4.9.2.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.8.0...webpack-cli@4.9.2)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:51:41 +02:00
dependabot[bot]
21c0042c24 Bump typescript from 4.4.3 to 4.7.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.3 to 4.7.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.3...v4.7.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:51:30 +02:00
dependabot[bot]
b12fd5db72 Bump @typescript-eslint/eslint-plugin from 4.31.1 to 4.33.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.31.1 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 21:02:02 +02:00
dependabot[bot]
ef7d46b6dc Bump @typescript-eslint/parser from 4.31.1 to 4.33.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.31.1 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:56:45 +02:00
dependabot[bot]
ff8fe0644a Bump eslint-plugin-import from 2.24.2 to 2.26.0
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.24.2 to 2.26.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.24.2...v2.26.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:56:35 +02:00
dependabot[bot]
6779133dd8 Bump ansi-regex from 3.0.0 to 3.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:56:22 +02:00
dependabot[bot]
097ccd2048 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:57 +02:00
dependabot[bot]
c45a630286 Bump prettier from 2.3.2 to 2.6.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.6.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.6.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:39 +02:00
dependabot[bot]
30809c7b45 Bump @types/chai from 4.2.21 to 4.3.1
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.21 to 4.3.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:29 +02:00
dependabot[bot]
db8d722479 Bump webpack from 5.52.1 to 5.72.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.52.1 to 5.72.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.52.1...v5.72.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:17 +02:00
humdogm
79f8079228 Re-order Garden max rewards by amount of cookies
Build CookieMonsterDev.js and .js.map
Ran npm build-dev
2022-04-20 20:51:57 +02:00
Daniël van Noord
9d101ddfd4 Merge pull request #1037 from dsf3449/dev
fix: duplicated cookie notation
2021-12-30 09:28:16 +01:00
dsf3449
0e69ac39dc Remove no longer needed Beautify call 2021-12-30 01:03:53 -06:00
Daniël van Noord
f0757d2490 Bump cookiemonsterframework to 0.2.3 2021-09-29 23:03:37 +02:00
Daniël van Noord
65754bc29d Fix jumping of options screen 2021-09-29 21:10:25 +02:00
Daniël van Noord
1d26217f80 Merge pull request #994 from benblank/cmd-cache
Export caches via CookieMonsterData
2021-09-22 12:34:39 +02:00
Ben Blank
c0751438b6 Rebuild after updating dependencies. 2021-09-16 16:52:20 -07:00
Ben Blank
53ed8fe167 Fix handling of undefined in FillCMDCache. 2021-09-15 12:16:10 -07:00
Ben Blank
74e7c64ca2 Export caches via CookieMonsterData. 2021-09-15 12:14:22 -07:00
Daniël van Noord
809bd4d35d Update dependencies 2021-09-14 21:15:35 +02:00
Daniël van Noord
348ba4b9fd Rebuild CM.js 2021-09-14 21:07:36 +02:00
Daniël van Noord
9e783cc3d7 Bump cookiemonsterframework to 0.2.2 2021-09-14 21:06:19 +02:00
Daniël van Noord
6766c05091 Use issue forms instead of issue templates 2021-09-10 10:14:16 +02:00
Daniël van Noord
1f6ca9ebe6 Merge pull request #981 from DanielNoord/dev
Fix Krumblor
2021-09-06 15:46:38 +02:00
Daniël van Noord
bbf31fe96f Merge branch 'dev' of https://github.com/CookieMonsterTeam/CookieMonster into dev 2021-09-06 15:44:24 +02:00
Daniël van Noord
4be3942af3 Fix Krumblor on Steam 2021-09-06 15:43:41 +02:00
Daniël van Noord
488233c8dd Merge pull request #979 from Pidgeot/dev
Disable automatic sizing on grimoire bar to allow text to fit
2021-09-05 20:15:11 +02:00
Daniël van Noord
a89f1eed1a Update src/Main/ReplaceGameElements/NativeGrimoire.js 2021-09-05 20:13:58 +02:00
Michael Madsen
790cf411c3 Set grimoire bar width to 75% 2021-09-05 20:10:27 +02:00
Michael Madsen
46853f711a Disable automatic sizing on grimoire bar to allow text to fit 2021-09-05 19:33:44 +02:00
Daniël van Noord
60121c0be5 Merge pull request #977 from dmytrokyrychuk/short-time-format
Add short time format
2021-09-05 17:34:51 +02:00
Daniël van Noord
c7d9144dd2 Rebuild CookieMonster files 2021-09-05 17:33:49 +02:00
Daniël van Noord
aa5cad663b Merge branch 'dev' of https://github.com/CookieMonsterTeam/CookieMonster into short-time-format 2021-09-05 17:33:29 +02:00
Daniël van Noord
b191d9a434 Fix Grimoire bar on Steam 2021-09-05 17:31:23 +02:00
Daniël van Noord
1842c40c01 Rebuild CookieMonster files 2021-09-05 17:28:59 +02:00
Daniël van Noord
9c005b2f2f Merge branch 'dev' of https://github.com/CookieMonsterTeam/CookieMonster into short-time-format 2021-09-05 17:23:37 +02:00
Dmytro Kyrychuk
e6d89fa0c7 Add short time format 2021-09-05 17:52:27 +03:00
Daniël van Noord
b74ae3eee0 Change order of Steam delay 2021-09-05 13:02:04 +02:00
Daniël van Noord
e4267f4c41 Merge pull request #970 from DanielNoord/dev
Fix Steam delay
2021-09-04 16:18:25 +02:00
Daniël van Noord
62dc882e5a Fix the delay for Steam 2021-09-04 16:16:28 +02:00
Daniël van Noord
f7e7d171e8 Increase delay for steam to 2000ms 2021-09-04 15:45:49 +02:00
Daniël van Noord
669b5c1dd9 Merge branch 'gh-pages' into dev 2021-09-03 12:40:53 +02:00
Daniël van Noord
f67b561990 Add delay for steam 2021-09-03 12:38:38 +02:00
github-actions[bot]
5def4ee13b [Automated] Merge dev into gh-pages 2021-09-03 10:35:36 +00:00
Daniël van Noord
c4812ef8fc Add a delay for loading in Steam 2021-09-03 12:34:53 +02:00
github-actions[bot]
9b9bf962b7 [Automated] Merge dev into gh-pages 2021-09-02 21:00:13 +00:00
Daniël van Noord
2940d1c631 Merge pull request #955 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-4.4.2
Bump typescript from 4.3.5 to 4.4.2
2021-09-02 23:00:00 +02:00
github-actions[bot]
0cf30e5cea [Automated] Merge dev into gh-pages 2021-09-02 20:58:35 +00:00
dependabot[bot]
700a5987a8 Bump typescript from 4.3.5 to 4.4.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.3.5...v4.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 20:58:34 +00:00
Daniël van Noord
029c25f48e Merge pull request #956 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/parser-4.30.0
Bump @typescript-eslint/parser from 4.29.1 to 4.30.0
2021-09-02 22:58:23 +02:00
github-actions[bot]
6fb8470432 [Automated] Merge dev into gh-pages 2021-09-02 20:58:05 +00:00
Daniël van Noord
518aff7ca7 Merge pull request #957 from CookieMonsterTeam/dependabot/npm_and_yarn/webpack-5.51.2
Bump webpack from 5.50.0 to 5.51.2
2021-09-02 22:57:51 +02:00
dependabot[bot]
f82b0fbc3a Bump @typescript-eslint/parser from 4.29.1 to 4.30.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.29.1 to 4.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.30.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 20:57:22 +00:00
dependabot[bot]
c0c3414dea Bump webpack from 5.50.0 to 5.51.2
Bumps [webpack](https://github.com/webpack/webpack) from 5.50.0 to 5.51.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.50.0...v5.51.2)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 20:56:39 +00:00
github-actions[bot]
513780efc4 [Automated] Merge dev into gh-pages 2021-09-02 20:56:15 +00:00
Daniël van Noord
295771bcec Merge pull request #954 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-4.30.0
Bump @typescript-eslint/eslint-plugin from 4.29.3 to 4.30.0
2021-09-02 22:56:04 +02:00
dependabot[bot]
0184fde289 Bump @typescript-eslint/eslint-plugin from 4.29.3 to 4.30.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.29.3 to 4.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.30.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 20:55:13 +00:00
github-actions[bot]
66d6be8039 [Automated] Merge dev into gh-pages 2021-09-02 20:52:31 +00:00
Daniël van Noord
612ab6a6f5 Merge pull request #945 from CookieMonsterTeam/dependabot/npm_and_yarn/ts-node-10.2.1
Bump ts-node from 10.2.0 to 10.2.1
2021-09-02 22:52:18 +02:00
github-actions[bot]
fd3276a9a7 [Automated] Merge dev into gh-pages 2021-09-02 20:51:59 +00:00
Daniël van Noord
b9fe2aa3fb Merge pull request #947 from CookieMonsterTeam/dependabot/npm_and_yarn/eslint-plugin-import-2.24.2
Bump eslint-plugin-import from 2.24.0 to 2.24.2
2021-09-02 22:51:54 +02:00
github-actions[bot]
765f2637f9 [Automated] Merge dev into gh-pages 2021-09-02 20:51:46 +00:00
Daniël van Noord
4b454cc123 Merge pull request #948 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-4.29.3
Bump @typescript-eslint/eslint-plugin from 4.29.1 to 4.29.3
2021-09-02 22:51:44 +02:00
Daniël van Noord
725e053df6 Merge pull request #953 from Urganot/steam-fix
Steam fix
2021-09-02 22:51:31 +02:00
Simon Balling
4008c2a8ee Fix for steam 2021-09-02 22:16:17 +02:00
Simon Balling
248c36c357 steam fix 2021-09-02 22:02:17 +02:00
dependabot[bot]
5679f4ab01 Bump @typescript-eslint/eslint-plugin from 4.29.1 to 4.29.3
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.29.1 to 4.29.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.29.3/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 02:04:54 +00:00
dependabot[bot]
40dc0b89cc Bump eslint-plugin-import from 2.24.0 to 2.24.2
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.24.0 to 2.24.2.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.24.0...v2.24.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 02:04:34 +00:00
dependabot[bot]
c6b38aa501 Bump ts-node from 10.2.0 to 10.2.1
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.2.0 to 10.2.1.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.2.0...v10.2.1)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-23 02:05:20 +00:00
github-actions[bot]
667b91142f [Automated] Merge dev into gh-pages 2021-08-16 10:03:28 +00:00
Daniël van Noord
f4445f7b0a Merge pull request #938 from CookieMonsterTeam/dependabot/npm_and_yarn/ts-loader-9.2.5
Bump ts-loader from 9.2.4 to 9.2.5
2021-08-16 12:03:25 +02:00
github-actions[bot]
7e42c62f6b [Automated] Merge dev into gh-pages 2021-08-16 10:03:17 +00:00
Daniël van Noord
3d99f818ab Merge pull request #937 from CookieMonsterTeam/dependabot/npm_and_yarn/eslint-plugin-import-2.24.0
Bump eslint-plugin-import from 2.23.4 to 2.24.0
2021-08-16 12:03:15 +02:00
Daniël van Noord
5f40b2a45e Merge pull request #936 from CookieMonsterTeam/dependabot/npm_and_yarn/webpack-cli-4.8.0
Bump webpack-cli from 4.7.2 to 4.8.0
2021-08-16 12:03:02 +02:00
dependabot[bot]
1fbe7c4b51 Bump ts-loader from 9.2.4 to 9.2.5
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.4 to 9.2.5.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.4...v9.2.5)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 09:56:26 +00:00
dependabot[bot]
fbaa2cc8de Bump webpack-cli from 4.7.2 to 4.8.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.7.2 to 4.8.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.7.2...webpack-cli@4.8.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 09:56:25 +00:00
dependabot[bot]
91dd817212 Bump eslint-plugin-import from 2.23.4 to 2.24.0
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.23.4 to 2.24.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.23.4...v2.24.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 09:56:22 +00:00
github-actions[bot]
dddf786567 [Automated] Merge dev into gh-pages 2021-08-16 09:55:44 +00:00
Daniël van Noord
df392029ce Merge pull request #935 from CookieMonsterTeam/dependabot/npm_and_yarn/ts-node-10.2.0
Bump ts-node from 10.1.0 to 10.2.0
2021-08-16 11:55:30 +02:00
dependabot[bot]
5ae4ed761f Bump ts-node from 10.1.0 to 10.2.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.1.0...v10.2.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 09:54:16 +00:00
github-actions[bot]
c080876fc0 [Automated] Merge dev into gh-pages 2021-08-16 09:53:30 +00:00
Daniël van Noord
001efa24bd Merge pull request #933 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/parser-4.29.1
Bump @typescript-eslint/parser from 4.28.4 to 4.29.1
2021-08-16 11:53:29 +02:00
dependabot[bot]
0963a2b63a Bump @typescript-eslint/parser from 4.28.4 to 4.29.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.28.4 to 4.29.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.29.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 09:53:21 +00:00
github-actions[bot]
fb8f6dbb49 [Automated] Merge dev into gh-pages 2021-08-16 09:53:16 +00:00
Daniël van Noord
88952e9986 Merge pull request #924 from CookieMonsterTeam/dependabot/npm_and_yarn/eslint-7.32.0
Bump eslint from 7.31.0 to 7.32.0
2021-08-16 11:53:16 +02:00
Daniël van Noord
946d0ff00e Merge pull request #932 from CookieMonsterTeam/dependabot/npm_and_yarn/webpack-5.50.0
Bump webpack from 5.46.0 to 5.50.0
2021-08-16 11:53:04 +02:00
github-actions[bot]
27fd8626c8 [Automated] Merge dev into gh-pages 2021-08-16 09:53:00 +00:00
Daniël van Noord
cb23000caa Merge pull request #934 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-4.29.1
Bump @typescript-eslint/eslint-plugin from 4.28.4 to 4.29.1
2021-08-16 11:52:47 +02:00
dependabot[bot]
2be1716c05 Bump @typescript-eslint/eslint-plugin from 4.28.4 to 4.29.1
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.28.4 to 4.29.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.29.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 02:06:16 +00:00
dependabot[bot]
b363e3a06a Bump webpack from 5.46.0 to 5.50.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.46.0 to 5.50.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.46.0...v5.50.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 02:05:37 +00:00
dependabot[bot]
c909c99cb5 Bump eslint from 7.31.0 to 7.32.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.31.0 to 7.32.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.31.0...v7.32.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-02 02:04:58 +00:00
github-actions[bot]
4c63f6d9e2 [Automated] Merge dev into gh-pages 2021-07-25 14:23:06 +00:00
Daniël van Noord
97f8e974de Merge pull request #911 from CookieMonsterTeam/dependabot/npm_and_yarn/ts-loader-9.2.4
Bump ts-loader from 9.2.3 to 9.2.4
2021-07-25 16:22:52 +02:00
github-actions[bot]
8e27b5980b [Automated] Merge dev into gh-pages 2021-07-25 14:20:45 +00:00
Daniël van Noord
42543370b7 Fix Amortization tooltips 2021-07-25 16:20:22 +02:00
github-actions[bot]
ccc5f83491 [Automated] Merge dev into gh-pages 2021-07-25 13:39:17 +00:00
Daniël van Noord
b736015b1c Merge pull request #913 from CookieMonsterTeam/master
Merge pull request #912 from CookieMonsterTeam/dev
2021-07-25 15:39:04 +02:00
Daniël van Noord
60f19e5084 Merge pull request #912 from CookieMonsterTeam/dev
Bump master to 2.031.10
2021-07-25 15:33:37 +02:00
dependabot[bot]
525ea72174 Bump ts-loader from 9.2.3 to 9.2.4
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.3 to 9.2.4.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.3...v9.2.4)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-25 13:33:17 +00:00
github-actions[bot]
2489eb16ac [Automated] Merge dev into gh-pages 2021-07-25 13:32:56 +00:00
Daniël van Noord
c455f940c6 Merge pull request #910 from DanielNoord/update
Bump to 2.031.10
2021-07-25 15:32:42 +02:00
Daniël van Noord
36780486a1 Bump to 2.031.10 2021-07-25 15:31:08 +02:00
github-actions[bot]
89f895f01e [Automated] Merge dev into gh-pages 2021-07-25 13:28:39 +00:00
Daniël van Noord
55e3fe536c Merge pull request #909 from DanielNoord/various
Various
2021-07-25 15:28:25 +02:00
Daniël van Noord
f60ac4889e Add percentage to GC/Reindeer timer 2021-07-25 15:25:17 +02:00
Daniël van Noord
51713afaea Fix building tooltips not updating correctly #893 2021-07-25 14:54:38 +02:00
Daniël van Noord
d0ddc93f7c Change to "color" to "colour" 2021-07-25 14:42:21 +02:00
Daniël van Noord
65eff470cf Fix bug with storing locked buildings 2021-07-25 14:41:51 +02:00
Daniël van Noord
9996e59024 Fix upgrade bar not displaying #908 2021-07-25 14:15:16 +02:00
Daniël van Noord
f59972892b Add overlay and save to building locking #763 2021-07-25 14:09:37 +02:00
Daniël van Noord
4fe07ba1d3 Fix loading if no previous save is found 2021-07-25 10:33:03 +02:00
github-actions[bot]
7d40e12472 [Automated] Merge dev into gh-pages 2021-07-22 20:19:02 +00:00
Daniël van Noord
bedda0093d Merge pull request #906 from CookieMonsterTeam/dependabot/npm_and_yarn/types/mocha-9.0.0
Bump @types/mocha from 8.2.3 to 9.0.0
2021-07-22 22:18:47 +02:00
dependabot[bot]
7c26b8015a Bump @types/mocha from 8.2.3 to 9.0.0
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.2.3 to 9.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-22 20:15:37 +00:00
github-actions[bot]
ce768cb135 [Automated] Merge dev into gh-pages 2021-07-22 20:12:43 +00:00
Daniël van Noord
1f219df674 Merge branch 'gh-pages' into dev 2021-07-22 22:12:28 +02:00
github-actions[bot]
8280d3ae7a [Automated] Merge dev into gh-pages 2021-07-22 20:07:49 +00:00
Daniël van Noord
3144e776b7 Update package name and version 2021-07-22 22:07:48 +02:00
Daniël van Noord
be0edd090d Update packagename 2021-07-22 22:07:19 +02:00
github-actions[bot]
038a8b33b0 [Automated] Merge dev into gh-pages 2021-07-22 20:05:18 +00:00
Daniël van Noord
6395ad318a Update README.md 2021-07-22 22:05:04 +02:00
github-actions[bot]
ed0049e367 [Automated] Merge dev into gh-pages 2021-07-22 20:00:26 +00:00
Daniël van Noord
bbd523ac3f Get latest version of framework 2021-07-22 22:00:03 +02:00
github-actions[bot]
cb1f9d7ca5 [Automated] Merge dev into gh-pages 2021-07-22 19:58:13 +00:00
Daniël van Noord
fb0f42deed Get latest version of Framework 2021-07-22 21:57:37 +02:00
Daniël van Noord
74bb5d924d Update CI 2021-07-22 21:53:18 +02:00
Daniël van Noord
065f8b4c23 Move saveClasses to Framework 2021-07-22 21:17:30 +02:00
Daniël van Noord
e685489543 Bump packages 2021-07-22 21:10:26 +02:00
Daniël van Noord
6a4772d8e2 Add new build commands 2021-07-22 09:08:24 +02:00
Daniël van Noord
bd0a55609d Fix sounds playing at start up #903 2021-07-21 14:42:17 +02:00
github-actions[bot]
6fcece6fc8 [Automated] Merge dev into gh-pages 2021-07-20 18:43:28 +00:00
Daniël van Noord
3e3659e2a4 Merge pull request #902 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/parser-4.28.4 2021-07-20 20:43:13 +02:00
dependabot[bot]
10c1e9eefb Bump @typescript-eslint/parser from 4.28.3 to 4.28.4
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.28.3 to 4.28.4.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.4/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-20 18:42:19 +00:00
github-actions[bot]
4c4ef57ce4 [Automated] Merge dev into gh-pages 2021-07-20 18:41:37 +00:00
Daniël van Noord
02bf0d6455 Merge pull request #901 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-4.28.4 2021-07-20 20:41:22 +02:00
dependabot[bot]
f89a685c49 Bump @typescript-eslint/eslint-plugin from 4.28.3 to 4.28.4
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.28.3 to 4.28.4.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.4/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-20 16:14:24 +00:00
github-actions[bot]
d776b9b799 [Automated] Merge dev into gh-pages 2021-07-20 16:11:47 +00:00
Daniël van Noord
2a82fc2b1f Merge pull request #900 from CookieMonsterTeam/master
Fix commit history
2021-07-20 18:11:33 +02:00
Daniël van Noord
80b373ff6c Build CM 2021-07-20 18:09:02 +02:00
Daniël van Noord
8c118b6aef Fix imports after changes to folder structure 2021-07-20 18:08:53 +02:00
Daniël van Noord
82c872ef18 Use framework for Options menu 2021-07-20 18:08:32 +02:00
Daniël van Noord
e9dc2ffa51 Use Framework notifications 2021-07-20 18:08:11 +02:00
Daniël van Noord
9294a5bc87 Remove functions and tests that moved to framework 2021-07-20 18:06:16 +02:00
Daniël van Noord
248fd32e91 Bump CM Framework to 0.2.0 2021-07-20 18:05:21 +02:00
Daniël van Noord
436c1d7239 Remove PlaySound from globals 2021-07-20 14:55:17 +02:00
github-actions[bot]
055ba22ee2 [Automated] Merge dev into gh-pages 2021-07-20 06:13:35 +00:00
Daniël van Noord
b84e511e52 Merge pull request #899 from DanielNoord/fix/ascensionlag
Fix lag on ascencion screen #890
2021-07-20 08:13:20 +02:00
Daniël van Noord
ec35013be7 Fix lag on ascencion screen #890 2021-07-20 08:11:43 +02:00
github-actions[bot]
52edc5696a [Automated] Merge dev into gh-pages 2021-07-19 20:02:19 +00:00
Daniël van Noord
eefecb7829 Merge pull request #898 from DanielNoord/optimize
Optimize
2021-07-19 22:02:04 +02:00
Daniël van Noord
bb0ba7f116 Small optimization to AscendButton() 2021-07-19 21:59:45 +02:00
Daniël van Noord
075bd89669 Fix BuildingGetPrice() and remove getSumPrice() 2021-07-19 21:42:04 +02:00
Daniël van Noord
43a651ea4a Only iterate over UpgradesInStore 2021-07-19 21:05:50 +02:00
github-actions[bot]
fde93b5639 [Automated] Merge dev into gh-pages 2021-07-19 14:55:05 +00:00
Daniël van Noord
80dab239b6 Update CI to also run on push to main branches 2021-07-19 16:54:24 +02:00
Daniël van Noord
22faf1edc2 Update README 2021-07-19 16:48:27 +02:00
Daniël van Noord
522443c30f Change env variable name 2021-07-19 16:45:26 +02:00
Daniël van Noord
d8eea6939e Update packages 2021-07-19 16:45:16 +02:00
github-actions[bot]
ab7a092ab9 [Automated] Merge dev into gh-pages 2021-07-19 05:59:54 +00:00
Daniël van Noord
c661cba533 Merge pull request #895 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-4.28.3
Bump @typescript-eslint/eslint-plugin from 4.28.2 to 4.28.3
2021-07-19 07:59:42 +02:00
dependabot[bot]
451ed9ee7a Bump @typescript-eslint/eslint-plugin from 4.28.2 to 4.28.3
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.28.2 to 4.28.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.3/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 05:58:12 +00:00
github-actions[bot]
6ac737d3af [Automated] Merge dev into gh-pages 2021-07-19 05:57:44 +00:00
Daniël van Noord
4572d0e5c5 Merge pull request #897 from CookieMonsterTeam/dependabot/npm_and_yarn/typescript-eslint/parser-4.28.3
Bump @typescript-eslint/parser from 4.28.2 to 4.28.3
2021-07-19 07:57:38 +02:00
Daniël van Noord
b7c7739a25 Merge pull request #896 from CookieMonsterTeam/dependabot/npm_and_yarn/eslint-7.31.0
Bump eslint from 7.30.0 to 7.31.0
2021-07-19 07:57:29 +02:00
github-actions[bot]
85b6d96be6 [Automated] Merge dev into gh-pages 2021-07-19 05:57:21 +00:00
Daniël van Noord
68e42e2744 Merge pull request #894 from CookieMonsterTeam/dependabot/npm_and_yarn/webpack-5.45.1
Bump webpack from 5.44.0 to 5.45.1
2021-07-19 07:57:01 +02:00
dependabot[bot]
984c11e2ac Bump @typescript-eslint/parser from 4.28.2 to 4.28.3
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.28.2 to 4.28.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.3/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 02:15:16 +00:00
dependabot[bot]
e3eccf25e8 Bump eslint from 7.30.0 to 7.31.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.30.0 to 7.31.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.30.0...v7.31.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 02:14:53 +00:00
dependabot[bot]
85b161fe14 Bump webpack from 5.44.0 to 5.45.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.44.0 to 5.45.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.44.0...v5.45.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 02:13:55 +00:00
github-actions[bot]
a497dec741 [Automated] Merge dev into gh-pages 2021-07-11 10:57:24 +00:00
Daniël van Noord
5a7187aa3c Merge pull request #887 from DanielNoord/framework
Start using the CookieMonsterFramework
2021-07-11 12:57:12 +02:00
Daniël van Noord
db07ab6c3e Add token to workflow and .npmrc 2021-07-11 12:56:01 +02:00
Daniël van Noord
c0e788b143 Use CookieMonsterFramework for save/load, infoMenu 2021-07-11 10:21:16 +02:00
Daniël van Noord
b959b3c024 Update CookieMonsterFramework to 0.1.0 2021-07-11 10:19:30 +02:00
Daniël van Noord
c8eeab45af Add .nprmc 2021-07-06 22:40:51 +02:00
github-actions[bot]
28bc2b5620 [Automated] Merge dev into gh-pages 2021-07-05 14:04:19 +00:00
Daniël van Noord
ecf73d815f Merge pull request #883 from DanielNoord/upmaster
Upmaster
2021-07-05 16:04:06 +02:00
Daniël van Noord
094b153f7e Add option to "lock" buildings #763 2021-07-05 16:02:29 +02:00
Daniël van Noord
3ac2c75b6f Fixed annotation 2021-07-05 15:32:33 +02:00
Daniël van Noord
3b444c2b69 Merge pull request #882 from CookieMonsterTeam/master
Merge pull request #881 from CookieMonsterTeam/dev
2021-07-05 10:11:53 +02:00
Daniël van Noord
a5c052b46e Merge pull request #881 from CookieMonsterTeam/dev
Hotfix
2021-07-05 10:11:10 +02:00
github-actions[bot]
531adb2a16 [Automated] Merge dev into gh-pages 2021-07-05 08:10:57 +00:00
Daniël van Noord
e3fddd4450 Merge pull request #880 from DanielNoord/cookieduplication
Cookieduplication
2021-07-05 10:10:42 +02:00
Daniël van Noord
07bb28cf46 Push hotfix to master file 2021-07-05 10:09:13 +02:00
Daniël van Noord
a9eb56de0c Add hotfix to release notes 2021-07-05 10:08:19 +02:00
Daniël van Noord
dcf00b82b8 Fix duplicate golden cookie with autoclickers #762 2021-07-05 10:05:26 +02:00
github-actions[bot]
27a621d9b0 [Automated] Merge dev into gh-pages 2021-07-05 05:25:29 +00:00
Daniël van Noord
14ba9105ca Merge pull request #879 from CookieMonsterTeam/dependabot/npm_and_yarn/eslint-7.30.0
Bump eslint from 7.29.0 to 7.30.0
2021-07-05 07:25:24 +02:00
Daniël van Noord
6f36d1dcf1 Merge pull request #878 from CookieMonsterTeam/dependabot/npm_and_yarn/webpack-5.42.0
Bump webpack from 5.41.1 to 5.42.0
2021-07-05 07:25:15 +02:00
dependabot[bot]
69afafd0fb Bump eslint from 7.29.0 to 7.30.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.29.0 to 7.30.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.29.0...v7.30.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 02:04:56 +00:00
dependabot[bot]
c9b6a06908 Bump webpack from 5.41.1 to 5.42.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.41.1 to 5.42.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.41.1...v5.42.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 02:04:48 +00:00
github-actions[bot]
a877dc5ad3 [Automated] Merge dev into gh-pages 2021-07-01 20:46:21 +00:00
Daniël van Noord
68e6afa410 Merge pull request #872 from CookieMonsterTeam/dependabot/npm_and_yarn/prettier-2.3.2 2021-07-01 22:46:07 +02:00
dependabot[bot]
3401a6165f Bump prettier from 2.3.1 to 2.3.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 20:37:58 +00:00
github-actions[bot]
59217317b3 [Automated] Merge dev into gh-pages 2021-07-01 20:37:31 +00:00
Daniël van Noord
a147065fd6 Merge pull request #876 from DanielNoord/updatepackage
Updatepackage
2021-07-01 22:37:16 +02:00
Daniël van Noord
27ad606380 Update packages 2021-07-01 22:36:05 +02:00
github-actions[bot]
6a30843c7d [Automated] Merge dev into gh-pages 2021-06-27 21:25:09 +00:00
github-actions[bot]
ca5acc1d37 [Automated] Merge dev into gh-pages 2021-06-27 21:22:04 +00:00
github-actions[bot]
a8c9fea127 [Automated] Merge dev into gh-pages 2021-06-21 06:59:42 +00:00
github-actions[bot]
d549bbdf9b [Automated] Merge dev into gh-pages 2021-06-21 06:58:36 +00:00
github-actions[bot]
e6b5bddda6 [Automated] Merge dev into gh-pages 2021-06-21 06:58:03 +00:00
github-actions[bot]
712a3dd5c3 [Automated] Merge dev into gh-pages 2021-06-21 06:56:46 +00:00
github-actions[bot]
e0756c4943 [Automated] Merge dev into gh-pages 2021-06-21 06:56:22 +00:00
github-actions[bot]
96b55fb77c [Automated] Merge dev into gh-pages 2021-06-20 20:36:12 +00:00
github-actions[bot]
b06ff269a1 [Automated] Merge dev into gh-pages 2021-06-14 07:09:07 +00:00
github-actions[bot]
17a3ef0d83 [Automated] Merge dev into gh-pages 2021-06-14 07:07:02 +00:00
github-actions[bot]
8cc7bb7f99 [Automated] Merge dev into gh-pages 2021-06-14 06:52:45 +00:00
github-actions[bot]
0bff74bddd [Automated] Merge dev into gh-pages 2021-06-08 06:57:48 +00:00
github-actions[bot]
ad146f9a43 [Automated] Merge dev into gh-pages 2021-06-07 08:31:57 +00:00
github-actions[bot]
aba1b88eac [Automated] Merge dev into gh-pages 2021-06-07 08:30:49 +00:00
github-actions[bot]
af547ee2c4 [Automated] Merge dev into gh-pages 2021-06-07 07:00:47 +00:00
github-actions[bot]
6344c454a6 [Automated] Merge dev into gh-pages 2021-06-07 06:59:13 +00:00
github-actions[bot]
65cec9da50 [Automated] Merge dev into gh-pages 2021-06-07 06:57:40 +00:00
Daniël van Noord
7df6e5fa54 Merge pull request #791 from CookieMonsterTeam/master
Hotfix #1 for 2.031.08
2021-05-02 10:46:27 +02:00
197 changed files with 6142 additions and 7406 deletions

View File

@@ -8,25 +8,12 @@
"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": {
"ecmaVersion": 12 "ecmaVersion": 12
}, },
"plugins": ["@typescript-eslint"],
"overrides": [
{
"files": ["src/**/*.{ts,tsx}"],
"extends": ["plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"rules": {
"import/extensions": "off", // To allow importing .ts without errors
"import/no-unresolved": "off" // To allow importing .ts without errors
}
}
],
"ignorePatterns": ["*CookieMonster*.js", "dist/*", "node_modules/*"], "ignorePatterns": ["*CookieMonster*.js", "dist/*", "node_modules/*"],
"rules": { "rules": {
"import/no-mutable-exports": "off", // We need to this throughout Cookie Monster "import/no-mutable-exports": "off", // We need to this throughout Cookie Monster

View File

@@ -2,17 +2,18 @@ Cookie Monster is written to modify Cookie Clicker as little as possible. This m
The following is a short description of the various `src` directories and their contents: The following is a short description of the various `src` directories and their contents:
JS | Description | JS | Description |
-- | - | ------------ | -------------------------------------------------------------------------- |
Cache | Functions related to creating and storing data cache | Cache | Functions related to creating and storing data cache |
Config | Functions related to manipulating CM configuration | Config | Functions related to manipulating CM configuration |
Data | Hard coded values | Data | Hard coded values |
Disp | Functions related to displaying CM's UI | Disp | Functions related to displaying CM's UI |
InitSaveLoad | Functions related to registering the CM object with the Game's Modding API | InitSaveLoad | Functions related to registering the CM object with the Game's Modding API |
Main | Functions related to the main loop and initializing CM | Main | Functions related to the main loop and initializing CM |
Sim | Functions related to simulate something | Sim | Functions related to simulate something |
These are some additional guidelines: These are some additional guidelines:
- Try to use DOM as much as possible instead of using string manipulation to modify HTML. - Try to use DOM as much as possible instead of using string manipulation to modify HTML.
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message. - Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
- PR's should target the `dev` branch - PR's should target the `dev` branch

53
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: 🐛 Bug report
description: Report a bug in Cookie Monster
labels: [Bug]
body:
- type: markdown
attributes:
value: |
**Thank you for wanting to report a bug in Cookie Monster!**
⚠ Please make sure that this [issue wasn't already requested][issue search], or already implemented in the ``dev`` branch.
[issue search]: https://github.com/CookieMonsterTeam/CookieMonster/issues?q=is%3Aissue+is%3Aopen+
- type: textarea
id: what-happened
attributes:
label: Bug description
description: What is the bug about?
placeholder: |
# Please describe the bug and what you would have expected the mod to do
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: To reproduce
description: How can you reproduce the bug?
placeholder: |
The steps needed to reproduce the behavior:
1.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshot
description: Please provide any relevant screenshots
- type: textarea
id: savefile
attributes:
label: Save file
description: Please provide a save file and paste it in between the "```"
placeholder: |
```SAVE FILE HERE```
- type: textarea
id: environment
attributes:
label: Browser / Steam / Version
description: Are you playing on browser (if so, which?) or Steam? And which version?
placeholder: Steam, version 2.04
validations:
required: true

View File

@@ -1,26 +0,0 @@
---
name: Bug report
about: Please use this template to report bugs you might have found
title: ''
labels: Bug
assignees: ''
---
**Describe the bug**
Please describe the bug and what you would have expected the mod to do
**To Reproduce**
The steps needed to reproduce the behavior:
1. ...
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Save file**
```
Please add a save file here.
This makes debugging much easier as we do not always have a good test save to debug the issue
```
**Browser**
Please specify your current browser. This can help find/fix the bug!

View File

@@ -0,0 +1,28 @@
name: ✨ Feature request
description: Request a new feature for Cookie Monster
labels: [Enhancement]
body:
- type: markdown
attributes:
value: |
**Thank you for wanting to suggest a new function for Cookie Monster!**
⚠ Please make sure that this [feature wasn't already requested][issue search], or already implemented in the ``dev`` branch.
[issue search]: https://github.com/CookieMonsterTeam/CookieMonster/issues?q=is%3Aissue+is%3Aopen+
- type: textarea
id: what-is-wanted
attributes:
label: Feature description
description: Describe the function you'd like to see added to CookieMonster
placeholder: |
# A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: additional-info
attributes:
label: Additional files
description: Add any other files such as save files or screenshots about the feature request here.

View File

@@ -1,14 +0,0 @@
---
name: Feature request
about: Suggest an idea for CookieMonster
title: ''
labels: Enhancement
assignees: ''
---
**Describe the function you'd like to see added to CookieMonster**
A clear and concise description of what you want to happen.
**Additional files**
Add any other files such as save files or screenshots about the feature request here.

View File

@@ -5,7 +5,7 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: "npm" - package-ecosystem: 'npm'
directory: "/" # Location of package manifests directory: '/' # Location of package manifests
schedule: schedule:
interval: "weekly" interval: 'weekly'

View File

@@ -1,32 +1,43 @@
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_REGISTRY_PAT: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- name: Check out repository code - uses: actions/checkout@v2
uses: actions/checkout@v2 - uses: actions/setup-node@v2
- name: Install dependencies with:
run: npm ci node-version: 22
- name: Run ESLint - name: Install dependencies
run: npx eslint src run: npm ci
- name: Run Mocha tests - name: Run ESLint
run: npx mocha run: npx eslint
- name: Check if CookieMonsterDev.js is built correctly - name: Run Mocha tests
run: | run: npx mocha
npx webpack -o ./tmp --env production - name: Check if CookieMonsterDev.js is built correctly
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then run: |
echo '### SUCCESS: CookieMonsterDev is correctly built! ###' npx webpack -o ./tmp --env minimize
else if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###' echo '### SUCCESS: CookieMonsterDev is built correctly! ###'
exit 1 else
fi echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###'
- name: Check if CookieMonster.js is built correctly exit 1
if: github.ref == 'refs/heads/master' fi
run: | - name: Check if CookieMonster.js is built correctly
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 dist/CookieMonster.js); then if: github.ref == 'refs/heads/master'
echo '### SUCCESS: CookieMonster is correctly built! ###' run: |
else npx webpack -o ./tmp --env minimize --env finalfile
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to copy CookieMonsterDev.js into CookieMonster.js before merging to master! ###' if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
exit 1 echo '### SUCCESS: CookieMonster is built correctly! ###'
fi else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build-final" after saving all your changes! ###'
exit 1
fi

View File

@@ -2,7 +2,7 @@ name: Publish
on: on:
push: push:
branches: branches:
- "dev" - 'dev'
jobs: jobs:
publish-dev: publish-dev:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -1,4 +1,3 @@
{ {
"recursive": true, "recursive": true
"require": ["esm", "ts-node/register"]
} }

4
.npmrc Normal file
View 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_REGISTRY_PAT}

12
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: dist
- id: end-of-file-fixer
exclude: dist

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
dist

View File

@@ -1,6 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Cookie Monster // @name Cookie Monster
// @include /https?://orteil.dashnet.org/cookieclicker/ // @include /https?://orteil.dashnet.org/cookieclicker/
// @include /https?://cookieclicker.ee/
// ==/UserScript== // ==/UserScript==
const readyCheck = setInterval(() => { const readyCheck = setInterval(() => {

View File

@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

View File

@@ -1,19 +1,21 @@
[![CI](https://github.com/CookieMonsterTeam/CookieMonster/actions/workflows/CI.yml/badge.svg)](https://github.com/CookieMonsterTeam/CookieMonster/actions/workflows/CI.yml) [![CI](https://github.com/CookieMonsterTeam/CookieMonster/actions/workflows/CI.yml/badge.svg)](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 `master` branch hosts the latest production version intended for general users.
The `master` branch hosts the latest production version intended for general users.
All development and pull requests should target the `dev` branch. All development and pull requests should target the `dev` branch.
Github Pages is hosted from the `gh-pages` 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)**. 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: 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
``` ```
@@ -21,14 +23,14 @@ If the relevant option is enabled, CM will color-code each of them based on thei
<details> <details>
<summary>The following standard colours are used:</summary> <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
* Yellow: This building is within the top 10 of best PP's - Yellow: This building is within the top 10 of best PP's
* Orange: This building is within the top 20 of best PP's - Orange: This building is within the top 20 of best PP's
* Red: This building is within the top 30 of best PP's - Red: This building is within the top 30 of best PP's
* 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> </details>
@@ -42,8 +44,8 @@ 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://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js'); Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js');
}()); })();
``` ```
If (for some reason) the above doesn't work, trying pasting everything after the <code>javascript:</code> bit into your browser's console. If (for some reason) the above doesn't work, trying pasting everything after the <code>javascript:</code> bit into your browser's console.
@@ -66,22 +68,22 @@ All suggestions are welcome, even the smallest ones.
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. 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! Currently we expose relevant data for buildings and upgrades (PP, colour and bonus income). If you would like us to add any additional 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 Registry (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_REGISTRY_PAT as defined in `.npmrc`.
Please also remember to run `npm run build` after saving all your changes to build the final `CookieMonsterDev.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 master and Github pages copy the `Dev` files into the normal files. 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
* **[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
* **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer - **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer
* **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer - **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

59
eslint.config.mjs Normal file
View File

@@ -0,0 +1,59 @@
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default [
{
ignores: [
'eslint.config.mjs',
'webpack.config.cjs',
'**/CookieMonster.user.js',
'dist/*',
'node_modules/*',
],
},
...compat.extends('airbnb-base', 'prettier'),
{
languageOptions: {
globals: {
...globals.browser,
Game: 'writable',
l: 'readonly',
b64_to_utf8: 'readonly',
utf8_to_b64: 'readonly',
BeautifyAll: 'readonly',
},
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'import/extensions': ['error', 'ignorePackages'],
'import/no-mutable-exports': 'off',
'no-import-assign': 'off',
'no-plusplus': [
'error',
{
allowForLoopAfterthoughts: true,
},
],
'func-names': 'off',
'prefer-destructuring': [
'error',
{
object: true,
array: false,
},
],
},
},
];

8557
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "cookiemonster-mod", "name": "@cookiemonsterteam/cookiemonster-mod",
"version": "2.031.7", "version": "2.053.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,11 +11,12 @@
"Orteil" "Orteil"
], ],
"scripts": { "scripts": {
"eslint-src": "eslint src test", "build-dev": "run-s eslint test pack-prod",
"build": "run-s eslint-src test pack-prod", "build-final": "run-s eslint test pack-final",
"build-test": "run-s pack-dev", "build-test": "webpack",
"pack-prod": "webpack --env production", "eslint": "eslint",
"pack-dev": "webpack", "pack-prod": "webpack --env minimize",
"pack-final": "webpack --env minimize --env finalfile",
"test": "mocha" "test": "mocha"
}, },
"repository": { "repository": {
@@ -42,26 +43,6 @@
"url": "https://github.com/CookieMonsterTeam/CookieMonster/issues" "url": "https://github.com/CookieMonsterTeam/CookieMonster/issues"
}, },
"homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme", "homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme",
"devDependencies": {
"@types/chai": "^4.2.19",
"@types/mocha": "^8.2.2",
"@typescript-eslint/eslint-plugin": "^4.27.0",
"@typescript-eslint/parser": "^4.27.0",
"chai": "^4.3.4",
"eslint": "^7.29.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"esm": "^3.2.25",
"mocha": "^8.4.0",
"npm-run-all": "^4.1.5",
"prettier": "2.3.1",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"typescript": "^4.3.4",
"webpack": "^5.39.1",
"webpack-cli": "^4.7.2"
},
"ccrepo": { "ccrepo": {
"icon": [ "icon": [
10, 10,
@@ -69,7 +50,30 @@
], ],
"name": "Cookie Monster" "name": "Cookie Monster"
}, },
"type": "module",
"engines": {
"node": ">=22"
},
"dependencies": { "dependencies": {
"@eastdesire/jscolor": "^2.4.5" "@cookiemonsterteam/cookiemonsterframework": "0.2.3",
"@eastdesire/jscolor": "^2.5.1",
"@eslint/compat": "^1.2.7",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.27.0",
"chai": "^5.2.0",
"eslint": "^9.21.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.0.1",
"globals": "^16.0.0",
"mocha": "^11.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.5.2",
"webpack": "^5.97.1",
"webpack-cli": "^6.0.1"
},
"overrides": {
"eslint-config-airbnb-base": {
"eslint": "^9.20.0"
}
} }
} }

View File

@@ -1,11 +1,11 @@
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData'; import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js';
import { import {
ChoEggDiff, // eslint-disable-line no-unused-vars ChoEggDiff, // eslint-disable-line no-unused-vars
ClicksDiff, // eslint-disable-line no-unused-vars ClicksDiff, // eslint-disable-line no-unused-vars
CookiesDiff, // eslint-disable-line no-unused-vars CookiesDiff, // eslint-disable-line no-unused-vars
WrinkDiff, // eslint-disable-line no-unused-vars WrinkDiff, // eslint-disable-line no-unused-vars
WrinkFattestDiff, // eslint-disable-line no-unused-vars WrinkFattestDiff, // eslint-disable-line no-unused-vars
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* @class * @class

View File

@@ -1,20 +1,20 @@
import { CMOptions } from '../../Config/VariablesAndData'; import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js';
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData'; import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheAverageClicks, // eslint-disable-line no-unused-vars CacheAverageClicks,
CacheAverageCPS, CacheAverageCPS,
CacheAverageGainBank, CacheAverageGainBank,
CacheAverageGainChoEgg, CacheAverageGainChoEgg,
CacheAverageGainWrink, CacheAverageGainWrink,
CacheAverageGainWrinkFattest, CacheAverageGainWrinkFattest,
CacheAvgCPSWithChoEgg, // eslint-disable-line no-unused-vars CacheAvgCPSWithChoEgg,
CacheLastChoEgg, CacheLastChoEgg,
CacheLastClicks, CacheLastClicks,
CacheLastCookies, CacheLastCookies,
CacheLastCPSCheck, CacheLastCPSCheck,
CacheLastWrinkCookies, CacheLastWrinkCookies,
CacheLastWrinkFattestCookies, CacheLastWrinkFattestCookies,
CacheRealCookiesEarned, // eslint-disable-line no-unused-vars CacheRealCookiesEarned,
CacheSellForChoEgg, CacheSellForChoEgg,
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersTotal, CacheWrinklersTotal,
@@ -23,7 +23,7 @@ import {
CookiesDiff, CookiesDiff,
WrinkDiff, WrinkDiff,
WrinkFattestDiff, WrinkFattestDiff,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches two variables related average CPS and Clicks * This functions caches two variables related average CPS and Clicks
@@ -67,23 +67,47 @@ 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; } else CacheAvgCPSWithChoEgg = CacheAverageCPS;
// eslint-disable-next-line no-unused-vars CacheAverageClicks = ClicksDiff.calcAverage(
CacheAverageClicks = ClicksDiff.calcAverage(ClickTimes[CMOptions.AvgClicksHist]); ClickTimes[Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist],
);
} }
FillCMDCache({
CacheRealCookiesEarned,
CacheLastCPSCheck,
CacheLastCookies,
CacheLastWrinkCookies,
CacheLastWrinkFattestCookies,
CacheLastChoEgg,
CacheLastClicks,
CacheAverageGainBank,
CacheAverageGainWrink,
CacheAverageGainWrinkFattest,
CacheAverageGainChoEgg,
CacheAverageCPS,
CacheAvgCPSWithChoEgg,
CacheAverageClicks,
});
} }

View File

@@ -1,5 +1,6 @@
import { SimObjects } from '../../Sim/VariablesAndData'; import { SimObjects } from '../../Sim/VariablesAndData.js';
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData.js';
/** /**
* This functions caches the current Wrinkler CPS multiplier * This functions caches the current Wrinkler CPS multiplier
@@ -26,4 +27,6 @@ export default function CacheCurrWrinklerCPS() {
(Game.Has('Sacrilegious corruption') * 0.05 + 1) * (Game.Has('Sacrilegious corruption') * 0.05 + 1) *
(Game.Has('Wrinklerspawn') * 0.05 + 1) * (Game.Has('Wrinklerspawn') * 0.05 + 1) *
godMult; godMult;
FillCMDCache({ CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult });
} }

View File

@@ -1,5 +1,6 @@
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc'; import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc.js';
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData.js';
/** /**
* 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
@@ -10,4 +11,6 @@ export default function CacheNoGoldSwitchCPS() {
if (Game.Has('Golden switch [off]')) { if (Game.Has('Golden switch [off]')) {
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS(); CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs; } else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
FillCMDCache({ CacheNoGoldSwitchCookiesPS });
} }

View File

@@ -1,5 +1,6 @@
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg'; import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg.js';
import { CacheSellForChoEgg } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheSellForChoEgg } from '../VariablesAndData.js';
/** /**
* This functions caches the reward for selling the Chocolate egg * This functions caches the reward for selling the Chocolate egg
@@ -21,4 +22,6 @@ export default function CacheSellAllForChoEgg() {
// Compute cookies earned by selling all buildings with optimal auras (ES + RB) // Compute cookies earned by selling all buildings with optimal auras (ES + RB)
sellTotal += SellBuildingsForChoEgg(); sellTotal += SellBuildingsForChoEgg();
CacheSellForChoEgg = sellTotal; CacheSellForChoEgg = sellTotal;
FillCMDCache({ CacheSellForChoEgg });
} }

View File

@@ -1,17 +1,17 @@
import { ClickTimes } from '../Disp/VariablesAndData'; import { ClickTimes } from '../Disp/VariablesAndData.js';
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue'; import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue.js';
import CacheAvgCPS from './CPS/CPS'; import CacheAvgCPS from './CPS/CPS.js';
import CacheDragonAuras from './Dragon/CacheDragonAuras'; import CacheDragonAuras from './Dragon/CacheDragonAuras.js';
import CachePP from './PP/PP'; import CachePP from './PP/PP.js';
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome'; import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome.js';
import { CacheChain } from './Stats/ChainCookies'; import { CacheChain } from './Stats/ChainCookies.js';
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips'; import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js';
import CacheAllMissingUpgrades from './Stats/MissingUpgrades'; import CacheAllMissingUpgrades from './Stats/MissingUpgrades.js';
import CacheSeasonSpec from './Stats/Reindeer'; import CacheSeasonSpec from './Stats/Reindeer.js';
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats'; import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats.js';
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement'; import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js';
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; // eslint-disable-line no-unused-vars import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars
import CacheWrinklers from './Wrinklers/Wrinklers'; import CacheWrinklers from './Wrinklers/Wrinklers.js';
/** /**
* This functions runs all cache-functions to generate all "full" cache * This functions runs all cache-functions to generate all "full" cache

View File

@@ -1,12 +1,12 @@
import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime'; import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime.js';
import GetCPS from '../Disp/HelperFunctions/GetCPS'; import GetCPS from '../Disp/HelperFunctions/GetCPS.js';
import CacheAvgCPS from './CPS/CPS'; import CacheAvgCPS from './CPS/CPS.js';
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS'; import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS.js';
import CachePP from './PP/PP'; import CachePP from './PP/PP.js';
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips'; import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js';
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement'; import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js';
import { CacheTimeTillNextPrestige } from './VariablesAndData'; // eslint-disable-line no-unused-vars import { CacheTimeTillNextPrestige } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars
import CacheWrinklers from './Wrinklers/Wrinklers'; import CacheWrinklers from './Wrinklers/Wrinklers.js';
/** /**
* This functions caches variables that are needed every loop * This functions caches variables that are needed every loop

View File

@@ -1,4 +1,4 @@
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars
/** /**
* This functions caches the currently selected Dragon Auras * This functions caches the currently selected Dragon Auras

View File

@@ -1,9 +1,10 @@
/** Functions related to the Dragon */ /** Functions related to the Dragon */
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify'; import Beautify from '../../Disp/BeautifyAndFormatting/Beautify.js';
import CopyData from '../../Sim/SimulationData/CopyData'; import CopyData from '../../Sim/SimulationData/CopyData.js';
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData'; import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData.js';
import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData.js'; // 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
@@ -14,7 +15,11 @@ export default function CacheDragonCost() {
Game.dragonLevel < 25 && Game.dragonLevel < 25 &&
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice') Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
) { ) {
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1]; const objectMatch = Game.dragonLevels[Game.dragonLevel].buy
.toString()
.match(/Objects\[(.*)\]/);
let target =
objectMatch !== null ? objectMatch[1] : Game.ObjectsById[Game.dragonLevel - 5].name;
const amount = Game.dragonLevels[Game.dragonLevel].buy const amount = Game.dragonLevels[Game.dragonLevel].buy
.toString() .toString()
.match(/sacrifice\((.*?)\)/)[1]; .match(/sacrifice\((.*?)\)/)[1];
@@ -62,4 +67,6 @@ export default function CacheDragonCost() {
} }
CacheLastDragonLevel = Game.dragonLevel; CacheLastDragonLevel = Game.dragonLevel;
} }
FillCMDCache({ CacheLastDragonLevel });
} }

22
src/Cache/FillCMDCache.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* Insert the provided values into `window.CookieMonsterData.Cache`.
*
* The initial 'Cache' is dropped from the name, so e.g. `CacheWrinklersTotal`
* becomes `window.CookieMonsterData.Cache.WrinklersTotal`.
*/
export default function FillCMDCache(caches) {
if (!('Cache' in window.CookieMonsterData)) {
window.CookieMonsterData.Cache = {};
}
Object.keys(caches).forEach((name) => {
const exportName = name.replace(/^Cache/, '');
if (typeof caches[name] === 'undefined') {
window.CookieMonsterData.Cache[exportName] = undefined;
} else {
// Passing through JSON ensures that no references are retained.
window.CookieMonsterData.Cache[exportName] = JSON.parse(JSON.stringify(caches[name]));
}
});
}

View File

@@ -1,15 +1,16 @@
import { CMOptions } from '../../Config/VariablesAndData'; import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js';
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank'; import { ColourGray } from '../../Disp/VariablesAndData.js';
import { ColourGray } from '../../Disp/VariablesAndData'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheMinPP, // eslint-disable-line no-unused-vars CacheMinPP,
CacheMinPPBulk, // eslint-disable-line no-unused-vars CacheMinPPBulk,
CacheObjects1, CacheObjects1,
CacheObjects10, CacheObjects10,
CacheObjects100, CacheObjects100,
CachePPArray, CachePPArray,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
import ColourOfPP from './ColourOfPP'; import ColourOfPP from './ColourOfPP.js';
/** /**
* This functions caches the buildings of bulk-buy mode when PP is compared against optimal single-purchase building * This functions caches the buildings of bulk-buy mode when PP is compared against optimal single-purchase building
@@ -18,28 +19,55 @@ 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)) if (
!(
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPRigidelMode &&
amount === 1
)
)
CachePPArray.push([target[i].pp, amount, price]); CachePPArray.push([target[i].pp, amount, price]);
}); });
} }
@@ -51,17 +79,21 @@ 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 = CMOptions.PPExcludeTop; let indexOfMin = Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPExcludeTop;
if (CMOptions.PPOnlyConsiderBuyable) { if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPOnlyConsiderBuyable) {
while (CachePPArray[indexOfMin][2] > Game.cookies) { while (CachePPArray[indexOfMin][2] > Game.cookies) {
indexOfMin += 1; indexOfMin += 1;
if (CachePPArray.length === indexOfMin + 1) { if (CachePPArray.length === indexOfMin + 1) {
@@ -75,4 +107,6 @@ export default function CacheBuildingsPP() {
CacheColour(CacheObjects1, 1); CacheColour(CacheObjects1, 1);
CacheColour(CacheObjects10, 10); CacheColour(CacheObjects10, 10);
CacheColour(CacheObjects100, 100); CacheColour(CacheObjects100, 100);
FillCMDCache({ CacheMinPP, CacheMinPPBulk, CachePPArray });
} }

View File

@@ -1,5 +1,4 @@
import { CMOptions } from '../../Config/VariablesAndData'; import GetCPS from '../../Disp/HelperFunctions/GetCPS.js';
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
import { import {
ColourBlue, ColourBlue,
ColourGray, ColourGray,
@@ -8,34 +7,44 @@ import {
ColourPurple, ColourPurple,
ColourRed, ColourRed,
ColourYellow, ColourYellow,
} from '../../Disp/VariablesAndData'; } from '../../Disp/VariablesAndData.js';
import { CacheMinPP, CachePPArray } from '../VariablesAndData'; import { CacheMinPP, CachePPArray } from '../VariablesAndData.js';
/** /**
* This functions return the colour assosciated with the given pp value * This functions return the colour assosciated with the given pp value
* 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;
} }

View File

@@ -1,9 +1,14 @@
/** /**
* Section: Functions related to caching PP */ * Section: Functions related to caching PP */
import { CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades } from '../VariablesAndData'; import {
import CacheBuildingsPP from './Building'; CacheObjects1,
import CacheUpgradePP from './Upgrade'; CacheObjects10,
CacheObjects100,
CacheUpgrades,
} from '../VariablesAndData.js';
import CacheBuildingsPP from './Building.js';
import CacheUpgradePP from './Upgrade.js';
/** /**
* This functions caches the PP of each building and upgrade and stores it in the cache * This functions caches the PP of each building and upgrade and stores it in the cache

View File

@@ -1,6 +1,6 @@
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank'; import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js';
import { CacheUpgrades } from '../VariablesAndData'; import { CacheUpgrades } from '../VariablesAndData.js';
import ColourOfPP from './ColourOfPP'; import ColourOfPP from './ColourOfPP.js';
/** /**
* This functions caches the PP of each building it saves all date in CM.Cache.Upgrades * This functions caches the PP of each building it saves all date in CM.Cache.Upgrades
@@ -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());
}); });
} }

View File

@@ -1,5 +1,6 @@
import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange'; import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange.js';
import { CacheGods } from '../VariablesAndData'; import FillCMDCache from '../FillCMDCache.js';
import { CacheGods } from '../VariablesAndData.js';
/** /**
* This functions caches the cps effect of each God in slot 1, 2 or 3 * This functions caches the cps effect of each God in slot 1, 2 or 3
@@ -10,4 +11,6 @@ export default function CachePantheonGods() {
CacheGods[god][slot] = CalculateChangeGod(god, slot); CacheGods[god][slot] = CalculateChangeGod(god, slot);
} }
} }
FillCMDCache({ CacheGods });
} }

View File

@@ -1,9 +1,9 @@
/** Section: Functions related to caching income */ /** Section: Functions related to caching income */
import { CMOptions } from '../../Config/VariablesAndData'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding'; import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome.js';
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome'; import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades.js';
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades'; import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheAverageGainBank, CacheAverageGainBank,
CacheAverageGainWrink, CacheAverageGainWrink,
@@ -14,7 +14,7 @@ import {
CacheObjects100, CacheObjects100,
CacheObjectsNextAchievement, CacheObjectsNextAchievement,
CacheUpgrades, CacheUpgrades,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions starts the calculation/simulation of the bonus income of buildings * This functions starts the calculation/simulation of the bonus income of buildings
@@ -39,20 +39,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,34 +66,36 @@ 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,
CacheObjectsNextAchievement[i].AmountNeeded, CacheObjectsNextAchievement[i].AmountNeeded,
); );
}); });
FillCMDCache({ CacheObjectsNextAchievement });
} }
/** /**

View File

@@ -1,22 +1,23 @@
import GetCPSBuffMult from '../CPS/GetCPSBuffMult'; import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheChainFrenzyMaxReward, CacheChainFrenzyMaxReward,
CacheChainFrenzyRequired, // eslint-disable-line no-unused-vars CacheChainFrenzyRequired,
CacheChainFrenzyRequiredNext, // eslint-disable-line no-unused-vars CacheChainFrenzyRequiredNext,
CacheChainFrenzyWrathMaxReward, CacheChainFrenzyWrathMaxReward,
CacheChainFrenzyWrathRequired, // eslint-disable-line no-unused-vars CacheChainFrenzyWrathRequired,
CacheChainFrenzyWrathRequiredNext, // eslint-disable-line no-unused-vars CacheChainFrenzyWrathRequiredNext,
CacheChainMaxReward, CacheChainMaxReward,
CacheChainRequired, // eslint-disable-line no-unused-vars CacheChainRequired,
CacheChainRequiredNext, // eslint-disable-line no-unused-vars CacheChainRequiredNext,
CacheChainWrathMaxReward, CacheChainWrathMaxReward,
CacheChainWrathRequired, // eslint-disable-line no-unused-vars CacheChainWrathRequired,
CacheChainWrathRequiredNext, // eslint-disable-line no-unused-vars CacheChainWrathRequiredNext,
CacheDragonsFortuneMultAdjustment, CacheDragonsFortuneMultAdjustment,
CacheGoldenCookiesMult, CacheGoldenCookiesMult,
CacheNoGoldSwitchCookiesPS, CacheNoGoldSwitchCookiesPS,
CacheWrathCookiesMult, CacheWrathCookiesMult,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions calculates the max possible payout given a set of variables * This functions calculates the max possible payout given a set of variables
@@ -89,4 +90,19 @@ export function CacheChain() {
CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult; CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
CacheChainFrenzyWrathRequiredNext = CacheChainFrenzyWrathRequiredNext =
CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
FillCMDCache({
CacheChainMaxReward,
CacheChainRequired,
CacheChainRequiredNext,
CacheChainWrathMaxReward,
CacheChainWrathRequired,
CacheChainWrathRequiredNext,
CacheChainFrenzyMaxReward,
CacheChainFrenzyRequired,
CacheChainFrenzyRequiredNext,
CacheChainFrenzyWrathMaxReward,
CacheChainFrenzyWrathRequired,
CacheChainFrenzyWrathRequiredNext,
});
} }

View File

@@ -1,9 +1,10 @@
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheHCPerSecond, // eslint-disable-line no-unused-vars CacheHCPerSecond,
CacheLastHeavenlyCheck, CacheLastHeavenlyCheck,
CacheLastHeavenlyChips, CacheLastHeavenlyChips,
HeavenlyChipsDiff, HeavenlyChipsDiff,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches the heavenly chips per second in the last five seconds * This functions caches the heavenly chips per second in the last five seconds
@@ -32,4 +33,6 @@ export default function CacheHeavenlyChipsPS() {
// Get average gain over period of 5 seconds // Get average gain over period of 5 seconds
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5); CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5);
} }
FillCMDCache({ CacheLastHeavenlyCheck, CacheLastHeavenlyChips, CacheHCPerSecond });
} }

View File

@@ -1,9 +1,9 @@
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades'; import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades.js';
import { import {
CacheMissingUpgrades, // eslint-disable-line no-unused-vars CacheMissingUpgrades, // eslint-disable-line no-unused-vars
CacheMissingUpgradesCookies, // eslint-disable-line no-unused-vars CacheMissingUpgradesCookies, // eslint-disable-line no-unused-vars
CacheMissingUpgradesPrestige, // eslint-disable-line no-unused-vars CacheMissingUpgradesPrestige, // eslint-disable-line no-unused-vars
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches variables related to missing upgrades * This functions caches variables related to missing upgrades
@@ -35,12 +35,10 @@ export default function CacheAllMissingUpgrades() {
let str = ''; let str = '';
str += crateMissing(me); str += crateMissing(me);
/* eslint-disable no-unused-vars */
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str; if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str; else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug') else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug')
CacheMissingUpgrades += str; CacheMissingUpgrades += str;
/* eslint-enable no-unused-vars */
} }
}); });
} }

View File

@@ -1,4 +1,5 @@
import { CacheSeaSpec } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheSeaSpec } from '../VariablesAndData.js';
/** /**
* This functions caches the reward of popping a reindeer * This functions caches the reward of popping a reindeer
@@ -13,4 +14,6 @@ export default function CacheSeasonSpec() {
CacheSeaSpec = Math.max(25, val); CacheSeaSpec = Math.max(25, val);
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2; if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2;
} }
FillCMDCache({ CacheSeaSpec });
} }

View File

@@ -1,23 +1,24 @@
/** Functions related to Caching stats */ /** Functions related to Caching stats */
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas'; import SimHas from '../../Sim/ReplacedGameFunctions/SimHas.js';
import GetCPSBuffMult from '../CPS/GetCPSBuffMult'; import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheConjure, CacheConjure,
CacheConjureReward, // eslint-disable-line no-unused-vars CacheConjureReward,
CacheDragonsFortuneMultAdjustment, CacheDragonsFortuneMultAdjustment,
CacheEdifice, CacheEdifice,
CacheEdificeBuilding, // eslint-disable-line no-unused-vars CacheEdificeBuilding,
CacheGoldenCookiesMult, CacheGoldenCookiesMult,
CacheLucky, CacheLucky,
CacheLuckyFrenzy, CacheLuckyFrenzy,
CacheLuckyReward, // eslint-disable-line no-unused-vars CacheLuckyReward,
CacheLuckyRewardFrenzy, // eslint-disable-line no-unused-vars CacheLuckyRewardFrenzy,
CacheLuckyWrathReward, // eslint-disable-line no-unused-vars CacheLuckyWrathReward,
CacheLuckyWrathRewardFrenzy, // eslint-disable-line no-unused-vars CacheLuckyWrathRewardFrenzy,
CacheNoGoldSwitchCookiesPS, CacheNoGoldSwitchCookiesPS,
CacheWrathCookiesMult, CacheWrathCookiesMult,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches variables related to the stats page * This functions caches variables related to the stats page
@@ -53,6 +54,19 @@ export function CacheStatsCookies() {
CacheEdificeBuilding = i; CacheEdificeBuilding = i;
} }
}); });
FillCMDCache({
CacheLucky,
CacheLuckyReward,
CacheLuckyWrathReward,
CacheLuckyFrenzy,
CacheLuckyRewardFrenzy,
CacheLuckyWrathRewardFrenzy,
CacheConjure,
CacheConjureReward,
CacheEdifice,
CacheEdificeBuilding,
});
} }
/** /**
@@ -84,4 +98,10 @@ export function CacheGoldenAndWrathCookiesMults() {
if (Game.shimmerTypes.golden.n === 0) { if (Game.shimmerTypes.golden.n === 0) {
CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23; CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23;
} }
FillCMDCache({
CacheGoldenCookiesMult,
CacheWrathCookiesMult,
CacheDragonsFortuneMultAdjustment,
});
} }

View File

@@ -1,5 +1,7 @@
import { CacheObjectsNextAchievement } from '../VariablesAndData'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement'; import FillCMDCache from '../FillCMDCache.js';
import { CacheObjectsNextAchievement } from '../VariablesAndData.js';
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement.js';
/** /**
* This functions caches the amount of buildings needed till next achievement * This functions caches the amount of buildings needed till next achievement
@@ -17,7 +19,11 @@ export default function AllAmountTillNextAchievement(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: Game.Objects[i].getSumPrice( price: BuildingGetPrice(
i,
Game.Objects[i].basePrice,
Game.Objects[i].amount,
Game.Objects[i].free,
CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount, CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount,
), ),
}; };
@@ -26,9 +32,17 @@ export default function AllAmountTillNextAchievement(forceRecalc) {
result[i] = { result[i] = {
AmountNeeded: tillNext, AmountNeeded: tillNext,
TotalNeeded: Game.Objects[i].amount + tillNext, TotalNeeded: Game.Objects[i].amount + tillNext,
price: Game.Objects[i].getSumPrice(tillNext), price: BuildingGetPrice(
i,
Game.Objects[i].basePrice,
Game.Objects[i].amount,
Game.Objects[i].free,
tillNext,
),
}; };
} }
}); });
CacheObjectsNextAchievement = result; // eslint-disable-line no-unused-vars CacheObjectsNextAchievement = result;
FillCMDCache({ CacheObjectsNextAchievement });
} }

View File

@@ -1,5 +1,5 @@
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome'; import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome.js';
import { SimAchievementsOwned } from '../../Sim/VariablesAndData'; import { SimAchievementsOwned } from '../../Sim/VariablesAndData.js';
export default function IndividualAmountTillNextAchievement(building) { export default function IndividualAmountTillNextAchievement(building) {
const AchievementsAtStart = Game.AchievementsOwned; const AchievementsAtStart = Game.AchievementsOwned;

View File

@@ -1,11 +1,12 @@
/** Caches data related to Wrinklers */ /** Caches data related to Wrinklers */
import { SimObjects } from '../../Sim/VariablesAndData'; import { SimObjects } from '../../Sim/VariablesAndData.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersNormal, // eslint-disable-line no-unused-vars CacheWrinklersNormal,
CacheWrinklersTotal, // eslint-disable-line no-unused-vars CacheWrinklersTotal,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches data related to Wrinklers * This functions caches data related to Wrinklers
@@ -37,4 +38,6 @@ export default function CacheWrinklers() {
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i]; if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
} }
} }
FillCMDCache({ CacheWrinklersTotal, CacheWrinklersNormal, CacheWrinklersFattest });
} }

View File

@@ -10,6 +10,7 @@ function CheckNotificationPermissions(ToggleOnOff) {
const checkNotificationPromise = function () { const checkNotificationPromise = function () {
try { try {
Notification.requestPermission().then(); Notification.requestPermission().then();
// eslint-disable-next-line no-unused-vars
} catch (e) { } catch (e) {
return false; return false;
} }

View File

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

View File

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

View File

@@ -1,52 +1,18 @@
import ConfigData from '../Data/SettingsData'; import { saveAndLoadingFunctions } from '@cookiemonsterteam/cookiemonsterframework/src/index.js';
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();
} }

View File

@@ -1,13 +1,12 @@
import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar'; import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar.js';
import { UpdateBotTimerBarPosition } from '../SpecificToggles'; import { UpdateBotTimerBarPosition } from '../SpecificToggles.js';
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 {

View File

@@ -1,12 +1,12 @@
import { CMSayTime } from '../../Disp/VariablesAndData'; import { CMSayTime } from '../../Disp/VariablesAndData.js';
import { BackupFunctions } from '../../Main/VariablesAndData'; import { BackupFunctions } from '../../Main/VariablesAndData.js';
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;
} }

View File

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

View File

@@ -1,13 +1,12 @@
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData'; import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData.js';
import { GCTimers } from '../../Disp/VariablesAndData'; import { GCTimers } from '../../Disp/VariablesAndData.js';
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;

View File

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

View File

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

View File

@@ -1,16 +1,17 @@
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades'; import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades.js';
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();

View File

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

View File

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

View File

@@ -1,2 +0,0 @@
export let CMOptions = {}; // eslint-disable-line prefer-const
export const ConfigPrefix = 'CMConfig';

View File

@@ -1,6 +1,6 @@
import init from './InitSaveLoad/init'; import init from './InitSaveLoad/init.js';
import load from './InitSaveLoad/load'; import load from './InitSaveLoad/load.js';
import save from './InitSaveLoad/save'; import save from './InitSaveLoad/save.js';
const CM = { const CM = {
init, init,
@@ -8,4 +8,16 @@ const CM = {
save, save,
}; };
Game.registerMod('CookieMonster', CM); if (typeof Steam !== 'undefined') {
// Need to add a delay for steam
setTimeout(() => {
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;
}, 2000);
} else {
Game.registerMod('CookieMonster', CM);
window.cookieMonsterFrameworkData.isInitializing = false;
}

View File

@@ -1,7 +1,7 @@
/** Data copied directly from the game */ /** Data copied directly from the game */
/** Array of the names of all fortune cookies obtainable from the ticker */ /** Array of the names of all fortune cookies obtainable from the ticker */
export const Fortunes: string[] = [ export const Fortunes = [
'Fortune #001', 'Fortune #001',
'Fortune #002', 'Fortune #002',
'Fortune #003', 'Fortune #003',
@@ -20,6 +20,8 @@ export const Fortunes: string[] = [
'Fortune #016', 'Fortune #016',
'Fortune #017', 'Fortune #017',
'Fortune #018', 'Fortune #018',
'Fortune #019',
'Fortune #020',
'Fortune #100', 'Fortune #100',
'Fortune #101', 'Fortune #101',
'Fortune #102', 'Fortune #102',
@@ -28,7 +30,7 @@ export const Fortunes: string[] = [
]; ];
/** Array of the names of all Halloween cookies */ /** Array of the names of all Halloween cookies */
export const HalloCookies: string[] = [ export const HalloCookies = [
'Skull cookies', 'Skull cookies',
'Ghost cookies', 'Ghost cookies',
'Bat cookies', 'Bat cookies',
@@ -39,7 +41,7 @@ export const HalloCookies: string[] = [
]; ];
/** Array of the names of all Christmas cookies */ /** Array of the names of all Christmas cookies */
export const ChristCookies: string[] = [ export const ChristCookies = [
'Christmas tree biscuits', 'Christmas tree biscuits',
'Snowflake biscuits', 'Snowflake biscuits',
'Snowman biscuits', 'Snowman biscuits',
@@ -50,7 +52,7 @@ export const ChristCookies: string[] = [
]; ];
/** Array of the names of all Valentine cookies */ /** Array of the names of all Valentine cookies */
export const ValCookies: string[] = [ export const ValCookies = [
'Pure heart biscuits', 'Pure heart biscuits',
'Ardent heart biscuits', 'Ardent heart biscuits',
'Sour heart biscuits', 'Sour heart biscuits',
@@ -61,7 +63,7 @@ export const ValCookies: string[] = [
]; ];
/** Array of the names of all plant drops */ /** Array of the names of all plant drops */
export const PlantDrops: string[] = [ export const PlantDrops = [
'Elderwort biscuits', 'Elderwort biscuits',
'Bakeberry cookies', 'Bakeberry cookies',
'Duketater cookies', 'Duketater cookies',
@@ -72,7 +74,7 @@ export const PlantDrops: string[] = [
]; ];
/** All possible effects plants and other items can have with a display-title */ /** All possible effects plants and other items can have with a display-title */
export const Effects: { [index: string]: string } = { export const Effects = {
buildingCost: 'Building prices', buildingCost: 'Building prices',
click: 'Cookies per click', click: 'Cookies per click',
cps: 'Total CPS', cps: 'Total CPS',

21
src/Data/Moddata.js Normal file
View File

@@ -0,0 +1,21 @@
/** Data related directly to Cookie Monster */
export const VersionMajor = '2.053';
export const VersionMinor = '10';
/** Information about Cookie Monster to be displayed in the info section */
export const ModDescription = `<a href="https://github.com/CookieMonsterTeam/CookieMonster" target="blank">Cookie Monster</a>
offers a wide range of tools and statistics to enhance your game experience.
It is not a cheat interface although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.</br>
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
Please also report any bugs you may find over there!</br>
`;
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
export const LatestReleaseNotes = `This update adds support for some parts of cookie clicker 2.048</br>
- added support for Dragon Aura 'Supreme Intellect' in the pantheon calculations</br>
- added support for new tiers of Shimmering veil</br>
- added support for unshackled upgrades</br>
- updated some simulator logic to more cloesly match updated cookie clicker logic</br>
- Bugfix: conjure backed goods tooltip used cached no gold switch raw cps instead of live cps</br>
- Bugfix: negative calculations due to glucosimium upgrades, kittens, unshackled, and achievements</br>`;

View File

@@ -1,32 +0,0 @@
/** Data related directly to Cookie Monster */
export const VersionMajor = '2.031';
export const VersionMinor = '9';
/** Information about Cookie Monster to be displayed in the info section */
export const ModDescription = `<div class="listing">
<a href="https://github.com/CookieMonsterTeam/CookieMonster" target="blank">Cookie Monster</a>
offers a wide range of tools and statistics to enhance your game experience.
It is not a cheat interface although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.</br>
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
Please also report any bugs you may find over there!</br>
</div>
`;
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
export const LatestReleaseNotes = `<div class="listing">
This update implements the following functions:</br>
- For developers: we now expose some data calculated by Cookie Monster to the global scope. You can access it through the CookieMonsterData object</br>
- The column with the most optimal building now has a green coloured indicator whenever colour coding is turned on</br>
- The current season in the seasons statistics section is now displayed with green text for easier identification</br>
- New option to show a timer bar that counts down till next autosave</br>
- New option to sort buildings based on the "cost till next achievement"</br>
- Added extra information about achievements in statistics page</br>
</br>
This update fixes the following bugs:</br>
- Fixed a bug where ignoring certain buildings in rare cases did not create a "most optimal building"</br>
- Fixed some issues related to "left till achievement"</br>
- Fixed some cases where upgrades and buildings were not correctly sorted</br>
- Fixed the tooltip of "Pop all normal wrinklers" displaying an incorrect reward when Shiny's are present</br>
</div>
`;

View File

@@ -1,10 +1,10 @@
/** Data related directly to the scales used by Cookie Monster */ /** Data related directly to the scales used by Cookie Monster */
/** Array of abbreviations used in the "Metric" scale */ /** Array of abbreviations used in the "Metric" scale */
export const metric: string[] = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
/** Array of abbreviations used in the "Short" scale */ /** Array of abbreviations used in the "Short" scale */
export const shortScale: string[] = [ export const shortScale = [
'', '',
'', '',
'M', 'M',
@@ -34,7 +34,7 @@ export const shortScale: string[] = [
]; ];
/** Array of abbreviations used in the "Abbreviated Short" scale */ /** Array of abbreviations used in the "Abbreviated Short" scale */
export const shortScaleAbbreviated: string[] = [ export const shortScaleAbbreviated = [
'', '',
'K', 'K',
'M', 'M',

View File

@@ -1,7 +1,7 @@
/** Data related to the display titles of certain sections in menu screens */ /** Data related to the display titles of certain sections in menu screens */
/** Display titles of the headers of the Cookie Monster settings section */ /** Display titles of the headers of the Cookie Monster settings section */
export const ConfigGroups: { [index: string]: string } = { export const ConfigGroups = {
Favourite: 'Favourite Settings', Favourite: 'Favourite Settings',
Calculation: 'Calculation', Calculation: 'Calculation',
Notation: 'Notation', Notation: 'Notation',
@@ -14,7 +14,7 @@ export const ConfigGroups: { [index: string]: string } = {
}; };
/** Display titles of the headers of the notification section of the Cookie Monster settings */ /** Display titles of the headers of the notification section of the Cookie Monster settings */
export const ConfigGroupsNotification: { [index: string]: string } = { export const ConfigGroupsNotification = {
NotificationGeneral: 'General Notifications', NotificationGeneral: 'General Notifications',
NotificationGC: 'Golden Cookie', NotificationGC: 'Golden Cookie',
NotificationFC: 'Fortune Cookie', NotificationFC: 'Fortune Cookie',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,144 +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,
AutosaveTimerBar: 0,
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,
Achievs: 1,
Misc: 1,
InfoTab: 1,
},
};
export default ConfigDefault;

33
src/Data/headers.js Normal file
View 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;

View File

@@ -1,36 +1,35 @@
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions'; import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index.js';
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
import ToggleBotBar from '../Config/Toggles/ToggleBotBar'; import CheckNotificationPermissions from '../Config/CheckNotificationPermissions.js';
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime'; import RefreshScale from '../Disp/HelperFunctions/RefreshScale.js';
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer'; import { SimDoSims } from '../Sim/VariablesAndData.js'; // eslint-disable-line no-unused-vars
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons'; import ToggleBotBar from '../Config/Toggles/ToggleBotBar.js';
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos'; import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime.js';
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour'; import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer.js';
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos'; import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons.js';
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons'; import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos.js';
import { CMOptions } from '../Config/VariablesAndData'; import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour.js';
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings'; import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos.js';
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight'; import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js';
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades'; import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings.js';
import RefreshScale from '../Disp/HelperFunctions/RefreshScale'; import { UpdateFavicon } from '../Disp/TabTitle/FavIcon.js';
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon'; import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js';
import { SimDoSims } from '../Sim/VariablesAndData'; // eslint-disable-line no-unused-vars import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades.js';
import SettingColours from './SettingClasses/SettingColours.ts'; import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles.js';
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',
[ [
@@ -75,7 +76,8 @@ const Config = {
), ),
// 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', 'Time XXx, XXx'],
'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,21 +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,
), ),
AutosaveTimerBar: new SettingStandard( AutosaveTimerBar: new settingClasses.SettingStandard(
0,
'bool', 'bool',
'BarsDisplay', 'BarsDisplay',
['Autosave timer bar OFF', 'Autosave timer bar ON'], ['Autosave timer bar OFF', 'Autosave timer bar ON'],
'Show a timer counting down till next autosave in the timer bar', 'Show a timer counting down till next autosave in the timer bar',
true, true,
), ),
UpBarColour: new SettingStandard( 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'],
@@ -291,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'],
@@ -301,7 +330,8 @@ const Config = {
ToggleUpgradeBarFixedPos(); ToggleUpgradeBarFixedPos();
}, },
), ),
SortBuildings: new SettingStandard( SortBuildings: new settingClasses.SettingStandardWithFunc(
0,
'bool', 'bool',
'BarsDisplay', 'BarsDisplay',
[ [
@@ -316,7 +346,8 @@ const Config = {
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'],
@@ -326,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'],
@@ -336,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 overlay showing how long till 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'],
@@ -360,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'],
@@ -370,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'],
@@ -380,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'],
@@ -392,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',
[ [
@@ -409,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: ',
@@ -452,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)'],
@@ -469,42 +517,56 @@ 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( TooltipStocks: new settingClasses.SettingStandard(
1,
'bool',
'Tooltip',
['Stock market tooltips OFF', 'Stock market tooltips ON'],
'Shows additional info in the stock market tooltips.',
true,
),
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'],
@@ -513,35 +575,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: ',
@@ -549,7 +616,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'],
@@ -558,257 +626,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:',
@@ -816,14 +938,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',
[ [
@@ -839,4 +963,4 @@ const Config = {
), ),
}; };
export default Config; export default settings;

View File

@@ -1,8 +1,7 @@
/** 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.js';
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts'; import { BackupFunctions } from '../../Main/VariablesAndData.js';
import { BackupFunctions } from '../../Main/VariablesAndData';
/** /**
* This function returns formats number based on the Scale setting * This function returns formats number based on the Scale setting
@@ -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

View File

@@ -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
@@ -7,6 +5,7 @@ import { CMOptions } from '../../Config/VariablesAndData';
* @returns {string} Formatted time * @returns {string} Formatted time
*/ */
export default function FormatTime(time, longFormat) { export default function FormatTime(time, longFormat) {
/* eslint-disable no-nested-ternary */
let formattedTime = time; let formattedTime = time;
if (time === Infinity) return time; if (time === Infinity) return time;
if (time < 0) return 'Negative time period'; if (time < 0) return 'Negative time period';
@@ -17,7 +16,18 @@ 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 === 0) {
if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
str += y > 0 ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` : '';
if (str.length > 0 || d > 0)
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `;
if (str.length > 0 || h > 0)
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
if (str.length > 0 || m > 0)
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
} else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat === 1) {
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}:`;
@@ -25,18 +35,23 @@ export default function FormatTime(time, longFormat) {
str += `${(m < 10 ? '0' : '') + m}:`; str += `${(m < 10 ? '0' : '') + m}:`;
str += (s < 10 ? '0' : '') + s; str += (s < 10 ? '0' : '') + s;
} else { } else {
// Similar to TimeFormat === 0, but only two most significant components are included.
if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d'; if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
str += if (y > 0) {
y > 0 str += `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `;
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}`;
: ''; } else if (d > 0) {
if (str.length > 0 || d > 0) str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `;
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `; // eslint-disable-line no-nested-ternary str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}`;
if (str.length > 0 || h > 0) } else if (h > 0) {
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
if (str.length > 0 || m > 0) str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}`;
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary } else if (m > 0) {
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
} else {
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
}
} }
return str; return str;
} }

View File

@@ -1,24 +1,24 @@
import { CMOptions } from '../../Config/VariablesAndData'; import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData.js';
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData'; import FormatTime from './FormatTime.js';
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 === 1)
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 };
} }

View File

@@ -4,11 +4,10 @@ import {
CacheObjects10, CacheObjects10,
CacheObjects100, CacheObjects100,
CacheObjectsNextAchievement, CacheObjectsNextAchievement,
} from '../../Cache/VariablesAndData'; } from '../../Cache/VariablesAndData.js';
import { CMOptions } from '../../Config/VariablesAndData'; import BuildingSell from '../../Sim/SimulationEvents/SellBuilding.js';
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData.js';
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
/** /**
* Section: Functions related to right column of the screen (buildings/upgrades) * Section: Functions related to right column of the screen (buildings/upgrades)
@@ -36,11 +35,15 @@ export default function UpdateBuildings() {
l(`storeBulk100`).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 = CMOptions.ColourGreen; 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');
@@ -67,8 +70,11 @@ export default function UpdateBuildings() {
// Build array of pointers and sort according to the user's configured sort option. // Build array of pointers and sort according to the user's configured sort option.
// This regulates sorting of buildings. // This regulates sorting of buildings.
let arr; let arr;
if (Game.buyMode !== 1 || !CMOptions.SortBuildings) { if (
arr = Object.keys(CacheObjects1).map(k => { Game.buyMode !== 1 ||
!Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings
) {
arr = Object.keys(CacheObjects1).map((k) => {
const o = {}; const o = {};
o.name = k; o.name = k;
o.id = Game.Objects[k].id; o.id = Game.Objects[k].id;
@@ -76,36 +82,42 @@ export default function UpdateBuildings() {
}); });
// Sort using default order. // Sort using default order.
arr.sort((a, b) => a.id - b.id); arr.sort((a, b) => a.id - b.id);
} else if (CMOptions.SortBuildings === 1) { } else if (
arr = Object.keys(CacheObjects1).map(k => { Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 1
) {
arr = Object.keys(CacheObjects1).map((k) => {
const o = {}; const o = {};
o.name = k; o.name = k;
o.pp = CacheObjects1[k].pp; o.pp = CacheObjects1[k].pp;
o.color = CacheObjects1[k].color; o.colour = CacheObjects1[k].colour;
return o; return o;
}); });
// Sort by pp colour group, then by pp. // Sort by pp colour group, then by pp.
arr.sort((a, b) => arr.sort((a, b) =>
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color) ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
? a.pp - b.pp ? a.pp - b.pp
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color) : ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
); );
} else if (CMOptions.SortBuildings === 2) { } else if (
arr = Object.keys(target).map(k => { Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 2
) {
arr = Object.keys(target).map((k) => {
const o = {}; const o = {};
o.name = k; o.name = k;
o.pp = target[k].pp; o.pp = target[k].pp;
o.color = target[k].color; o.colour = target[k].colour;
return o; return o;
}); });
// Sort by pp colour group, then by pp. // Sort by pp colour group, then by pp.
arr.sort((a, b) => arr.sort((a, b) =>
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color) ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
? a.pp - b.pp ? a.pp - b.pp
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color) : ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
); );
} else if (CMOptions.SortBuildings === 3) { } else if (
arr = Object.keys(CacheObjectsNextAchievement).map(k => { Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 3
) {
arr = Object.keys(CacheObjectsNextAchievement).map((k) => {
const o = {}; const o = {};
o.name = k; o.name = k;
o.id = Game.Objects[k].id; o.id = Game.Objects[k].id;
@@ -118,9 +130,10 @@ export default function UpdateBuildings() {
// Sort by price until next achievement. // Sort by price until next achievement.
// Buildings that aren't within 100 of an achievement are placed at the end, still in // 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. // default order relative to each other because sort() is guaranteed stable.
arr.sort((a, b) => arr.sort(
(a.amountUntilNext !== 101 ? a.priceUntilNext : Infinity) - (a, b) =>
(b.amountUntilNext !== 101 ? b.priceUntilNext : Infinity) (a.amountUntilNext !== 101 ? a.priceUntilNext : Infinity) -
(b.amountUntilNext !== 101 ? b.priceUntilNext : Infinity),
); );
} }

View File

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

View File

@@ -8,7 +8,7 @@ import {
ColourRed, ColourRed,
ColourTextPre, ColourTextPre,
ColourYellow, ColourYellow,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This function creates the legend for the upgrade bar * This function creates the legend for the upgrade bar
@@ -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';

View File

@@ -1,5 +1,4 @@
import { CacheUpgrades } from '../../Cache/VariablesAndData'; import { CacheUpgrades } from '../../Cache/VariablesAndData.js';
import { CMOptions } from '../../Config/VariablesAndData';
import { import {
ColourBackPre, ColourBackPre,
ColourBlue, ColourBlue,
@@ -10,7 +9,7 @@ import {
ColourRed, ColourRed,
ColoursOrdering, ColoursOrdering,
ColourYellow, ColourYellow,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This function adjusts some things in the upgrades section * This function adjusts some things in the upgrades section
@@ -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,16 +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. // Sort by pp colour group, then by pp.
arr.sort((a, b) => arr.sort((a, b) =>
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color) ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
? a.pp - b.pp ? a.pp - b.pp
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color) : ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
); );
} else { } else {
arr.sort((a, b) => a.price - b.price); arr.sort((a, b) => a.price - b.price);

View File

@@ -1,18 +1,17 @@
/** Functions related to the Dragon */ /** Functions related to the Dragon */
import CacheDragonCost from '../../Cache/Dragon/Dragon'; import CacheDragonCost from '../../Cache/Dragon/Dragon.js';
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData'; import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData.js';
import { CMOptions } from '../../Config/VariablesAndData'; import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange.js';
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import FormatTime from '../BeautifyAndFormatting/FormatTime.js';
import FormatTime from '../BeautifyAndFormatting/FormatTime';
/** /**
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen * This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
* @param {number} aura The number of the aura currently selected by the mouse/user * @param {number} aura The number of the aura currently selected by the mouse/user
*/ */
export function AddAuraInfo(aura) { export function AddAuraInfo(aura) {
if (CMOptions.DragonAuraInfo === 1) { if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.DragonAuraInfo === 1) {
const [bonusCPS, priceOfChange] = CalculateChangeAura(aura); const [bonusCPS, priceOfChange] = CalculateChangeAura(aura);
const timeToRecover = FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs)); const timeToRecover = FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs));
let bonusCPSPercentage; let bonusCPSPercentage;

View File

@@ -1,14 +1,12 @@
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons'; import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js';
import { CMOptions } from '../Config/VariablesAndData'; import UpdateBuildings from './BuildingsUpgrades/Buildings.js';
import Beautify from './BeautifyAndFormatting/Beautify'; import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight.js';
import UpdateBuildings from './BuildingsUpgrades/Buildings'; import UpdateUpgrades from './BuildingsUpgrades/Upgrades.js';
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight'; import { UpdateBotBar } from './InfoBars/BottomBar.js';
import UpdateUpgrades from './BuildingsUpgrades/Upgrades'; import { UpdateTimerBar } from './InfoBars/TimerBar.js';
import { UpdateBotBar } from './InfoBars/BottomBar'; import RefreshMenu from './MenuSections/Refreshmenu.js';
import { UpdateTimerBar } from './InfoBars/TimerBar'; import UpdateTooltips from './Tooltips/UpdateTooltips.js';
import RefreshMenu from './MenuSections/Refreshmenu'; import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips.js';
import UpdateTooltips from './Tooltips/UpdateTooltips';
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips';
/** /**
* This function handles all custom drawing for the Game.Draw() function. * This function handles all custom drawing for the Game.Draw() function.
@@ -20,7 +18,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 +26,7 @@ export default function CMDrawHook() {
} }
} }
// Update colors // Update colours
UpdateBuildings(); UpdateBuildings();
UpdateUpgrades(); UpdateUpgrades();
UpdateUpgradeSectionsHeight(); UpdateUpgradeSectionsHeight();
@@ -51,11 +49,4 @@ export default function CMDrawHook() {
// Update display of wrinkler buttons, this checks if Elder Pledge has been bought and if they should be disabled // Update display of wrinkler buttons, this checks if Elder Pledge has been bought and if they should be disabled
ToggleWrinklerButtons(); ToggleWrinklerButtons();
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
if (CMOptions.Scale) {
let str = l('cookies').innerHTML.replace(/.*(?=<br>)/i, Beautify(Game.cookies));
if (Game.prefs.monospace) str = `<span class="monospace">${str}</span>`;
l('cookies').innerHTML = str;
}
} }

View File

@@ -1,7 +1,6 @@
/** 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.js';
import { GCTimers } from '../VariablesAndData';
/** /**
* This function creates a new Golden Cookie Timer and appends it CM.Disp.GCTimers based on the id of the cookie * This function creates a new Golden Cookie Timer and appends it CM.Disp.GCTimers based on the id of the cookie
@@ -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 () {

View File

@@ -0,0 +1,104 @@
const SPECIAL_DIGIT = 7;
/**
* Count the number of 7s in any number
* @param {number} number The number to count sevens for
* @returns {number} The number of 7s in the provided number
*/
export function CountSevens(number) {
return String(number).split(String(SPECIAL_DIGIT)).length - 1;
}
/**
* Calculate the delta for the next number where the given digit is a 7
* @param {number} number The starting number to calculate the delta for
* @param {number} digitPlace 1 for ones place, 10 for tens place, 100 for hundreds place, etc
* @returns {number} The calculated delta
*/
export function CalculateSevenDelta(number, digitPlace) {
const target = SPECIAL_DIGIT * digitPlace;
const modulus = digitPlace * 10;
let delta = target - (number % modulus) + (number % digitPlace);
if (delta < 0) delta += modulus;
return delta;
}
/**
* This function calculates each of the next "lucky" prestige levels
* @param {number} currentLevel The user's prestige level, including levels earned since the last ascension
* @returns {{number}, {number}, {number}} luckyDigit, luckyNumber, luckyPayout The next eligible level for each upgrade
*/
export default function CalculateLuckyLevels(currentLevel) {
const result = {};
let sevenCount = CountSevens(currentLevel);
const numberOfDigits = Math.max(Math.floor(Math.log10(Math.abs(currentLevel))), 0) + 1;
if (sevenCount >= 1) {
result.luckyDigit = currentLevel;
if (sevenCount >= 2) {
result.luckyNumber = currentLevel;
if (sevenCount >= 4) {
result.luckyPayout = currentLevel;
return result;
}
}
}
// Consider only top 15 digits if it is big number
let localLevel;
if (numberOfDigits >= 16) {
localLevel = Math.ceil(currentLevel / 10 ** (numberOfDigits - 15));
} else {
localLevel = currentLevel;
}
sevenCount = CountSevens(localLevel);
if (result.luckyDigit === undefined) {
if (sevenCount < 1) {
const delta = CalculateSevenDelta(localLevel, 1);
localLevel += delta;
sevenCount = CountSevens(localLevel);
}
result.luckyDigit = localLevel;
if (numberOfDigits >= 16) {
result.luckyDigit *= 10 ** Number(numberOfDigits - 15);
}
}
if (result.luckyNumber === undefined) {
while (sevenCount < 2) {
let delta = CalculateSevenDelta(localLevel, 1);
if (delta === 0) delta = CalculateSevenDelta(localLevel, 10);
localLevel += delta;
sevenCount = CountSevens(localLevel);
}
result.luckyNumber = localLevel;
if (numberOfDigits >= 16) {
result.luckyNumber *= 10 ** Number(numberOfDigits - 15);
}
}
let digitPlace = 1;
while (sevenCount < 4) {
const delta = CalculateSevenDelta(localLevel, digitPlace);
if (delta === 0) {
digitPlace *= 10;
} else {
localLevel += delta;
sevenCount = CountSevens(localLevel);
}
}
result.luckyPayout = localLevel;
if (numberOfDigits >= 16) {
result.luckyPayout *= 10 ** Number(numberOfDigits - 15);
}
return result;
}

View File

@@ -0,0 +1,52 @@
/**
* This function calculates a stock's next expected value
* @param {number} value The stock's current value
* @param {number} delta The stock's current delta
* @param {number} restingValue The stock's resting value
* @param {number} mode The stock's current mode
* @param {number} bankLevel The bank building level
* @param {number} dragonBoost The current aura multiplier from Supreme Intellect and Reality Bending
* @returns {number} value + delta The stock's next expected value
*/
export default function CalculateStockNextExpectedValue(
pValue,
pDelta,
restingValue,
mode,
bankLevel,
dragonBoost,
) {
let value = pValue;
let delta = pDelta;
delta *= 0.97 + 0.01 * dragonBoost;
switch (mode) {
case 0:
delta *= 0.95;
break;
case 1:
delta *= 0.99;
delta += 0.02;
break;
case 2:
delta *= 0.99;
delta -= 0.02;
break;
case 3:
delta += 0.06;
value += 2.5;
break;
case 4:
delta -= 0.06;
value -= 2.5;
break;
default:
break;
}
value += (restingValue - value) * 0.01;
if (mode === 3) value -= 0.582;
if (mode === 4) value += 0.6;
if (value > 100 + (bankLevel - 1) * 3 && delta > 0) delta *= 0.9;
if (value < 5) value += (5 - value) * 0.5;
if (value < 5 && delta < 0) delta *= 0.95;
return Math.max(value + delta, 1);
}

View File

@@ -3,25 +3,27 @@ import {
CacheCurrWrinklerCount, CacheCurrWrinklerCount,
CacheCurrWrinklerCPSMult, CacheCurrWrinklerCPSMult,
CacheWrinklersFattest, CacheWrinklersFattest,
} from '../../Cache/VariablesAndData'; } from '../../Cache/VariablesAndData.js';
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 +

View File

@@ -5,29 +5,29 @@ import {
ColourPurple, ColourPurple,
ColourRed, ColourRed,
ColourYellow, ColourYellow,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* 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 };
} }

View File

@@ -1,5 +1,4 @@
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData'; import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData.js';
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;

View File

@@ -1,6 +1,6 @@
import UpdateBuildings from '../BuildingsUpgrades/Buildings'; import UpdateBuildings from '../BuildingsUpgrades/Buildings.js';
import UpdateUpgrades from '../BuildingsUpgrades/Upgrades'; import UpdateUpgrades from '../BuildingsUpgrades/Upgrades.js';
import { UpdateBotBar } from '../InfoBars/BottomBar'; import { UpdateBotBar } from '../InfoBars/BottomBar.js';
/** /**
* This function refreshes all numbers after a change in scale-setting * This function refreshes all numbers after a change in scale-setting

View File

@@ -1,7 +1,7 @@
import { ToggleTimerBar } from '../../Config/SpecificToggles'; import { ToggleTimerBar } from '../../Config/SpecificToggles.js';
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar'; import ToggleBotBar from '../../Config/Toggles/ToggleBotBar.js';
import { CMOptions } from '../../Config/VariablesAndData';
import UpdateBackground from './UpdateBackground'; import UpdateBackground from './UpdateBackground.js';
/** /**
* This function disables and shows the bars created by CookieMonster when the game is "ascending" * This function disables and shows the bars created by CookieMonster when the game is "ascending"
@@ -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();

View File

@@ -1,11 +1,10 @@
import { CMOptions } from '../../Config/VariablesAndData'; import UpdateBuildings from '../BuildingsUpgrades/Buildings.js';
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
import { import {
ColourBackPre, ColourBackPre,
ColourBorderPre, ColourBorderPre,
ColoursOrdering, ColoursOrdering,
ColourTextPre, ColourTextPre,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This function changes/refreshes colours if the user has set new standard colours * This function changes/refreshes colours if the user has set new standard colours
@@ -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;

View File

@@ -1,16 +1,15 @@
/** 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.js';
import { CMOptions } from '../../Config/VariablesAndData'; import { VersionMajor, VersionMinor } from '../../Data/Moddata.js';
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import FormatTime from '../BeautifyAndFormatting/FormatTime.js';
import FormatTime from '../BeautifyAndFormatting/FormatTime'; import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour.js';
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
import GetCPS from '../HelperFunctions/GetCPS'; import GetCPS from '../HelperFunctions/GetCPS.js';
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank'; import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank.js';
import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData'; import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData.js';
import { CreateBotBarBuildingColumn } from './CreateDOMElements'; import { CreateBotBarBuildingColumn } from './CreateDOMElements.js';
/** /**
* This function creates the bottom bar and appends it to l('wrapper') * This function creates the bottom bar and appends it to l('wrapper')
@@ -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,20 +86,20 @@ 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].textContent =
count `${timeColour.text} (with Wrink)`;
].textContent = `${timeColour.text} (with Wrink)`;
} else } else
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent = l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent =
timeColour.text; timeColour.text;

View File

@@ -1,12 +1,12 @@
/** Functions to create various DOM elements used by the Bars */ /** Functions to create various DOM elements used by the Bars */
import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData'; import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData.js';
/** /**
* 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');

View File

@@ -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.js';
import { CMOptions } from '../../Config/VariablesAndData';
import { import {
BuffColours, BuffColours,
ColourBackPre, ColourBackPre,
@@ -9,8 +8,9 @@ import {
ColourOrange, ColourOrange,
ColourPurple, ColourPurple,
LastNumberOfTimers, LastNumberOfTimers,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
import { CreateTimer } from './CreateDOMElements'; import { CreateTimer } from './CreateDOMElements.js';
import { updateChanceTotal, updateChanceTotalDeer } from '../../Main/CheckStates/Probability.js';
/** /**
* This function creates the TimerBar and appends it to l('wrapper') * This function creates the TimerBar and appends it to l('wrapper')
@@ -27,21 +27,21 @@ export function CreateTimerBar() {
// Create standard Autosave bar // Create standard Autosave bar
const CMTimerBarAutosave = CreateTimer('CMTimerBarAutosave', 'Autosave', [ const CMTimerBarAutosave = CreateTimer('CMTimerBarAutosave', 'Autosave', [
{ id: 'CMTimerBarAutosaveBar', color: ColourPurple }, { id: 'CMTimerBarAutosaveBar', colour: ColourPurple },
]); ]);
TimerBar.appendChild(CMTimerBarAutosave); 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');
@@ -55,14 +55,17 @@ 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 (CMOptions.AutosaveTimerBar && Game.prefs.autosave) { if (
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AutosaveTimerBar &&
Game.prefs.autosave
) {
const timeTillNextAutosave = const timeTillNextAutosave =
(Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60))) / Game.fps; (Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60))) / Game.fps;
l('CMTimerBarAutosave').style.display = ''; l('CMTimerBarAutosave').style.display = '';
@@ -71,7 +74,9 @@ export function UpdateTimerBar() {
(maxWidthOneBar - Math.ceil(timeTillNextAutosave).toString().length * 8)) / (maxWidthOneBar - Math.ceil(timeTillNextAutosave).toString().length * 8)) /
60, 60,
)}px`; )}px`;
if (CMOptions.TimerBarOverlay >= 1) { if (
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimerBarOverlay >= 1
) {
l('CMTimerBarAutosaveBar').textContent = Math.ceil(timeTillNextAutosave); l('CMTimerBarAutosaveBar').textContent = Math.ceil(timeTillNextAutosave);
} else l('CMTimerBarAutosaveBar').textContent = ''; } else l('CMTimerBarAutosaveBar').textContent = '';
l('CMTimerBarAutosaveTime').textContent = Math.ceil(timeTillNextAutosave); l('CMTimerBarAutosaveTime').textContent = Math.ceil(timeTillNextAutosave);
@@ -86,7 +91,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,
); );
@@ -106,7 +111,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,
@@ -114,9 +119,24 @@ 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;
const finalChance = updateChanceTotal(chanceToSpawn);
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,
); )} `;
if (finalChance < 0.01) {
l('CMTimerBarGCTime').textContent +=
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
} else {
l('CMTimerBarGCTime').textContent += finalChance.toLocaleString('en', {
style: 'percent',
});
}
numberOfTimers += 1; numberOfTimers += 1;
} else l('CMTimerBarGC').style.display = 'none'; } else l('CMTimerBarGC').style.display = 'none';
@@ -128,7 +148,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,
); );
@@ -141,7 +161,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,
@@ -149,9 +169,24 @@ 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;
const deerFinalChance = updateChanceTotalDeer(chanceToSpawn);
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,
); )} `;
if (deerFinalChance < 0.01) {
l('CMTimerBarRenTime').textContent +=
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
} else {
l('CMTimerBarRenTime').textContent += deerFinalChance.toLocaleString('en', {
style: 'percent',
});
}
numberOfTimers += 1; numberOfTimers += 1;
} else { } else {
l('CMTimerBarRen').style.display = 'none'; l('CMTimerBarRen').style.display = 'none';
@@ -167,13 +202,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),
)}%`; )}%`;

View File

@@ -1,6 +1,6 @@
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData'; import { CacheWrinklersFattest } from '../../Cache/VariablesAndData.js';
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers'; import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers.js';
import { CreateTooltip } from '../Tooltips/Tooltip'; import { CreateTooltip } from '../Tooltips/Tooltip.js';
/** /**
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers * This function creates two objects at the bottom of the left column that allowing popping of wrinklers

View File

@@ -1,4 +1,4 @@
import { DispCSS } from '../VariablesAndData'; import { DispCSS } from '../VariablesAndData.js';
/** /**
* This function creates a CSS style that stores certain standard CSS classes used by CookieMonster * This function creates a CSS style that stores certain standard CSS classes used by CookieMonster

View File

@@ -1,7 +1,5 @@
import { CMOptions } from '../../Config/VariablesAndData'; import createMenuOptions from './createMenuOptions.js';
import AddMenuStats from './Statistics/AddStatsPage'; import AddMenuStats from './Statistics/AddStatsPage.js';
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 +8,16 @@ 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') { } else if (Game.onMenu === 'prefs') {
title.textContent = 'Cookie Monster '; // To create space between name and button // Added because Framework is broken
AddMenuInfo(title); l('menu').childNodes[2].insertBefore(
createMenuOptions(),
l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1],
);
} }
} }

View File

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

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