File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
2257
package-lock.json
generated
2257
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -12,12 +12,12 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
||||||
"eslint_src": "eslint src",
|
"eslint-src": "eslint src",
|
||||||
"build": "run-s eslint_src pack_prod remove_comment copy-file",
|
"build": "run-s eslint-src pack-prod remove-comment copy-file",
|
||||||
"build_test": "run-s pack_dev",
|
"build-test": "run-s pack-dev",
|
||||||
"pack_prod": "webpack --env production",
|
"pack-prod": "webpack --env production",
|
||||||
"pack_dev": "webpack",
|
"pack-dev": "webpack",
|
||||||
"remove_comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
"remove-comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
13
src/Config/Toggles/ToggleSectionHideButtons.js
Normal file
13
src/Config/Toggles/ToggleSectionHideButtons.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { CMOptions } from '../VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function updates the display setting of the two objects created by CM.Disp.CreateWrinklerButtons()
|
||||||
|
* It is called by changes in CM.Options.WrinklerButtons
|
||||||
|
*/
|
||||||
|
export default function ToggleSectionHideButtons() {
|
||||||
|
if (CMOptions.HideSectionsButtons) {
|
||||||
|
l('CMSectionHidButtons').style.display = '';
|
||||||
|
} else {
|
||||||
|
l('CMSectionHidButtons').style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
|||||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
||||||
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
||||||
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
||||||
|
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons';
|
||||||
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
||||||
import ToggleUpgradeBarAndColor from '../Config/Toggles/ToggleUpgradeBarAndColor';
|
import ToggleUpgradeBarAndColor from '../Config/Toggles/ToggleUpgradeBarAndColor';
|
||||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||||
@@ -100,6 +101,13 @@ const Config = {
|
|||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
PPDisplayTime: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'BarsColors',
|
||||||
|
['PP As Value (Standard)', 'PP As Time Unit'],
|
||||||
|
'Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.',
|
||||||
|
false,
|
||||||
|
),
|
||||||
UpBarColor: new SettingStandard(
|
UpBarColor: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsColors',
|
'BarsColors',
|
||||||
@@ -728,13 +736,23 @@ const Config = {
|
|||||||
WrinklerButtons: new SettingStandard(
|
WrinklerButtons: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Miscellaneous',
|
'Miscellaneous',
|
||||||
['Extra Buttons OFF', 'Extra Buttons ON'],
|
['Extra Wrinkler Buttons OFF', 'Extra Wrinkler Buttons ON'],
|
||||||
'Show buttons for popping wrinklers at bottom of cookie section',
|
'Show buttons for popping wrinklers at bottom of cookie section',
|
||||||
true,
|
true,
|
||||||
function () {
|
function () {
|
||||||
ToggleWrinklerButtons();
|
ToggleWrinklerButtons();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
HideSectionsButtons: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'Miscellaneous',
|
||||||
|
['Hide Upgrades/Buildings Button OFF', 'Hide Upgrades/Buildings Button ON'],
|
||||||
|
'Show buttons for hiding and showing the upgrades and buildings section in the right column',
|
||||||
|
true,
|
||||||
|
function () {
|
||||||
|
ToggleSectionHideButtons();
|
||||||
|
},
|
||||||
|
),
|
||||||
BulkBuyBlock: new SettingStandard(
|
BulkBuyBlock: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Miscellaneous',
|
'Miscellaneous',
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const ConfigDefault = {
|
|||||||
TimerBarPos: 0,
|
TimerBarPos: 0,
|
||||||
TimerBarOverlay: 2,
|
TimerBarOverlay: 2,
|
||||||
BuildColor: 1,
|
BuildColor: 1,
|
||||||
|
PPDisplayTime: 0,
|
||||||
UpBarColor: 1,
|
UpBarColor: 1,
|
||||||
UpgradeBarFixedPos: 1,
|
UpgradeBarFixedPos: 1,
|
||||||
CalcWrink: 0,
|
CalcWrink: 0,
|
||||||
@@ -100,6 +101,7 @@ const ConfigDefault = {
|
|||||||
GCTimer: 1,
|
GCTimer: 1,
|
||||||
Favicon: 1,
|
Favicon: 1,
|
||||||
WrinklerButtons: 1,
|
WrinklerButtons: 1,
|
||||||
|
HideSectionsButtons: 0,
|
||||||
BulkBuyBlock: 0,
|
BulkBuyBlock: 0,
|
||||||
Header: {
|
Header: {
|
||||||
BarsColors: 1,
|
BarsColors: 1,
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ export function Beautify(num, floats, forced) {
|
|||||||
export function FormatTime(time, longFormat) {
|
export function FormatTime(time, longFormat) {
|
||||||
let formattedTime = time;
|
let formattedTime = time;
|
||||||
if (time === Infinity) return time;
|
if (time === Infinity) return time;
|
||||||
|
if (time < 0) return 'Negative time period';
|
||||||
formattedTime = Math.ceil(time);
|
formattedTime = Math.ceil(time);
|
||||||
const y = Math.floor(formattedTime / 31557600);
|
const y = Math.floor(formattedTime / 31557600);
|
||||||
const d = Math.floor((formattedTime % 31557600) / 86400);
|
const d = Math.floor((formattedTime % 31557600) / 86400);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColor,
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
import GetCPS from '../HelperFunctions/GetCPS';
|
||||||
@@ -94,9 +95,13 @@ export function UpdateBotBar() {
|
|||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
count
|
count
|
||||||
].className = ColorTextPre + target[i].color;
|
].className = ColorTextPre + target[i].color;
|
||||||
|
let PPString;
|
||||||
|
if (CMOptions.PPDisplayTime)
|
||||||
|
PPString = FormatTime(Math.round(target[i].pp));
|
||||||
|
else PPString = Beautify(Math.round(target[i].pp), 2);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
count
|
count
|
||||||
].textContent = Beautify(Math.round(target[i].pp), 2);
|
].textContent = PPString;
|
||||||
const timeColor = GetTimeColor(
|
const timeColor = GetTimeColor(
|
||||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
||||||
GetCPS(),
|
GetCPS(),
|
||||||
|
|||||||
38
src/Disp/Initialization/CreateSectionHideButtons.js
Normal file
38
src/Disp/Initialization/CreateSectionHideButtons.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* This function creates two objects at the top of the right column that allowing hiding the upgrade and building section
|
||||||
|
*/
|
||||||
|
export default function CreateSectionHideButtons() {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.id = 'CMSectionHidButtons';
|
||||||
|
div.style.textAlign = 'center';
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.className = 'option';
|
||||||
|
a.onclick = function () {
|
||||||
|
if (l('upgrades').style.display === 'flex') {
|
||||||
|
l('upgrades').style.display = 'none';
|
||||||
|
l('toggleUpgrades').style.display = 'none';
|
||||||
|
l('techUpgrades').style.display = 'none';
|
||||||
|
l('vaultUpgrades').style.display = 'none';
|
||||||
|
} else {
|
||||||
|
l('upgrades').style.display = 'flex';
|
||||||
|
if (l('toggleUpgrades').children.length !== 0)
|
||||||
|
l('toggleUpgrades').style.display = 'block';
|
||||||
|
if (l('techUpgrades').children.length !== 0)
|
||||||
|
l('techUpgrades').style.display = 'block';
|
||||||
|
if (l('vaultUpgrades').children.length !== 0)
|
||||||
|
l('vaultUpgrades').style.display = 'block';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
a.textContent = 'Hide/Show Upgrades';
|
||||||
|
div.appendChild(a);
|
||||||
|
const b = document.createElement('a');
|
||||||
|
b.className = 'option';
|
||||||
|
b.onclick = function () {
|
||||||
|
if (l('products').style.display === 'grid')
|
||||||
|
l('products').style.display = 'none';
|
||||||
|
else l('products').style.display = 'grid';
|
||||||
|
};
|
||||||
|
b.textContent = 'Hide/Show Buildings';
|
||||||
|
div.appendChild(b);
|
||||||
|
l('store').insertBefore(div, l('store').childNodes[2]);
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import { CMOptions } from '../../../Config/VariablesAndData';
|
|||||||
import { SimObjects } from '../../../Sim/VariablesAndData';
|
import { SimObjects } from '../../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColor,
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
@@ -55,7 +56,9 @@ export default function Building() {
|
|||||||
}01% of income)`;
|
}01% of income)`;
|
||||||
}
|
}
|
||||||
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
||||||
l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
if (CMOptions.PPDisplayTime)
|
||||||
|
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
||||||
|
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||||
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
||||||
const timeColor = GetTimeColor(
|
const timeColor = GetTimeColor(
|
||||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
GetTimeColor,
|
GetTimeColor,
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
@@ -70,10 +71,15 @@ export default function Upgrade() {
|
|||||||
)} Clicks`;
|
)} Clicks`;
|
||||||
l('CMTooltipPP').style.color = 'white';
|
l('CMTooltipPP').style.color = 'white';
|
||||||
} else {
|
} else {
|
||||||
l('CMTooltipPP').textContent = Beautify(
|
if (CMOptions.PPDisplayTime)
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
l('CMTooltipPP').textContent = FormatTime(
|
||||||
2,
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
);
|
);
|
||||||
|
else
|
||||||
|
l('CMTooltipPP').textContent = Beautify(
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
|
2,
|
||||||
|
);
|
||||||
l('CMTooltipPP').className =
|
l('CMTooltipPP').className =
|
||||||
ColorTextPre +
|
ColorTextPre +
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
|||||||
import CreateUpgradeBar from '../Disp/BuildingsUpgrades/UpgradeBar';
|
import CreateUpgradeBar from '../Disp/BuildingsUpgrades/UpgradeBar';
|
||||||
import { CreateBotBar } from '../Disp/InfoBars/BottomBar';
|
import { CreateBotBar } from '../Disp/InfoBars/BottomBar';
|
||||||
import { CreateTimerBar } from '../Disp/InfoBars/TimerBar';
|
import { CreateTimerBar } from '../Disp/InfoBars/TimerBar';
|
||||||
|
import CreateSectionHideButtons from '../Disp/Initialization/CreateSectionHideButtons';
|
||||||
import CreateWrinklerButtons from '../Disp/Initialization/CreateWrinklerButton';
|
import CreateWrinklerButtons from '../Disp/Initialization/CreateWrinklerButton';
|
||||||
import CreateCssArea from '../Disp/Initialization/CssArea';
|
import CreateCssArea from '../Disp/Initialization/CssArea';
|
||||||
import UpdateBuildingUpgradeStyle from '../Disp/Initialization/UpdateBuildingUpgradeStyle';
|
import UpdateBuildingUpgradeStyle from '../Disp/Initialization/UpdateBuildingUpgradeStyle';
|
||||||
@@ -37,6 +38,7 @@ export default function InitializeCookieMonster() {
|
|||||||
CreateTimerBar();
|
CreateTimerBar();
|
||||||
CreateUpgradeBar();
|
CreateUpgradeBar();
|
||||||
CreateWhiteScreen();
|
CreateWhiteScreen();
|
||||||
|
CreateSectionHideButtons();
|
||||||
CreateFavicon();
|
CreateFavicon();
|
||||||
Object.keys(TooltipText).forEach((i) => {
|
Object.keys(TooltipText).forEach((i) => {
|
||||||
CreateSimpleTooltip(
|
CreateSimpleTooltip(
|
||||||
|
|||||||
Reference in New Issue
Block a user