Fixed linting issues
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
CacheSpawnedGoldenShimmer,
|
||||
CacheGoldenShimmersByID,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CacheSpawnedGoldenShimmer, CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import CreateGCTimer from '../../Disp/GoldenCookieTimers/GoldenCookieTimers';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
@@ -69,11 +66,8 @@ export default function CheckGoldenCookie() {
|
||||
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
||||
Object.keys(GCTimers).forEach((i) => {
|
||||
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
||||
GCTimers[i].style.transform =
|
||||
CacheGoldenShimmersByID[i].l.style.transform;
|
||||
GCTimers[i].textContent = Math.ceil(
|
||||
CacheGoldenShimmersByID[i].life / Game.fps,
|
||||
);
|
||||
GCTimers[i].style.transform = CacheGoldenShimmersByID[i].l.style.transform;
|
||||
GCTimers[i].textContent = Math.ceil(CacheGoldenShimmersByID[i].life / Game.fps);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,7 @@ import { LastMagicBarFull } from '../VariablesAndData';
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
export default function CheckMagicMeter() {
|
||||
if (
|
||||
Game.Objects['Wizard tower'].minigameLoaded &&
|
||||
CMOptions.GrimoireBar === 1
|
||||
) {
|
||||
if (Game.Objects['Wizard tower'].minigameLoaded && CMOptions.GrimoireBar === 1) {
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
||||
else if (!LastMagicBarFull) {
|
||||
|
||||
@@ -9,20 +9,11 @@ import { LastTickerFortuneState } from '../VariablesAndData';
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
export default function CheckTickerFortune() {
|
||||
if (
|
||||
LastTickerFortuneState !==
|
||||
(Game.TickerEffect && Game.TickerEffect.type === 'fortune')
|
||||
) {
|
||||
LastTickerFortuneState =
|
||||
Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
||||
if (LastTickerFortuneState !== (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) {
|
||||
LastTickerFortuneState = Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
||||
if (LastTickerFortuneState) {
|
||||
Flash(3, 'FortuneFlash', false);
|
||||
PlaySound(
|
||||
CMOptions.FortuneSoundURL,
|
||||
'FortuneSound',
|
||||
'FortuneVolume',
|
||||
false,
|
||||
);
|
||||
PlaySound(CMOptions.FortuneSoundURL, 'FortuneSound', 'FortuneVolume', false);
|
||||
CreateNotification(
|
||||
'FortuneNotification',
|
||||
'Fortune Cookie found',
|
||||
|
||||
@@ -16,36 +16,17 @@ export default function CheckWrinklerCount() {
|
||||
});
|
||||
if (CurrentWrinklers > LastWrinklerCount) {
|
||||
LastWrinklerCount = CurrentWrinklers;
|
||||
if (
|
||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||
CMOptions.WrinklerMaxFlash
|
||||
) {
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxFlash) {
|
||||
Flash(3, 'WrinklerMaxFlash', false);
|
||||
} else {
|
||||
Flash(3, 'WrinklerFlash', false);
|
||||
}
|
||||
if (
|
||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||
CMOptions.WrinklerMaxSound
|
||||
) {
|
||||
PlaySound(
|
||||
CMOptions.WrinklerMaxSoundURL,
|
||||
'WrinklerMaxSound',
|
||||
'WrinklerMaxVolume',
|
||||
false,
|
||||
);
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxSound) {
|
||||
PlaySound(CMOptions.WrinklerMaxSoundURL, 'WrinklerMaxSound', 'WrinklerMaxVolume', false);
|
||||
} else {
|
||||
PlaySound(
|
||||
CMOptions.WrinklerSoundURL,
|
||||
'WrinklerSound',
|
||||
'WrinklerVolume',
|
||||
false,
|
||||
);
|
||||
PlaySound(CMOptions.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume', false);
|
||||
}
|
||||
if (
|
||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||
CMOptions.WrinklerMaxNotification
|
||||
) {
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxNotification) {
|
||||
CreateNotification(
|
||||
'WrinklerMaxNotification',
|
||||
'Maximum Wrinklers Reached',
|
||||
|
||||
@@ -40,11 +40,7 @@ export default function InitializeCookieMonster() {
|
||||
CreateSectionHideButtons();
|
||||
CreateFavicon();
|
||||
Object.keys(TooltipText).forEach((i) => {
|
||||
CreateSimpleTooltip(
|
||||
TooltipText[i][0],
|
||||
TooltipText[i][1],
|
||||
TooltipText[i][2],
|
||||
);
|
||||
CreateSimpleTooltip(TooltipText[i][0], TooltipText[i][1], TooltipText[i][2]);
|
||||
});
|
||||
CreateWrinklerButtons();
|
||||
UpdateBuildingUpgradeStyle();
|
||||
@@ -61,17 +57,8 @@ export default function InitializeCookieMonster() {
|
||||
CMLastAscendState = Game.OnAscend; // eslint-disable-line no-unused-vars
|
||||
|
||||
if (Game.prefs.popups)
|
||||
Game.Popup(
|
||||
`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`,
|
||||
);
|
||||
else
|
||||
Game.Notify(
|
||||
`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`,
|
||||
'',
|
||||
'',
|
||||
1,
|
||||
1,
|
||||
);
|
||||
Game.Popup(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`);
|
||||
else Game.Notify(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`, '', '', 1, 1);
|
||||
|
||||
Game.Win('Third-party');
|
||||
}
|
||||
|
||||
@@ -4,22 +4,13 @@ import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
||||
import CacheSellAllForChoEgg from '../Cache/CPS/SellChoEgg';
|
||||
import CacheDragonCost from '../Cache/Dragon/Dragon';
|
||||
import CachePantheonGods from '../Cache/PantheonGods/CacheGods';
|
||||
import {
|
||||
CacheBuildingsPrices,
|
||||
CacheIncome,
|
||||
} from '../Cache/PriceAndIncome/PriceAndIncome';
|
||||
import { CacheBuildingsPrices, CacheIncome } from '../Cache/PriceAndIncome/PriceAndIncome';
|
||||
import { CacheChain } from '../Cache/Stats/ChainCookies';
|
||||
import CacheAllMissingUpgrades from '../Cache/Stats/MissingUpgrades';
|
||||
import CacheSeasonSpec from '../Cache/Stats/Reindeer';
|
||||
import {
|
||||
CacheGoldenAndWrathCookiesMults,
|
||||
CacheStatsCookies,
|
||||
} from '../Cache/Stats/Stats';
|
||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from '../Cache/Stats/Stats';
|
||||
import AllAmountTillNextAchievement from '../Cache/TillNextAchievement/AllAmountTillNextAchievement';
|
||||
import {
|
||||
CacheDoRemakeBuildPrices,
|
||||
CacheHadBuildAura,
|
||||
} from '../Cache/VariablesAndData';
|
||||
import { CacheDoRemakeBuildPrices, CacheHadBuildAura } from '../Cache/VariablesAndData';
|
||||
import UpdateAscendState from '../Disp/HelperFunctions/UpdateAscendState';
|
||||
import { LastAscendState } from '../Disp/VariablesAndData';
|
||||
import InitData from '../Sim/InitializeData/InitData';
|
||||
|
||||
@@ -14,21 +14,14 @@ import ReplaceTooltipGrimoire from './TooltipGrimoire';
|
||||
* This function fixes replaces the .draw function of the Grimoire
|
||||
*/
|
||||
function ReplaceNativeGrimoireDraw() {
|
||||
if (
|
||||
!HasReplaceNativeGrimoireDraw &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
if (!HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
BackupGrimoireDraw = minigame.draw;
|
||||
Game.Objects['Wizard tower'].minigame.draw = function () {
|
||||
BackupGrimoireDraw();
|
||||
if (CMOptions.GrimoireBar === 1 && minigame.magic < minigame.magicM) {
|
||||
minigame.magicBarTextL.innerHTML += ` (${FormatTime(
|
||||
CalculateGrimoireRefillTime(
|
||||
minigame.magic,
|
||||
minigame.magicM,
|
||||
minigame.magicM,
|
||||
),
|
||||
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM),
|
||||
)})`;
|
||||
}
|
||||
};
|
||||
@@ -40,10 +33,7 @@ function ReplaceNativeGrimoireDraw() {
|
||||
* This function fixes replaces the .launch function of the Grimoire
|
||||
*/
|
||||
function ReplaceNativeGrimoireLaunch() {
|
||||
if (
|
||||
!HasReplaceNativeGrimoireLaunch &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
if (!HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
BackupGrimoireLaunch = minigame.launch; // eslint-disable-line no-unused-vars
|
||||
BackupGrimoireLaunchMod = new Function( // eslint-disable-line no-new-func
|
||||
|
||||
@@ -6,21 +6,15 @@ import { TooltipGrimoireBackup } from '../VariablesAndData';
|
||||
*/
|
||||
export default function ReplaceTooltipGrimoire() {
|
||||
if (Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
Object.keys(Game.Objects['Wizard tower'].minigame.spellsById).forEach(
|
||||
(i) => {
|
||||
if (l(`grimoireSpell${i}`).onmouseover !== null) {
|
||||
TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover;
|
||||
l(`grimoireSpell${i}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('g', `${i}`),
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
},
|
||||
);
|
||||
Object.keys(Game.Objects['Wizard tower'].minigame.spellsById).forEach((i) => {
|
||||
if (l(`grimoireSpell${i}`).onmouseover !== null) {
|
||||
TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover;
|
||||
l(`grimoireSpell${i}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(this, () => CreateTooltip('g', `${i}`), 'this');
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,7 @@ export default function ReplaceTooltipUpgrade() {
|
||||
if (!Game.mouseDown) {
|
||||
Game.setOnCrate(this);
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('u', `${i}`),
|
||||
'store',
|
||||
);
|
||||
Game.tooltip.draw(this, () => CreateTooltip('u', `${i}`), 'store');
|
||||
Game.tooltip.wobble();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/** Functions related to replacing tooltips */
|
||||
|
||||
import { CreateTooltip } from '../../Disp/Tooltips/Tooltip';
|
||||
import {
|
||||
LoadMinigames,
|
||||
TooltipBuildBackup,
|
||||
TooltipLumpBackup,
|
||||
} from '../VariablesAndData';
|
||||
import { LoadMinigames, TooltipBuildBackup, TooltipLumpBackup } from '../VariablesAndData';
|
||||
import ReplaceNativeGrimoire from './NativeGrimoire';
|
||||
import ReplaceTooltipGrimoire from './TooltipGrimoire';
|
||||
|
||||
@@ -19,11 +15,7 @@ function ReplaceTooltipBuild() {
|
||||
TooltipBuildBackup[i] = l(`product${me.id}`).onmouseover;
|
||||
l(`product${me.id}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('b', `${i}`),
|
||||
'store',
|
||||
);
|
||||
Game.tooltip.draw(this, () => CreateTooltip('b', `${i}`), 'store');
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
@@ -38,11 +30,7 @@ function ReplaceTooltipLump() {
|
||||
TooltipLumpBackup = l('lumps').onmouseover; // eslint-disable-line no-unused-vars
|
||||
l('lumps').onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('s', 'Lump'),
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.draw(this, () => CreateTooltip('s', 'Lump'), 'this');
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
@@ -55,11 +43,7 @@ function ReplaceTooltipGarden() {
|
||||
if (Game.Objects.Farm.minigameLoaded) {
|
||||
l('gardenTool-1').onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('ha', 'HarvestAllButton'),
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.draw(this, () => CreateTooltip('ha', 'HarvestAllButton'), 'this');
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
Array.from(l('gardenPlot').children).forEach((child) => {
|
||||
@@ -67,11 +51,7 @@ function ReplaceTooltipGarden() {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
child.onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]),
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.draw(this, () => CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]), 'this');
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
});
|
||||
@@ -83,11 +63,7 @@ function ReplaceTooltipPantheon() {
|
||||
for (let i = 0; i < 11; i += 1) {
|
||||
l(`templeGod${i}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('pag', i),
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.draw(this, () => CreateTooltip('pag', i), 'this');
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
@@ -96,10 +72,7 @@ function ReplaceTooltipPantheon() {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
() => CreateTooltip('pas', [
|
||||
i,
|
||||
Game.Objects.Temple.minigame.slot[i],
|
||||
]),
|
||||
() => CreateTooltip('pas', [i, Game.Objects.Temple.minigame.slot[i]]),
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
|
||||
@@ -45,10 +45,7 @@ export default function ReplaceNative() {
|
||||
|
||||
BackupFunctions.tooltip.update = Game.tooltip.update;
|
||||
BackupFunctions.tooltip.updateMod = new Function( // eslint-disable-line no-new-func
|
||||
`return ${Game.tooltip.update
|
||||
.toString()
|
||||
.split('this.')
|
||||
.join('Game.tooltip.')}`,
|
||||
`return ${Game.tooltip.update.toString().split('this.').join('Game.tooltip.')}`,
|
||||
)();
|
||||
Game.tooltip.update = function () {
|
||||
BackupFunctions.tooltip.updateMod();
|
||||
@@ -119,10 +116,7 @@ export default function ReplaceNative() {
|
||||
|
||||
BackupFunctions.UpdateMenu = Game.UpdateMenu;
|
||||
Game.UpdateMenu = function () {
|
||||
if (
|
||||
typeof jscolor.picker === 'undefined' ||
|
||||
typeof jscolor.picker.owner === 'undefined'
|
||||
) {
|
||||
if (typeof jscolor.picker === 'undefined' || typeof jscolor.picker.owner === 'undefined') {
|
||||
BackupFunctions.UpdateMenu();
|
||||
AddMenu();
|
||||
}
|
||||
@@ -131,8 +125,7 @@ export default function ReplaceNative() {
|
||||
BackupFunctions.sayTime = Game.sayTime;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
CMSayTime = function (time, detail) {
|
||||
if (Number.isNaN(time) || time <= 0)
|
||||
return BackupFunctions.sayTime(time, detail);
|
||||
if (Number.isNaN(time) || time <= 0) return BackupFunctions.sayTime(time, detail);
|
||||
return FormatTime(time / Game.fps, 1);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
TooltipWrinklerArea,
|
||||
TooltipWrinklerBeingShown,
|
||||
} from '../../Disp/VariablesAndData';
|
||||
import { TooltipWrinklerArea, TooltipWrinklerBeingShown } from '../../Disp/VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler
|
||||
|
||||
Reference in New Issue
Block a user