Merge pull request #733 from DanielNoord/bugfixes

Bugfixes
This commit is contained in:
Daniël van Noord
2021-03-28 15:09:51 +02:00
committed by GitHub
8 changed files with 47 additions and 9 deletions

View File

@@ -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,
},
],
},
};

View File

@@ -1,5 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80
"trailingComma": "all"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View 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();
}

View File

@@ -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',
function () {
Game.ClosePrompt();
},
],
]);
};
a.textContent = 'Edit';

View File

@@ -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;