10
.eslintrc.js
10
.eslintrc.js
@@ -9,6 +9,7 @@ module.exports = {
|
||||
b64_to_utf8: 'readonly',
|
||||
utf8_to_b64: 'readonly',
|
||||
BeautifyAll: 'readonly',
|
||||
PlaySound: 'readonly',
|
||||
},
|
||||
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
||||
parserOptions: {
|
||||
@@ -23,5 +24,14 @@ module.exports = {
|
||||
'no-alert': 'off',
|
||||
'no-restricted-globals': 'off',
|
||||
'prefer-destructuring': ['error', { object: true, array: false }],
|
||||
'max-len': [
|
||||
1,
|
||||
{
|
||||
code: 100,
|
||||
ignoreComments: true,
|
||||
ignoreStrings: true,
|
||||
ignoreTemplateLiterals: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 80
|
||||
"trailingComma": "all"
|
||||
}
|
||||
|
||||
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
23
src/Disp/MenuSections/Prompt.js
Normal file
23
src/Disp/MenuSections/Prompt.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/* eslint-disable no-return-assign */
|
||||
/** Creates a Prompt similar to the base game without some of the stuff breaking them */
|
||||
export default function CookieMonsterPrompt(content, options) {
|
||||
Game.promptWrapL.className = 'framed';
|
||||
const str = content;
|
||||
Game.promptL.innerHTML = `${str}<div class="optionBox"></div>`;
|
||||
Object.keys(options).forEach((i) => {
|
||||
const option = document.createElement('a');
|
||||
option.id = `promptOption${i}`;
|
||||
option.className = 'option';
|
||||
option.onclick = function () {
|
||||
PlaySound('snd/tick.mp3');
|
||||
options[i][1]();
|
||||
};
|
||||
option.textContent = options[i][0];
|
||||
Game.promptL.children[1].appendChild(option);
|
||||
});
|
||||
Game.promptAnchorL.style.display = 'block';
|
||||
Game.darkenL.style.display = 'block';
|
||||
Game.promptL.focus();
|
||||
Game.promptOn = 1;
|
||||
Game.UpdatePrompt();
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import RefreshScale from '../HelperFunctions/RefreshScale';
|
||||
import UpdateColours from '../HelperFunctions/UpdateColours';
|
||||
import Flash from '../Notifications/Flash';
|
||||
import PlaySound from '../Notifications/Sound';
|
||||
import CookieMonsterPrompt from './Prompt';
|
||||
|
||||
/**
|
||||
* This function creates a header-object for the options page
|
||||
@@ -147,17 +148,22 @@ function CreatePrefOption(config) {
|
||||
const a = document.createElement('a');
|
||||
a.className = 'option';
|
||||
a.onclick = function () {
|
||||
Game.Prompt(inputPrompt.outerHTML, [
|
||||
CookieMonsterPrompt(inputPrompt.outerHTML, [
|
||||
[
|
||||
'Save',
|
||||
function () {
|
||||
CMOptions[`${config}`] = l(`${ConfigPrefix}${config}Prompt`).value;
|
||||
CMOptions[config] = l(`${ConfigPrefix}${config}Prompt`).value;
|
||||
SaveConfig();
|
||||
Game.ClosePrompt();
|
||||
Game.UpdateMenu();
|
||||
},
|
||||
],
|
||||
'Cancel',
|
||||
[
|
||||
'Cancel',
|
||||
function () {
|
||||
Game.ClosePrompt();
|
||||
},
|
||||
],
|
||||
]);
|
||||
};
|
||||
a.textContent = 'Edit';
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function GardenPlots() {
|
||||
const mature =
|
||||
minigame.plot[TooltipName[1]][TooltipName[0]][1] >
|
||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||
.matureBase;
|
||||
.mature;
|
||||
const plantName =
|
||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||
.name;
|
||||
|
||||
Reference in New Issue
Block a user