本文整理汇总了C++中GuiTrigger::SetButtonOnlyTrigger方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiTrigger::SetButtonOnlyTrigger方法的具体用法?C++ GuiTrigger::SetButtonOnlyTrigger怎么用?C++ GuiTrigger::SetButtonOnlyTrigger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiTrigger
的用法示例。
在下文中一共展示了GuiTrigger::SetButtonOnlyTrigger方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eraseCategory
/****************************************************************************
* Kategorie entfernen
***************************************************************************/
string eraseCategory()
{
bool stop = true;
int kategorieInt = 1;
string kategoriename = AvailableCategory.categories[kategorieInt];
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiWindow promptWindow(520,360);
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
GuiImageData dialogBox(Theme.dialog_background);
GuiImage dialogBoxImg(&dialogBox);
GuiImageData btnOutline(Theme.button_small);
GuiImageData btnOutlineOver(Theme.button_small_focus);
GuiText zeile1Txt(tr("Remove Category"), 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
zeile1Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
zeile1Txt.SetPosition(0, -100);
GuiText zeile2Txt(AvailableCategory.categories[1].c_str(), 24, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
zeile2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
zeile2Txt.SetPosition(0, -10);
GuiText zeile4Txt(tr("Select Category (-/+)"), 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
zeile4Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
zeile4Txt.SetPosition(0, 60);
GuiText okTxt(tr("Yes"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
GuiImage okImg(&btnOutline);
GuiImage okImgOver(&btnOutlineOver);
GuiButton ok(btnOutline.GetWidth(), btnOutline.GetHeight());
ok.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
ok.SetPosition(-120, -25);
ok.SetLabel(&okTxt);
ok.SetImage(&okImg);
ok.SetImageOver(&okImgOver);
ok.SetTrigger(&trigA);
GuiText backTxt(tr("No"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
GuiImage backImg(&btnOutline);
GuiImage backImgOver(&btnOutlineOver);
GuiButton back(btnOutline.GetWidth(), btnOutline.GetHeight());
back.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
back.SetPosition(120, -25);
back.SetLabel(&backTxt);
back.SetImage(&backImg);
back.SetImageOver(&backImgOver);
back.SetTrigger(&trigA);
back.SetTrigger(&trigB);
back.SetState(STATE_SELECTED);
promptWindow.Append(&dialogBoxImg);
promptWindow.Append(&zeile1Txt);
promptWindow.Append(&zeile2Txt);
promptWindow.Append(&zeile4Txt);
promptWindow.Append(&ok);
promptWindow.Append(&back);
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while(stop)
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS)
{
kategorieInt++;
if ( kategorieInt >= (signed)AvailableCategory.categories.size() )
kategorieInt = 1;
kategoriename = AvailableCategory.categories[kategorieInt];
zeile2Txt.SetText(kategoriename.c_str());
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS)
{
kategorieInt--;
if ( kategorieInt < 1 )
kategorieInt = AvailableCategory.categories.size() -1;
kategoriename = AvailableCategory.categories[kategorieInt];
zeile2Txt.SetText(kategoriename.c_str());
HaltResumeGui();
}
//.........这里部分代码省略.........
示例2: CheatMenu
/****************************************************************************
* CheatMenu
***************************************************************************/
int CheatMenu(const char * gameID) {
int choice = 0;
bool exit = false;
int ret = 1;
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
// GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path);
GuiImageData settingsbg(imgPath, settings_background_png);
GuiImage settingsbackground(&settingsbg);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -140, 400, &trigA, NULL, btnClick2,1);
backBtn.SetLabel(&backBtnTxt);
backBtn.SetTrigger(&trigB);
GuiText createBtnTxt(tr("Create") , 22, THEME.prompttext);
createBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage createBtnImg(&btnOutline);
GuiButton createBtn(&createBtnImg,&createBtnImg, 2, 3, 160, 400, &trigA, NULL, btnClick2,1);
createBtn.SetLabel(&createBtnTxt);
char txtfilename[55];
snprintf(txtfilename,sizeof(txtfilename),"%s%s.txt",Settings.TxtCheatcodespath,gameID);
GCTCheats c;
int check = c.openTxtfile(txtfilename);
int download =0;
switch (check) {
case -1:
WindowPrompt(tr("Error"),tr("Cheatfile is blank"),tr("OK"));
break;
case 0:
download = WindowPrompt(tr("Error"),tr("No Cheatfile found"),tr("Download Now"),tr("Cancel"));
if (download==1)
{
download = CodeDownload(gameID);
if(download < 0 || c.openTxtfile(txtfilename) != 1)
break;
}
else
break;
case 1:
int cntcheats = c.getCnt();
customOptionList cheatslst(cntcheats);
GuiCustomOptionBrowser chtBrowser(400, 280, &cheatslst, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 1, 90);
chtBrowser.SetPosition(0, 90);
chtBrowser.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
chtBrowser.SetClickable(true);
GuiText titleTxt(c.getGameName().c_str(), 28, (GXColor) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetMaxWidth(350, GuiText::SCROLL);
titleTxt.SetPosition(12,40);
for (int i = 0; i <= cntcheats; i++) {
cheatslst.SetValue(i, "%s",c.getCheatName(i).c_str());
cheatslst.SetName(i, "OFF");
}
HaltGui();
GuiWindow w(screenwidth, screenheight);
w.Append(&settingsbackground);
w.Append(&titleTxt);
w.Append(&backBtn);
w.Append(&createBtn);
w.Append(&chtBrowser);
mainWindow->SetState(STATE_DISABLED);
mainWindow->ChangeFocus(&w);
mainWindow->Append(&w);
ResumeGui();
while (!exit) {
VIDEO_WaitVSync ();
ret = chtBrowser.GetClickedOption();
if (ret != -1) {
const char *strCheck = cheatslst.GetName(ret);
if (strncmp(strCheck,"ON",2) == 0) {
cheatslst.SetName(ret,"%s","OFF");
} else if (strncmp(strCheck,"OFF",3) == 0) {
cheatslst.SetName(ret,"%s","ON");
}
//.........这里部分代码省略.........
示例3: TitleBrowser
//.........这里部分代码省略.........
std::string TitleName;
if(XML_DB->GetTitle(id, TitleName))
name = TitleName.c_str();
else
name = NandTitles.NameOf(tid);
options3.SetName(i, "%s", id);
options3.SetValue(i, "%s", name ? name : tr( "Unknown" ));
titleList[i] = tid;
i++;
}
delete XML_DB;
XML_DB = NULL;
if (i == num_titles + num_sys_titles)
{
options3.SetName(i, " ");
options3.SetValue(i, "%s", tr( "Wii Settings" ));
}
bool exit = false;
int total = num_titles + num_sys_titles;
if (IsNetworkInit()) ResumeNetworkWait();
GuiImageData btnOutline(Resources::GetFile("button_dialogue_box.png"), Resources::GetFileSize("button_dialogue_box.png"));
GuiImageData settingsbg(Resources::GetFile("settings_background.png"), Resources::GetFileSize("settings_background.png"));
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigHome;
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiText titleTxt(tr( "Title Launcher" ), 28, ( GXColor )
{ 0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTER, ALIGN_TOP);
titleTxt.SetPosition(12, 40);
titleTxt.SetMaxWidth(356, SCROLL_HORIZONTAL);
GuiImage settingsbackground(&settingsbg);
GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight());
settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
settingsbackgroundbtn.SetPosition(0, 0);
settingsbackgroundbtn.SetImage(&settingsbackground);
GuiText cancelBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows button text color"));
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30);
GuiImage cancelBtnImg(&btnOutline);
if (Settings.wsprompt)
{
cancelBtnTxt.SetWidescreen(Settings.widescreen);
cancelBtnImg.SetWidescreen(Settings.widescreen);
}
GuiButton cancelBtn(&cancelBtnImg, &cancelBtnImg, 2, 3, 180, 400, &trigA, btnSoundOver, btnSoundClick2, 1);
cancelBtn.SetScale(0.9);
cancelBtn.SetLabel(&cancelBtnTxt);
cancelBtn.SetTrigger(&trigB);
GuiOptionBrowser optionBrowser3(396, 280, &options3, "bg_options_settings.png");
optionBrowser3.SetPosition(0, 90);
optionBrowser3.SetAlignment(ALIGN_CENTER, ALIGN_TOP);
示例4: TitleSelector
/********************************************************************************
* TitleBrowser- opens a browser with a list of installed Titles
*********************************************************************************/
bool TitleSelector(char output[])
{
gprintf("TitleSelector()\n");
s32 num_titles;
s32 r = -1;
bool ret = false;
u64 *titleList = NULL;
// Get count of titles of the good titles
num_titles = NandTitles.SetType(0x10001);
u32 n = num_titles;
for (u32 i = 0; i < n; i++)
{
u64 tid = NandTitles.Next();
if (!tid)
{
break;
}
//remove ones not actually installed on the nand
if (!NandTitles.Exists(tid))
{
num_titles--;
}
}
//make a list of just the tids we are adding to the titlebrowser
titleList = (u64*) memalign(32, num_titles * sizeof(u64));
if (!titleList)
{
gprintf("TitleLister(): out of memory!\n");
return false;
}
OptionList options4;
//write the titles on the option browser
std::string Filepath = Settings.titlestxt_path;
Filepath += "wiitdb.xml";
GameTDB *XML_DB = new GameTDB(Filepath.c_str());
XML_DB->SetLanguageCode(Settings.db_language);
s32 i = 0;
NandTitles.SetType(0x10001);
while (i < num_titles)
{
u64 tid = NandTitles.Next();
if (!tid)
{
gprintf("shit happened\n");
break;
}
if (!NandTitles.Exists(tid))
continue;
char id[5];
NandTitles.AsciiTID(tid, (char*) &id);
const char* name = NULL;
std::string TitleName;
if(XML_DB->GetTitle(id, TitleName))
name = TitleName.c_str();
else
name = NandTitles.NameOf(tid);
//gprintf("%016llx: %s: %s\n%p\t%p\n", tid, id, name, &id, name );
options4.SetName(i, "%s", id);
options4.SetValue(i, "%s", name ? name : tr( "Unknown" ));
titleList[i] = tid;
i++;
}
delete XML_DB;
XML_DB = NULL;
options4.SetName(i, " ");
options4.SetValue(i, "%s", tr( "Clear" ));
bool exit = false;
GuiImageData btnOutline(Resources::GetFile("button_dialogue_box.png"), Resources::GetFileSize("button_dialogue_box.png"));
GuiImageData settingsbg(Resources::GetFile("settings_background.png"), Resources::GetFileSize("settings_background.png"));
GuiImage settingsbackground(&settingsbg);
GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight());
settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
settingsbackgroundbtn.SetPosition(0, 0);
settingsbackgroundbtn.SetImage(&settingsbackground);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
//.........这里部分代码省略.........
示例5: MenuLanguageSelect
/****************************************************************************
* MenuLanguageSelect
***************************************************************************/
int MenuLanguageSelect() {
int cnt = 0;
int ret = 0, choice = 0;
int scrollon;
int returnhere = 0;
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume);
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
// GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path);
GuiImageData settingsbg(imgPath, settings_background_png);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
char fullpath[100];
int countfiles = GetAllDirFiles(Settings.languagefiles_path);
if (!strcmp("", Settings.languagefiles_path)) {
sprintf(fullpath, "%s", tr("Standard"));
} else {
sprintf(fullpath, "%s", Settings.languagefiles_path);
}
GuiText titleTxt(fullpath, 24, (GXColor) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
titleTxt.SetPosition(0,0);
GuiButton pathBtn(300, 50);
pathBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
pathBtn.SetPosition(0,28);
pathBtn.SetLabel(&titleTxt);
pathBtn.SetSoundOver(&btnSoundOver);
pathBtn.SetSoundClick(btnClick2);
pathBtn.SetTrigger(&trigA);
pathBtn.SetEffectGrow();
GuiImage oggmenubackground(&settingsbg);
oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
oggmenubackground.SetPosition(0, 0);
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
backBtnTxt.SetWidescreen(CFG.widescreen);
backBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton backBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
backBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
backBtn.SetPosition(-190, 400);
backBtn.SetLabel(&backBtnTxt);
backBtn.SetImage(&backBtnImg);
backBtn.SetSoundOver(&btnSoundOver);
backBtn.SetSoundClick(btnClick2);
backBtn.SetTrigger(&trigA);
backBtn.SetTrigger(&trigB);
backBtn.SetEffectGrow();
GuiText defaultBtnTxt(tr("Default") , 22, THEME.prompttext);
defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage defaultBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
defaultBtnTxt.SetWidescreen(CFG.widescreen);
defaultBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton defaultBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
defaultBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
defaultBtn.SetPosition(190, 400);
defaultBtn.SetLabel(&defaultBtnTxt);
defaultBtn.SetImage(&defaultBtnImg);
defaultBtn.SetSoundOver(&btnSoundOver);
defaultBtn.SetSoundClick(btnClick2);
defaultBtn.SetTrigger(&trigA);
defaultBtn.SetEffectGrow();
GuiText updateBtnTxt(tr("Update Files") , 22, THEME.prompttext);
updateBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage updateBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
updateBtnTxt.SetWidescreen(CFG.widescreen);
updateBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton updateBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
updateBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
updateBtn.SetPosition(0, 400);
updateBtn.SetLabel(&updateBtnTxt);
updateBtn.SetImage(&updateBtnImg);
updateBtn.SetSoundOver(&btnSoundOver);
updateBtn.SetSoundClick(btnClick2);
//.........这里部分代码省略.........
示例6: MenuHomebrewBrowse
/****************************************************************************
* MenuHomebrewBrowse
***************************************************************************/
int MenuHomebrewBrowse() {
int menu = MENU_NONE;
int choice = 0;
HomebrewFiles HomebrewFiles(Settings.homebrewapps_path);
u32 filecount = HomebrewFiles.GetFilecount();
if (!filecount) {
WindowPrompt(tr("No .dol or .elf files found."),0, tr("OK"));
return MENU_DISCLIST;
}
enum {
FADE,
LEFT,
RIGHT
};
if (IsNetworkInit())
ResumeNetworkWait();
int slidedirection = FADE;
/*** Sound Variables ***/
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume);
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
// GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
GuiSound btnClick1(button_click_pcm, button_click_pcm_size, Settings.sfxvolume);
/*** Image Variables ***/
char imgPath[150];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path);
GuiImageData bgData(imgPath, settings_background_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_title.png", CFG.theme_path);
GuiImageData MainButtonImgData(imgPath, settings_title_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_title_over.png", CFG.theme_path);
GuiImageData MainButtonImgOverData(imgPath, settings_title_over_png);
snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_left.png", CFG.theme_path);
GuiImageData arrow_left(imgPath, startgame_arrow_left_png);
snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_right.png", CFG.theme_path);
GuiImageData arrow_right(imgPath, startgame_arrow_right_png);
snprintf(imgPath, sizeof(imgPath), "%sWifi_btn.png", CFG.theme_path);
GuiImageData wifiImgData(imgPath, Wifi_btn_png);
snprintf(imgPath, sizeof(imgPath), "%sChannel_btn.png", CFG.theme_path);
GuiImageData channelImgData(imgPath, Channel_btn_png);
GuiImage background(&bgData);
/*** Trigger Variables ***/
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigHome;
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiTrigger trigL;
trigL.SetButtonOnlyTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT);
GuiTrigger trigR;
trigR.SetButtonOnlyTrigger(-1, WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT, PAD_BUTTON_RIGHT);
GuiTrigger trigMinus;
trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
GuiTrigger trigPlus;
trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0);
GuiText titleTxt(tr("Homebrew Launcher"), 28, (GXColor) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,40);
GuiImageData *IconData[4];
GuiImage *IconImg[4];
for (int i = 0; i < 4; i++) {
IconData[i] = NULL;
IconImg[i] = NULL;
}
/*** Buttons ***/
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
backBtnTxt.SetWidescreen(CFG.widescreen);
backBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -180, 400, &trigA, &btnSoundOver, btnClick2,1);
//.........这里部分代码省略.........
示例7: devicePrompt
/****************************************************************************
* WindowPrompt
*
* Displays a prompt window to user, with information, an error message, or
* presenting a user with a choice
***************************************************************************/
int devicePrompt()
{
bool stop = false;
int device = -1;
#ifndef VWII
GuiWindow promptWindow(328,64);
#else
GuiWindow promptWindow(144,64);
#endif
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
promptWindow.SetPosition(-135, 280);
GuiTrigger trigA;
GuiTrigger trigB;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
// Hintergrund
#ifndef VWII
GuiImageData dialogBox(Theme.choice_large);
#else
GuiImageData dialogBox(Theme.choice);
#endif
GuiImage dialogBoxImg(&dialogBox);
// button data
GuiImageData sd_BtnImgData(Theme.sd_inactive);
GuiImageData sd_BtnImgDataOver(Theme.sd_active);
GuiImageData usb_BtnImgData(Theme.usb_inactive);
GuiImageData usb_BtnImgDataOver(Theme.usb_active);
GuiImageData sd_usb_BtnImgData(Theme.sd_usb_inactive);
GuiImageData sd_usb_BtnImgDataOver(Theme.sd_usb_active);
#ifndef VWII
GuiImageData dvd_BtnImgData(Theme.dvd_inactive);
GuiImageData dvd_BtnImgDataOver(Theme.dvd_active);
GuiImageData gca_BtnImgData(Theme.gca_inactive);
GuiImageData gca_BtnImgDataOver(Theme.gca_active);
GuiImageData gcb_BtnImgData(Theme.gcb_inactive);
GuiImageData gcb_BtnImgDataOver(Theme.gcb_active);
GuiImageData all_BtnImgData(Theme.all_inactive);
GuiImageData all_BtnImgDataOver(Theme.all_active);
#endif
// button
GuiImage sd_BtnImg(&sd_BtnImgData);
GuiImage usb_BtnImg(&usb_BtnImgData);
GuiImage sd_usb_BtnImg(&sd_usb_BtnImgData);
#ifndef VWII
GuiImage dvd_BtnImg(&dvd_BtnImgData);
GuiImage gca_BtnImg(&gca_BtnImgData);
GuiImage gcb_BtnImg(&gca_BtnImgData);
GuiImage all_BtnImg(&all_BtnImgData);
#endif
// button over
GuiImage sd_BtnImgOver(&sd_BtnImgDataOver);
GuiImage usb_BtnImgOver(&usb_BtnImgDataOver);
GuiImage sd_usb_BtnImgOver(&sd_usb_BtnImgDataOver);
#ifndef VWII
GuiImage dvd_BtnImgOver(&dvd_BtnImgDataOver);
GuiImage gca_BtnImgOver(&gca_BtnImgDataOver);
GuiImage gcb_BtnImgOver(&gca_BtnImgDataOver);
GuiImage all_BtnImgOver(&all_BtnImgDataOver);
#endif
GuiButton sd_Btn(sd_BtnImgData.GetWidth(), sd_BtnImgData.GetHeight());
sd_Btn.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
sd_Btn.SetPosition(8, 0);
sd_Btn.SetImage(&sd_BtnImg);
sd_Btn.SetImageOver(&sd_BtnImgOver);
sd_Btn.SetTrigger(&trigA);
GuiButton usb_Btn(usb_BtnImgData.GetWidth(), usb_BtnImgData.GetHeight());
usb_Btn.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
usb_Btn.SetPosition(52, 0);
usb_Btn.SetImage(&usb_BtnImg);
usb_Btn.SetImageOver(&usb_BtnImgOver);
usb_Btn.SetTrigger(&trigA);
GuiButton sd_usb_Btn(sd_usb_BtnImgData.GetWidth(), sd_usb_BtnImgData.GetHeight());
sd_usb_Btn.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
sd_usb_Btn.SetPosition(96, 0);
sd_usb_Btn.SetImage(&sd_usb_BtnImg);
sd_usb_Btn.SetImageOver(&sd_usb_BtnImgOver);
sd_usb_Btn.SetTrigger(&trigA);
#ifndef VWII
GuiButton dvd_Btn(dvd_BtnImgData.GetWidth(), dvd_BtnImgData.GetHeight());
dvd_Btn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
dvd_Btn.SetPosition(0, 0);
dvd_Btn.SetImage(&dvd_BtnImg);
dvd_Btn.SetImageOver(&dvd_BtnImgOver);
dvd_Btn.SetTrigger(&trigA);
GuiButton gca_Btn(gca_BtnImgData.GetWidth(), gca_BtnImgData.GetHeight());
//.........这里部分代码省略.........
示例8: MainButtonClicked
void ThemeMenu::MainButtonClicked(int button)
{
//! TODO: Clean me
const char * title = ThemeList[button].Title.c_str();
const char * author = ThemeList[button].Team.c_str();
const char * version = ThemeList[button].Version.c_str();
GuiImageData *thumbimageData = ThemePreviews[button % 4];
debughelper_printf("\nTheme_Prompt(%s ,%s)", title, author);
bool leave = false;
GuiImageData btnOutline(Resources::GetFile("button_dialogue_box.png"), Resources::GetFileSize("button_dialogue_box.png"));
GuiImageData dialogBox(Resources::GetFile("theme_dialogue_box.png"), Resources::GetFileSize("theme_dialogue_box.png"));
GuiImage dialogBoxImg(&dialogBox);
GuiWindow promptWindow(dialogBox.GetWidth(), dialogBox.GetHeight());
promptWindow.SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
int PositionY = 30;
GuiText titleTxt(tr( "Theme Title:" ), 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
titleTxt.SetPosition(230, PositionY);
PositionY += 20;
GuiText titleTxt2(title, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
titleTxt2.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
titleTxt2.SetPosition(230, PositionY);
titleTxt2.SetMaxWidth(dialogBox.GetWidth() - 220, WRAP);
if(titleTxt2.GetTextWidth() >= dialogBox.GetWidth() - 220)
PositionY += 50;
else
PositionY += 30;
GuiText authorTxt(tr( "Author(s):" ), 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
authorTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
authorTxt.SetPosition(230, PositionY);
PositionY += 20;
GuiText authorTxt2(author, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
authorTxt2.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
authorTxt2.SetPosition(230, PositionY);
authorTxt2.SetMaxWidth(dialogBox.GetWidth() - 220, DOTTED);
if(authorTxt2.GetTextWidth() >= dialogBox.GetWidth() - 220)
PositionY += 50;
else
PositionY += 30;
GuiText versionTxt(tr( "Version:" ), 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
versionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
versionTxt.SetPosition(230, PositionY);
GuiText versionTxt2(version, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
versionTxt2.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
versionTxt2.SetPosition(235+versionTxt.GetTextWidth(), PositionY);
versionTxt2.SetMaxWidth(dialogBox.GetWidth() - 220, DOTTED);
GuiText applyBtnTxt(tr( "Apply" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows button text color"));
applyBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30);
GuiImage applyBtnImg(&btnOutline);
if (Settings.wsprompt)
{
applyBtnTxt.SetWidescreen(Settings.widescreen);
applyBtnImg.SetWidescreen(Settings.widescreen);
}
GuiButton applyBtn(&applyBtnImg, &applyBtnImg, ALIGN_RIGHT, ALIGN_TOP, -5, 170, &trigA, btnSoundOver, btnSoundClick2, 1);
applyBtn.SetLabel(&applyBtnTxt);
applyBtn.SetScale(0.9);
GuiText backBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows button text color"));
backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt)
{
backBtnTxt.SetWidescreen(Settings.widescreen);
backBtnImg.SetWidescreen(Settings.widescreen);
}
GuiButton backBtn(&backBtnImg, &backBtnImg, ALIGN_RIGHT, ALIGN_TOP, -5, 220, &trigA, btnSoundOver, btnSoundClick2, 1);
backBtn.SetLabel(&backBtnTxt);
backBtn.SetTrigger(&trigB);
backBtn.SetScale(0.9);
GuiImage ThemeImage(thumbimageData);
ThemeImage.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
ThemeImage.SetPosition(20, 10);
ThemeImage.SetScale(0.8);
promptWindow.Append(&dialogBoxImg);
promptWindow.Append(&ThemeImage);
promptWindow.Append(&titleTxt);
promptWindow.Append(&titleTxt2);
//.........这里部分代码省略.........
示例9: DiscBrowse
/********************************************************************************
*Disk Browser
*********************************************************************************/
int DiscBrowse(const char * GameID, char * alternatedname, int alternatedname_size)
{
gprintf("\nDiscBrowser() started");
bool exit = false;
int ret = -1, choice;
HaltGui();
gprintf("WBFS_OpenDisc\n");
wbfs_disc_t *disc = WBFS_OpenDisc((u8 *) GameID);
if (!disc)
{
ResumeGui();
WindowPrompt(tr( "ERROR:" ), tr( "Could not open Disc" ), tr( "OK" ));
return ret;
}
gprintf("wd_open_disc\n");
wiidisc_t *wdisc = wd_open_disc((int(*)(void *, u32, u32, void *)) wbfs_disc_read, disc);
if (!wdisc)
{
ResumeGui();
WindowPrompt(tr( "ERROR:" ), tr( "Could not open Disc" ), tr( "OK" ));
return ret;
}
gprintf("wd_get_fst\n");
FST_ENTRY * fstbuffer = (FST_ENTRY *) wd_extract_file(wdisc, ONLY_GAME_PARTITION, (char *) "FST");
if (!fstbuffer)
{
ResumeGui();
WindowPrompt(tr( "ERROR:" ), tr( "Not enough free memory." ), tr( "OK" ));
return -1;
}
gprintf("wd_close_disc\n");
wd_close_disc(wdisc);
gprintf("WBFS_CloseDisc\n");
WBFS_CloseDisc(disc);
gprintf("options\n");
OptionList options;
for (u32 i = 0, position = 0; i < fstbuffer[0].filelen; i++)
{
//don't add files that aren't .dol to the list
const char * filename = fstfiles(fstbuffer, i);
const char * fileext = NULL;
if(filename)
fileext = strrchr(filename, '.');
if (fileext && strcasecmp(fileext, ".dol") == 0)
{
options.SetName(position, "%s %03i", tr("Offset"), i);
options.SetValue(position, filename);
position++;
}
}
free(fstbuffer);
gprintf("\n%i alt dols found", options.GetLength()+1);
if (options.GetLength() <= 0)
{
WindowPrompt(tr( "ERROR" ), tr( "No DOL file found on disc." ), tr( "OK" ));
return ret;
}
GuiImageData btnOutline(Resources::GetFile("button_dialogue_box.png"), Resources::GetFileSize("button_dialogue_box.png"));
GuiImageData settingsbg(Resources::GetFile("settings_background.png"), Resources::GetFileSize("settings_background.png"));
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigHome;
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiText titleTxt(GameTitles.GetTitle(GameID), 28, ( GXColor ) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTER, ALIGN_TOP);
titleTxt.SetPosition(12, 40);
titleTxt.SetMaxWidth(356, SCROLL_HORIZONTAL);
GuiImage settingsbackground(&settingsbg);
GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight());
settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
settingsbackgroundbtn.SetPosition(0, 0);
settingsbackgroundbtn.SetImage(&settingsbackground);
GuiText cancelBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows button text color"));
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30);
GuiImage cancelBtnImg(&btnOutline);
if (Settings.wsprompt == ON)
{
cancelBtnTxt.SetWidescreen(Settings.widescreen);
cancelBtnImg.SetWidescreen(Settings.widescreen);
}
//.........这里部分代码省略.........
示例10: InternalShowGameInfo
//.........这里部分代码省略.........
//GuiImageData * vitalitysensorImgData = NULL;
GuiImageData * gamecubeImgData = NULL;
GuiImageData * ratingImgData = NULL;
GuiImageData * cover = NULL;
GuiText * releasedTxt = NULL;
GuiText * publisherTxt = NULL;
GuiText * developerTxt = NULL;
GuiText * titleTxt = NULL;
Text * synopsisTxt = NULL;
GuiText * genreTitleTxt = NULL;
GuiText ** genreTxt = NULL;
GuiText ** wifiTxt = NULL;
GuiText * gametdb1Txt = NULL;
GuiText * memTxt = NULL;
GuiWindow gameinfoWindow(600, 308);
gameinfoWindow.SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
gameinfoWindow.SetPosition(0, -50);
GuiWindow InfoWindow(600, 308);
InfoWindow.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
GuiWindow txtWindow(350, 270);
txtWindow.SetAlignment(ALIGN_CENTER, ALIGN_TOP);
txtWindow.SetPosition(95, 40);
GuiImageData dialogBox1(Resources::GetFile("gameinfo1.png"), Resources::GetFileSize("gameinfo1.png"));
GuiImageData dialogBox2(Resources::GetFile("gameinfo1a.png"), Resources::GetFileSize("gameinfo1a.png"));
GuiImageData dialogBox3(Resources::GetFile("gameinfo2.png"), Resources::GetFileSize("gameinfo2.png"));
GuiImageData dialogBox4(Resources::GetFile("gameinfo2a.png"), Resources::GetFileSize("gameinfo2a.png"));
GuiTrigger trig1;
trig1.SetButtonOnlyTrigger(-1, WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_X, 0);
GuiTrigger trigA;
trigA.SetButtonOnlyTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiTrigger trigU;
trigU.SetButtonOnlyTrigger(-1, WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP, PAD_BUTTON_UP);
GuiTrigger trigD;
trigD.SetButtonOnlyTrigger(-1, WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN, PAD_BUTTON_DOWN);
GuiTrigger trigH;
trigH.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
//buttons for changing between synopsis and other info
GuiButton backBtn(0, 0);
backBtn.SetPosition(-20, -20);
backBtn.SetTrigger(&trigB);
gameinfoWindow.Append(&backBtn);
GuiTrigger trigA_Simple;
trigA_Simple.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigLeft;
trigLeft.SetButtonOnlyTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT);
GuiTrigger trigRight;
trigRight.SetButtonOnlyTrigger(-1, WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT, PAD_BUTTON_RIGHT);
GuiButton LeftBtn(0, 0);
LeftBtn.SetTrigger(&trigLeft);
if(header->type != TYPE_GAME_WII_DISC && header->type != TYPE_GAME_GC_DISC)
gameinfoWindow.Append(&LeftBtn);
GuiButton RightBtn(0, 0);
示例11: TitleBrowser
//.........这里部分代码省略.........
//move on to the next title
i++;
}
if (i == num_titles+num_sys_titles) {
options3.SetName(i, " ");
options3.SetValue(i, "%s",tr("Wii Settings"));
}
//we have all the titles we need so close the database and stop poking around in the wii
fclose(f);
//get rid of our footprints in there
Uninstall_FromTitle(TITLE_ID(1, 0));
ISFS_Deinitialize();
bool exit = false;
if (IsNetworkInit())
ResumeNetworkWait();
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume);
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
// GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%sgamesettings_background.png", CFG.theme_path);
GuiImageData settingsbg(imgPath, settings_background_png);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigHome;
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiText titleTxt(tr("Title Launcher"), 28, (GXColor) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(12,40);
titleTxt.SetMaxWidth(356, GuiText::SCROLL);
GuiImage settingsbackground(&settingsbg);
GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight());
settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
settingsbackgroundbtn.SetPosition(0, 0);
settingsbackgroundbtn.SetImage(&settingsbackground);
GuiText cancelBtnTxt(tr("Back"), 22, THEME.prompttext);
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage cancelBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
cancelBtnTxt.SetWidescreen(CFG.widescreen);
cancelBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton cancelBtn(&cancelBtnImg,&cancelBtnImg, 2, 3, 180, 400, &trigA, &btnSoundOver, btnClick2,1);
cancelBtn.SetScale(0.9);
cancelBtn.SetLabel(&cancelBtnTxt);
cancelBtn.SetTrigger(&trigB);
u8 scrollbaron = 0;
if (num_titles > 9)
scrollbaron = 1;
GuiCustomOptionBrowser optionBrowser3(396, 280, &options3, CFG.theme_path, "bg_options_gamesettings.png", bg_options_settings_png, num_titles+num_sys_titles>9?1:0, 200);
optionBrowser3.SetPosition(0, 90);
示例12: MenuSettings
/****************************************************************************
* MenuSettings
***************************************************************************/
static int MenuSettings() {
int menu = MENU_NONE;
GuiText titleTxt("Settings", 28, ColorGrey);
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
titleTxt.SetPosition(50, 50);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
GuiImageData btnOutline(xenon_button_png);
GuiImageData btnOutlineOver(xenon_button_over_png);
GuiImageData btnLargeOutline(xenon_button_large_png);
GuiImageData btnLargeOutlineOver(xenon_button_large_over_png);
GuiTrigger trigA;
// trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigA.SetSimpleTrigger(-1, 0, PAD_BUTTON_A);
GuiTrigger trigHome;
// trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
trigHome.SetButtonOnlyTrigger(-1, 0, 0);
GuiText fileBtnTxt("File Browser", 22, ColorGrey2);
fileBtnTxt.SetWrap(true, btnLargeOutline.GetWidth() - 30);
GuiImage fileBtnImg(&btnLargeOutline);
GuiImage fileBtnImgOver(&btnLargeOutlineOver);
GuiButton fileBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
fileBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
fileBtn.SetPosition(50, 120);
fileBtn.SetLabel(&fileBtnTxt);
fileBtn.SetImage(&fileBtnImg);
fileBtn.SetImageOver(&fileBtnImgOver);
fileBtn.SetSoundOver(&btnSoundOver);
fileBtn.SetTrigger(&trigA);
fileBtn.SetEffectGrow();
GuiText videoBtnTxt("Video", 22, ColorGrey2);
videoBtnTxt.SetWrap(true, btnLargeOutline.GetWidth() - 30);
GuiImage videoBtnImg(&btnLargeOutline);
GuiImage videoBtnImgOver(&btnLargeOutlineOver);
GuiButton videoBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
videoBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
videoBtn.SetPosition(0, 120);
videoBtn.SetLabel(&videoBtnTxt);
videoBtn.SetImage(&videoBtnImg);
videoBtn.SetImageOver(&videoBtnImgOver);
videoBtn.SetSoundOver(&btnSoundOver);
videoBtn.SetTrigger(&trigA);
videoBtn.SetEffectGrow();
GuiText savingBtnTxt1("Saving", 22, ColorGrey2);
GuiText savingBtnTxt2("&", 18, ColorGrey2);
GuiText savingBtnTxt3("Loading", 22, ColorGrey2);
savingBtnTxt1.SetPosition(0, -20);
savingBtnTxt3.SetPosition(0, +20);
GuiImage savingBtnImg(&btnLargeOutline);
GuiImage savingBtnImgOver(&btnLargeOutlineOver);
GuiButton savingBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
savingBtn.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
savingBtn.SetPosition(-50, 120);
savingBtn.SetLabel(&savingBtnTxt1, 0);
savingBtn.SetLabel(&savingBtnTxt2, 1);
savingBtn.SetLabel(&savingBtnTxt3, 2);
savingBtn.SetImage(&savingBtnImg);
savingBtn.SetImageOver(&savingBtnImgOver);
savingBtn.SetSoundOver(&btnSoundOver);
savingBtn.SetTrigger(&trigA);
savingBtn.SetEffectGrow();
GuiText menuBtnTxt("Menu", 22, ColorGrey2);
menuBtnTxt.SetWrap(true, btnLargeOutline.GetWidth() - 30);
GuiImage menuBtnImg(&btnLargeOutline);
GuiImage menuBtnImgOver(&btnLargeOutlineOver);
GuiButton menuBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
menuBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
menuBtn.SetPosition(-125, 250);
menuBtn.SetLabel(&menuBtnTxt);
menuBtn.SetImage(&menuBtnImg);
menuBtn.SetImageOver(&menuBtnImgOver);
menuBtn.SetSoundOver(&btnSoundOver);
menuBtn.SetTrigger(&trigA);
menuBtn.SetEffectGrow();
GuiText networkBtnTxt("Network", 22, ColorGrey2);
networkBtnTxt.SetWrap(true, btnLargeOutline.GetWidth() - 30);
GuiImage networkBtnImg(&btnLargeOutline);
GuiImage networkBtnImgOver(&btnLargeOutlineOver);
GuiButton networkBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
networkBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
networkBtn.SetPosition(125, 250);
networkBtn.SetLabel(&networkBtnTxt);
networkBtn.SetImage(&networkBtnImg);
networkBtn.SetImageOver(&networkBtnImgOver);
networkBtn.SetSoundOver(&btnSoundOver);
networkBtn.SetTrigger(&trigA);
networkBtn.SetEffectGrow();
//.........这里部分代码省略.........
示例13: osdBtn
extern "C" void mplayer_osd_draw(int level)
{
if ((mplayer_get_pause() == 1) && (first_enter == 1)) {
ResetController();
first_enter = 0;
}
//Y-osd button used because libmenu is off
GuiTrigger osdMenu;
osdMenu.SetButtonOnlyTrigger(-1, 0, PAD_BUTTON_Y);
GuiButton osdBtn(20, 20);
osdBtn.SetTrigger(&osdMenu);
osdBtn.SetSelectable(false);
mainWindow->Append(&osdBtn);
if (osd_show) {
double duration = mplayer_get_duration();
double elapsed = mplayer_get_elapsed();
struct XenosSurface * img = video_osd_progress_bar_front->GetImage();
float pourcents = (float) (elapsed * 100) / (float) duration;
float width = (float) osd_duration_bar_width * (pourcents / 100.0);
img->width = width;
format_time(osd_duration, duration);
format_time(osd_cur_time, elapsed);
video_osd_info_cur_time->SetText(osd_cur_time);
video_osd_info_duration->SetText(osd_duration);
if (last_level != level) {
video_osd_info_filename->SetText(mplayer_get_filename());
video_osd_info_filename->SetMaxWidth(644);
video_osd_info_filename->SetScroll(SCROLL_HORIZONTAL);
}
video_osd_progress_bar_front->SetImage(img, img->width, img->height);
video_osd_play->SetVisible(false);
video_osd_pause->SetVisible(false);
video_osd_stop->SetVisible(false);
video_osd_rewind->SetVisible(false);
video_osd_forward->SetVisible(false);
video_osd_next->SetVisible(false);
video_osd_prev->SetVisible(false);
switch (mplayer_get_status()) {
case 1:
video_osd_play->SetVisible(true);
break;
case 2:
video_osd_pause->SetVisible(true);
break;
case 3:
video_osd_stop->SetVisible(true);
break;
case 4:
video_osd_rewind->SetVisible(true);
break;
case 5:
video_osd_forward->SetVisible(true);
break;
case 6:
video_osd_next->SetVisible(true);
break;
case 7:
video_osd_prev->SetVisible(true);
break;
default:
break;
}
// show file info
if (osd_display_info) {
if (!video_osd_infobar->IsVisible())
video_osd_infobar->SetVisible(true);
} else {
if (video_osd_infobar->IsVisible())
video_osd_infobar->SetVisible(false);
}
if (level == 3) {
if (!osd_options_window->IsVisible())
osd_options_window->SetVisible(true);
} else {
if (osd_options_window->IsVisible())
osd_options_window->SetVisible(false);
osd_display_info = 0;
osd_display_option_subtitle = 0;
osd_display_option_audio = 0;
osd_display_option_video = 0;
}
} else {
osd_display_info = 0;
}
OsdSubtitlesOptions();
OsdAudioOptions();
OsdVideoOptions();
Menu_Frame();
last_level = level;
//.........这里部分代码省略.........