Changed order and reformatted settings #721

This commit is contained in:
Daniël van Noord
2021-03-23 09:35:48 +01:00
parent f7c4e23eb3
commit 02d49dca2e
29 changed files with 855 additions and 853 deletions

View File

@@ -10,14 +10,14 @@ import { VersionMajor, VersionMinor } from '../../Data/Moddata';
import {
Beautify,
FormatTime,
GetTimeColor,
GetTimeColour,
} from '../BeautifyAndFormatting/BeautifyFormatting';
import GetCPS from '../HelperFunctions/GetCPS';
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
import {
ColorBlue,
ColorTextPre,
ColorYellow,
ColourBlue,
ColourTextPre,
ColourYellow,
LastTargetBotBar,
} from '../VariablesAndData';
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
@@ -32,7 +32,7 @@ export function CreateBotBar() {
BotBar.style.width = '100%';
BotBar.style.position = 'absolute';
BotBar.style.display = 'none';
BotBar.style.backgroundColor = '#262224';
BotBar.style.backgroundColour = '#262224';
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
BotBar.style.borderTop = '1px solid black';
BotBar.style.overflow = 'auto';
@@ -48,19 +48,21 @@ export function CreateBotBar() {
const firstCol = function (text, color) {
const td = document.createElement('td');
td.style.textAlign = 'right';
td.className = ColorTextPre + color;
td.className = ColourTextPre + color;
td.textContent = text;
return td;
};
const type = tbody.appendChild(document.createElement('tr'));
type.style.fontWeight = 'bold';
type.appendChild(firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColorYellow));
type.appendChild(
firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColourYellow),
);
const bonus = tbody.appendChild(document.createElement('tr'));
bonus.appendChild(firstCol('Bonus Income', ColorBlue));
bonus.appendChild(firstCol('Bonus Income', ColourBlue));
const pp = tbody.appendChild(document.createElement('tr'));
pp.appendChild(firstCol('Payback Period', ColorBlue));
pp.appendChild(firstCol('Payback Period', ColourBlue));
const time = tbody.appendChild(document.createElement('tr'));
time.appendChild(firstCol('Time Left', ColorBlue));
time.appendChild(firstCol('Time Left', ColourBlue));
l('wrapper').appendChild(BotBar);
@@ -94,7 +96,7 @@ export function UpdateBotBar() {
].textContent = Beautify(target[i].bonus, 2);
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
count
].className = ColorTextPre + target[i].color;
].className = ColourTextPre + target[i].color;
let PPString;
if (CMOptions.PPDisplayTime)
PPString = FormatTime(Math.round(target[i].pp));
@@ -102,24 +104,24 @@ export function UpdateBotBar() {
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
count
].textContent = PPString;
const timeColor = GetTimeColor(
const timeColour = GetTimeColour(
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
GetCPS(),
);
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
count
].className = ColorTextPre + timeColor.color;
].className = ColourTextPre + timeColour.color;
if (
timeColor.text === 'Done!' &&
timeColour.text === 'Done!' &&
Game.cookies < Game.Objects[i].bulkPrice
) {
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
count
].textContent = `${timeColor.text} (with Wrink)`;
].textContent = `${timeColour.text} (with Wrink)`;
} else
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
count
].textContent = timeColor.text;
].textContent = timeColour.text;
});
}
}

View File

@@ -1,6 +1,6 @@
/** Functions to create various DOM elements used by the Bars */
import { ColorBackPre, ColorBlue, ColorTextPre } from '../VariablesAndData';
import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData';
/**
* This function creates an indivudual timer for the timer bar
@@ -47,7 +47,7 @@ export function CreateTimer(id, name, bars) {
colorBar.style.borderBottomRightRadius = '10px';
}
if (typeof bars[i].color !== 'undefined') {
colorBar.className = ColorBackPre + bars[i].color;
colorBar.className = ColourBackPre + bars[i].color;
}
div.appendChild(colorBar);
}
@@ -83,7 +83,7 @@ export function CreateBotBarBuildingColumn(buildingName) {
);
const span = header.appendChild(document.createElement('span'));
span.className = ColorTextPre + ColorBlue;
span.className = ColourTextPre + ColourBlue;
header.appendChild(document.createTextNode(')'));
type.lastChild.style.paddingLeft = '8px';

View File

@@ -3,11 +3,11 @@
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
import { CMOptions } from '../../Config/VariablesAndData';
import {
BuffColors,
ColorBackPre,
ColorGray,
ColorOrange,
ColorPurple,
BuffColours,
ColourBackPre,
ColourGray,
ColourOrange,
ColourPurple,
LastNumberOfTimers,
} from '../VariablesAndData';
import { CreateTimer } from './CreateDOMElements';
@@ -23,19 +23,19 @@ export function CreateTimerBar() {
TimerBar.style.height = '0px';
TimerBar.style.fontSize = '10px';
TimerBar.style.fontWeight = 'bold';
TimerBar.style.backgroundColor = 'black';
TimerBar.style.backgroundColour = 'black';
// Create standard Golden Cookie bar
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
{ id: 'CMTimerBarGCMinBar', color: ColorGray },
{ id: 'CMTimerBarGCBar', color: ColorPurple },
{ id: 'CMTimerBarGCMinBar', color: ColourGray },
{ id: 'CMTimerBarGCBar', color: ColourPurple },
]);
TimerBar.appendChild(CMTimerBarGC);
// Create standard Reindeer bar
const CMTimerBarRen = CreateTimer('CMTimerBarRen', 'Next Reindeer', [
{ id: 'CMTimerBarRenMinBar', color: ColorGray },
{ id: 'CMTimerBarRenBar', color: ColorOrange },
{ id: 'CMTimerBarRenMinBar', color: ColourGray },
{ id: 'CMTimerBarRenBar', color: ColourOrange },
]);
TimerBar.appendChild(CMTimerBarRen);
const TimerBarBuffTimers = document.createElement('div');
@@ -166,12 +166,12 @@ export function UpdateTimerBar() {
{ id: `${Game.buffs[i].name}Bar` },
]);
timer.style.display = '';
let classColor = '';
let classColour = '';
// Gives specific timers specific colors
if (typeof BuffColors[Game.buffs[i].name] !== 'undefined') {
classColor = BuffColors[Game.buffs[i].name];
} else classColor = ColorPurple;
timer.lastChild.children[1].className = ColorBackPre + classColor;
if (typeof BuffColours[Game.buffs[i].name] !== 'undefined') {
classColour = BuffColours[Game.buffs[i].name];
} else classColour = ColourPurple;
timer.lastChild.children[1].className = ColourBackPre + classColour;
timer.lastChild.children[1].style.color = 'black';
if (CMOptions.TimerBarOverlay === 2)
timer.lastChild.children[1].textContent = `${Math.round(