Fixed error wrong icon index in GeneratePowerPage

This commit is contained in:
fre4242
2023-04-23 11:49:24 +02:00
parent 3b20acc703
commit a60bff301e
2 changed files with 8 additions and 8 deletions

View File

@@ -5071,17 +5071,17 @@ function GeneratePowerPage(page: PagePower): Payload[] {
let arrayColorScale = [colorScale0, colorScale1, colorScale2, colorScale3, colorScale4, colorScale5, colorScale6, colorScale7, colorScale8, colorScale9, colorScale10]; let arrayColorScale = [colorScale0, colorScale1, colorScale2, colorScale3, colorScale4, colorScale5, colorScale6, colorScale7, colorScale8, colorScale9, colorScale10];
let homeIconColor = 0;
if (!demoMode) { if (!demoMode) {
for (let obji = 1; obji < 7; obji++) { for (let obji = 1; obji < 7; obji++) {
array_icon_color[obji] = arrayColorScale[obj[obji].iconColor !== '' ? obj[obji].iconColor : 0]; const color = obj[obji].iconColor !== '' ? obj[obji].iconColor : 0;
array_icon_color[obji] = arrayColorScale[color];
array_icon[obji] = obj[obji].icon; array_icon[obji] = obj[obji].icon;
array_powerspeed[obji] = obj[obji].speed; array_powerspeed[obji] = obj[obji].speed;
array_powerstate[obji] = obj[obji].value + ' ' + obj[obji].unit ; array_powerstate[obji] = obj[obji].value + ' ' + obj[obji].unit ;
} }
array_icon[0] = obj[0].icon; array_icon[0] = obj[0].icon;
array_powerstate[0] = obj[0].value + ' ' + obj[0].unit; array_powerstate[0] = obj[0].value + ' ' + obj[0].unit;
homeIconColor = obj[0].iconColor; array_icon_color[0] = arrayColorScale[obj[0].iconColor];
} }
let power_string : any = ''; let power_string : any = '';
@@ -5108,7 +5108,7 @@ function GeneratePowerPage(page: PagePower): Payload[] {
'' + '~' + // type (ignored) '' + '~' + // type (ignored)
'' + '~' + // intNameEntity (ignored) '' + '~' + // intNameEntity (ignored)
Icons.GetIcon(array_icon[0]) + '~' + // icon Icons.GetIcon(array_icon[0]) + '~' + // icon
rgb_dec565(array_icon_color[homeIconColor]) + '~' + // icon_color rgb_dec565(array_icon_color[0]) + '~' + // icon_color
'' + '~' + // display (ignored in TS) '' + '~' + // display (ignored in TS)
array_powerstate[0] + '~' + // optionalValue array_powerstate[0] + '~' + // optionalValue
'' + '~' + // speed '' + '~' + // speed

View File

@@ -4572,17 +4572,17 @@ function GeneratePowerPage(page: PagePower): Payload[] {
let arrayColorScale = [colorScale0, colorScale1, colorScale2, colorScale3, colorScale4, colorScale5, colorScale6, colorScale7, colorScale8, colorScale9, colorScale10]; let arrayColorScale = [colorScale0, colorScale1, colorScale2, colorScale3, colorScale4, colorScale5, colorScale6, colorScale7, colorScale8, colorScale9, colorScale10];
let homeIconColor = 0;
if (!demoMode) { if (!demoMode) {
for (let obji = 1; obji < 7; obji++) { for (let obji = 1; obji < 7; obji++) {
array_icon_color[obji] = arrayColorScale[obj[obji].iconColor !== '' ? obj[obji].iconColor : 0]; const color = obj[obji].iconColor !== '' ? obj[obji].iconColor : 0;
array_icon_color[obji] = arrayColorScale[color];
array_icon[obji] = obj[obji].icon; array_icon[obji] = obj[obji].icon;
array_powerspeed[obji] = obj[obji].speed; array_powerspeed[obji] = obj[obji].speed;
array_powerstate[obji] = obj[obji].value + ' ' + obj[obji].unit ; array_powerstate[obji] = obj[obji].value + ' ' + obj[obji].unit ;
} }
array_icon[0] = obj[0].icon; array_icon[0] = obj[0].icon;
array_powerstate[0] = obj[0].value + ' ' + obj[0].unit; array_powerstate[0] = obj[0].value + ' ' + obj[0].unit;
homeIconColor = obj[0].iconColor; array_icon_color[0] = arrayColorScale[obj[0].iconColor];
} }
let power_string : any = ''; let power_string : any = '';
@@ -4609,7 +4609,7 @@ function GeneratePowerPage(page: PagePower): Payload[] {
'' + '~' + // type (ignored) '' + '~' + // type (ignored)
'' + '~' + // intNameEntity (ignored) '' + '~' + // intNameEntity (ignored)
Icons.GetIcon(array_icon[0]) + '~' + // icon Icons.GetIcon(array_icon[0]) + '~' + // icon
rgb_dec565(array_icon_color[homeIconColor]) + '~' + // icon_color rgb_dec565(array_icon_color[0]) + '~' + // icon_color
'' + '~' + // display (ignored in TS) '' + '~' + // display (ignored in TS)
array_powerstate[0] + '~' + // optionalValue array_powerstate[0] + '~' + // optionalValue
'' + '~' + // speed '' + '~' + // speed