Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix upvote buttons still having colored background after clearing the…

… save, make them look more like from in tpt
  • Loading branch information...
commit c62ef2cb359f31f305b87e49d230f0786df28007 1 parent e4907d1
@jacob1 jacob1 authored
Showing with 20 additions and 8 deletions.
  1. +1 −0  .gitignore
  2. +17 −6 src/game/GameView.cpp
  3. +2 −2 src/graphics/Graphics.cpp
View
1  .gitignore
@@ -32,6 +32,7 @@ Makefile.me
*.manifest.res
*manifest.rc
*res.res
+*.idb
*.obj
*.tlog
*.lib
View
23 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;
View
4 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)
Please sign in to comment.
Something went wrong with that request. Please try again.