Change to "color" to "colour"

This commit is contained in:
Daniël van Noord
2021-07-25 14:42:21 +02:00
parent 65eff470cf
commit d0ddc93f7c
20 changed files with 99 additions and 99 deletions

View File

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

View File

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

View File

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