/** GuiOptionBrowser * Constructor for the GuiOptionBrowser class. */ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l, const char * custombg) : scrollBar(h-10) { width = w; height = h; options = l; selectable = true; selectedItem = 0; oldSelectedItem = -1; coL2 = 50; listOffset = 0; trigA = new GuiTrigger; trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); bgOptions = Resources::GetImageData(custombg); bgOptionsImg = new GuiImage(bgOptions); bgOptionsImg->SetParent(this); bgOptionsImg->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); bgOptionsEntry = Resources::GetImageData("bg_options_entry.png"); scrollBar.SetParent(this); scrollBar.SetAlignment(thAlign("right - options browser scrollbar align hor"), thAlign("top - options browser scrollbar align ver")); scrollBar.SetPosition(thInt("0 - options browser scrollbar pos x"), thInt("5 - options browser scrollbar pos y")); scrollBar.listChanged.connect(this, &GuiOptionBrowser::onListChange); optionBtn.resize(PAGESIZE); optionBg.resize(PAGESIZE); optionTxt.resize(PAGESIZE); optionVal.resize(PAGESIZE); for (int i = 0; i < PAGESIZE; i++) { optionTxt[i] = new GuiText((wchar_t *) NULL, 20, thColor("r=0 g=0 b=0 a=255 - settings text color")); optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); optionTxt[i]->SetPosition(24, 0); optionTxt[i]->SetMaxWidth(bgOptionsImg->GetWidth()-scrollBar.GetWidth()-40, DOTTED); optionBg[i] = new GuiImage(bgOptionsEntry); optionVal[i] = new GuiText((wchar_t *) NULL, 20, thColor("r=0 g=0 b=0 a=255 - settings text color")); optionVal[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); optionBtn[i] = new GuiButton(width - scrollBar.GetWidth(), GAMESELECTSIZE); optionBtn[i]->SetParent(this); optionBtn[i]->SetLabel(optionTxt[i], 0); optionBtn[i]->SetLabel(optionVal[i], 1); optionBtn[i]->SetImageOver(optionBg[i]); optionBtn[i]->SetPosition(10, GAMESELECTSIZE * i + 4); optionBtn[i]->SetRumble(false); optionBtn[i]->SetTrigger(trigA); optionBtn[i]->SetSoundClick(btnSoundClick); } }
SettingsMenu::SettingsMenu(const char * title, OptionList * opts, int returnTo) : GuiWindow(screenwidth, screenheight) { Options = opts; returnToMenu = returnTo; trigA = NULL; trigB = NULL; backBtnTxt = NULL; backBtnImg = NULL; backBtn = NULL; btnOutline = NULL; //! Skipping back button if there is no menu defined to go back to if(returnToMenu != MENU_NONE) { btnOutline = Resources::GetImageData("button_dialogue_box.png"); trigA = new GuiTrigger(); trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigB = new GuiTrigger(); trigB->SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); backBtnTxt = new GuiText(tr("Back"), 22, (GXColor){0, 0, 0, 255}); backBtnImg = new GuiImage(btnOutline); backBtn = new GuiButton(backBtnImg, backBtnImg, 2, 3, -180, 400, trigA, btnSoundOver, btnSoundClick2, 1); backBtn->SetLabel(backBtnTxt); backBtn->SetTrigger(trigB); Append(backBtn); } optionBrowser = new GuiOptionBrowser(396, 280, Options, "bg_options_settings.png"); optionBrowser->SetAlignment(thAlign("center - settings option browser align hor"), thAlign("top - settings option browser align ver")); optionBrowser->SetPosition(thInt("0 - settings option browser pos x"), thInt("90 - settings option browser pos y")); titleTxt = new GuiText(title, 28, thColor("r=0 g=0 b=0 a=255 - settings title text color")); titleTxt->SetAlignment(thAlign("center - settings title text align hor"), thAlign("top - settings title text align ver")); titleTxt->SetPosition(thInt("0 - settings title text pos x"), thInt("40 - settings title text pos y")); titleTxt->SetMaxWidth(thInt("310 - settings title text max width"), SCROLL_HORIZONTAL); Append(optionBrowser); Append(titleTxt); SetEffect(EFFECT_FADE, 50); }
SettingsMenu::SettingsMenu() : GuiFrame(screenwidth, screenheight) { globalSettings = NULL; settingsBrowser = NULL; BtnSoundClick = Resources::GetSound("button_click.wav"); BtnSoundOver = Resources::GetSound("button_over.wav"); BtnSoundClick->SetVolume(Settings.SFXVolume); BtnSoundOver->SetVolume(Settings.SFXVolume); trigA.SetSimpleTrigger(-1, WiiControls.ClickButton | ClassicControls.ClickButton << 16, GCControls.ClickButton); trigB.SetButtonOnlyTrigger(-1, WiiControls.BackButton | ClassicControls.BackButton << 16, GCControls.BackButton); BgImgData = Resources::GetImageData("settings_background.png"); BgImg = new GuiImage(BgImgData); Title = new GuiText(tr("Global Settings"), 28, thColor("r=0 g=0 b=0 a=255 - settings menu title text color")); Title->SetAlignment(ALIGN_LEFT | ALIGN_TOP); Title->SetPosition(170, 38); Title->SetMaxWidth(310, SCROLL_HORIZONTAL); BackBtnTxt = new GuiText(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - settings menu back button text color")); BackBtn = new PictureButton("settings_menu_button.png", "settings_menu_button.png", BtnSoundClick, BtnSoundOver); BackBtn->SetAlignment(thAlign("center - settings menu back button align hor") | thAlign("top - settings menu back button align ver")); BackBtn->SetPosition(thInt("-195 - settings menu back button pos x"), thInt("400 - settings menu back button pos y")); BackBtn->SetLabel(BackBtnTxt); BackBtn->SetTrigger(&trigA); BackBtn->SetTrigger(&trigB); BackBtn->Clicked.connect(this, &SettingsMenu::OnBackButtonClick); globalSettings = new GlobalSettings(); globalSettings->FlyingBtnMenuClicked.connect(this, &SettingsMenu::OnFlyingButtonClick); Append(BgImg); Append(Title); Append(BackBtn); Append(globalSettings); SetEffect(EFFECT_FADE, 20); }
bool Theme::Load(const char * theme_file_path) { bool result = LoadTheme(theme_file_path); if(!result) return result; Theme::ShowTooltips = (thInt("1 - Enable tooltips: 0 for off and 1 for on") != 0); FILE * file = fopen(theme_file_path, "rb"); if(!file) return false; char line[300]; char * Foldername = NULL; while (fgets(line, sizeof(line), file)) { char * ptr = strcasestr(line, "Image-Folder:"); if(!ptr) continue; ptr += strlen("Image-Folder:"); while(*ptr != '\0' && *ptr == ' ') ptr++; Foldername = ptr; while(*ptr != '\\' && *ptr != '"' && *ptr != '\0') ptr++; *ptr = '\0'; break; } fclose(file); if(!Foldername) return result; char theme_path[300]; snprintf(theme_path, sizeof(theme_path), theme_file_path); char * ptr = strrchr(theme_path, '/'); if(ptr) *ptr = '\0'; strcat(theme_path, fmt("/%s", Foldername)); if(!Resources::LoadFiles(theme_path)) { const char * ThemeFilename = strrchr(theme_file_path, '/')+1; char Filename[255]; snprintf(Filename, sizeof(Filename), ThemeFilename); char * fileext = strrchr(Filename, '.'); if(fileext) *fileext = 0; char * ptr = strrchr(theme_path, '/'); *ptr = 0; strcat(theme_path, fmt("/%s", Filename)); Resources::LoadFiles(theme_path); } //! Override font.ttf with the theme font.ttf if it exists in the image folder strcat(theme_path, "/font.ttf"); if(CheckFile(theme_path)) Theme::LoadFont(theme_path); return result; }
BannerWindow::BannerWindow(GameBrowseMenu *m, struct discHdr *header) : GuiWindow(screenwidth, screenheight) , browserMenu(m) , MaxAnimSteps(Settings.BannerZoomDuration) { ScreenProps.x = screenwidth; ScreenProps.y = screenheight; f32 xOffset = Settings.BannerProjectionOffsetX; f32 yOffset = Settings.BannerProjectionOffsetY; guMtxIdentity(modelview); guMtxTransApply (modelview, modelview, xOffset, yOffset, 0.0F); memcpy(&originalProjection, &FSProjection2D, sizeof(Mtx44)); returnVal = -1; gameSelected = 0; gameSound = NULL; dvdheader = NULL; reducedVol = false; if(!bannerFrame.IsLoaded()) bannerFrame.Load(U8Archive(SystemMenuResources::Instance()->GetChanTtlAsh(), SystemMenuResources::Instance()->GetChanTtlAshSize())); AnimStep = 0; AnimPosX = 0.5f * (ScreenProps.x - fIconWidth); AnimPosY = 0.5f * (ScreenProps.y - fIconHeight); AnimZoomIn = true; AnimationRunning = false; int gameIdx; //! get the game index to this header for(gameIdx = 0; gameIdx < gameList.size(); ++gameIdx) { if(gameList[gameIdx] == header) { gameSelected = gameIdx; break; } } //! Set dvd header if the header does not match any of the list games if(gameIdx == gameList.size()) dvdheader = header; GuiBannerGrid *bannerBrowser = dynamic_cast<GuiBannerGrid *>(browserMenu->GetGameBrowser()); if(bannerBrowser) bannerBrowser->GetIconCoordinates(gameSelected, &AnimPosX, &AnimPosY); gameBanner = new Banner; imgLeft = Resources::GetImageData("startgame_arrow_left.png"); imgRight = Resources::GetImageData("startgame_arrow_right.png"); trigA = new GuiTrigger; trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigB = new GuiTrigger; trigB->SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); trigL = new GuiTrigger; trigL->SetButtonOnlyTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT); trigR = new GuiTrigger; trigR->SetButtonOnlyTrigger(-1, WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT, PAD_BUTTON_RIGHT); trigPlus = new GuiTrigger; trigPlus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, PAD_TRIGGER_R); trigMinus = new GuiTrigger; trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, PAD_TRIGGER_L); playcntTxt = new GuiText((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - banner window playcount text color")); playcntTxt->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); playcntTxt->SetPosition(thInt("0 - banner window play count pos x"), thInt("215 - banner window play count pos y") - Settings.AdjustOverscanY / 2); settingsBtn = new GuiButton(215, 75); settingsBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); settingsBtn->SetSoundOver(btnSoundOver); settingsBtn->SetSoundClick(btnSoundAccept); settingsBtn->SetPosition(-120, 175); settingsBtn->SetTrigger(trigA); startBtn = new GuiButton(215, 75); startBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); startBtn->SetSoundOver(btnSoundOver); startBtn->SetSoundClick(btnSoundClick3); startBtn->SetPosition(110, 175); startBtn->SetTrigger(trigA); backBtn = new GuiButton(215, 75); backBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); backBtn->SetSoundOver(btnSoundOver); backBtn->SetSoundClick(btnSoundBack); backBtn->SetPosition(-screenwidth, -screenheight); // set out of screen backBtn->SetTrigger(0, trigA); backBtn->SetTrigger(1, trigB); btnLeftImg = new GuiImage(imgLeft); if (Settings.wsprompt) btnLeftImg->SetWidescreen(Settings.widescreen); btnLeft = new GuiButton(btnLeftImg, btnLeftImg, ALIGN_LEFT, ALIGN_MIDDLE, 20, -50, trigA, btnSoundOver, btnSoundClick2, 1); btnLeft->SetTrigger(trigL); btnLeft->SetTrigger(trigMinus); btnRightImg = new GuiImage(imgRight); if (Settings.wsprompt) btnRightImg->SetWidescreen(Settings.widescreen); btnRight = new GuiButton(btnRightImg, btnRightImg, ALIGN_RIGHT, ALIGN_MIDDLE, -20, -50, trigA, btnSoundOver, btnSoundClick2, 1); btnRight->SetTrigger(trigR); btnRight->SetTrigger(trigPlus); if (Settings.ShowPlayCount) Append(playcntTxt); Append(backBtn); if (!dvdheader) //stuff we don't show if it is a DVD mounted { Append(btnLeft); Append(btnRight); } bannerFrame.SetButtonBText(tr("Start")); //check if unlocked if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_GAME_SETTINGS)) { bannerFrame.SetButtonAText(tr("Settings")); Append(settingsBtn); } else { bannerFrame.SetButtonAText(tr("Back")); backBtn->SetPosition(-120, 175); } Append(startBtn); //! Appending the disc on top of all ChangeGame(false); }
MainMenu::MainMenu() : GuiFrame(screenwidth, screenheight) { searchOn = false; filterOn = false; refreshSearch = false; oldLockSetting = Settings.GodMode; mainExplorer = NULL; deviceMenu = NULL; searchWindow = NULL; BtnSoundClick = Resources::GetSound("button_click.wav"); BtnSoundOver = Resources::GetSound("button_over.wav"); BtnSoundClick->SetVolume(Settings.SFXVolume); BtnSoundOver->SetVolume(Settings.SFXVolume); trigA.SetSimpleTrigger(-1, WiiControls.ClickButton | ClassicControls.ClickButton << 16, GCControls.ClickButton); ManageTT = new GuiTooltip(tr( "Manage All" )); ManageTT->SetAlignment(ALIGN_LEFT | ALIGN_TOP); ManageTT->SetPosition(thInt("24 - manageAll btn tooltip pos x"), thInt("-30 - manageAll btn tooltip pos y")); ManageTT->SetAlpha(thInt("255 - tooltip alpha")); ManageBtn = new PictureButton("menu_button_switch.png", "menu_button_switch_over.png", BtnSoundClick, BtnSoundOver); ManageBtn->SetAlignment(ALIGN_LEFT | ALIGN_TOP); ManageBtn->SetPosition(thInt("16 - manageAll btn pos x"), thInt("355 - managAll btn pos y")); ManageBtn->SetTooltip(ManageTT); ManageBtn->SetTrigger(&trigA); ManageBtn->SetEffect(EFFECT_FADE, 20); ManageBtn->Clicked.connect(this, &MainMenu::OnManageButtonClick); SettingsTT = new GuiTooltip(tr("Settings")); SettingsTT->SetAlignment(ALIGN_LEFT | ALIGN_TOP); SettingsTT->SetPosition(thInt("65 - settings btn tooltip pos x"), thInt("-30 - settings btn tooltip pos y")); SettingsTT->SetAlpha(thInt("255 - tooltip alpha")); SettingsBtn = new PictureButton("menu_button_settings.png", "menu_button_settings_over.png", BtnSoundClick, BtnSoundOver); SettingsBtn->SetAlignment(ALIGN_LEFT | ALIGN_TOP); SettingsBtn->SetPosition(thInt("64 - settings btn pos x"), thInt("371 - settings btn pos y")); SettingsBtn->SetTooltip(SettingsTT); SettingsBtn->SetTrigger(&trigA); SettingsBtn->SetEffect(EFFECT_FADE, 20); SettingsBtn->Clicked.connect(this, &MainMenu::OnSettingsButtonClick); HomebrewTT = new GuiTooltip(tr( "Homebrew Launcher" )); HomebrewTT->SetAlignment(ALIGN_RIGHT | ALIGN_TOP); HomebrewTT->SetPosition(thInt("-65 - homebrew btn tooltip pos x"), thInt("-30 - homebrew btn tooltip pos y")); HomebrewTT->SetAlpha(thInt("255 - tooltip alpha")); HomebrewBtn = new PictureButton("menu_button_wii.png", "menu_button_wii_over.png", BtnSoundClick, BtnSoundOver); HomebrewBtn->SetAlignment(ALIGN_LEFT | ALIGN_TOP); HomebrewBtn->SetPosition(thInt("489 - homebrew btn pos x"), thInt("371 - homebrew btn pos y")); HomebrewBtn->SetTooltip(HomebrewTT); HomebrewBtn->SetTrigger(&trigA); HomebrewBtn->SetEffect(EFFECT_FADE, 20); HomebrewBtn->Clicked.connect(this, &MainMenu::OnHomebrewButtonClick); MusicPlayerTT = new GuiTooltip(tr( "Music Player" )); MusicPlayerTT->SetAlignment(ALIGN_RIGHT | ALIGN_TOP); MusicPlayerTT->SetPosition(thInt("-24 - music btn tooltip pos x"), thInt("-30 - music btn tooltip pos y")); MusicPlayerTT->SetAlpha(thInt("255 - tooltip alpha")); MusicPlayerBtn = new PictureButton("menu_button_music.png", "menu_button_music_over.png", BtnSoundClick, BtnSoundOver); MusicPlayerBtn->SetAlignment(ALIGN_LEFT | ALIGN_TOP); MusicPlayerBtn->SetPosition(thInt("576 - music btn pos x"), thInt("355 - music btn pos y")); MusicPlayerBtn->SetTooltip(MusicPlayerTT); MusicPlayerBtn->SetTrigger(&trigA); MusicPlayerBtn->SetEffect(EFFECT_FADE, 20); MusicPlayerBtn->Clicked.connect(this, &MainMenu::OnMusicButtonClick); SdCardImgData = Resources::GetImageData("menu_button_sdcard.png"); SdCardImgGrayData = Resources::GetImageData("menu_button_sdcard_gray.png"); SdCardImg = new GuiImage(SdCardImgData); SdCardImgGray = new GuiImage(SdCardImgGrayData); SdCardTT = new GuiTooltip(tr( "Reload SD" )); SdCardTT->SetAlignment(ALIGN_LEFT | ALIGN_TOP); SdCardTT->SetPosition(thInt("15 - sd card btn tooltip pos x"), thInt("-30 - sd card btn tooltip pos y")); SdCardTT->SetAlpha(thInt("255 - tooltip alpha")); bool sd_inserted = DeviceHandler::Instance()->IsInserted(SD); SdCardBtn = new PictureButton("menu_button_sdcard.png", "menu_button_sdcard_over.png", BtnSoundClick, BtnSoundOver); SdCardBtn->SetAlignment(ALIGN_LEFT | ALIGN_TOP); SdCardBtn->SetPosition(thInt("160 - sd card btn pos x"), thInt("395 - sd card btn pos y")); SdCardBtn->SetImage(sd_inserted ? SdCardImg : SdCardImgGray); SdCardBtn->SetState(sd_inserted ? STATE_DEFAULT : STATE_DISABLED); SdCardBtn->SetTooltip(SdCardTT); SdCardBtn->SetTrigger(&trigA); SdCardBtn->SetEffect(EFFECT_FADE, 20); SdCardBtn->Clicked.connect(this, &MainMenu::OnSdCardButtonClick); }
BannerWindow::BannerWindow(GameBrowseMenu *m, struct discHdr *header) : GuiWindow(screenwidth, screenheight) , browserMenu(m) , MaxAnimSteps(Settings.BannerZoomDuration) { ScreenProps.x = screenwidth; ScreenProps.y = screenheight; f32 xOffset = Settings.BannerProjectionOffsetX; f32 yOffset = Settings.BannerProjectionOffsetY; guMtxIdentity(modelview); guMtxTransApply (modelview, modelview, xOffset, yOffset, 0.0F); memcpy(&originalProjection, &FSProjection2D, sizeof(Mtx44)); returnVal = -1; gameSelected = 0; gameSound = NULL; dvdheader = NULL; reducedVol = false; if(!bannerFrame.IsLoaded()) bannerFrame.Load(U8Archive(SystemMenuResources::Instance()->GetChanTtlAsh(), SystemMenuResources::Instance()->GetChanTtlAshSize())); AnimStep = 0; AnimPosX = 0.5f * (ScreenProps.x - fIconWidth); AnimPosY = 0.5f * (ScreenProps.y - fIconHeight); AnimZoomIn = true; AnimationRunning = false; int gameIdx; //! get the game index to this header for(gameIdx = 0; gameIdx < gameList.size(); ++gameIdx) { if(gameList[gameIdx] == header) { gameSelected = gameIdx; break; } } //! Set dvd header if the header does not match any of the list games if(gameIdx == gameList.size()) dvdheader = header; GuiBannerGrid *bannerBrowser = dynamic_cast<GuiBannerGrid *>(browserMenu->GetGameBrowser()); if(bannerBrowser) bannerBrowser->GetIconCoordinates(gameSelected, &AnimPosX, &AnimPosY); gameBanner = new Banner; imgFavorite = Resources::GetImageData("favorite.png"); imgNotFavorite = Resources::GetImageData("not_favorite.png"); imgLeft = Resources::GetImageData("startgame_arrow_left.png"); imgRight = Resources::GetImageData("startgame_arrow_right.png"); trigA = new GuiTrigger; trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigB = new GuiTrigger; trigB->SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); trigL = new GuiTrigger; trigL->SetButtonOnlyTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT); trigR = new GuiTrigger; trigR->SetButtonOnlyTrigger(-1, WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT, PAD_BUTTON_RIGHT); trigPlus = new GuiTrigger; trigPlus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, PAD_TRIGGER_R); trigMinus = new GuiTrigger; trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, PAD_TRIGGER_L); playcntTxt = new GuiText((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - banner window playcount text color")); playcntTxt->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); playcntTxt->SetPosition(thInt("0 - banner window play count pos x"), thInt("215 - banner window play count pos y") - Settings.AdjustOverscanY / 2); settingsBtn = new GuiButton(215, 75); settingsBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); settingsBtn->SetSoundOver(btnSoundOver); settingsBtn->SetSoundClick(btnSoundClick2); settingsBtn->SetPosition(-120, 175); settingsBtn->SetTrigger(trigA); startBtn = new GuiButton(215, 75); startBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); startBtn->SetSoundOver(btnSoundOver); startBtn->SetSoundClick(btnSoundClick2); startBtn->SetPosition(110, 175); startBtn->SetTrigger(trigA); backBtn = new GuiButton(215, 75); backBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); backBtn->SetSoundOver(btnSoundOver); backBtn->SetSoundClick(btnSoundClick2); backBtn->SetPosition(-screenwidth, -screenheight); // set out of screen backBtn->SetTrigger(0, trigA); backBtn->SetTrigger(1, trigB); // Set favorite button position int xPos = -198-(3*27)-14; if(Settings.bannerFavIcon == BANNER_FAVICON_SINGLE_LINEA) // push more to the screen border xPos += -14; int yPos = 175-27; float angle = 3*M_PI/2; for(int i = 0; i < FAVORITE_STARS; ++i) { if(Settings.bannerFavIcon == BANNER_FAVICON_CIRC) { /* Arrangement: 0 1 2 3 4 */ if (i==0 || i == 4){ xPos = (-180-70 - 40*cos(angle)); //litte adjustment, image looks too far } else{ xPos = (-180-65 - 40*cos(angle)); } yPos = (169 + 40*sin(angle)); angle += M_PI/4; /* if (i == 0){ xPos += 27+14; }else if (i < 3){ xPos += -14; yPos += 27; } else if (i >= 3){ xPos += 14; yPos += 27; } */ } else if(Settings.bannerFavIcon == BANNER_FAVICON_SIN) { /* Arrangement: 0 2 4 1 3 */ xPos += 27; xPos += -14; if ((i&1)==0) { yPos += 27; } else { yPos -= 27; } } else if(Settings.bannerFavIcon == BANNER_FAVICON_MULTI_LINE) { /* Sequential arrangement, 3 on top, 2 at bottom: 1 2 3 4 5 */ xPos += 27; if (i==2){ xPos += -27-27-14; yPos += 27; } } else if(Settings.bannerFavIcon == BANNER_FAVICON_SINGLE_LINEA) { /* Arrangement : inline above the settings */ xPos += 27; yPos = 95; } else if(Settings.bannerFavIcon == BANNER_FAVICON_SINGLE_LINEB) { /* Arrangement : inline below the settings */ xPos += 27; yPos = 210; } FavoriteBtnImg[i] = new GuiImage; FavoriteBtnImg[i]->SetWidescreen(Settings.widescreen); FavoriteBtn[i] = new GuiButton(imgFavorite->GetWidth(), imgFavorite->GetHeight()); FavoriteBtn[i]->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE); FavoriteBtn[i]->SetPosition(xPos, yPos); FavoriteBtn[i]->SetImage(FavoriteBtnImg[i]); FavoriteBtn[i]->SetSoundOver(btnSoundOver); FavoriteBtn[i]->SetSoundClick(btnSoundClick2); FavoriteBtn[i]->SetTrigger(trigA); FavoriteBtn[i]->SetEffectGrow(); } btnLeftImg = new GuiImage(imgLeft); if (Settings.wsprompt) btnLeftImg->SetWidescreen(Settings.widescreen); btnLeft = new GuiButton(btnLeftImg, btnLeftImg, ALIGN_LEFT, ALIGN_MIDDLE, 20, -50, trigA, btnSoundOver, btnSoundClick2, 1); btnLeft->SetTrigger(trigL); btnLeft->SetTrigger(trigMinus); btnRightImg = new GuiImage(imgRight); if (Settings.wsprompt) btnRightImg->SetWidescreen(Settings.widescreen); btnRight = new GuiButton(btnRightImg, btnRightImg, ALIGN_RIGHT, ALIGN_MIDDLE, -20, -50, trigA, btnSoundOver, btnSoundClick2, 1); btnRight->SetTrigger(trigR); btnRight->SetTrigger(trigPlus); if (Settings.ShowPlayCount) Append(playcntTxt); Append(backBtn); if (!dvdheader) //stuff we don't show if it is a DVD mounted { Append(btnLeft); Append(btnRight); } bannerFrame.SetButtonBText(tr("Start")); //check if unlocked if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_GAME_SETTINGS)) { bannerFrame.SetButtonAText(tr("Settings")); Append(settingsBtn); if(Settings.bannerFavIcon != BANNER_FAVICON_OFF) for(int i = 0; i < FAVORITE_STARS; ++i) Append(FavoriteBtn[i]); } else { bannerFrame.SetButtonAText(tr("Back")); backBtn->SetPosition(-120, 175); } Append(startBtn); //! Appending the disc on top of all ChangeGame(false); }