fix upvote buttons still having colored background after clearing the save, make them look more like from in tpt

This commit is contained in:
jacob1 2012-12-15 20:34:00 -05:00
parent e4907d1881
commit c62ef2cb35
3 changed files with 20 additions and 8 deletions

1
.gitignore vendored
View File

@ -32,6 +32,7 @@ Makefile.me
*.manifest.res *.manifest.res
*manifest.rc *manifest.rc
*res.res *res.res
*.idb
*.obj *.obj
*.tlog *.tlog
*.lib *.lib

View File

@ -817,16 +817,27 @@ void GameView::NotifySaveChanged(GameModel * sender)
reloadButton->Enabled = true; reloadButton->Enabled = true;
upVoteButton->Enabled = (sender->GetSave()->GetID() && sender->GetUser().ID && sender->GetSave()->GetVote()==0); upVoteButton->Enabled = (sender->GetSave()->GetID() && sender->GetUser().ID && sender->GetSave()->GetVote()==0);
if(sender->GetSave()->GetID() && sender->GetUser().ID && sender->GetSave()->GetVote()==1) 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 else
upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
downVoteButton->Enabled = upVoteButton->Enabled; downVoteButton->Enabled = upVoteButton->Enabled;
if(sender->GetSave()->GetID() && sender->GetUser().ID && sender->GetSave()->GetVote()==-1) 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 else
downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0)); 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); tagSimulationButton->Enabled = (sender->GetSave()->GetID() && sender->GetUser().ID);
if(sender->GetSave()->GetID()) if(sender->GetSave()->GetID())
{ {
@ -862,9 +873,9 @@ void GameView::NotifySaveChanged(GameModel * sender)
saveSimulationButton->SetText(sender->GetSaveFile()->GetDisplayName()); saveSimulationButton->SetText(sender->GetSaveFile()->GetDisplayName());
reloadButton->Enabled = true; reloadButton->Enabled = true;
upVoteButton->Enabled = false; upVoteButton->Enabled = false;
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
downVoteButton->Enabled = false; downVoteButton->Enabled = false;
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
tagSimulationButton->Enabled = false; tagSimulationButton->Enabled = false;
tagSimulationButton->SetText("[no tags set]"); tagSimulationButton->SetText("[no tags set]");
currentSaveType = 2; currentSaveType = 2;
@ -875,9 +886,9 @@ void GameView::NotifySaveChanged(GameModel * sender)
saveSimulationButton->SetText("[untitled simulation]"); saveSimulationButton->SetText("[untitled simulation]");
reloadButton->Enabled = false; reloadButton->Enabled = false;
upVoteButton->Enabled = false; upVoteButton->Enabled = false;
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
downVoteButton->Enabled = false; downVoteButton->Enabled = false;
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0)); upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
tagSimulationButton->Enabled = false; tagSimulationButton->Enabled = false;
tagSimulationButton->SetText("[no tags set]"); tagSimulationButton->SetText("[no tags set]");
currentSaveType = 0; currentSaveType = 0;

View File

@ -824,9 +824,9 @@ void Graphics::draw_icon(int x, int y, Icon icon, unsigned char alpha, bool inve
break; break;
case IconVoteUp: case IconVoteUp:
if(invert) if(invert)
drawchar(x, y, 0xCB, 0, 100, 0, alpha); drawchar(x, y+1, 0xCB, 0, 100, 0, alpha);
else else
drawchar(x, y, 0xCB, 0, 187, 18, alpha); drawchar(x, y+1, 0xCB, 0, 187, 18, alpha);
break; break;
case IconVoteDown: case IconVoteDown:
if(invert) if(invert)