Complete overhaul of code structure and relevant files (#639)
This commit is contained in:
22
src/Config/Toggles/ToggleUpgradeBarAndColor.js
Normal file
22
src/Config/Toggles/ToggleUpgradeBarAndColor.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
||||
import { CMOptions } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* Section: Functions related to the Upgrade Bar
|
||||
|
||||
/**
|
||||
* This function toggles the upgrade bar and the colours of upgrades
|
||||
* It is called by a change in CM.Options.UpBarColor
|
||||
*/
|
||||
export default function ToggleUpgradeBarAndColor() {
|
||||
if (CMOptions.UpBarColor === 1) { // Colours and bar on
|
||||
l('CMUpgradeBar').style.display = '';
|
||||
UpdateUpgrades();
|
||||
} else if (CMOptions.UpBarColor === 2) { // Colours on and bar off
|
||||
l('CMUpgradeBar').style.display = 'none';
|
||||
UpdateUpgrades();
|
||||
} else { // Colours and bar off
|
||||
l('CMUpgradeBar').style.display = 'none';
|
||||
Game.RebuildUpgrades();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user