Coloring and highlighting!
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
98e1326287
commit
034e2f8d66
@ -290,6 +290,9 @@ class ChampionsLeaguePointSolver : public olc::PixelGameEngine
|
|||||||
element.p1Score->Enable(false);
|
element.p1Score->Enable(false);
|
||||||
element.p2Score->Enable(false);
|
element.p2Score->Enable(false);
|
||||||
element.p3Score->Enable(false);
|
element.p3Score->Enable(false);
|
||||||
|
element.p1Score->bHasBackground=element.label->bHasBackground=false;
|
||||||
|
element.p2Score->bHasBackground=element.label->bHasBackground=false;
|
||||||
|
element.p3Score->bHasBackground=element.label->bHasBackground=false;
|
||||||
}
|
}
|
||||||
calculating=true;
|
calculating=true;
|
||||||
calculationStep=0;
|
calculationStep=0;
|
||||||
@ -347,6 +350,23 @@ class ChampionsLeaguePointSolver : public olc::PixelGameEngine
|
|||||||
}
|
}
|
||||||
calculating=false;
|
calculating=false;
|
||||||
calculateButton->bPressed=false;
|
calculateButton->bPressed=false;
|
||||||
|
calculateButton->Enable(true);
|
||||||
|
int index=0;
|
||||||
|
for(SongElement&element:songs){
|
||||||
|
element.p1Score->Enable(true);
|
||||||
|
element.p2Score->Enable(true);
|
||||||
|
element.p3Score->Enable(true);
|
||||||
|
if(index<12){
|
||||||
|
if(picked1.p1Picked.count(index)){element.p1Score->bHasBackground=element.label->bHasBackground=true;}
|
||||||
|
if(picked1.p2Picked.count(index)){element.p2Score->bHasBackground=element.label->bHasBackground=true;}
|
||||||
|
if(picked1.p3Picked.count(index)){element.p3Score->bHasBackground=element.label->bHasBackground=true;}
|
||||||
|
}else{
|
||||||
|
if(picked2.p1Picked.count(index-12)){element.p1Score->bHasBackground=element.label->bHasBackground=true;}
|
||||||
|
if(picked2.p2Picked.count(index-12)){element.p2Score->bHasBackground=element.label->bHasBackground=true;}
|
||||||
|
if(picked2.p3Picked.count(index-12)){element.p3Score->bHasBackground=element.label->bHasBackground=true;}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Binary file not shown.
@ -493,13 +493,13 @@ namespace olc::QuickGUI
|
|||||||
switch (nAlign)
|
switch (nAlign)
|
||||||
{
|
{
|
||||||
case Alignment::Left:
|
case Alignment::Left:
|
||||||
pge->DrawStringProp(olc::vf2d( vPos.x + 2.0f, vPos.y + (vSize.y - vText.y) * 0.5f ), sText, m_manager.colText);
|
pge->DrawStringProp(olc::vf2d( vPos.x + 2.0f, vPos.y + (vSize.y - vText.y) * 0.5f ), sText, bHasBackground?olc::YELLOW:m_manager.colText);
|
||||||
break;
|
break;
|
||||||
case Alignment::Centre:
|
case Alignment::Centre:
|
||||||
pge->DrawStringProp(vPos + (vSize - vText) * 0.5f, sText, m_manager.colText);
|
pge->DrawStringProp(vPos + (vSize - vText) * 0.5f, sText, bHasBackground?olc::YELLOW:m_manager.colText);
|
||||||
break;
|
break;
|
||||||
case Alignment::Right:
|
case Alignment::Right:
|
||||||
pge->DrawStringProp(olc::vf2d{ vPos.x + vSize.x - vText.x - 2.0f, vPos.y + (vSize.y - vText.y) * 0.5f }, sText, m_manager.colText);
|
pge->DrawStringProp(olc::vf2d{ vPos.x + vSize.x - vText.x - 2.0f, vPos.y + (vSize.y - vText.y) * 0.5f }, sText, bHasBackground?olc::YELLOW:m_manager.colText);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -646,7 +646,7 @@ namespace olc::QuickGUI
|
|||||||
|
|
||||||
// Draw Text
|
// Draw Text
|
||||||
olc::vf2d vText = pge->GetTextSizeProp(sText);
|
olc::vf2d vText = pge->GetTextSizeProp(sText);
|
||||||
pge->DrawStringProp(olc::vf2d(vPos.x + 2.0f, vPos.y + (vSize.y - vText.y) * 0.5f), sText, m_manager.colText);
|
pge->DrawStringProp(olc::vf2d(vPos.x + 2.0f, vPos.y + (vSize.y - vText.y) * 0.5f), sText, bHasBackground?olc::GREEN:m_manager.colText);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user