Changed Volume-options into sliders

This commit is contained in:
Daniel van Noord
2020-12-15 15:17:49 +01:00
parent 6098a398f0
commit 08b30e9c62
4 changed files with 94 additions and 52 deletions

View File

@@ -104,6 +104,19 @@ CM.ToggleConfigDown = function(config) {
CM.SaveConfig(CM.Config);
}
/**
* This function sets the value of the specified volume-option and updates the display in the options menu
* It is called by CM.Disp.CreatePrefOption()
* @param {string} config The name of the option
*/
CM.ToggleConfigVolume = function(config) {
if (l("slider" + config) != null) {
l("slider" + config + "right").innerHTML = l("slider" + config).value + "%";
CM.Config[config] = Math.round(l("slider" + config).value);
}
CM.SaveConfig(CM.Config);
}
CM.ToggleStatsConfig = function(config) {
if (CM.Config.StatsPref[config] == 0) {
CM.Config.StatsPref[config]++;