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

@@ -7,7 +7,7 @@ import {
import { CMOptions } from '../../Config/VariablesAndData';
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
import { Colors, LastTargetBuildings } from '../VariablesAndData';
import { Colours, LastTargetBuildings } from '../VariablesAndData';
/**
* Section: Functions related to right column of the screen (buildings/upgrades)
@@ -15,8 +15,8 @@ import { Colors, LastTargetBuildings } from '../VariablesAndData';
/**
* This function adjusts some things in the column of buildings.
* It colours them, helps display the correct sell-price and shuffles the order when CM.Options.SortBuildings is set
* The function is called by CM.Disp.Draw(), CM.Disp.UpdateColors() & CM.Disp.RefreshScale()
* And by changes in CM.Options.BuildColor, CM.Options.SortBuild & CM.Data.Config.BulkBuildColor
* The function is called by CM.Disp.Draw(), CM.Disp.UpdateColours() & CM.Disp.RefreshScale()
* And by changes in CM.Options.BuildColour, CM.Options.SortBuild & CM.Data.Config.BulkBuildColour
*/
export default function UpdateBuildings() {
let target = Game.buyBulk;
@@ -30,10 +30,10 @@ export default function UpdateBuildings() {
else if (target === 100) target = CacheObjects100;
if (Game.buyMode === 1) {
if (CMOptions.BuildColor === 1) {
if (CMOptions.BuildColour === 1) {
Object.keys(target).forEach((i) => {
l(`productPrice${Game.Objects[i].id}`).style.color =
CMOptions.Colors[target[i].color];
CMOptions.Colours[target[i].color];
});
} else {
Object.keys(Game.Objects).forEach((i) => {
@@ -72,9 +72,9 @@ export default function UpdateBuildings() {
});
arr.sort(function (a, b) {
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
return Colours.indexOf(a.color) > Colours.indexOf(b.color)
? 1
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
: Colours.indexOf(a.color) < Colours.indexOf(b.color)
? -1
: a.pp < b.pp
? -1
@@ -89,9 +89,9 @@ export default function UpdateBuildings() {
});
arr.sort(function (a, b) {
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
return Colours.indexOf(a.color) > Colours.indexOf(b.color)
? 1
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
: Colours.indexOf(a.color) < Colours.indexOf(b.color)
? -1
: a.pp < b.pp
? -1