remove old ToolTip-Code

This commit is contained in:
ardi@ist-einmalig.de 2009-05-08 14:23:05 +00:00
parent 916dd71f65
commit 339ea60337
3 changed files with 23 additions and 67 deletions

View File

@ -746,11 +746,7 @@ class GuiButton : public GuiElement
void SetSoundClick(GuiSound * s); void SetSoundClick(GuiSound * s);
//!Constantly called to draw the GuiButtons ToolTip //!Constantly called to draw the GuiButtons ToolTip
//!Sets the button's Tooltip on over //!Sets the button's Tooltip on over
//!\param i Pointer to GuiImage object, t Pointer to GuiText, x & y Positioning //!\param tt Pointer to GuiElement object, x & y Positioning, h & v Align
// void SetToolTip(GuiImage* i, GuiText * t, int x, int y);
//!Constantly called to draw the GuiButtons ToolTip
//!Sets the button's Tooltip on over
//!\param i Pointer to GuiImage object, t Pointer to GuiText, x & y Positioning
void SetToolTip(GuiElement* tt, int x, int y, int h=ALIGN_RIGHT, int v=ALIGN_TOP); void SetToolTip(GuiElement* tt, int x, int y, int h=ALIGN_RIGHT, int v=ALIGN_TOP);
//!Constantly called to draw the GuiButton //!Constantly called to draw the GuiButton
void Draw(); void Draw();
@ -769,9 +765,7 @@ class GuiButton : public GuiElement
GuiImage * iconOver; //!< Button icon for STATE_SELECTED GuiImage * iconOver; //!< Button icon for STATE_SELECTED
GuiImage * iconHold; //!< Button icon for STATE_HELD GuiImage * iconHold; //!< Button icon for STATE_HELD
GuiImage * iconClick; //!< Button icon for STATE_CLICKED GuiImage * iconClick; //!< Button icon for STATE_CLICKED
GuiImage * toolTip; //!< Tooltip for STATE_SELECTED GuiElement *toolTip;
GuiText * toolTipTxt;//!< Tooltip Text
GuiElement *toolTip2;
time_t time1, time2;//!< Tooltip timeconstants time_t time1, time2;//!< Tooltip timeconstants
GuiText * label[3]; //!< Label(s) to display (default) GuiText * label[3]; //!< Label(s) to display (default)
GuiText * labelOver[3]; //!< Label(s) to display for STATE_SELECTED GuiText * labelOver[3]; //!< Label(s) to display for STATE_SELECTED

View File

@ -29,8 +29,6 @@ GuiButton::GuiButton(int w, int h)
iconHold = NULL; iconHold = NULL;
iconClick = NULL; iconClick = NULL;
toolTip = NULL; toolTip = NULL;
toolTip2 = NULL;
toolTipTxt = NULL;
for(int i=0; i < 3; i++) for(int i=0; i < 3; i++)
{ {
@ -169,10 +167,10 @@ void GuiButton::SetToolTip(GuiElement* tt, int x, int y, int h_align, int v_alig
LOCK(this); LOCK(this);
if(tt) if(tt)
{ {
toolTip2 = tt; toolTip = tt;
toolTip2->SetParent(this); toolTip->SetParent(this);
toolTip2->SetAlignment(h_align, v_align); toolTip->SetAlignment(h_align, v_align);
toolTip2->SetPosition(x,y); toolTip->SetPosition(x,y);
} }
} }
@ -209,7 +207,7 @@ void GuiButton::Draw()
void GuiButton::DrawTooltip() void GuiButton::DrawTooltip()
{ {
LOCK(this); LOCK(this);
if(state == STATE_SELECTED && (toolTip || toolTip2)) if(state == STATE_SELECTED && toolTip)
{ {
if (time2 == 0) if (time2 == 0)
{ {
@ -222,50 +220,21 @@ void GuiButton::DrawTooltip()
if(time1 == 0 || difftime(time1, time2) >= 2) if(time1 == 0 || difftime(time1, time2) >= 2)
{ {
if(time1 != 0) // timer gerade abgelaufen if(time1 != 0) // timer gerade abgelaufen
if(toolTip2) toolTip2->SetEffect(EFFECT_FADE, 20); toolTip->SetEffect(EFFECT_FADE, 20);
time1 = 0; time1 = 0;
if(toolTip2) toolTip2->Draw(); toolTip->Draw();
if(toolTip) toolTip->Draw();
if (toolTipTxt)
{
toolTipTxt->Draw();
}
return; return;
} }
} }
else else
{ {
if(time2 != 0 && time1 == 0) // timer abgelaufen, gerade DESELECT if(time2 != 0 && time1 == 0) // timer abgelaufen, gerade DESELECT
if(toolTip2) toolTip2->SetEffect(EFFECT_FADE, -20); if(toolTip) toolTip->SetEffect(EFFECT_FADE, -20);
time2 = 0; time2 = 0;
} }
if(toolTip2 && toolTip2->GetEffect()) if(toolTip && toolTip->GetEffect())
toolTip2->Draw(); toolTip->Draw();
} }
/*
void GuiButton::DrawTooltip()
{
LOCK(this);
if(state == STATE_SELECTED && (toolTip || toolTip2))
{
if (time2 == 0)
time(&time2);
time(&time1);
if (difftime(time1, time2) >= 2) {
if(toolTip) toolTip->Draw();
if(toolTip2) toolTip2->Draw();
if (toolTipTxt)
{
toolTipTxt->Draw();
}
}
}
else
time2 = 0;
}
*/
void GuiButton::ScrollIsOn(int f) void GuiButton::ScrollIsOn(int f)
{ {
LOCK(this); LOCK(this);

View File

@ -1861,7 +1861,8 @@ UpdateGUI (void *arg)
else else
{ {
mainWindow->Draw(); mainWindow->Draw();
mainWindow->DrawTooltip(); if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
mainWindow->DrawTooltip();
#ifdef HW_RVL #ifdef HW_RVL
for(int i=3; i >= 0; i--) // so that player 1's cursor appears on top! for(int i=3; i >= 0; i--) // so that player 1's cursor appears on top!
@ -1871,7 +1872,7 @@ UpdateGUI (void *arg)
96, 96, pointer[i]->GetImage(), userInput[i].wpad.ir.angle, CFG.widescreen? 0.8 : 1, 1, 255); 96, 96, pointer[i]->GetImage(), userInput[i].wpad.ir.angle, CFG.widescreen? 0.8 : 1, 1, 255);
if(Settings.rumble == RumbleOn) if(Settings.rumble == RumbleOn)
{ {
DoRumble(i); DoRumble(i);
} }
} }
#endif #endif
@ -2424,8 +2425,7 @@ static int MenuDiscList()
installBtn.SetSoundClick(&btnClick); installBtn.SetSoundClick(&btnClick);
installBtn.SetTrigger(&trigA); installBtn.SetTrigger(&trigA);
installBtn.SetEffectGrow(); installBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) installBtn.SetToolTip(&installBtnTT,24,-30, ALIGN_LEFT);
installBtn.SetToolTip(&installBtnTT,24,-30, ALIGN_LEFT);
GuiTooltip settingsBtnTT("Settings"); GuiTooltip settingsBtnTT("Settings");
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes)
@ -2444,8 +2444,7 @@ static int MenuDiscList()
settingsBtn.SetSoundClick(&btnClick); settingsBtn.SetSoundClick(&btnClick);
settingsBtn.SetTrigger(&trigA); settingsBtn.SetTrigger(&trigA);
settingsBtn.SetEffectGrow(); settingsBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) settingsBtn.SetToolTip(&settingsBtnTT,65,-30);
settingsBtn.SetToolTip(&settingsBtnTT,65,-30);
GuiTooltip homeBtnTT("Back to HBC or Wii Menu"); GuiTooltip homeBtnTT("Back to HBC or Wii Menu");
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes)
@ -2465,8 +2464,7 @@ static int MenuDiscList()
homeBtn.SetTrigger(&trigA); homeBtn.SetTrigger(&trigA);
homeBtn.SetTrigger(&trigHome); homeBtn.SetTrigger(&trigHome);
homeBtn.SetEffectGrow(); homeBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) homeBtn.SetToolTip(&homeBtnTT,15,-30);
homeBtn.SetToolTip(&homeBtnTT,15,-30);
GuiTooltip poweroffBtnTT("Power off the Wii"); GuiTooltip poweroffBtnTT("Power off the Wii");
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes)
@ -2486,8 +2484,7 @@ static int MenuDiscList()
poweroffBtn.SetSoundClick(&btnClick); poweroffBtn.SetSoundClick(&btnClick);
poweroffBtn.SetTrigger(&trigA); poweroffBtn.SetTrigger(&trigA);
poweroffBtn.SetEffectGrow(); poweroffBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) poweroffBtn.SetToolTip(&poweroffBtnTT,-10,-30);
poweroffBtn.SetToolTip(&poweroffBtnTT,-10,-30);
GuiTooltip sdcardBtnTT("Reload SD"); GuiTooltip sdcardBtnTT("Reload SD");
@ -2504,8 +2501,7 @@ static int MenuDiscList()
sdcardBtn.SetSoundClick(&btnClick); sdcardBtn.SetSoundClick(&btnClick);
sdcardBtn.SetTrigger(&trigA); sdcardBtn.SetTrigger(&trigA);
sdcardBtn.SetEffectGrow(); sdcardBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) sdcardBtn.SetToolTip(&sdcardBtnTT,95,-40);
sdcardBtn.SetToolTip(&sdcardBtnTT,95,-40);
//Downloading Covers //Downloading Covers
GuiTooltip DownloadBtnTT("Click to Download Covers"); GuiTooltip DownloadBtnTT("Click to Download Covers");
@ -2520,8 +2516,7 @@ static int MenuDiscList()
{//only make the button have trigger & tooltip if in godmode {//only make the button have trigger & tooltip if in godmode
DownloadBtn.SetSoundOver(&btnSoundOver); DownloadBtn.SetSoundOver(&btnSoundOver);
DownloadBtn.SetTrigger(&trigA); DownloadBtn.SetTrigger(&trigA);
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) DownloadBtn.SetToolTip(&DownloadBtnTT,205,-30);
DownloadBtn.SetToolTip(&DownloadBtnTT,205,-30);
} }
else else
DownloadBtn.SetRumble(false); DownloadBtn.SetRumble(false);
@ -3463,8 +3458,7 @@ static int MenuSettings()
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes)
page1BtnTT.SetWidescreen(CFG.widescreen);/////////// page1BtnTT.SetWidescreen(CFG.widescreen);///////////
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) page1Btn.SetToolTip(&page1BtnTT,105, 15);
page1Btn.SetToolTip(&page1BtnTT,105, 15);
GuiImage page2Img(&page2); GuiImage page2Img(&page2);
@ -3481,8 +3475,7 @@ static int MenuSettings()
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes)
page2BtnTT.SetWidescreen(CFG.widescreen);/////////// page2BtnTT.SetWidescreen(CFG.widescreen);///////////
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) page2Btn.SetToolTip(&page2BtnTT,105,0);
page2Btn.SetToolTip(&page2BtnTT,105,0);
//////////////////////////////// ////////////////////////////////