mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-12-19 00:11:55 +01:00
*Added tooltip to scrollbararrows and Tabs in settings.
This commit is contained in:
parent
8edbd2e1b1
commit
7ed41e0491
@ -172,24 +172,6 @@ void GuiButton::Draw()
|
|||||||
label[i]->Draw();
|
label[i]->Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw ToolTip
|
|
||||||
/*
|
|
||||||
if(state == STATE_SELECTED && toolTip)
|
|
||||||
{
|
|
||||||
if (time2 == 0)
|
|
||||||
time(&time2);
|
|
||||||
|
|
||||||
time(&time1);
|
|
||||||
|
|
||||||
if (difftime(time1, time2) >= 2) {
|
|
||||||
toolTip->Draw();
|
|
||||||
if (toolTipTxt)
|
|
||||||
{
|
|
||||||
toolTipTxt->Draw();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
this->UpdateEffects();
|
this->UpdateEffects();
|
||||||
}
|
}
|
||||||
void GuiButton::DrawTooltip()
|
void GuiButton::DrawTooltip()
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "gui_gamebrowser.h"
|
#include "gui_gamebrowser.h"
|
||||||
#include "../cfg.h"
|
#include "../cfg.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
#define GAMESELECTSIZE 30
|
#define GAMESELECTSIZE 30
|
||||||
extern const int vol;
|
extern const int vol;
|
||||||
@ -83,6 +84,16 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
|
|||||||
arrowUpBtn->SetEffectOnOver(EFFECT_SCALE, 50, 130);
|
arrowUpBtn->SetEffectOnOver(EFFECT_SCALE, 50, 130);
|
||||||
arrowUpBtn->SetSoundClick(btnSoundClick);
|
arrowUpBtn->SetSoundClick(btnSoundClick);
|
||||||
|
|
||||||
|
snprintf(imgPath, sizeof(imgPath), "%stooltip.png", themePath);
|
||||||
|
ttarrow = new GuiImageData(imgPath, tooltip_png);
|
||||||
|
ttarrowUpImg = new GuiImage(ttarrow);
|
||||||
|
|
||||||
|
ttarrowUpTxt = new GuiText("Scroll up", 20, (GXColor){0, 0, 0, 255});
|
||||||
|
|
||||||
|
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0){
|
||||||
|
arrowUpBtn->SetToolTip(ttarrowUpImg,ttarrowUpTxt, -45, 0);
|
||||||
|
}
|
||||||
|
|
||||||
arrowDownBtn = new GuiButton(arrowDownImg->GetWidth(), arrowDownImg->GetHeight());
|
arrowDownBtn = new GuiButton(arrowDownImg->GetWidth(), arrowDownImg->GetHeight());
|
||||||
arrowDownBtn->SetParent(this);
|
arrowDownBtn->SetParent(this);
|
||||||
arrowDownBtn->SetImage(arrowDownImg);
|
arrowDownBtn->SetImage(arrowDownImg);
|
||||||
@ -95,6 +106,13 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
|
|||||||
arrowDownBtn->SetEffectOnOver(EFFECT_SCALE, 50, 130);
|
arrowDownBtn->SetEffectOnOver(EFFECT_SCALE, 50, 130);
|
||||||
arrowDownBtn->SetSoundClick(btnSoundClick);
|
arrowDownBtn->SetSoundClick(btnSoundClick);
|
||||||
|
|
||||||
|
ttarrowDownImg = new GuiImage(ttarrow);
|
||||||
|
ttarrowDownTxt = new GuiText("Scroll down", 20, (GXColor){0, 0, 0, 255});
|
||||||
|
|
||||||
|
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0){
|
||||||
|
arrowDownBtn->SetToolTip(ttarrowDownImg,ttarrowDownTxt, -5,-35);
|
||||||
|
}
|
||||||
|
|
||||||
scrollbarBoxBtn = new GuiButton(scrollbarBoxImg->GetWidth(), scrollbarBoxImg->GetHeight());
|
scrollbarBoxBtn = new GuiButton(scrollbarBoxImg->GetWidth(), scrollbarBoxImg->GetHeight());
|
||||||
scrollbarBoxBtn->SetParent(this);
|
scrollbarBoxBtn->SetParent(this);
|
||||||
scrollbarBoxBtn->SetImage(scrollbarBoxImg);
|
scrollbarBoxBtn->SetImage(scrollbarBoxImg);
|
||||||
@ -173,6 +191,11 @@ GuiGameBrowser::~GuiGameBrowser()
|
|||||||
delete bgGameImg;
|
delete bgGameImg;
|
||||||
delete bgGames;
|
delete bgGames;
|
||||||
delete bgGamesEntry;
|
delete bgGamesEntry;
|
||||||
|
delete ttarrow;
|
||||||
|
delete ttarrowUpImg;
|
||||||
|
delete ttarrowDownImg;
|
||||||
|
delete ttarrowDownTxt;
|
||||||
|
delete ttarrowUpTxt;
|
||||||
|
|
||||||
delete trigA;
|
delete trigA;
|
||||||
delete btnSoundClick;
|
delete btnSoundClick;
|
||||||
@ -285,6 +308,7 @@ void GuiGameBrowser::Draw()
|
|||||||
if(next >= 0)
|
if(next >= 0)
|
||||||
{
|
{
|
||||||
game[i]->Draw();
|
game[i]->Draw();
|
||||||
|
game[i]->DrawTooltip();
|
||||||
next = this->FindMenuItem(next, 1);
|
next = this->FindMenuItem(next, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -296,6 +320,9 @@ void GuiGameBrowser::Draw()
|
|||||||
arrowUpBtn->Draw();
|
arrowUpBtn->Draw();
|
||||||
arrowDownBtn->Draw();
|
arrowDownBtn->Draw();
|
||||||
scrollbarBoxBtn->Draw();
|
scrollbarBoxBtn->Draw();
|
||||||
|
arrowUpBtn->DrawTooltip();
|
||||||
|
arrowDownBtn->DrawTooltip();
|
||||||
|
scrollbarBoxBtn->DrawTooltip();
|
||||||
}
|
}
|
||||||
this->UpdateEffects();
|
this->UpdateEffects();
|
||||||
}
|
}
|
||||||
|
@ -65,16 +65,22 @@ class GuiGameBrowser : public GuiElement
|
|||||||
GuiImage * scrollbarImg;
|
GuiImage * scrollbarImg;
|
||||||
GuiImage * arrowDownImg;
|
GuiImage * arrowDownImg;
|
||||||
GuiImage * arrowDownOverImg;
|
GuiImage * arrowDownOverImg;
|
||||||
|
GuiImage * ttarrowUpImg;
|
||||||
|
GuiImage * ttarrowDownImg;
|
||||||
GuiImage * arrowUpImg;
|
GuiImage * arrowUpImg;
|
||||||
GuiImage * arrowUpOverImg;
|
GuiImage * arrowUpOverImg;
|
||||||
GuiImage * scrollbarBoxImg;
|
GuiImage * scrollbarBoxImg;
|
||||||
GuiImage * scrollbarBoxOverImg;
|
GuiImage * scrollbarBoxOverImg;
|
||||||
|
|
||||||
|
GuiText * ttarrowDownTxt;
|
||||||
|
GuiText * ttarrowUpTxt;
|
||||||
|
|
||||||
GuiImageData * bgGames;
|
GuiImageData * bgGames;
|
||||||
GuiImageData * bgGamesEntry;
|
GuiImageData * bgGamesEntry;
|
||||||
GuiImageData * scrollbar;
|
GuiImageData * scrollbar;
|
||||||
GuiImageData * arrowDown;
|
GuiImageData * arrowDown;
|
||||||
GuiImageData * arrowDownOver;
|
GuiImageData * arrowDownOver;
|
||||||
|
GuiImageData * ttarrow;
|
||||||
GuiImageData * arrowUp;
|
GuiImageData * arrowUp;
|
||||||
GuiImageData * arrowUpOver;
|
GuiImageData * arrowUpOver;
|
||||||
GuiImageData * scrollbarBox;
|
GuiImageData * scrollbarBox;
|
||||||
|
@ -1043,7 +1043,7 @@ int GameWindowPrompt()
|
|||||||
choice = 3;
|
choice = 3;
|
||||||
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
|
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == no)){//next game
|
else if((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == no)){//next game
|
||||||
promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50);
|
promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50);
|
||||||
changed = 1;
|
changed = 1;
|
||||||
@ -1061,7 +1061,7 @@ int GameWindowPrompt()
|
|||||||
btnLeft.ResetState();
|
btnLeft.ResetState();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == yes)){//previous game
|
else if((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == yes)){//previous game
|
||||||
promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50);
|
promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50);
|
||||||
changed = 2;
|
changed = 2;
|
||||||
@ -3280,7 +3280,6 @@ static int MenuSettings()
|
|||||||
settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||||
settingsbackgroundbtn.SetPosition(0, 0);
|
settingsbackgroundbtn.SetPosition(0, 0);
|
||||||
settingsbackgroundbtn.SetImage(&settingsbackground);
|
settingsbackgroundbtn.SetImage(&settingsbackground);
|
||||||
settingsbackgroundbtn.SetTrigger(&trigA);
|
|
||||||
|
|
||||||
GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255});
|
GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255});
|
||||||
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
||||||
@ -3305,7 +3304,15 @@ static int MenuSettings()
|
|||||||
page1Btn.SetSoundOver(&btnSoundOver);
|
page1Btn.SetSoundOver(&btnSoundOver);
|
||||||
page1Btn.SetSoundClick(&btnClick);
|
page1Btn.SetSoundClick(&btnClick);
|
||||||
page1Btn.SetTrigger(&trigA);
|
page1Btn.SetTrigger(&trigA);
|
||||||
|
|
||||||
|
GuiImageData ttpage(tooltip_png);
|
||||||
|
GuiText ttpage1Txt("Go to Page 1", 20, (GXColor){0, 0, 0, 255});
|
||||||
|
GuiImage ttpage1Img(&ttpage);
|
||||||
|
|
||||||
|
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
|
||||||
|
page1Btn.SetToolTip(&ttpage1Img,&ttpage1Txt,105, 15);
|
||||||
|
|
||||||
|
|
||||||
GuiImage page2Img(&page2);
|
GuiImage page2Img(&page2);
|
||||||
GuiImage page2dImg(&page2d);
|
GuiImage page2dImg(&page2d);
|
||||||
GuiButton page2Btn(page2.GetWidth(), page2.GetHeight());
|
GuiButton page2Btn(page2.GetWidth(), page2.GetHeight());
|
||||||
@ -3315,8 +3322,15 @@ static int MenuSettings()
|
|||||||
page2Btn.SetSoundOver(&btnSoundOver);
|
page2Btn.SetSoundOver(&btnSoundOver);
|
||||||
page2Btn.SetSoundClick(&btnClick);
|
page2Btn.SetSoundClick(&btnClick);
|
||||||
page2Btn.SetTrigger(&trigA);
|
page2Btn.SetTrigger(&trigA);
|
||||||
|
|
||||||
|
GuiText ttpage2Txt("Go to Page 2", 20, (GXColor){0, 0, 0, 255});
|
||||||
|
GuiImage ttpage2Img(&ttpage);
|
||||||
|
|
||||||
|
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0)
|
||||||
|
page2Btn.SetToolTip(&ttpage2Img,&ttpage2Txt,105,0);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
const char * text = "Unlock";
|
const char * text = "Unlock";
|
||||||
if (CFG.godmode == 1)
|
if (CFG.godmode == 1)
|
||||||
@ -3390,7 +3404,7 @@ static int MenuSettings()
|
|||||||
{
|
{
|
||||||
mainWindow->Append(&page1Btn);
|
mainWindow->Append(&page1Btn);
|
||||||
mainWindow->Append(&page2Btn);
|
mainWindow->Append(&page2Btn);
|
||||||
|
|
||||||
sprintf(options2.name[0], "Tooltips");
|
sprintf(options2.name[0], "Tooltips");
|
||||||
sprintf(options2.name[1], "Password");
|
sprintf(options2.name[1], "Password");
|
||||||
sprintf(options2.name[2], "Boot Loader in");
|
sprintf(options2.name[2], "Boot Loader in");
|
||||||
@ -3472,7 +3486,7 @@ static int MenuSettings()
|
|||||||
else if (Settings.volume == v90) sprintf (options2.value[7],"90");
|
else if (Settings.volume == v90) sprintf (options2.value[7],"90");
|
||||||
else if (Settings.volume == v100) sprintf (options2.value[7],"100");
|
else if (Settings.volume == v100) sprintf (options2.value[7],"100");
|
||||||
else if (Settings.volume == v0) sprintf (options2.value[7],"Off");
|
else if (Settings.volume == v0) sprintf (options2.value[7],"Off");
|
||||||
|
|
||||||
sprintf (options2.value[8]," ");
|
sprintf (options2.value[8]," ");
|
||||||
|
|
||||||
ret = optionBrowser2.GetClickedOption();
|
ret = optionBrowser2.GetClickedOption();
|
||||||
@ -3526,13 +3540,13 @@ static int MenuSettings()
|
|||||||
|
|
||||||
if (Settings.cios == ios249) sprintf (options2.value[2],"cIOS 249");
|
if (Settings.cios == ios249) sprintf (options2.value[2],"cIOS 249");
|
||||||
else if (Settings.cios == ios222) sprintf (options2.value[2],"cIOS 222");
|
else if (Settings.cios == ios222) sprintf (options2.value[2],"cIOS 222");
|
||||||
|
|
||||||
if (Settings.xflip == no) sprintf (options2.value[3],"No");
|
if (Settings.xflip == no) sprintf (options2.value[3],"No");
|
||||||
else if (Settings.xflip == yes) sprintf (options2.value[3],"Yes");
|
else if (Settings.xflip == yes) sprintf (options2.value[3],"Yes");
|
||||||
|
|
||||||
if (Settings.qboot == no) sprintf (options2.value[4],"No");
|
if (Settings.qboot == no) sprintf (options2.value[4],"No");
|
||||||
else if (Settings.qboot == yes) sprintf (options2.value[4],"Yes");
|
else if (Settings.qboot == yes) sprintf (options2.value[4],"Yes");
|
||||||
|
|
||||||
sprintf (options2.value[5]," ");
|
sprintf (options2.value[5]," ");
|
||||||
sprintf (options2.value[6]," ");
|
sprintf (options2.value[6]," ");
|
||||||
sprintf (options2.value[7]," ");
|
sprintf (options2.value[7]," ");
|
||||||
@ -3547,7 +3561,7 @@ static int MenuSettings()
|
|||||||
break;
|
break;
|
||||||
case 1: // Modify Password
|
case 1: // Modify Password
|
||||||
if ( CFG.godmode == 1)
|
if ( CFG.godmode == 1)
|
||||||
{
|
{
|
||||||
mainWindow->Remove(&optionBrowser2);
|
mainWindow->Remove(&optionBrowser2);
|
||||||
mainWindow->Remove(&page1Btn);
|
mainWindow->Remove(&page1Btn);
|
||||||
mainWindow->Remove(&page2Btn);
|
mainWindow->Remove(&page2Btn);
|
||||||
@ -3589,7 +3603,7 @@ static int MenuSettings()
|
|||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
if(reset == 1)
|
if(reset == 1)
|
||||||
Sys_Reboot();
|
Sys_Reboot();
|
||||||
|
|
||||||
if(page1Btn.GetState() == STATE_CLICKED)
|
if(page1Btn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
pageToDisplay = 1;
|
pageToDisplay = 1;
|
||||||
@ -3598,8 +3612,8 @@ static int MenuSettings()
|
|||||||
page2Btn.SetImage(&page2dImg);
|
page2Btn.SetImage(&page2dImg);
|
||||||
menu = MENU_NONE;
|
menu = MENU_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(page2Btn.GetState() == STATE_CLICKED)
|
if(page2Btn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
pageToDisplay = 2;
|
pageToDisplay = 2;
|
||||||
@ -3609,7 +3623,7 @@ static int MenuSettings()
|
|||||||
page2Btn.SetImage(&page2Img);
|
page2Btn.SetImage(&page2Img);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
//Add the procedure call to save the global configuration
|
//Add the procedure call to save the global configuration
|
||||||
@ -4050,7 +4064,7 @@ int MainMenu(int menu)
|
|||||||
int currentMenu = menu;
|
int currentMenu = menu;
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
|
||||||
pointer[0] = new GuiImageData(imgPath, player1_point_png);
|
pointer[0] = new GuiImageData(imgPath, player1_point_png);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user