new Tooltip-Handling, change Widescreen-sizing to mathematically correct value (0.75 alias 1.333), new Clock-Font

This commit is contained in:
ardi@ist-einmalig.de 2009-05-07 22:46:54 +00:00
parent 29f0691a08
commit 6e3f50efeb
17 changed files with 164 additions and 103 deletions

View File

@ -205,10 +205,10 @@ void FreeTypeGX::unloadFont() {
this->fontData.clear(); this->fontData.clear();
} }
void FreeTypeGX::changeSize(FT_UInt pointSize) { void FreeTypeGX::changeSize(FT_UInt vPointSize, FT_UInt hPointSize/*=0*/) {
this->unloadFont(); this->unloadFont();
this->ftPointSize = pointSize; this->ftPointSize = vPointSize;
FT_Set_Pixel_Sizes(this->ftFace, 0, this->ftPointSize); FT_Set_Pixel_Sizes(this->ftFace, hPointSize, this->ftPointSize);
} }
/** /**

View File

@ -270,7 +270,7 @@ class FreeTypeGX {
uint16_t loadFont(uint8_t* fontBuffer, FT_Long bufferSize, FT_UInt pointSize, bool cacheAll = false); uint16_t loadFont(uint8_t* fontBuffer, FT_Long bufferSize, FT_UInt pointSize, bool cacheAll = false);
uint16_t loadFont(const uint8_t* fontBuffer, FT_Long bufferSize, FT_UInt pointSize, bool cacheAll = false); uint16_t loadFont(const uint8_t* fontBuffer, FT_Long bufferSize, FT_UInt pointSize, bool cacheAll = false);
void changeSize(FT_UInt pointSize); void changeSize(FT_UInt vPointSize, FT_UInt hPointSize=0);
uint16_t drawText(int16_t x, int16_t y, wchar_t *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL); uint16_t drawText(int16_t x, int16_t y, wchar_t *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL);
uint16_t drawText(int16_t x, int16_t y, wchar_t const *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL); uint16_t drawText(int16_t x, int16_t y, wchar_t const *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL);

View File

@ -248,7 +248,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
THEME.info_g = 154; THEME.info_g = 154;
THEME.info_b = 192; THEME.info_b = 192;
THEME.clock_x = 0; THEME.clock_x = 0;
THEME.clock_y = -128; THEME.clock_y = 330;
THEME.clockAlign = CFG_ALIGN_CENTRE; THEME.clockAlign = CFG_ALIGN_CENTRE;
THEME.sdcard_x = 160; THEME.sdcard_x = 160;
THEME.sdcard_y = 390; THEME.sdcard_y = 390;

View File

@ -53,8 +53,17 @@ extern const u32 button_click_pcm_size;
extern const u8 button_click2_pcm[]; extern const u8 button_click2_pcm[];
extern const u32 button_click2_pcm_size; extern const u32 button_click2_pcm_size;
extern const u8 tooltip_png[]; ///extern const u8 tooltip_png[];
extern const u32 tooltip_png_size; ///extern const u32 tooltip_png_size;
extern const u8 tooltip_left_png[];
extern const u32 tooltip_left_png_size;
extern const u8 tooltip_tile_png[];
extern const u32 tooltip_tile_png_size;
extern const u8 tooltip_right_png[];
extern const u32 tooltip_right_png_size;
extern const u8 startgame_arrow_left_png[]; extern const u8 startgame_arrow_left_png[];
extern const u32 startgame_arrow_left_png_size; extern const u32 startgame_arrow_left_png_size;
@ -62,11 +71,11 @@ extern const u32 startgame_arrow_left_png_size;
extern const u8 startgame_arrow_right_png[]; extern const u8 startgame_arrow_right_png[];
extern const u32 startgame_arrow_right_png_size; extern const u32 startgame_arrow_right_png_size;
extern const u8 tooltip_medium_png[]; ///extern const u8 tooltip_medium_png[];
extern const u32 tooltip_medium_png_size; ///extern const u32 tooltip_medium_png_size;
extern const u8 tooltip_large_png[]; ///extern const u8 tooltip_large_png[];
extern const u32 tooltip_large_png_size; ///extern const u32 tooltip_large_png_size;
extern const u8 credits_bg_png[]; extern const u8 credits_bg_png[];
extern const u32 credits_bg_png_size; extern const u32 credits_bg_png_size;

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

View File

@ -301,7 +301,7 @@ class GuiElement
void SetScale(float s); void SetScale(float s);
//!Gets the element's current scale //!Gets the element's current scale
//!Considers scale, scaleDyn, and the parent element's GetScale() value //!Considers scale, scaleDyn, and the parent element's GetScale() value
float GetScale(); virtual float GetScale();
//!Set a new GuiTrigger for the element //!Set a new GuiTrigger for the element
//!\param t Pointer to GuiTrigger //!\param t Pointer to GuiTrigger
void SetTrigger(GuiTrigger * t); void SetTrigger(GuiTrigger * t);
@ -551,7 +551,7 @@ class GuiImage : public GuiElement
//!Sets the number of times to draw the image horizontally //!Sets the number of times to draw the image horizontally
//!\param t Number of times to draw the image //!\param t Number of times to draw the image
void SetTile(int t); void SetTile(int t);
// not NULL set horizontal scale to 0.8 //added // not NULL set horizontal scale to 0.75 //added
void SetWidescreen(short w); void SetWidescreen(short w);
//!Constantly called to draw the image //!Constantly called to draw the image
void Draw(); void Draw();
@ -641,6 +641,8 @@ class GuiText : public GuiElement
void SetFont(FreeTypeGX *f); void SetFont(FreeTypeGX *f);
//!Get the Horizontal Size of Text //!Get the Horizontal Size of Text
int GetTextWidth(); int GetTextWidth();
// not NULL set horizontal scale to 0.75 //added
void SetWidescreen(short w);
//!Constantly called to draw the text //!Constantly called to draw the text
void Draw(); void Draw();
protected: protected:
@ -650,6 +652,7 @@ class GuiText : public GuiElement
u16 style; //!< FreeTypeGX style attributes u16 style; //!< FreeTypeGX style attributes
GXColor color; //!< Font color GXColor color; //!< Font color
FreeTypeGX *font; FreeTypeGX *font;
short widescreen; //added
}; };
//!Display, manage, and manipulate tooltips in the GUI. //!Display, manage, and manipulate tooltips in the GUI.
@ -663,17 +666,20 @@ class GuiTooltip : public GuiElement
//!Destructor //!Destructor
~ GuiTooltip(); ~ GuiTooltip();
//!Gets the element's current scale
//!Considers scale, scaleDyn, and the parent element's GetScale() value
float GetScale();
//!Sets the text of the GuiTooltip element //!Sets the text of the GuiTooltip element
//!\param t Text //!\param t Text
void SetText(const char * t); void SetText(const char * t);
void SetWidescreen(short w); // timely a dummy
//!Constantly called to draw the GuiButton //!Constantly called to draw the GuiButton
void Draw(); void Draw();
protected: protected:
static GuiImageData tooltipStd; GuiImage leftImage; //!< Tooltip left-image
static GuiImageData tooltipMedium; GuiImage tileImage; //!< Tooltip tile-image
static GuiImageData tooltipLarge; GuiImage rightImage; //!< Tooltip right-image
GuiImage image; //!< Tooltip
GuiText *text; GuiText *text;
}; };
@ -741,7 +747,7 @@ class GuiButton : public GuiElement
//!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 i Pointer to GuiImage object, t Pointer to GuiText, x & y Positioning
void SetToolTip(GuiImage* i, GuiText * t, int x, int y); // void SetToolTip(GuiImage* i, GuiText * t, int x, int y);
//!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 i Pointer to GuiImage object, t Pointer to GuiText, x & y Positioning

View File

@ -144,6 +144,7 @@ void GuiButton::SetSoundClick(GuiSound * snd)
} }
//No delay for now //No delay for now
/*
void GuiButton::SetToolTip(GuiImage* img, GuiText * txt, int x, int y) void GuiButton::SetToolTip(GuiImage* img, GuiText * txt, int x, int y)
{ {
LOCK(this); LOCK(this);
@ -162,6 +163,7 @@ void GuiButton::SetToolTip(GuiImage* img, GuiText * txt, int x, int y)
} }
} }
*/
void GuiButton::SetToolTip(GuiElement* tt, int x, int y, int h_align, int v_align) void GuiButton::SetToolTip(GuiElement* tt, int x, int y, int h_align, int v_align)
{ {
LOCK(this); LOCK(this);
@ -205,6 +207,43 @@ void GuiButton::Draw()
this->UpdateEffects(); this->UpdateEffects();
} }
void GuiButton::DrawTooltip() void GuiButton::DrawTooltip()
{
LOCK(this);
if(state == STATE_SELECTED && (toolTip || toolTip2))
{
if (time2 == 0)
{
time(&time1);
time2 = time1;
}
if(time1 != 0) // timer läuft
time(&time1);
if(time1 == 0 || difftime(time1, time2) >= 2)
{
if(time1 != 0) // timer gerade abgelaufen
if(toolTip2) toolTip2->SetEffect(EFFECT_FADE, 20);
time1 = 0;
if(toolTip2) toolTip2->Draw();
if(toolTip) toolTip->Draw();
if (toolTipTxt)
{
toolTipTxt->Draw();
}
return;
}
}
else
{
if(time2 != 0 && time1 == 0) // timer abgelaufen, gerade DESELECT
if(toolTip2) toolTip2->SetEffect(EFFECT_FADE, -20);
time2 = 0;
}
if(toolTip2 && toolTip2->GetEffect())
toolTip2->Draw();
}
/*
void GuiButton::DrawTooltip()
{ {
LOCK(this); LOCK(this);
if(state == STATE_SELECTED && (toolTip || toolTip2)) if(state == STATE_SELECTED && (toolTip || toolTip2))
@ -226,6 +265,7 @@ void GuiButton::DrawTooltip()
else else
time2 = 0; time2 = 0;
} }
*/
void GuiButton::ScrollIsOn(int f) void GuiButton::ScrollIsOn(int f)
{ {
LOCK(this); LOCK(this);

View File

@ -233,7 +233,7 @@ void GuiImage::Draw()
if(tile > 0) if(tile > 0)
{ {
for(int i=0; i<tile; i++) for(int i=0; i<tile; i++)
Menu_DrawImg(currLeft+width*i, this->GetTop(), width, height, image, imageangle, widescreen ? currScale*0.8 : currScale, currScale, this->GetAlpha()); Menu_DrawImg(currLeft+width*i, this->GetTop(), width, height, image, imageangle, widescreen ? currScale*0.75 : currScale, currScale, this->GetAlpha());
} }
else else
{ {
@ -241,7 +241,7 @@ void GuiImage::Draw()
if(scale != 1) if(scale != 1)
currLeft = currLeft - width/2 + (width*scale)/2; currLeft = currLeft - width/2 + (width*scale)/2;
Menu_DrawImg(currLeft, this->GetTop(), width, height, image, imageangle, widescreen ? currScale*0.8 : currScale, currScale, this->GetAlpha()); Menu_DrawImg(currLeft, this->GetTop(), width, height, image, imageangle, widescreen ? currScale*0.75 : currScale, currScale, this->GetAlpha());
} }
if(stripe > 0) if(stripe > 0)

View File

@ -30,6 +30,7 @@ GuiText::GuiText(const char * t, int s, GXColor c)
style = FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE; style = FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE;
maxWidth = 0; maxWidth = 0;
font = NULL; font = NULL;
widescreen = 0; //added
alignmentHor = ALIGN_CENTRE; alignmentHor = ALIGN_CENTRE;
alignmentVert = ALIGN_MIDDLE; alignmentVert = ALIGN_MIDDLE;
@ -50,6 +51,7 @@ GuiText::GuiText(const char * t)
style = presetStyle; style = presetStyle;
maxWidth = presetMaxWidth; maxWidth = presetMaxWidth;
font = NULL; font = NULL;
widescreen = 0; //added
alignmentHor = presetAlignmentHor; alignmentHor = presetAlignmentHor;
alignmentVert = presetAlignmentVert; alignmentVert = presetAlignmentVert;
@ -166,7 +168,7 @@ int GuiText::GetTextWidth()
if(newSize != currentSize) if(newSize != currentSize)
{ {
//fontSystem->changeSize(newSize); //fontSystem->changeSize(newSize);
(font ? font : fontSystem)->changeSize(newSize); (font ? font : fontSystem)->changeSize(newSize, widescreen ? (newSize*3)>>2 : 0);
currentSize = newSize; currentSize = newSize;
} }
return (font ? font : fontSystem)->getWidth(text); return (font ? font : fontSystem)->getWidth(text);
@ -192,7 +194,7 @@ void GuiText::Draw()
if(newSize != currentSize) if(newSize != currentSize)
{ {
//fontSystem->changeSize(newSize); //fontSystem->changeSize(newSize);
(font ? font : fontSystem)->changeSize(newSize); (font ? font : fontSystem)->changeSize(newSize, widescreen ? (newSize*3)>>2 : 0);
currentSize = newSize; currentSize = newSize;
} }

View File

@ -10,18 +10,23 @@
#include "gui.h" #include "gui.h"
GuiImageData GuiTooltip::tooltipStd(tooltip_png); static GuiImageData tooltipLeft(tooltip_left_png);
GuiImageData GuiTooltip::tooltipMedium(tooltip_medium_png); static GuiImageData tooltipTile(tooltip_tile_png);
GuiImageData GuiTooltip::tooltipLarge(tooltip_large_png); static GuiImageData tooltipRight(tooltip_right_png);
/** /**
* Constructor for the GuiTooltip class. * Constructor for the GuiTooltip class.
*/ */
GuiTooltip::GuiTooltip(const char *t) GuiTooltip::GuiTooltip(const char *t)
:
leftImage(&tooltipLeft), tileImage(&tooltipTile), rightImage(&tooltipRight)
{ {
text = NULL; text = NULL;
image.SetParent(this); height = leftImage.GetHeight();
leftImage.SetParent(this);
tileImage.SetParent(this);
rightImage.SetParent(this);
SetText(t); SetText(t);
} }
@ -33,6 +38,16 @@ GuiTooltip::~GuiTooltip()
if(text) delete text; if(text) delete text;
} }
float GuiTooltip::GetScale()
{
float s = scale * scaleDyn;
// if(parentElement)
// s *= parentElement->GetScale();
return s;
}
/* !Sets the text of the GuiTooltip element /* !Sets the text of the GuiTooltip element
* !\param t Text * !\param t Text
*/ */
@ -44,24 +59,20 @@ void GuiTooltip::SetText(const char * t)
delete text; delete text;
text = NULL; text = NULL;
} }
int t_width = 24; int tile_cnt = 0;
if(t && (text = new GuiText(t, 22, (GXColor){0, 0, 0, 255}))) if(t && (text = new GuiText(t, 22, (GXColor){0, 0, 0, 255})))
{ {
text->SetParent(this); text->SetParent(this);
t_width += text->GetTextWidth(); tile_cnt = (text->GetTextWidth()-12) /tileImage.GetWidth();
if(tile_cnt < 0) tile_cnt = 0;
} }
tileImage.SetPosition(leftImage.GetWidth(), 0);
if(t_width > tooltipMedium.GetWidth()) tileImage.SetTile(tile_cnt);
image.SetImage(&tooltipLarge); rightImage.SetPosition(leftImage.GetWidth() + tile_cnt * tileImage.GetWidth(), 0);
else if(t_width > tooltipStd.GetWidth()) width = leftImage.GetWidth() + tile_cnt * tileImage.GetWidth() + rightImage.GetWidth();
image.SetImage(&tooltipMedium);
else
image.SetImage(&tooltipStd);
image.SetPosition(0, 0);
width = image.GetWidth();
height = image.GetHeight();
} }
void GuiTooltip::SetWidescreen(short){}
/* /*
* Draw the Tooltip on screen * Draw the Tooltip on screen
*/ */
@ -70,7 +81,9 @@ void GuiTooltip::Draw()
LOCK(this); LOCK(this);
if(!this->IsVisible()) return; if(!this->IsVisible()) return;
image.Draw(); leftImage.Draw();
tileImage.Draw();
rightImage.Draw();
if(text) text->Draw(); if(text) text->Draw();
this->UpdateEffects(); this->UpdateEffects();

View File

@ -1530,7 +1530,7 @@ ShowProgress (s32 done, s32 total)
// timeTxt.SetFont(fontClock); // timeTxt.SetFont(fontClock);
if ((Settings.wsprompt == yes) && (CFG.widescreen)){ if ((Settings.wsprompt == yes) && (CFG.widescreen)){
progressbarImg.SetTile(80*done/total);} progressbarImg.SetTile(75*done/total);}
else {progressbarImg.SetTile(100*done/total);} else {progressbarImg.SetTile(100*done/total);}
} }
@ -1774,7 +1774,7 @@ ProgressDownloadWindow(int choice2)
if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen
progressbarImg.SetPosition(80,40); progressbarImg.SetPosition(80,40);
progressbarImg.SetTile(80*i/cntMissFiles); progressbarImg.SetTile(75*i/cntMissFiles);
} }
else{ else{
progressbarImg.SetTile(100*i/cntMissFiles);} progressbarImg.SetTile(100*i/cntMissFiles);}
@ -2355,6 +2355,7 @@ static int MenuDiscList()
struct tm * timeinfo; struct tm * timeinfo;
char theTime[80]; char theTime[80];
int counter = 0; int counter = 0;
time_t lastrawtime=0;
WBFS_DiskSpace(&used, &freespace); WBFS_DiskSpace(&used, &freespace);
@ -2407,17 +2408,9 @@ static int MenuDiscList()
gamecntTxt.SetAlignment(THEME.gameCntAlign, ALIGN_TOP); gamecntTxt.SetAlignment(THEME.gameCntAlign, ALIGN_TOP);
gamecntTxt.SetPosition(THEME.gameCnt_x,THEME.gameCnt_y); gamecntTxt.SetPosition(THEME.gameCnt_x,THEME.gameCnt_y);
GuiImageData tooltipLarge(tooltip_large_png); GuiTooltip installBtnTT("Install a game");
GuiImage tooltipLargeImg(&tooltipLarge); if (Settings.wsprompt == yes)
if (Settings.wsprompt == yes){ installBtnTT.SetWidescreen(CFG.widescreen);///////////
tooltipLargeImg.SetWidescreen(CFG.widescreen);}///////////
GuiText ttinstallTxt("Install a game", 22, (GXColor){0, 0, 0, 255}); //TOOLTIP DATA FOR INSTALL BUTTON
GuiImageData ttinstall(tooltip_medium_png);
GuiImage ttinstallImg(&ttinstall);
if (Settings.wsprompt == yes){
ttinstallImg.SetWidescreen(CFG.widescreen);}///////////
GuiImage installBtnImg(&btnInstall); GuiImage installBtnImg(&btnInstall);
GuiImage installBtnImgOver(&btnInstallOver); GuiImage installBtnImgOver(&btnInstallOver);
installBtnImg.SetWidescreen(CFG.widescreen); //added installBtnImg.SetWidescreen(CFG.widescreen); //added
@ -2432,13 +2425,11 @@ static int MenuDiscList()
installBtn.SetTrigger(&trigA); installBtn.SetTrigger(&trigA);
installBtn.SetEffectGrow(); installBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
installBtn.SetToolTip(&ttinstallImg,&ttinstallTxt,175,-30); installBtn.SetToolTip(&installBtnTT,24,-30, ALIGN_LEFT);
GuiText ttsettingsTxt("Settings", 22, (GXColor){0, 0, 0, 255}); //TOOLTIP DATA FOR SETTINGS BUTTON GuiTooltip settingsBtnTT("Settings");
GuiImageData ttsettings(tooltip_png); if (Settings.wsprompt == yes)
GuiImage ttsettingsImg(&ttsettings); settingsBtnTT.SetWidescreen(CFG.widescreen);///////////
ttsettingsImg.SetWidescreen(CFG.widescreen);
GuiTooltip tt_settings("Settings");
GuiImage settingsBtnImg(&btnSettings); GuiImage settingsBtnImg(&btnSettings);
settingsBtnImg.SetWidescreen(CFG.widescreen); //added settingsBtnImg.SetWidescreen(CFG.widescreen); //added
@ -2453,15 +2444,12 @@ 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(&ttsettingsImg,&ttsettingsTxt,65,-30);
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
settingsBtn.SetToolTip(&tt_settings,65,-30); settingsBtn.SetToolTip(&settingsBtnTT,65,-30);
GuiText tthomeTxt("Back to HBC or Wii Menu", 22, (GXColor){0, 0, 0, 255}); //TOOLTIP DATA FOR HOME BUTTON GuiTooltip homeBtnTT("Back to HBC or Wii Menu");
GuiImageData tthome(tooltip_large_png); if (Settings.wsprompt == yes)
GuiImage tthomeImg(&tthome); homeBtnTT.SetWidescreen(CFG.widescreen);///////////
tthomeImg.SetWidescreen(CFG.widescreen);
GuiImage homeBtnImg(&btnhome); GuiImage homeBtnImg(&btnhome);
homeBtnImg.SetWidescreen(CFG.widescreen); //added homeBtnImg.SetWidescreen(CFG.widescreen); //added
@ -2478,12 +2466,11 @@ static int MenuDiscList()
homeBtn.SetTrigger(&trigHome); homeBtn.SetTrigger(&trigHome);
homeBtn.SetEffectGrow(); homeBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
homeBtn.SetToolTip(&tthomeImg,&tthomeTxt,15,-30); homeBtn.SetToolTip(&homeBtnTT,15,-30);
GuiText ttpoweroffTxt("Power off the Wii", 22, (GXColor){0, 0, 0, 255}); //TOOLTIP DATA FOR POWER BUTTON GuiTooltip poweroffBtnTT("Power off the Wii");
GuiImageData ttpoweroff(tooltip_medium_png); if (Settings.wsprompt == yes)
GuiImage ttpoweroffImg(&ttpoweroff); poweroffBtnTT.SetWidescreen(CFG.widescreen);///////////
ttpoweroffImg.SetWidescreen(CFG.widescreen);
GuiImage poweroffBtnImg(&btnpwroff); GuiImage poweroffBtnImg(&btnpwroff);
@ -2500,13 +2487,12 @@ static int MenuDiscList()
poweroffBtn.SetTrigger(&trigA); poweroffBtn.SetTrigger(&trigA);
poweroffBtn.SetEffectGrow(); poweroffBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
poweroffBtn.SetToolTip(&ttpoweroffImg,&ttpoweroffTxt,-10,-30); poweroffBtn.SetToolTip(&poweroffBtnTT,-10,-30);
GuiText ttsdcardTxt("Reload SD", 22, (GXColor){0, 0, 0, 255}); //TOOLTIP DATA FOR SETTINGS BUTTON GuiTooltip sdcardBtnTT("Reload SD");
GuiImageData ttsdcard(tooltip_png); if (Settings.wsprompt == yes)
GuiImage ttsdcardImg(&ttsdcard); sdcardBtnTT.SetWidescreen(CFG.widescreen);///////////
ttsdcardImg.SetWidescreen(CFG.widescreen);
GuiImage sdcardImg(&btnsdcard); GuiImage sdcardImg(&btnsdcard);
sdcardImg.SetWidescreen(CFG.widescreen); sdcardImg.SetWidescreen(CFG.widescreen);
@ -2519,26 +2505,26 @@ static int MenuDiscList()
sdcardBtn.SetTrigger(&trigA); sdcardBtn.SetTrigger(&trigA);
sdcardBtn.SetEffectGrow(); sdcardBtn.SetEffectGrow();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
sdcardBtn.SetToolTip(&ttsdcardImg,&ttsdcardTxt,95,-40); sdcardBtn.SetToolTip(&sdcardBtnTT,95,-40);
//Downloading Covers //Downloading Covers
GuiText ttDownloadTxt("Click to Download Covers", 20, (GXColor){0, 0, 0, 255}); //TOOLTIP DATA FOR DOWNLOAD GuiTooltip DownloadBtnTT("Click to Download Covers");
GuiImageData ttDownload(tooltip_large_png); if (Settings.wsprompt == yes)
GuiImage ttDownloadImg(&ttDownload); DownloadBtnTT.SetWidescreen(CFG.widescreen);///////////
ttDownloadImg.SetWidescreen(CFG.widescreen);
GuiButton DownloadBtn(160,224); GuiButton DownloadBtn(160,224);
DownloadBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP); DownloadBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
DownloadBtn.SetPosition(THEME.cover_x,THEME.cover_y);//(20, 300); DownloadBtn.SetPosition(THEME.cover_x,THEME.cover_y);//(20, 300);
DownloadBtn.SetSoundOver(&btnSoundOver);
if (CFG.godmode == 1){//only make the button have trigger & tooltip if in godmode if (CFG.godmode == 1)
DownloadBtn.SetTrigger(&trigA); {//only make the button have trigger & tooltip if in godmode
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0){ DownloadBtn.SetSoundOver(&btnSoundOver);
DownloadBtn.SetToolTip(&ttDownloadImg,&ttDownloadTxt,205,-30); DownloadBtn.SetTrigger(&trigA);
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
DownloadBtn.SetToolTip(&DownloadBtnTT,205,-30);
} }
} else
DownloadBtn.SetRumble(false);
#ifdef HW_RVL #ifdef HW_RVL
int i = 0, level; int i = 0, level;
char txt[3]; char txt[3];
@ -2585,12 +2571,12 @@ static int MenuDiscList()
gameBrowser.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); gameBrowser.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
GuiText clockTimeBack("88:88", 40, (GXColor){138, 138, 138, 40}); GuiText clockTimeBack("88:88", 40, (GXColor){138, 138, 138, 40});
clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_BOTTOM); clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_TOP);
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y); clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y);
clockTimeBack.SetFont(fontClock); clockTimeBack.SetFont(fontClock);
GuiText clockTime(theTime, 40, (GXColor){138, 138, 138, 240}); GuiText clockTime(theTime, 40, (GXColor){138, 138, 138, 240});
clockTime.SetAlignment(THEME.clockAlign, ALIGN_BOTTOM); clockTime.SetAlignment(THEME.clockAlign, ALIGN_TOP);
clockTime.SetPosition(THEME.clock_x, THEME.clock_y); clockTime.SetPosition(THEME.clock_x, THEME.clock_y);
clockTime.SetFont(fontClock); clockTime.SetFont(fontClock);
@ -2642,10 +2628,14 @@ static int MenuDiscList()
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
//CLOCK //CLOCK
if ((Settings.hddinfo == Clock)&&(counter % 2000 == 0)) {//only update the clock every 2000 loops time_t rawtime = time(0); //this fixes code dump caused by the clock
time_t rawtime = time(0); //this fixes code dump caused by the clock if (Settings.hddinfo == Clock && rawtime != lastrawtime) {//only update the clock every 2000 loops
timeinfo = localtime (&rawtime); lastrawtime = rawtime;
strftime(theTime, sizeof(theTime), "%H:%M", timeinfo); timeinfo = localtime (&rawtime);
if(rawtime & 1)
strftime(theTime, sizeof(theTime), "%H:%M", timeinfo);
else
strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
clockTime.SetText(theTime); clockTime.SetText(theTime);
} }
counter++; counter++;
@ -3469,12 +3459,12 @@ static int MenuSettings()
page1Btn.SetSoundClick(&btnClick); page1Btn.SetSoundClick(&btnClick);
page1Btn.SetTrigger(&trigA); page1Btn.SetTrigger(&trigA);
GuiImageData ttpage(tooltip_png); GuiTooltip page1BtnTT("Go to Page 1");
GuiText ttpage1Txt("Go to Page 1", 20, (GXColor){0, 0, 0, 255}); if (Settings.wsprompt == yes)
GuiImage ttpage1Img(&ttpage); page1BtnTT.SetWidescreen(CFG.widescreen);///////////
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
page1Btn.SetToolTip(&ttpage1Img,&ttpage1Txt,105, 15); page1Btn.SetToolTip(&page1BtnTT,105, 15);
GuiImage page2Img(&page2); GuiImage page2Img(&page2);
@ -3487,11 +3477,12 @@ static int MenuSettings()
page2Btn.SetSoundClick(&btnClick); page2Btn.SetSoundClick(&btnClick);
page2Btn.SetTrigger(&trigA); page2Btn.SetTrigger(&trigA);
GuiText ttpage2Txt("Go to Page 2", 20, (GXColor){0, 0, 0, 255}); GuiTooltip page2BtnTT("Go to Page 2");
GuiImage ttpage2Img(&ttpage); if (Settings.wsprompt == yes)
page2BtnTT.SetWidescreen(CFG.widescreen);///////////
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0) if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
page2Btn.SetToolTip(&ttpage2Img,&ttpage2Txt,105,0); page2Btn.SetToolTip(&page2BtnTT,105,0);
//////////////////////////////// ////////////////////////////////