fix issue 370, issue 376, issue 374, issue 372, and issue 358. created a new function to remove soundover from buttons.

This commit is contained in:
giantpune 2009-05-28 23:18:37 +00:00
parent 518858a351
commit 1faa39a755
4 changed files with 23 additions and 2 deletions

View File

@ -819,6 +819,8 @@ class GuiButton : public GuiElement
//!Sets the sound to play on click
//!\param s Pointer to GuiSound object
void SetSoundClick(GuiSound * s);
//!\param reset the soundover to NULL
void RemoveSoundOver();
//!Constantly called to draw the GuiButtons ToolTip
//!Sets the button's Tooltip on over
//!\param tt Pointer to GuiElement object, x & y Positioning, h & v Align

View File

@ -254,6 +254,12 @@ void GuiButton::SetToolTip(GuiElement* tt, int x, int y, int h_align, int v_alig
}
}
void GuiButton::RemoveSoundOver()
{
LOCK(this);
soundOver = NULL;
}
/**
* Draw the button on screen
*/

View File

@ -138,6 +138,7 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int gameCnt, const ch
if (((changed+pagesize)>gameCnt)&&(i>((gameCnt-changed)-1))) {
game[i]->SetVisible(false);
game[i]->SetClickable(false);
game[i]->RemoveSoundOver();
}
}
}
@ -375,10 +376,12 @@ void GuiGameGrid::Update(GuiTrigger * t)
game[i]->SetImage(coverImg[i]);
game[i]->SetVisible(true);
game[i]->SetClickable(true);
game[i]->SetSoundOver(btnSoundOver);
coverImg[i]->SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 65);
if (((changed+pagesize)>gameCnt)&&(i>((gameCnt-changed)-1))) {
game[i]->SetVisible(false);
game[i]->SetClickable(false);
game[i]->RemoveSoundOver();
}
}
btnRight->ResetState();
@ -430,11 +433,13 @@ void GuiGameGrid::Update(GuiTrigger * t)
game[i]->ResetState();
game[i]->SetVisible(true);
game[i]->SetImage(coverImg[i]);
game[i]->SetSoundOver(btnSoundOver);
game[i]->SetClickable(true);
coverImg[i]->SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 65);
if (((changed+pagesize)>gameCnt)&&(i>((gameCnt-changed)-1))) {
game[i]->SetVisible(false);
game[i]->SetClickable(false);
game[i]->RemoveSoundOver();
}
}
btnLeft->ResetState();

View File

@ -1024,7 +1024,7 @@ int GameWindowPrompt()
GuiText sizeTxt("", 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{50, 50, 50, 255}); //TODO: get the size here
sizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
sizeTxt.SetPosition(-60,70);
sizeTxt.SetPosition(-110,70);
// GuiImage diskImg;
GuiDiskCover diskImg;
@ -1084,7 +1084,15 @@ int GameWindowPrompt()
GuiImage btnFavoriteImg;
btnFavoriteImg.SetWidescreen(CFG.widescreen);
GuiButton btnFavorite(&btnFavoriteImg,&btnFavoriteImg, 2, 5, -125, -60, &trigA, &btnSoundOver, &btnClick,1);
//GuiButton btnFavorite(&btnFavoriteImg,&btnFavoriteImg, 2, 5, -125, -60, &trigA, &btnSoundOver, &btnClick,1);
GuiButton btnFavorite(imgFavorite.GetWidth(), imgFavorite.GetHeight());
btnFavorite.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
btnFavorite.SetPosition(-125, -60);
btnFavorite.SetImage(&btnFavoriteImg);
btnFavorite.SetSoundOver(&btnSoundOver);
btnFavorite.SetSoundClick(&btnClick);
btnFavorite.SetTrigger(&trigA);
btnFavorite.SetEffectGrow();
GuiImage btnLeftImg(&imgLeft);
if (Settings.wsprompt == yes)