Working on new skin

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-03-29 17:46:33 +01:00
parent ae7e338cdd
commit 48d3085ead
4 changed files with 1180 additions and 318 deletions
+38 -38
View File
@@ -300,7 +300,7 @@ void readRds() {
if (advancedRDS) {
tftPrint(0, PIold, 275, 75, RDSDropoutColor, RDSDropoutColorSmooth, 28);
} else {
if (CurrentSkin == 1) PISprite.pushImage (-26, -98, 320, 240, mainbackground);
if (CurrentSkin == 1) PISprite.pushImage (-26, -98, 320, 240, skin1_mainbackground);
if (CurrentSkin == 1) PISprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false); else tftPrint(0, PIold, 275, 187, RDSDropoutColor, RDSDropoutColorSmooth, 28);
if (CurrentSkin == 1) {
@@ -320,7 +320,7 @@ void readRds() {
tftPrint(-1, PSold, 36, 75, RDSDropoutColor, RDSDropoutColorSmooth, 28);
} else {
if (CurrentSkin == 1) {
PSSprite.pushImage (-8, -154, 320, 240, mainbackground);
PSSprite.pushImage (-8, -154, 320, 240, skin1_mainbackground);
PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
PSSprite.drawString(PSold, 84, 1);
PSSprite.pushSprite(8, 154);
@@ -332,7 +332,7 @@ void readRds() {
tftPrint(-1, PTYold, 36, 109, RDSDropoutColor, RDSDropoutColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
PTYSprite.pushImage (-40, -130, 320, 240, mainbackground);
PTYSprite.pushImage (-40, -130, 320, 240, skin1_mainbackground);
PTYSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
PTYSprite.drawString(radio.rds.stationType, 65, 0);
PTYSprite.pushSprite(40, 130);
@@ -356,7 +356,7 @@ void readRds() {
RDSSprite.pushSprite(36, 220);
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
xPos = 0;
if (CurrentSkin == 1) RadiotextSprite.pushImage (-25, -188, 320, 240, mainbackground); else RadiotextSprite.fillSprite(BackgroundColor);
if (CurrentSkin == 1) RadiotextSprite.pushImage (-25, -188, 320, 240, skin1_mainbackground); else RadiotextSprite.fillSprite(BackgroundColor);
RadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
@@ -368,11 +368,11 @@ void readRds() {
tftPrint(1, rds_clock, 205, 109, RDSDropoutColor, RDSDropoutColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
CTBWSignalSprite.pushImage (-196, -8, 320, 240, mainbackground);
CTBWSignalSprite.pushImage (-202, 0, 320, 240, skin1_mainbackground);
CTBWSignalSprite.setTextDatum(TL_DATUM);
CTBWSignalSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
CTBWSignalSprite.drawString(rds_clock, 0, 0);
CTBWSignalSprite.pushSprite(196, 8);
CTBWSignalSprite.drawString(rds_clock, 0, 8);
CTBWSignalSprite.pushSprite(202, 0);
} else {
tftPrint(1, rds_clock, 205, 163, RDSDropoutColor, RDSDropoutColorSmooth, 16);
}
@@ -386,7 +386,7 @@ void readRds() {
if (advancedRDS) {
tftPrint(0, PIold, 275, 75, RDSColor, RDSColorSmooth, 28);
} else {
if (CurrentSkin == 1) PISprite.pushImage (-26, -98, 320, 240, mainbackground);
if (CurrentSkin == 1) PISprite.pushImage (-26, -98, 320, 240, skin1_mainbackground);
if (CurrentSkin == 1) PISprite.setTextColor(RDSColor, RDSColor, false); else tftPrint(0, PIold, 275, 187, RDSColor, RDSColor, 28);
if (CurrentSkin == 1) {
@@ -406,7 +406,7 @@ void readRds() {
tftPrint(-1, PSold, 36, 75, RDSColor, RDSColorSmooth, 28);
} else {
if (CurrentSkin == 1) {
PSSprite.pushImage (-8, -154, 320, 240, mainbackground);
PSSprite.pushImage (-8, -154, 320, 240, skin1_mainbackground);
PSSprite.setTextColor(RDSColor, RDSColorSmooth, false);
PSSprite.drawString(PSold, 84, 1);
PSSprite.pushSprite(8, 154);
@@ -418,7 +418,7 @@ void readRds() {
tftPrint(-1, PTYold, 36, 109, RDSColor, RDSColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
PTYSprite.pushImage (-40, -130, 320, 240, mainbackground);
PTYSprite.pushImage (-40, -130, 320, 240, skin1_mainbackground);
PTYSprite.setTextColor(RDSColor, RDSColorSmooth, false);
PTYSprite.drawString(radio.rds.stationType, 65, 0);
PTYSprite.pushSprite(40, 130);
@@ -445,7 +445,7 @@ void readRds() {
RDSSprite.pushSprite(36, 220);
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
xPos = 0;
if (CurrentSkin == 1) RadiotextSprite.pushImage (-25, -188, 320, 240, mainbackground); else RadiotextSprite.fillSprite(BackgroundColor);
if (CurrentSkin == 1) RadiotextSprite.pushImage (-25, -188, 320, 240, skin1_mainbackground); else RadiotextSprite.fillSprite(BackgroundColor);
RadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
@@ -457,11 +457,11 @@ void readRds() {
tftPrint(1, rds_clock, 205, 109, RDSColor, RDSColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
CTBWSignalSprite.pushImage (-196, -8, 320, 240, mainbackground);
CTBWSignalSprite.pushImage (-202, 0, 320, 240, skin1_mainbackground);
CTBWSignalSprite.setTextDatum(TL_DATUM);
CTBWSignalSprite.setTextColor(ActiveColor, ActiveColorSmooth, false);
CTBWSignalSprite.drawString(rds_clock, 0, 0);
CTBWSignalSprite.pushSprite(196, 8);
CTBWSignalSprite.drawString(rds_clock, 0, 8);
CTBWSignalSprite.pushSprite(202, 0);
} else {
tftPrint(1, rds_clock, 205, 163, RDSColor, RDSColorSmooth, 16);
}
@@ -547,8 +547,8 @@ void ShowErrors() {
if (calc != rdsqualityold || BWreset) {
switch (calc) {
case 0:
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 156 : 186)), 4, 24, 2, BarInsignificantColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 157 : 187)), 2, 22, 2, BarInsignificantColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 155 : 186)), 4, 24, 2, BarInsignificantColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 156 : 187)), 2, 22, 2, BarInsignificantColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 193 : 199), (advancedRDS ? 79 : (CurrentSkin == 1 ? 160 : 191)), 4, 19, 2, BarInsignificantColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 194 : 200), (advancedRDS ? 80 : (CurrentSkin == 1 ? 161 : 192)), 2, 17, 2, BarInsignificantColor);
@@ -561,8 +561,8 @@ void ShowErrors() {
break;
case 1:
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 156 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 157 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 155 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 156 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 193 : 199), (advancedRDS ? 79 : (CurrentSkin == 1 ? 160 : 191)), 4, 19, 2, BarInsignificantColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 194 : 200), (advancedRDS ? 80 : (CurrentSkin == 1 ? 161 : 192)), 2, 17, 2, BarInsignificantColor);
@@ -575,8 +575,8 @@ void ShowErrors() {
break;
case 2:
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 156 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 157 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 155 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 156 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 193 : 199), (advancedRDS ? 79 : (CurrentSkin == 1 ? 160 : 191)), 4, 19, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 194 : 200), (advancedRDS ? 80 : (CurrentSkin == 1 ? 161 : 192)), 2, 17, 2, BackgroundColor);
@@ -589,8 +589,8 @@ void ShowErrors() {
break;
case 3:
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 156 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 157 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 155 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 156 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 193 : 199), (advancedRDS ? 79 : (CurrentSkin == 1 ? 160 : 191)), 4, 19, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 194 : 200), (advancedRDS ? 80 : (CurrentSkin == 1 ? 161 : 192)), 2, 17, 2, BackgroundColor);
@@ -603,8 +603,8 @@ void ShowErrors() {
break;
case 4:
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 156 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 157 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 199 : 205), (advancedRDS ? 74 : (CurrentSkin == 1 ? 155 : 186)), 4, 24, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 200 : 206), (advancedRDS ? 75 : (CurrentSkin == 1 ? 156 : 187)), 2, 22, 2, BackgroundColor);
tft.drawRoundRect((!advancedRDS && CurrentSkin == 1 ? 193 : 199), (advancedRDS ? 79 : (CurrentSkin == 1 ? 160 : 191)), 4, 19, 2, GreyoutColor);
tft.fillRoundRect((!advancedRDS && CurrentSkin == 1 ? 194 : 200), (advancedRDS ? 80 : (CurrentSkin == 1 ? 161 : 192)), 2, 17, 2, BackgroundColor);
@@ -651,7 +651,7 @@ void showPI() {
tftReplace(-1, PIold, radio.rds.picode, 30, 201, BWAutoColor, BWAutoColorSmooth, 16);
} else {
if (region == REGION_EU) {
if (CurrentSkin == 1) PISprite.pushImage (-26, -98, 320, 240, mainbackground);
if (CurrentSkin == 1) PISprite.pushImage (-26, -98, 320, 240, skin1_mainbackground);
if (!RDSstatus) {
if (CurrentSkin == 1) PISprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false); else tftReplace(0, PIold, radio.rds.picode, 275, 187, RDSDropoutColor, RDSDropoutColorSmooth, 28);
} else {
@@ -696,7 +696,7 @@ void showPTY() {
tftReplace(-1, PTYold, radio.rds.stationType, 36, 109, RDSColor, RDSColorSmooth, 16);
}
} else {
if (CurrentSkin == 1) PTYSprite.pushImage (-40, -130, 320, 240, mainbackground);
if (CurrentSkin == 1) PTYSprite.pushImage (-40, -130, 320, 240, skin1_mainbackground);
if (!RDSstatus) {
if (CurrentSkin == 1) PTYSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false); else tftReplace(-1, PTYold, radio.rds.stationType, 36, 163, RDSDropoutColor, RDSDropoutColorSmooth, 16);
} else {
@@ -733,7 +733,7 @@ void showPS() {
} else {
if (!RDSstatus) {
if (CurrentSkin == 1) {
PSSprite.pushImage (-8, -154, 320, 240, mainbackground);
PSSprite.pushImage (-8, -154, 320, 240, skin1_mainbackground);
PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
PSSprite.drawString(radio.rds.stationName, 84, 1);
PSSprite.pushSprite(8, 154);
@@ -742,7 +742,7 @@ void showPS() {
}
} else {
if (CurrentSkin == 1) {
PSSprite.pushImage (-8, -154, 320, 240, mainbackground);
PSSprite.pushImage (-8, -154, 320, 240, skin1_mainbackground);
PSSprite.setTextColor(RDSColor, RDSColorSmooth, false);
PSSprite.drawString(radio.rds.stationName, 84, 1);
PSSprite.pushSprite(8, 154);
@@ -788,11 +788,11 @@ void showCT() {
tftReplace(1, rds_clockold, rds_clock, 205, 109, RDSColor, RDSColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
CTBWSignalSprite.pushImage (-196, -8, 320, 240, mainbackground);
CTBWSignalSprite.pushImage (-202, 0, 320, 240, skin1_mainbackground);
CTBWSignalSprite.setTextDatum(TL_DATUM);
CTBWSignalSprite.setTextColor(ActiveColor, ActiveColorSmooth, false);
CTBWSignalSprite.drawString(rds_clock, 0, 0);
CTBWSignalSprite.pushSprite(196, 8);
CTBWSignalSprite.drawString(rds_clock, 0, 8);
CTBWSignalSprite.pushSprite(202, 0);
} else {
tftReplace(1, rds_clockold, rds_clock, 205, 163, RDSColor, RDSColorSmooth, 16);
}
@@ -803,11 +803,11 @@ void showCT() {
tftReplace(1, rds_clockold, rds_clock, 205, 109, RDSDropoutColor, RDSDropoutColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
CTBWSignalSprite.pushImage (-196, -8, 320, 240, mainbackground);
CTBWSignalSprite.pushImage (-202, 0, 320, 240, skin1_mainbackground);
CTBWSignalSprite.setTextDatum(TL_DATUM);
CTBWSignalSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
CTBWSignalSprite.drawString(rds_clock, 0, 0);
CTBWSignalSprite.pushSprite(196, 8);
CTBWSignalSprite.drawString(rds_clock, 0, 8);
CTBWSignalSprite.pushSprite(202, 0);
} else {
tftReplace(1, rds_clockold, rds_clock, 205, 163, RDSDropoutColor, RDSDropoutColorSmooth, 16);
}
@@ -818,8 +818,8 @@ void showCT() {
tftPrint(1, rds_clock, 205, 109, BackgroundColor, BackgroundColor, 16);
} else {
if (CurrentSkin == 1) {
CTBWSignalSprite.pushImage (-196, -8, 320, 240, mainbackground);
CTBWSignalSprite.pushSprite(196, 8);
CTBWSignalSprite.pushImage (-202, 0, 320, 240, skin1_mainbackground);
CTBWSignalSprite.pushSprite(202, 0);
} else {
tftPrint(1, rds_clockold, 205, 163, BackgroundColor, BackgroundColor, 16);
tftPrint(1, rds_clock, 205, 163, BackgroundColor, BackgroundColor, 16);
@@ -850,7 +850,7 @@ void showRadioText() {
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
xPos = 0;
if (CurrentSkin == 1) {
RadiotextSprite.pushImage (-25, -188, 320, 240, mainbackground);
RadiotextSprite.pushImage (-25, -188, 320, 240, skin1_mainbackground);
RadiotextSprite.setTextDatum(TC_DATUM);
} else {
RadiotextSprite.fillSprite(BackgroundColor);
@@ -885,7 +885,7 @@ void showRadioText() {
RDSSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
RDSSprite.pushSprite(36, 220);
} else {
if (CurrentSkin == 1) RadiotextSprite.pushImage (-25, -188, 320, 240, mainbackground); else RadiotextSprite.fillSprite(BackgroundColor);
if (CurrentSkin == 1) RadiotextSprite.pushImage (-25, -188, 320, 240, skin1_mainbackground); else RadiotextSprite.fillSprite(BackgroundColor);
if (RDSstatus) RadiotextSprite.setTextColor(CurrentSkin == 1 ? FreqColor : RDSColor), (CurrentSkin == 1 ? FreqColorSmooth : RDSColorSmooth, false); else RadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);