Fixed JSColor display not updating #539

This commit is contained in:
Daniel van Noord
2021-01-30 11:35:28 +01:00
parent 8deb0c435d
commit 2491f7a7cc
2 changed files with 2 additions and 2 deletions

View File

@@ -3322,7 +3322,7 @@ CM.Disp.CreatePrefOption = function(config) {
input.style.width = '65px'; input.style.width = '65px';
input.setAttribute('value', CM.Options.Colors[CM.Disp.colors[i]]); input.setAttribute('value', CM.Options.Colors[CM.Disp.colors[i]]);
innerDiv.appendChild(input); innerDiv.appendChild(input);
let change = function() {CM.Options.Colors[this.targetElement.id] = this.toHEXString(); CM.Disp.UpdateColors(); CM.Config.SaveConfig();}; let change = function() {CM.Options.Colors[this.targetElement.id] = this.toHEXString(); CM.Disp.UpdateColors(); CM.Config.SaveConfig(); Game.UpdateMenu();};
let picker = new JSColor(input, {hash: true, position: "right", onInput: change}) let picker = new JSColor(input, {hash: true, position: "right", onInput: change})
var label = document.createElement('label'); var label = document.createElement('label');
label.textContent = CM.ConfigData.Colors.desc[CM.Disp.colors[i]]; label.textContent = CM.ConfigData.Colors.desc[CM.Disp.colors[i]];

View File

@@ -2110,7 +2110,7 @@ CM.Disp.CreatePrefOption = function(config) {
input.style.width = '65px'; input.style.width = '65px';
input.setAttribute('value', CM.Options.Colors[CM.Disp.colors[i]]); input.setAttribute('value', CM.Options.Colors[CM.Disp.colors[i]]);
innerDiv.appendChild(input); innerDiv.appendChild(input);
let change = function() {CM.Options.Colors[this.targetElement.id] = this.toHEXString(); CM.Disp.UpdateColors(); CM.Config.SaveConfig();}; let change = function() {CM.Options.Colors[this.targetElement.id] = this.toHEXString(); CM.Disp.UpdateColors(); CM.Config.SaveConfig(); Game.UpdateMenu();};
let picker = new JSColor(input, {hash: true, position: "right", onInput: change}) let picker = new JSColor(input, {hash: true, position: "right", onInput: change})
var label = document.createElement('label'); var label = document.createElement('label');
label.textContent = CM.ConfigData.Colors.desc[CM.Disp.colors[i]]; label.textContent = CM.ConfigData.Colors.desc[CM.Disp.colors[i]];