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

@@ -0,0 +1,33 @@
import { CMOptions } from '../../Config/VariablesAndData';
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
import {
ColourBackPre,
ColourBorderPre,
Colours,
ColourTextPre,
} from '../VariablesAndData';
/**
* This function changes/refreshes colours if the user has set new standard colours
* The function is therefore called by a change in CM.Options.Colours
*/
export default function UpdateColours() {
let str = '';
for (let i = 0; i < Colours.length; i++) {
str += `.${ColourTextPre}${Colours[i]} { color: ${
CMOptions.Colours[Colours[i]]
}; }\n`;
}
for (let i = 0; i < Colours.length; i++) {
str += `.${ColourBackPre}${Colours[i]} { background-color: ${
CMOptions.Colours[Colours[i]]
}; }\n`;
}
for (let i = 0; i < Colours.length; i++) {
str += `.${ColourBorderPre}${Colours[i]} { border: 1px solid ${
CMOptions.Colours[Colours[i]]
}; }\n`;
}
l('CMCSS').textContent = str;
UpdateBuildings(); // Class has been already set
}