diff options
| author | jacob1 <jfu614@gmail.com> | 2012-12-16 01:34:00 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2012-12-16 01:34:00 (GMT) |
| commit | c62ef2cb359f31f305b87e49d230f0786df28007 (patch) | |
| tree | 7ea92f44fdb8748d9699c056ca01c8cafb368d9b /src | |
| parent | e4907d18815b72bb811e4ef981c8cdff4a880a1b (diff) | |
| download | powder-c62ef2cb359f31f305b87e49d230f0786df28007.zip powder-c62ef2cb359f31f305b87e49d230f0786df28007.tar.gz | |
fix upvote buttons still having colored background after clearing the save, make them look more like from in tpt
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/GameView.cpp | 23 | ||||
| -rw-r--r-- | src/graphics/Graphics.cpp | 4 |
2 files changed, 19 insertions, 8 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index a1c7f70..be79b5c 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -817,16 +817,27 @@ void GameView::NotifySaveChanged(GameModel * sender) reloadButton->Enabled = true; upVoteButton->Enabled = (sender->GetSave()->GetID() && sender->GetUser().ID && sender->GetSave()->GetVote()==0); if(sender->GetSave()->GetID() && sender->GetUser().ID && sender->GetSave()->GetVote()==1) - upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 200, 40, 100)); + upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 108, 10, 255)); else upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); downVoteButton->Enabled = upVoteButton->Enabled; if(sender->GetSave()->GetID() && sender->GetUser().ID && sender->GetSave()->GetVote()==-1) - downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(200, 40, 40, 100)); + downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(108, 0, 10, 255)); else downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); + if (sender->GetUser().ID) + { + upVoteButton->Appearance.BorderDisabled = upVoteButton->Appearance.BorderInactive; + downVoteButton->Appearance.BorderDisabled = downVoteButton->Appearance.BorderInactive; + } + else + { + upVoteButton->Appearance.BorderDisabled = ui::Colour(10, 10, 10); + downVoteButton->Appearance.BorderDisabled = ui::Colour(10, 10, 10); + } + tagSimulationButton->Enabled = (sender->GetSave()->GetID() && sender->GetUser().ID); if(sender->GetSave()->GetID()) { @@ -862,9 +873,9 @@ void GameView::NotifySaveChanged(GameModel * sender) saveSimulationButton->SetText(sender->GetSaveFile()->GetDisplayName()); reloadButton->Enabled = true; upVoteButton->Enabled = false; - upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); + upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); downVoteButton->Enabled = false; - upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); + upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); tagSimulationButton->Enabled = false; tagSimulationButton->SetText("[no tags set]"); currentSaveType = 2; @@ -875,9 +886,9 @@ void GameView::NotifySaveChanged(GameModel * sender) saveSimulationButton->SetText("[untitled simulation]"); reloadButton->Enabled = false; upVoteButton->Enabled = false; - upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); + upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); downVoteButton->Enabled = false; - upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); + upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); tagSimulationButton->Enabled = false; tagSimulationButton->SetText("[no tags set]"); currentSaveType = 0; diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp index c3a5aca..974a169 100644 --- a/src/graphics/Graphics.cpp +++ b/src/graphics/Graphics.cpp @@ -824,9 +824,9 @@ void Graphics::draw_icon(int x, int y, Icon icon, unsigned char alpha, bool inve break; case IconVoteUp: if(invert) - drawchar(x, y, 0xCB, 0, 100, 0, alpha); + drawchar(x, y+1, 0xCB, 0, 100, 0, alpha); else - drawchar(x, y, 0xCB, 0, 187, 18, alpha); + drawchar(x, y+1, 0xCB, 0, 187, 18, alpha); break; case IconVoteDown: if(invert) |
