Complete overhaul of code structure and relevant files (#639)
This commit is contained in:
20
src/Disp/Initialization/CreateWrinklerButton.js
Normal file
20
src/Disp/Initialization/CreateWrinklerButton.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
|
||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
||||
|
||||
/**
|
||||
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
|
||||
*/
|
||||
export default function CreateWrinklerButtons() {
|
||||
const popAllA = document.createElement('a');
|
||||
popAllA.id = 'PopAllNormalWrinklerButton';
|
||||
popAllA.textContent = 'Pop All Normal';
|
||||
popAllA.className = 'option';
|
||||
popAllA.onclick = function () { PopAllNormalWrinklers(); };
|
||||
l('sectionLeftExtra').children[0].append(popAllA);
|
||||
const popFattestA = document.createElement('a');
|
||||
popFattestA.id = 'PopFattestWrinklerButton';
|
||||
popFattestA.textContent = 'Pop Single Fattest';
|
||||
popFattestA.className = 'option';
|
||||
popFattestA.onclick = function () { if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0; };
|
||||
l('sectionLeftExtra').children[0].append(popFattestA);
|
||||
}
|
||||
13
src/Disp/Initialization/CssArea.js
Normal file
13
src/Disp/Initialization/CssArea.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { DispCSS } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function creates a CSS style that stores certain standard CSS classes used by CookieMonster
|
||||
|
||||
*/
|
||||
export default function CreateCssArea() {
|
||||
DispCSS = document.createElement('style');
|
||||
DispCSS.type = 'text/css';
|
||||
DispCSS.id = 'CMCSS';
|
||||
|
||||
document.head.appendChild(DispCSS);
|
||||
}
|
||||
10
src/Disp/Initialization/UpdateBuildingUpgradeStyle.js
Normal file
10
src/Disp/Initialization/UpdateBuildingUpgradeStyle.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* This function updates the style of the building and upgrade sections to make these sortable
|
||||
*/
|
||||
export default function UpdateBuildingUpgradeStyle() {
|
||||
l('products').style.display = 'grid';
|
||||
l('storeBulk').style.gridRow = '1/1';
|
||||
|
||||
l('upgrades').style.display = 'flex';
|
||||
l('upgrades').style['flex-wrap'] = 'wrap';
|
||||
}
|
||||
14
src/Disp/Initialization/WhiteScreen.js
Normal file
14
src/Disp/Initialization/WhiteScreen.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* This function creates a white square over the full screen and appends it to l('wrapper')
|
||||
*/
|
||||
export default function CreateWhiteScreen() {
|
||||
const WhiteScreen = document.createElement('div');
|
||||
WhiteScreen.id = 'CMWhiteScreen';
|
||||
WhiteScreen.style.width = '100%';
|
||||
WhiteScreen.style.height = '100%';
|
||||
WhiteScreen.style.backgroundColor = 'white';
|
||||
WhiteScreen.style.display = 'none';
|
||||
WhiteScreen.style.zIndex = '9999999999';
|
||||
WhiteScreen.style.position = 'absolute';
|
||||
l('wrapper').appendChild(WhiteScreen);
|
||||
}
|
||||
Reference in New Issue
Block a user