28 files changed
+214
-143
No files matched your search
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
/*! For license information please see CookieMonsterDev.js.LICENSE.txt */
|
||||
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,a,i=((a={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",a.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?a.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),i=new RegExp("(^|\\s)("+a.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var s,l;if(!(n[r].jscolor&&n[r].jscolor instanceof a.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!a.isColorAttrSupported)&&(null!==(s=a.getDataAttr(n[r],"jscolor"))||n[r].className&&(l=n[r].className.match(i)))){var c=n[r],d="";null!==s?d=s:l&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+a.docsRef),l[4]&&(d=l[4]));var m=null;if(d.trim())try{m=a.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new a.pub(c,m)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!a.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<a.instances.length;t+=1)a.instances[t]&&a.instances[t].targetElement&&e.push(a.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return a.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return a.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===a.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=a.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(a.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(a.dataProp)?e[a.dataProp]:e[a.dataProp]={},o=arguments[2];return t[i=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(a.dataProp)?e[a.dataProp]:e[a.dataProp]={};var n=arguments[1];for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(a.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[a.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(a.dataProp)){if(void 0===o)return;e[a.dataProp]={}}var n=e[a.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){a._attachedGroupEvents.hasOwnProperty(e)||(a._attachedGroupEvents[e]=[]),a._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(a._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<a._attachedGroupEvents[e].length;t+=1){var o=a._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete a._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(a._capturedTarget=e,a._capturedTarget.setCapture())},releaseTarget:function(){a._capturedTarget&&(a._capturedTarget.releaseCapture(),a._capturedTarget=null)},triggerEvent:function(t,o,n,i){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:i}):(r=e.document.createEvent("Event")).initEvent(o,n,i),!!r&&(a.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&a.isTextInput(e)Line truncated
|
||||
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,a,i=((a={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",a.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?a.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),i=new RegExp("(^|\\s)("+a.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var s,l;if(!(n[r].jscolor&&n[r].jscolor instanceof a.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!a.isColorAttrSupported)&&(null!==(s=a.getDataAttr(n[r],"jscolor"))||n[r].className&&(l=n[r].className.match(i)))){var c=n[r],d="";null!==s?d=s:l&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+a.docsRef),l[4]&&(d=l[4]));var m=null;if(d.trim())try{m=a.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new a.pub(c,m)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!a.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<a.instances.length;t+=1)a.instances[t]&&a.instances[t].targetElement&&e.push(a.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return a.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return a.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===a.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=a.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(a.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(a.dataProp)?e[a.dataProp]:e[a.dataProp]={},o=arguments[2];return t[i=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(a.dataProp)?e[a.dataProp]:e[a.dataProp]={};var n=arguments[1];for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(a.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[a.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(a.dataProp)){if(void 0===o)return;e[a.dataProp]={}}var n=e[a.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){a._attachedGroupEvents.hasOwnProperty(e)||(a._attachedGroupEvents[e]=[]),a._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(a._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<a._attachedGroupEvents[e].length;t+=1){var o=a._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete a._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(a._capturedTarget=e,a._capturedTarget.setCapture())},releaseTarget:function(){a._capturedTarget&&(a._capturedTarget.releaseCapture(),a._capturedTarget=null)},triggerEvent:function(t,o,n,i){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:i}):(r=e.document.createEvent("Event")).initEvent(o,n,i),!!r&&(a.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&a.isTextInput(e)Line truncated
|
||||
//# sourceMappingURL=https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonsterDev.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///./node_modules/@eastdesire/jscolor/jscolor.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/baseSetting.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/prompt.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/flash.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/savingAndLoading/saveFramework.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/toggles/toggleHeader.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/sound.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/toggleConfigVolume.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/addMenu.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/info/addInfoMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/info/createFrameworkInfoMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/data/modInfo.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/options/addOptionsMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/options/createFrameworkOptionsMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/draw/drawLoop.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/data/headers.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/savingAndLoading/loadMod.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/savingAndLoading/createSaveDataObject.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/logic/logicLoop.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/data/settings.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/load.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/cookieMonsterFramework.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/init.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/init/createFlashScreen.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/save.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/index.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/init/initModFramework.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/init/registerMod.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createInfoListing.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createOptionListing.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createOptionsFavouriteStar.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/toggles/toggleFavourite.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/toggleConfig.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/toggleConfigKeycode.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createOptionsSubHeader.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/createModMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/notification.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingColours.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingInputNumber.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingStandard.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingStandardWithFunc.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingVolume.js","webpack:///./src/Config/Toggles/ToggleWrinklerButtons.js","webpack:///./src/Data/Scales.ts","webpack:///./src/Main/VariablesAndData.js","webpack:///./src/Disp/BeauLine truncated
|
||||
{"version":3,"sources":["webpack:///./node_modules/@eastdesire/jscolor/jscolor.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/baseSetting.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/prompt.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/flash.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/savingAndLoading/saveFramework.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/toggles/toggleHeader.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/sound.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/toggleConfigVolume.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/addMenu.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/info/addInfoMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/info/createFrameworkInfoMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/data/modInfo.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/options/addOptionsMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/menuSections/options/createFrameworkOptionsMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/draw/drawLoop.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/data/headers.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/savingAndLoading/loadMod.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/savingAndLoading/createSaveDataObject.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/logic/logicLoop.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/data/settings.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/load.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/cookieMonsterFramework.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/init.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/init/createFlashScreen.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/frameworkDataObject/save.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/index.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/init/initModFramework.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/init/registerMod.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createInfoListing.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createOptionListing.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createOptionsFavouriteStar.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/toggles/toggleFavourite.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/toggleConfig.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/toggleConfigKeycode.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/listings/createOptionsSubHeader.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/menu/createModMenuSection.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/notifications/notification.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingColours.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingInputNumber.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingStandard.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingStandardWithFunc.js","webpack:///./node_modules/@cookiemonsterteam/cookiemonsterframework/src/options/settingClasses/settingVolume.js","webpack:///./src/Config/Toggles/ToggleWrinklerButtons.js","webpack:///./src/Data/Scales.ts","webpack:///./src/Main/VariablesAndData.js","webpack:///./src/Disp/BeauLine truncated
|
||||
@@ -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);
|
||||
|
||||
+12
-12
@@ -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;
|
||||
}
|
||||
@@ -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());
|
||||
});
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -2,23 +2,23 @@ import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../Variables
|
||||
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
|
||||
* @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) {
|
||||
let color;
|
||||
let colour;
|
||||
let text;
|
||||
if (time <= 0) {
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat)
|
||||
text = '00:00:00:00:00';
|
||||
else text = 'Done!';
|
||||
color = ColourGreen;
|
||||
colour = ColourGreen;
|
||||
} else {
|
||||
text = FormatTime(time);
|
||||
if (time > 300) color = ColourRed;
|
||||
else if (time > 60) color = ColourOrange;
|
||||
else color = ColourYellow;
|
||||
if (time > 300) colour = ColourRed;
|
||||
else if (time > 60) colour = ColourOrange;
|
||||
else colour = ColourYellow;
|
||||
}
|
||||
return { text, color };
|
||||
return { text, colour };
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* This function toggle the locked state of a building
|
||||
* @param {number} index Index of the row to change
|
||||
*/
|
||||
export default function ToggleBuildingLock(index) {
|
||||
if (l(`productLock${index}`).innerHTML === 'Unlocked') {
|
||||
l(`productLock${index}`).innerHTML = 'Locked';
|
||||
l(`row${index}`).children[3].style.pointerEvents = 'none';
|
||||
} else {
|
||||
l(`productLock${index}`).innerHTML = 'Unlocked';
|
||||
l(`row${index}`).children[3].style.pointerEvents = 'auto';
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ export default function UpdateBuildings() {
|
||||
Object.keys(target).forEach((i) => {
|
||||
l(`productPrice${Game.Objects[i].id}`).style.color =
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings[
|
||||
`Colour${target[i].color}`
|
||||
`Colour${target[i].colour}`
|
||||
];
|
||||
});
|
||||
l(`storeBulk${CacheMinPPBulk}`).style.color =
|
||||
@@ -89,14 +89,14 @@ export default function UpdateBuildings() {
|
||||
const o = {};
|
||||
o.name = k;
|
||||
o.pp = CacheObjects1[k].pp;
|
||||
o.color = CacheObjects1[k].color;
|
||||
o.colour = CacheObjects1[k].colour;
|
||||
return o;
|
||||
});
|
||||
// Sort by pp colour group, then by pp.
|
||||
arr.sort((a, b) =>
|
||||
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color)
|
||||
ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
|
||||
? a.pp - b.pp
|
||||
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color),
|
||||
: ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
|
||||
);
|
||||
} else if (
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 2
|
||||
@@ -105,14 +105,14 @@ export default function UpdateBuildings() {
|
||||
const o = {};
|
||||
o.name = k;
|
||||
o.pp = target[k].pp;
|
||||
o.color = target[k].color;
|
||||
o.colour = target[k].colour;
|
||||
return o;
|
||||
});
|
||||
// Sort by pp colour group, then by pp.
|
||||
arr.sort((a, b) =>
|
||||
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color)
|
||||
ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
|
||||
? a.pp - b.pp
|
||||
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color),
|
||||
: ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
|
||||
);
|
||||
} else if (
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortBuildings === 3
|
||||
|
||||
@@ -24,11 +24,11 @@ function CreateUpgradeBarLegend() {
|
||||
title.textContent = 'Legend';
|
||||
legend.appendChild(title);
|
||||
|
||||
const legendLine = function (color, text) {
|
||||
const legendLine = function (colour, text) {
|
||||
const div = document.createElement('div');
|
||||
div.style.verticalAlign = 'middle';
|
||||
const span = document.createElement('span');
|
||||
span.className = ColourBackPre + color;
|
||||
span.className = ColourBackPre + colour;
|
||||
span.style.display = 'inline-block';
|
||||
span.style.height = '10px';
|
||||
span.style.width = '10px';
|
||||
@@ -70,10 +70,10 @@ export default function CreateUpgradeBar() {
|
||||
Game.tooltip.draw(this, escape(placeholder.innerHTML), 'store');
|
||||
};
|
||||
|
||||
const upgradeNumber = function (id, color) {
|
||||
const upgradeNumber = function (id, colour) {
|
||||
const span = document.createElement('span');
|
||||
span.id = id;
|
||||
span.className = ColourTextPre + color;
|
||||
span.className = ColourTextPre + colour;
|
||||
span.style.width = '14.28571428571429%';
|
||||
span.style.display = 'inline-block';
|
||||
span.textContent = '0';
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function UpdateUpgrades() {
|
||||
let addedColour = false;
|
||||
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 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;
|
||||
break;
|
||||
}
|
||||
@@ -42,16 +42,16 @@ export default function UpdateUpgrades() {
|
||||
const div = document.createElement('div');
|
||||
div.style.width = '10px';
|
||||
div.style.height = '10px';
|
||||
div.className = ColourBackPre + CacheUpgrades[me.name].color;
|
||||
div.className = ColourBackPre + CacheUpgrades[me.name].colour;
|
||||
l(`upgrade${i}`).appendChild(div);
|
||||
}
|
||||
if (CacheUpgrades[me.name].color === ColourBlue) blue += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColourGreen) green += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColourYellow) yellow += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColourOrange) orange += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColourRed) red += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColourPurple) purple += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColourGray) gray += 1;
|
||||
if (CacheUpgrades[me.name].colour === ColourBlue) blue += 1;
|
||||
else if (CacheUpgrades[me.name].colour === ColourGreen) green += 1;
|
||||
else if (CacheUpgrades[me.name].colour === ColourYellow) yellow += 1;
|
||||
else if (CacheUpgrades[me.name].colour === ColourOrange) orange += 1;
|
||||
else if (CacheUpgrades[me.name].colour === ColourRed) red += 1;
|
||||
else if (CacheUpgrades[me.name].colour === ColourPurple) purple += 1;
|
||||
else if (CacheUpgrades[me.name].colour === ColourGray) gray += 1;
|
||||
});
|
||||
|
||||
l('CMUpgradeBarBlue').textContent = blue;
|
||||
@@ -71,16 +71,16 @@ export default function UpdateUpgrades() {
|
||||
o.name = Game.UpgradesInStore[x].name;
|
||||
o.price = Game.UpgradesInStore[x].basePrice;
|
||||
o.pp = CacheUpgrades[o.name].pp;
|
||||
o.color = CacheUpgrades[o.name].color;
|
||||
o.colour = CacheUpgrades[o.name].colour;
|
||||
arr.push(o);
|
||||
}
|
||||
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.SortUpgrades) {
|
||||
// Sort by pp colour group, then by pp.
|
||||
arr.sort((a, b) =>
|
||||
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color)
|
||||
ColoursOrdering.indexOf(a.colour) === ColoursOrdering.indexOf(b.colour)
|
||||
? a.pp - b.pp
|
||||
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color),
|
||||
: ColoursOrdering.indexOf(a.colour) - ColoursOrdering.indexOf(b.colour),
|
||||
);
|
||||
} else {
|
||||
arr.sort((a, b) => a.price - b.price);
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function CMDrawHook() {
|
||||
}
|
||||
}
|
||||
|
||||
// Update colors
|
||||
// Update colours
|
||||
UpdateBuildings();
|
||||
UpdateUpgrades();
|
||||
UpdateUpgradeSectionsHeight();
|
||||
|
||||
@@ -11,23 +11,23 @@ import {
|
||||
* 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()
|
||||
* @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) {
|
||||
if (type === 0) {
|
||||
return { text: 'Normal', color: ColourGray };
|
||||
return { text: 'Normal', colour: ColourGray };
|
||||
}
|
||||
if (type === 1) {
|
||||
return { text: 'Bifurcated', color: ColourGreen };
|
||||
return { text: 'Bifurcated', colour: ColourGreen };
|
||||
}
|
||||
if (type === 2) {
|
||||
return { text: 'Golden', color: ColourYellow };
|
||||
return { text: 'Golden', colour: ColourYellow };
|
||||
}
|
||||
if (type === 3) {
|
||||
return { text: 'Meaty', color: ColourOrange };
|
||||
return { text: 'Meaty', colour: ColourOrange };
|
||||
}
|
||||
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 };
|
||||
}
|
||||
@@ -33,10 +33,10 @@ export function CreateBotBar() {
|
||||
table.style.whiteSpace = 'nowrap';
|
||||
const tbody = table.appendChild(document.createElement('tbody'));
|
||||
|
||||
const firstCol = function (text, color) {
|
||||
const firstCol = function (text, colour) {
|
||||
const td = document.createElement('td');
|
||||
td.style.textAlign = 'right';
|
||||
td.className = ColourTextPre + color;
|
||||
td.className = ColourTextPre + colour;
|
||||
td.textContent = text;
|
||||
return td;
|
||||
};
|
||||
@@ -86,7 +86,7 @@ export function UpdateBotBar() {
|
||||
2,
|
||||
);
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className =
|
||||
ColourTextPre + target[i].color;
|
||||
ColourTextPre + target[i].colour;
|
||||
let PPString;
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPDisplayTime)
|
||||
PPString = FormatTime(Math.round(target[i].pp));
|
||||
@@ -96,7 +96,7 @@ export function UpdateBotBar() {
|
||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
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) {
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||
count
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData';
|
||||
* This function creates an indivudual timer for the timer bar
|
||||
* @param {string} id An id to identify 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) {
|
||||
const timerBar = document.createElement('div');
|
||||
@@ -36,20 +36,20 @@ export function CreateTimer(id, name, bars) {
|
||||
div.appendChild(type);
|
||||
|
||||
for (let i = 0; i < bars.length; i++) {
|
||||
const colorBar = document.createElement('span');
|
||||
colorBar.id = bars[i].id;
|
||||
colorBar.style.display = 'inline-block';
|
||||
colorBar.style.height = '10px';
|
||||
colorBar.style.verticalAlign = 'text-top';
|
||||
colorBar.style.textAlign = 'center';
|
||||
const colourBar = document.createElement('span');
|
||||
colourBar.id = bars[i].id;
|
||||
colourBar.style.display = 'inline-block';
|
||||
colourBar.style.height = '10px';
|
||||
colourBar.style.verticalAlign = 'text-top';
|
||||
colourBar.style.textAlign = 'center';
|
||||
if (bars.length - 1 === i) {
|
||||
colorBar.style.borderTopRightRadius = '10px';
|
||||
colorBar.style.borderBottomRightRadius = '10px';
|
||||
colourBar.style.borderTopRightRadius = '10px';
|
||||
colourBar.style.borderBottomRightRadius = '10px';
|
||||
}
|
||||
if (typeof bars[i].color !== 'undefined') {
|
||||
colorBar.className = ColourBackPre + bars[i].color;
|
||||
if (typeof bars[i].colour !== 'undefined') {
|
||||
colourBar.className = ColourBackPre + bars[i].colour;
|
||||
}
|
||||
div.appendChild(colorBar);
|
||||
div.appendChild(colourBar);
|
||||
}
|
||||
|
||||
const timer = document.createElement('span');
|
||||
|
||||
@@ -26,21 +26,21 @@ export function CreateTimerBar() {
|
||||
|
||||
// Create standard Autosave bar
|
||||
const CMTimerBarAutosave = CreateTimer('CMTimerBarAutosave', 'Autosave', [
|
||||
{ id: 'CMTimerBarAutosaveBar', color: ColourPurple },
|
||||
{ id: 'CMTimerBarAutosaveBar', colour: ColourPurple },
|
||||
]);
|
||||
TimerBar.appendChild(CMTimerBarAutosave);
|
||||
|
||||
// Create standard Golden Cookie bar
|
||||
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
|
||||
{ id: 'CMTimerBarGCMinBar', color: ColourGray },
|
||||
{ id: 'CMTimerBarGCBar', color: ColourPurple },
|
||||
{ id: 'CMTimerBarGCMinBar', colour: ColourGray },
|
||||
{ id: 'CMTimerBarGCBar', colour: ColourPurple },
|
||||
]);
|
||||
TimerBar.appendChild(CMTimerBarGC);
|
||||
|
||||
// Create standard Reindeer bar
|
||||
const CMTimerBarRen = CreateTimer('CMTimerBarRen', 'Next Reindeer', [
|
||||
{ id: 'CMTimerBarRenMinBar', color: ColourGray },
|
||||
{ id: 'CMTimerBarRenBar', color: ColourOrange },
|
||||
{ id: 'CMTimerBarRenMinBar', colour: ColourGray },
|
||||
{ id: 'CMTimerBarRenBar', colour: ColourOrange },
|
||||
]);
|
||||
TimerBar.appendChild(CMTimerBarRen);
|
||||
const TimerBarBuffTimers = document.createElement('div');
|
||||
@@ -118,9 +118,17 @@ export function UpdateTimerBar() {
|
||||
) / Game.fps,
|
||||
);
|
||||
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;
|
||||
l('CMTimerBarGCTime').textContent = `${Math.ceil(
|
||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||
);
|
||||
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
|
||||
style: 'percent',
|
||||
})}`;
|
||||
numberOfTimers += 1;
|
||||
} else l('CMTimerBarGC').style.display = 'none';
|
||||
|
||||
@@ -153,9 +161,17 @@ export function UpdateTimerBar() {
|
||||
) / Game.fps,
|
||||
);
|
||||
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;
|
||||
l('CMTimerBarRenTime').textContent = `${Math.ceil(
|
||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||
);
|
||||
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
|
||||
style: 'percent',
|
||||
})}`;
|
||||
numberOfTimers += 1;
|
||||
} else {
|
||||
l('CMTimerBarRen').style.display = 'none';
|
||||
@@ -171,7 +187,7 @@ export function UpdateTimerBar() {
|
||||
]);
|
||||
timer.style.display = '';
|
||||
let classColour = '';
|
||||
// Gives specific timers specific colors
|
||||
// Gives specific timers specific colours
|
||||
if (typeof BuffColours[Game.buffs[i].name] !== 'undefined') {
|
||||
classColour = BuffColours[Game.buffs[i].name];
|
||||
} else classColour = ColourPurple;
|
||||
|
||||
@@ -53,18 +53,18 @@ export function TooltipCreateWarningSection() {
|
||||
TooltipWarn.style.bottom = 'auto';
|
||||
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
||||
|
||||
const create = function (boxId, color, labelTextFront, labelTextBack, deficitId) {
|
||||
const create = function (boxId, colour, labelTextFront, labelTextBack, deficitId) {
|
||||
const box = document.createElement('div');
|
||||
box.id = boxId;
|
||||
box.style.display = 'none';
|
||||
box.style.transition = 'opacity 0.1s ease-out';
|
||||
box.className = ColourBorderPre + color;
|
||||
box.className = ColourBorderPre + colour;
|
||||
box.style.padding = '2px';
|
||||
box.style.background = '#000 url(img/darkNoise.png)';
|
||||
const labelDiv = document.createElement('div');
|
||||
box.appendChild(labelDiv);
|
||||
const labelSpan = document.createElement('span');
|
||||
labelSpan.className = ColourTextPre + color;
|
||||
labelSpan.className = ColourTextPre + colour;
|
||||
labelSpan.style.fontWeight = 'bold';
|
||||
labelSpan.textContent = labelTextFront;
|
||||
labelDiv.appendChild(labelSpan);
|
||||
|
||||
@@ -26,13 +26,6 @@ import * as Create from '../CreateTooltip';
|
||||
* This function adds extra info to the Building tooltips
|
||||
*/
|
||||
export default function Building() {
|
||||
if (
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipBuildUpgrade === 1 &&
|
||||
Game.buyMode === 1
|
||||
) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||
|
||||
let target;
|
||||
if (Game.buyMode === 1) {
|
||||
LastTargetTooltipBuilding = target;
|
||||
@@ -46,6 +39,13 @@ export default function Building() {
|
||||
TooltipPrice = Game.Objects[TooltipName].bulkPrice;
|
||||
TooltipBonusIncome = target[TooltipName].bonus;
|
||||
|
||||
if (
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipBuildUpgrade === 1 &&
|
||||
Game.buyMode === 1
|
||||
) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||
|
||||
if (
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipBuildUpgrade ===
|
||||
1 &&
|
||||
@@ -62,11 +62,11 @@ export default function Building() {
|
||||
: '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className = ColourTextPre + target[TooltipName].color;
|
||||
l('CMTooltipBorder').className = ColourTextPre + target[TooltipName].colour;
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.PPDisplayTime)
|
||||
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
||||
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||
l('CMTooltipPP').className = ColourTextPre + target[TooltipName].color;
|
||||
l('CMTooltipPP').className = ColourTextPre + target[TooltipName].colour;
|
||||
const timeColour = GetTimeColour(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
@@ -74,7 +74,7 @@ export default function Building() {
|
||||
if (timeColour.text === 'Done!' && Game.cookies < target[TooltipName].price) {
|
||||
l('CMTooltipTime').textContent = `${timeColour.text} (with Wrink)`;
|
||||
} else l('CMTooltipTime').textContent = timeColour.text;
|
||||
l('CMTooltipTime').className = ColourTextPre + timeColour.color;
|
||||
l('CMTooltipTime').className = ColourTextPre + timeColour.colour;
|
||||
}
|
||||
|
||||
// Add "production left till next achievement"-bar
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function Grimoire() {
|
||||
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost),
|
||||
);
|
||||
time.textContent = timeColour.text;
|
||||
time.className = ColourTextPre + timeColour.color;
|
||||
time.className = ColourTextPre + timeColour.colour;
|
||||
|
||||
// Time left untill magic spent is recovered
|
||||
if (spellCost <= minigame.magic) {
|
||||
@@ -46,7 +46,7 @@ export default function Grimoire() {
|
||||
),
|
||||
);
|
||||
recover.textContent = recoverColour.text;
|
||||
recover.className = ColourTextPre + recoverColour.color;
|
||||
recover.className = ColourTextPre + recoverColour.colour;
|
||||
}
|
||||
|
||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
||||
|
||||
@@ -16,6 +16,6 @@ export default function SugarLump() {
|
||||
tooltipBox.appendChild(lumpType);
|
||||
const lumpColour = GetLumpColour(Game.lumpCurrentType);
|
||||
lumpType.textContent = lumpColour.text;
|
||||
lumpType.className = ColourTextPre + lumpColour.color;
|
||||
lumpType.className = ColourTextPre + lumpColour.colour;
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export default function Upgrade() {
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className =
|
||||
ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].colour;
|
||||
}
|
||||
|
||||
// If clicking power upgrade
|
||||
@@ -73,7 +73,7 @@ export default function Upgrade() {
|
||||
2,
|
||||
);
|
||||
l('CMTooltipPP').className =
|
||||
ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].colour;
|
||||
}
|
||||
const timeColour = GetTimeColour(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
@@ -85,7 +85,7 @@ export default function Upgrade() {
|
||||
) {
|
||||
l('CMTooltipTime').textContent = `${timeColour.text} (with Wrink)`;
|
||||
} else l('CMTooltipTime').textContent = timeColour.text;
|
||||
l('CMTooltipTime').className = ColourTextPre + timeColour.color;
|
||||
l('CMTooltipTime').className = ColourTextPre + timeColour.colour;
|
||||
|
||||
// Add extra info to Chocolate egg tooltip
|
||||
if (Game.UpgradesInStore[TooltipName].name === 'Chocolate egg') {
|
||||
|
||||
+4
-4
@@ -1,17 +1,17 @@
|
||||
import ToggleBuildingLock from './ToggleBuildingLock';
|
||||
import toggleBuildingLock from './toggleBuildingLock';
|
||||
|
||||
/**
|
||||
* This function adds a lock button to the "building view" in the middle section
|
||||
*/
|
||||
export default function CreateBuildingLockButtons() {
|
||||
export default function createBuildingLockButtons() {
|
||||
Object.keys(l('rows').children).forEach((index) => {
|
||||
const productButtons = l('rows').children[index].children[1];
|
||||
const button = document.createElement('div');
|
||||
button.id = `productLock${Number(index) + 1}`;
|
||||
button.className = 'productButton';
|
||||
button.innerHTML = 'Unlocked';
|
||||
button.innerHTML = 'Lock';
|
||||
button.onclick = function () {
|
||||
ToggleBuildingLock(Number(index) + 1);
|
||||
toggleBuildingLock(Number(index) + 1);
|
||||
};
|
||||
productButtons.appendChild(button);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* This function toggle the locked state of a building
|
||||
* @param {number} index Index of the row to change
|
||||
*/
|
||||
export default function toggleBuildingLock(index) {
|
||||
if (l(`productLock${index}`).innerHTML === 'Lock') {
|
||||
// Add to storing array
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames.push(
|
||||
index.toString(),
|
||||
);
|
||||
|
||||
// Update styles
|
||||
l(`row${index}`).style.pointerEvents = 'none';
|
||||
l(`row${index}`).style.opacity = '0.4';
|
||||
l(`productLock${index}`).innerHTML = 'Unlock';
|
||||
l(`productLock${index}`).style.pointerEvents = 'auto';
|
||||
} else {
|
||||
// Remove from storing array
|
||||
if (
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames.includes(
|
||||
index.toString(),
|
||||
)
|
||||
) {
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames =
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames.filter(
|
||||
(value) => value !== index.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
// Update styles
|
||||
l(`productLock${index}`).innerHTML = 'Lock';
|
||||
l(`row${index}`).style.pointerEvents = 'auto';
|
||||
l(`row${index}`).style.opacity = '1';
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import CMDrawHook from '../Disp/DrawHook';
|
||||
import CMClickHook from '../Main/ClickHook';
|
||||
import InitializeCookieMonster from '../Main/Initialization';
|
||||
import CMLoopHook from '../Main/LoopHook';
|
||||
import load from './load';
|
||||
|
||||
/**
|
||||
* This creates a init function for the CM object. Per Game code/comments:
|
||||
@@ -30,5 +31,10 @@ export default function init() {
|
||||
Game.registerHook('click', CMClickHook);
|
||||
Game.registerHook('draw', CMDrawHook);
|
||||
Game.registerHook('logic', CMLoopHook);
|
||||
|
||||
// Load default settings if no previous saveData is found
|
||||
if (typeof Game.modSaveData.cookieMonsterMod === 'undefined') {
|
||||
load('{}');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,34 @@ import InitData from '../Sim/InitializeData/InitData';
|
||||
*/
|
||||
export default function load(str) {
|
||||
InitData();
|
||||
|
||||
// Load saveData
|
||||
saveAndLoadingFunctions.loadMod('cookieMonsterMod', str, settings, headers, CMLoopHook);
|
||||
UpdateColours();
|
||||
if (
|
||||
typeof Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames ===
|
||||
'undefined'
|
||||
) {
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames = [];
|
||||
}
|
||||
|
||||
// Update display with colours and locking of minigames
|
||||
UpdateColours();
|
||||
for (
|
||||
let index = 0;
|
||||
index < Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames.length;
|
||||
index++
|
||||
) {
|
||||
const buildingIndex =
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.lockedMinigames[index];
|
||||
l(`row${buildingIndex}`).style.pointerEvents = 'none';
|
||||
l(`row${buildingIndex}`).style.opacity = '0.4';
|
||||
l(`productLock${buildingIndex}`).innerHTML = 'Unlock';
|
||||
l(`productLock${buildingIndex}`).style.pointerEvents = 'auto';
|
||||
}
|
||||
|
||||
// Notify of update
|
||||
if (
|
||||
typeof Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.version !== 'undefined' &&
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.version !==
|
||||
`${VersionMajor}.${VersionMinor}`
|
||||
) {
|
||||
|
||||
@@ -17,7 +17,7 @@ import ReplaceTooltips from './ReplaceGameElements/Tooltips';
|
||||
import ReplaceNative from './ReplaceGameFunctions/ReplaceNative';
|
||||
import { LastModCount } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import AddWrinklerAreaDetect from './WrinklerArea/AddDetectArea';
|
||||
import CreateBuildingLockButtons from '../Disp/Buildings/CreateBuildingLockButtons';
|
||||
import createBuildingLockButtons from '../Disp/buildingTiles/createBuildingLockButtons';
|
||||
import createMenuInfo from '../Disp/MenuSections/createMenuInfo';
|
||||
import createMenuOptions from '../Disp/MenuSections/createMenuOptions';
|
||||
|
||||
@@ -51,7 +51,7 @@ export default function InitializeCookieMonster() {
|
||||
});
|
||||
CreateWrinklerButtons();
|
||||
UpdateBuildingUpgradeStyle();
|
||||
CreateBuildingLockButtons();
|
||||
createBuildingLockButtons();
|
||||
|
||||
ReplaceTooltips();
|
||||
AddWrinklerAreaDetect();
|
||||
|
||||
@@ -2,36 +2,36 @@ import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l, Game } from '../../GlobalsForTesting';
|
||||
|
||||
import ToggleUpgradeBarAndColor from '../../../src/Config/Toggles/ToggleUpgradeBarAndColour';
|
||||
import ToggleUpgradeBarAndColour from '../../../src/Config/Toggles/ToggleUpgradeBarAndColour';
|
||||
|
||||
describe('ToggleUpgradeBarAndColor', () => {
|
||||
describe('ToggleUpgradeBarAndColour', () => {
|
||||
global.l = l;
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
ToggleUpgradeBarAndColor();
|
||||
ToggleUpgradeBarAndColour();
|
||||
});
|
||||
|
||||
describe('UpBarColor = 0', () => {
|
||||
describe('UpBarColour = 0', () => {
|
||||
before(() => {
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour = 0;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpBarColor = 1', () => {
|
||||
describe('UpBarColour = 1', () => {
|
||||
before(() => {
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour = 1;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpBarColor = 2', () => {
|
||||
describe('UpBarColour = 2', () => {
|
||||
before(() => {
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor = 2;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColour = 2;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
|
||||
@@ -5,25 +5,25 @@ import GetTimeColour from '../../src/Disp/BeautifyAndFormatting/GetTimeColour';
|
||||
|
||||
describe('GetTimeColour', () => {
|
||||
it('Format when time is less than 60', () => {
|
||||
expect(GetTimeColour(59).color).to.deep.equal('Yellow');
|
||||
expect(GetTimeColour(59).colour).to.deep.equal('Yellow');
|
||||
});
|
||||
it('Format when time is more than 60', () => {
|
||||
expect(GetTimeColour(61).color).to.deep.equal('Orange');
|
||||
expect(GetTimeColour(61).colour).to.deep.equal('Orange');
|
||||
});
|
||||
it('Format when time is more than 300', () => {
|
||||
expect(GetTimeColour(301).color).to.deep.equal('Red');
|
||||
expect(GetTimeColour(301).colour).to.deep.equal('Red');
|
||||
});
|
||||
describe('TimeFormat = 0', () => {
|
||||
before(() => {
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat = 0;
|
||||
});
|
||||
it('Format when time is 0', () => {
|
||||
expect(GetTimeColour(0)).to.deep.equal({ text: 'Done!', color: 'Green' });
|
||||
expect(GetTimeColour(0)).to.deep.equal({ text: 'Done!', colour: 'Green' });
|
||||
});
|
||||
it('Format when time is negative', () => {
|
||||
expect(GetTimeColour(-1)).to.deep.equal({
|
||||
text: 'Done!',
|
||||
color: 'Green',
|
||||
colour: 'Green',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -34,13 +34,13 @@ describe('GetTimeColour', () => {
|
||||
it('Format when time is 0', () => {
|
||||
expect(GetTimeColour(0)).to.deep.equal({
|
||||
text: '00:00:00:00:00',
|
||||
color: 'Green',
|
||||
colour: 'Green',
|
||||
});
|
||||
});
|
||||
it('Format when time is negative', () => {
|
||||
expect(GetTimeColour(-1)).to.deep.equal({
|
||||
text: '00:00:00:00:00',
|
||||
color: 'Green',
|
||||
colour: 'Green',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user