diff --git a/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.cpp b/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.cpp index 16d46cb..c4baa54 100644 --- a/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.cpp +++ b/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.cpp @@ -290,6 +290,9 @@ class ChampionsLeaguePointSolver : public olc::PixelGameEngine element.p1Score->Enable(false); element.p2Score->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; calculationStep=0; @@ -347,6 +350,23 @@ class ChampionsLeaguePointSolver : public olc::PixelGameEngine } calculating=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; diff --git a/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.wasm b/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.wasm index a346e78..724401b 100755 Binary files a/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.wasm and b/ChallengeLeaguePointSolver/ChampionsLeaguePointSolver.wasm differ diff --git a/ChallengeLeaguePointSolver/olcPGEX_QuickGUI.h b/ChallengeLeaguePointSolver/olcPGEX_QuickGUI.h index 8721dd6..46bc46b 100644 --- a/ChallengeLeaguePointSolver/olcPGEX_QuickGUI.h +++ b/ChallengeLeaguePointSolver/olcPGEX_QuickGUI.h @@ -493,13 +493,13 @@ namespace olc::QuickGUI switch (nAlign) { 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; 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; 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; } } @@ -646,7 +646,7 @@ namespace olc::QuickGUI // Draw Text 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); } diff --git a/ChallengeLeaguePointSolver/pixelGameEngine_wasm.o b/ChallengeLeaguePointSolver/pixelGameEngine_wasm.o index 268c82a..6e7d63e 100644 Binary files a/ChallengeLeaguePointSolver/pixelGameEngine_wasm.o and b/ChallengeLeaguePointSolver/pixelGameEngine_wasm.o differ