Skip to content

Commit

Permalink
Merge pull request #912 from CookieMonsterTeam/dev
Browse files Browse the repository at this point in the history
Bump master to 2.031.10
  • Loading branch information
DanielNoord authored Jul 25, 2021
2 parents 80b373f + c455f94 commit 60f19e5
Show file tree
Hide file tree
Showing 43 changed files with 520 additions and 543 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ jobs:
run: npx mocha
- name: Check if CookieMonsterDev.js is built correctly
run: |
npx webpack -o ./tmp --env production
npx webpack -o ./tmp --env minimize
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
echo '### SUCCESS: CookieMonsterDev is correctly built! ###'
echo '### SUCCESS: CookieMonsterDev is built correctly! ###'
else
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###'
exit 1
fi
- name: Check if CookieMonster.js is built correctly
if: github.ref == 'refs/heads/master'
run: |
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 dist/CookieMonster.js); then
echo '### SUCCESS: CookieMonster is correctly built! ###'
npx webpack -o ./tmp --env minimize --env finalfile
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
echo '### SUCCESS: CookieMonster is built correctly! ###'
else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to copy CookieMonsterDev.js into CookieMonster.js before merging to master! ###'
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build-final" after saving all your changes! ###'
exit 1
fi
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Currently we exposes relevant data for buildings and upgrades (PP, colour and bo

To contribute you can fork and clone the repository and run `npm install`. Note that you will need to authenticate to the GitHub Package Registery (see [this documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages)). After creating a Public Access Token you should export this variable to $GITHUB_REGISTERY_PAT as defined in `.npmrc`.

Please also remember to run `npm run build` after saving all your changes to build the final `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

Expand Down
6 changes: 3 additions & 3 deletions dist/CookieMonster.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/CookieMonster.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/CookieMonsterDev.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/CookieMonsterDev.js.map

Large diffs are not rendered by default.

272 changes: 136 additions & 136 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cookiemonster-mod",
"version": "2.031.7",
"name": "@cookiemonsterteam/cookiemonster-mod",
"version": "2.031.10",
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
"main": "CookieMonster.js",
"keywords": [
Expand All @@ -11,11 +11,12 @@
"Orteil"
],
"scripts": {
"eslint-src": "eslint src test",
"build": "run-s eslint-src test pack-prod",
"build-test": "run-s pack-dev",
"pack-prod": "webpack --env production",
"pack-dev": "webpack",
"build-dev": "run-s eslint test pack-prod",
"build-final": "run-s eslint test pack-final",
"build-test": "webpack",
"eslint": "eslint src test",
"pack-prod": "webpack --env minimize",
"pack-final": "webpack --env minimize --env finalfile",
"test": "mocha"
},
"repository": {
Expand Down Expand Up @@ -44,9 +45,9 @@
"homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme",
"devDependencies": {
"@types/chai": "^4.2.19",
"@types/mocha": "^8.2.2",
"@typescript-eslint/eslint-plugin": "^4.28.3",
"@typescript-eslint/parser": "^4.28.3",
"@types/mocha": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.28.4",
"@typescript-eslint/parser": "^4.28.4",
"chai": "^4.3.4",
"eslint": "^7.31.0",
"eslint-config-airbnb-base": "^14.2.1",
Expand All @@ -71,6 +72,6 @@
},
"dependencies": {
"@eastdesire/jscolor": "^2.4.5",
"@cookiemonsterteam/cookiemonsterframework": "^0.2.0"
"@cookiemonsterteam/cookiemonsterframework": "^0.2.1"
}
}
8 changes: 4 additions & 4 deletions src/Cache/PP/Building.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ function CacheColour(target, amount) {
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPRigidelMode &&
amount === 1
) {
target[i].color = ColourGray; // eslint-disable-line no-param-reassign
target[i].colour = ColourGray; // eslint-disable-line no-param-reassign
return;
}
// eslint-disable-next-line no-param-reassign
target[i].color = ColourOfPP(
target[i].colour = ColourOfPP(
target[i],
BuildingGetPrice(
i,
Expand All @@ -42,7 +42,7 @@ function CacheColour(target, amount) {
j < Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPExcludeTop;
j++
) {
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColourGray; // eslint-disable-line no-param-reassign
if (target[i].pp === CachePPArray[j][0]) target[i].colour = ColourGray; // eslint-disable-line no-param-reassign
}
});
}
Expand Down Expand Up @@ -84,7 +84,7 @@ export default function CacheBuildingsPP() {
)
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPExcludeTop = 0; // Otherwise breaks during initialization

// Calculate PP and colors
// Calculate PP and colours
CachePP(CacheObjects1, 1);
CachePP(CacheObjects10, 10);
CachePP(CacheObjects100, 100);
Expand Down
24 changes: 12 additions & 12 deletions src/Cache/PP/ColourOfPP.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ import { CacheMinPP, CachePPArray } from '../VariablesAndData';
* 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 {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) {
let color = '';
let colour = '';
// Colour based on PP
if (me.pp <= 0 || me.pp === Infinity) color = ColourGray;
else if (me.pp < CacheMinPP) color = ColourBlue;
else if (me.pp === CacheMinPP) color = ColourGreen;
else if (me.pp < CachePPArray[10][0]) color = ColourYellow;
else if (me.pp < CachePPArray[20][0]) color = ColourOrange;
else if (me.pp < CachePPArray[30][0]) color = ColourRed;
else color = ColourPurple;
if (me.pp <= 0 || me.pp === Infinity) colour = ColourGray;
else if (me.pp < CacheMinPP) colour = ColourBlue;
else if (me.pp === CacheMinPP) colour = ColourGreen;
else if (me.pp < CachePPArray[10][0]) colour = ColourYellow;
else if (me.pp < CachePPArray[20][0]) colour = ColourOrange;
else if (me.pp < CachePPArray[30][0]) colour = ColourRed;
else colour = ColourPurple;

// Colour based on price in terms of CPS
if (
Expand All @@ -40,11 +40,11 @@ export default function ColourOfPP(me, price) {
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPSecondsLowerLimit,
)
)
color = ColourBlue;
colour = ColourBlue;
}
// Colour based on being able to purchase
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;
}
2 changes: 1 addition & 1 deletion src/Cache/PP/Upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export default function CacheUpgradePP() {
} else CacheUpgrades[i].pp = Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
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());
});
}
10 changes: 6 additions & 4 deletions src/Config/Toggles/ToggleUpgradeBarAndColour.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import UpdateUpgrades from '../../Disp/BuildingsUpgrades/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() {
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor === 1) {
export default function ToggleUpgradeBarAndColour() {
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour === 1) {
// Colours and bar on
l('CMUpgradeBar').style.display = '';
UpdateUpgrades();
} else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor === 2) {
} else if (
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour === 2
) {
// Colours on and bar off
l('CMUpgradeBar').style.display = 'none';
UpdateUpgrades();
Expand Down
4 changes: 4 additions & 0 deletions src/CookieMonster.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ const CM = {
};

Game.registerMod('CookieMonster', CM);

// Game.registerMod also calls CM.load() which calls the loop hook
// Thus sounds normally play at start up as Season and Garden states are checked
window.cookieMonsterFrameworkData.isInitializing = false;
24 changes: 10 additions & 14 deletions src/Data/Moddata.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Data related directly to Cookie Monster */

export const VersionMajor = '2.031';
export const VersionMinor = '9';
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>
Expand All @@ -13,17 +13,13 @@ export const ModDescription = `<a href="https://github.com/CookieMonsterTeam/Coo

/** Latest releasenotes of Cookie Monster to be displayed in the info section */
export const LatestReleaseNotes = `This update implements the following functions:</br>
- HOTFIX: Fixed the possibility of clicking Golden Cookies multiple times with autoclickers</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>
- This updates adds a number of performance improvements which make CookieMonster about 33% more efficient</br>
- Added a button to all buildings in the middle section that can "lock" the building. This makes the building unclickable, which might be useful for frantic clicking during cookie storms</br>
- Added a percentage to the Golden Cookie timer bar</br>
</br>
This update fixes the following bugs:</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>
`;
This update fixes the following bugs:
- Fix considerable lag on the Ascension screen when using the monospace font</br>
- Fix sound playing at start-up</br>
- Fix building tooltips and warnings not updating correctly</br>
- Fix upgrade bar not displaying</br>
- Fix loading of mod when no save was found</br>`;
14 changes: 0 additions & 14 deletions src/Data/SettingClasses/BaseSetting.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/Data/SettingClasses/SettingColours.ts

This file was deleted.

28 changes: 0 additions & 28 deletions src/Data/SettingClasses/SettingInputNumber.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/Data/SettingClasses/SettingStandard.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/Data/SettingClasses/SettingVolume.ts

This file was deleted.

Loading

0 comments on commit 60f19e5

Please sign in to comment.