Skip to content

Commit

Permalink
KOTOR: Fix disappearing text on mouse over.
Browse files Browse the repository at this point in the history
  • Loading branch information
ImperatorPrime committed Apr 25, 2013
1 parent 65f82aa commit 2bfbbdd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/engines/kotor/gui/widgets/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,20 @@ void WidgetButton::mouseUp(uint8 state, float x, float y) {
void WidgetButton::enter() {
float r, g, b, a;
_sound = playSound("gui_actscroll", Sound::kSoundTypeSFX);
_text->getColor(_unselectedR, _unselectedG, _unselectedB, _unselectedA);
_text->getHighlightedLowerBound(r, g, b, a);
_text->setColor(r, g, b, a);
_text->setHighlighted(true);
if(getTextHighlightableComponent()->isHighlightable()) {
_text->getColor(_unselectedR, _unselectedG, _unselectedB, _unselectedA);
_text->getHighlightedLowerBound(r, g, b, a);
_text->setColor(r, g, b, a);
_text->setHighlighted(true);
}
}

void WidgetButton::leave() {
SoundMan.stopChannel(_sound);
_text->setHighlighted(false);
_text->setColor(_unselectedR, _unselectedG, _unselectedB, _unselectedA);
if(getTextHighlightableComponent()->isHighlightable()) {
_text->setHighlighted(false);
_text->setColor(_unselectedR, _unselectedG, _unselectedB, _unselectedA);
}
}

} // End of namespace KotOR
Expand Down

0 comments on commit 2bfbbdd

Please sign in to comment.