From 8fec6f98ceb7618985c27865248a445a57e08724 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Tue, 3 Jul 2012 22:08:51 +0000 Subject: [PATCH] -added new buttons for fullscreen banner view, also if in fullscreen banner view the background screen is black now --- source/banner/BannerWindow.cpp | 15 ++++++-- source/banner/BannerWindow.hpp | 1 + source/menu/menu_game.cpp | 65 ++++++++++++++++++++++++---------- 3 files changed, 59 insertions(+), 22 deletions(-) diff --git a/source/banner/BannerWindow.cpp b/source/banner/BannerWindow.cpp index b65f75d2..3e4bd402 100644 --- a/source/banner/BannerWindow.cpp +++ b/source/banner/BannerWindow.cpp @@ -23,6 +23,7 @@ void BannerWindow::LoadBanner(Banner *banner, CVideo *vid, u8 *font1, u8 *font2) { + changing = true; MaxAnimSteps = 30; returnVal = -1; reducedVol = false; @@ -41,8 +42,11 @@ void BannerWindow::LoadBanner(Banner *banner, CVideo *vid, u8 *font1, u8 *font2) AnimZoomOut = false; AnimationRunning = false; BannerAlpha = 255.f; + BGAlpha = 255.f; + ChangeGame(banner); gameSelected = 1; + changing = false; } void BannerWindow::DeleteBanner() @@ -53,6 +57,7 @@ void BannerWindow::DeleteBanner() BannerWindow::BannerWindow() { + changing = false; AnimStep = 20; gameSelected = 0; gameBanner = new AnimatedBanner; @@ -60,7 +65,7 @@ BannerWindow::BannerWindow() void BannerWindow::ChangeGame(Banner *banner) { - gameSelected = 0; + gameBanner->Clear(); gameBanner->LoadFont(sysFont1, sysFont2); gameBanner->LoadBanner(banner); } @@ -168,7 +173,11 @@ void BannerWindow::Animate(void) void BannerWindow::Draw(void) { // draw a black background image first - //DrawRectangle(0.0f, 0.0f, ScreenProps.x, ScreenProps.y, (GXColor) {0, 0, 0, BGAlpha}, true); + if(AnimStep >= MaxAnimSteps) + DrawRectangle(0.0f, 0.0f, video->width(), video->height(), (GXColor) {0, 0, 0, BGAlpha}, true); + + if(changing) + return; // Run window animation Animate(); @@ -184,7 +193,7 @@ void BannerWindow::Draw(void) guMtxScaleApply(modelview,mv1, 1.f, -1.f, 1.f); guMtxTransApply(mv1,mv1, 0.5f * ScreenProps.x, 0.5f * ScreenProps.y, 0.f); guMtxTransApply(mv2,mv2, -0.5f * fBannerWidth, 0.5f * fBannerHeight, 0.f); - guMtxTransApply(mv3,mv3, 0.5f * fBannerWidth, -0.5f * fBannerHeight + 102.f, 0.f); + guMtxTransApply(mv3,mv3, 0.5f * fBannerWidth, -0.5f * fBannerHeight + 104.f, 0.f); guMtxConcat(mv1, mv2, mv2); guMtxConcat(mv1, mv3, mv3); diff --git a/source/banner/BannerWindow.hpp b/source/banner/BannerWindow.hpp index fa7be015..f489016c 100644 --- a/source/banner/BannerWindow.hpp +++ b/source/banner/BannerWindow.hpp @@ -65,6 +65,7 @@ class BannerWindow bool AnimZoomOut; bool AnimationRunning; bool oldAnimationRunning; + bool changing; u8 BGAlpha; u8 BannerAlpha; diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 6ea17409..aea4a410 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -58,7 +58,9 @@ extern u32 sector_size; extern int mainIOS; static u64 sm_title_id[8] ATTRIBUTE_ALIGN(32); -bool m_zoom_banner; +bool m_zoom_banner = false; +u32 m_gameBtnPlayFull; +u32 m_gameBtnBackFull; const string CMenu::_translations[23] = { "Default", @@ -306,11 +308,13 @@ void CMenu::_hideGame(bool instant) m_gameSelected = false; m_fa.unload(); m_cf.showCover(); - m_btnMgr.hide(m_gameBtnPlay, instant); + m_btnMgr.hide(m_gameBtnBack, instant); + m_btnMgr.hide(m_gameBtnPlayFull, instant); + m_btnMgr.hide(m_gameBtnBackFull, instant); m_btnMgr.hide(m_gameBtnDelete, instant); m_btnMgr.hide(m_gameBtnSettings, instant); - m_btnMgr.hide(m_gameBtnBack, instant); + m_btnMgr.hide(m_gameBtnFavoriteOn, instant); m_btnMgr.hide(m_gameBtnFavoriteOff, instant); m_btnMgr.hide(m_gameBtnAdultOn, instant); @@ -335,12 +339,22 @@ void CMenu::_showGame(void) } else _setBg(m_mainBg, m_mainBgLQ); - - m_btnMgr.show(m_gameBtnPlay); - m_btnMgr.show(m_gameBtnBack); - for (u32 i = 0; i < ARRAY_SIZE(m_gameLblUser); ++i) - if (m_gameLblUser[i] != -1u) - m_btnMgr.show(m_gameLblUser[i]); + + if(!m_zoom_banner) + { + for(u32 i = 0; i < ARRAY_SIZE(m_gameLblUser); ++i) + { + if(m_gameLblUser[i] != -1u) + m_btnMgr.show(m_gameLblUser[i]); + } + m_btnMgr.show(m_gameBtnPlay); + m_btnMgr.show(m_gameBtnBack); + } + else + { + m_btnMgr.show(m_gameBtnPlayFull); + m_btnMgr.show(m_gameBtnBackFull); + } } static void setLanguage(int l) @@ -470,7 +484,7 @@ void CMenu::_game(bool launch) m_gcfg1.setBool("FAVORITES", id, !m_gcfg1.getBool("FAVORITES", id, false)); else if(m_btnMgr.selected(m_gameBtnAdultOn) || m_btnMgr.selected(m_gameBtnAdultOff)) m_gcfg1.setBool("ADULTONLY", id, !m_gcfg1.getBool("ADULTONLY", id, false)); - else if(m_btnMgr.selected(m_gameBtnBack)) + else if(m_btnMgr.selected(m_gameBtnBack) || m_btnMgr.selected(m_gameBtnBackFull)) { //m_gameSound.Stop(); //CheckGameSoundThread(); @@ -479,11 +493,13 @@ void CMenu::_game(bool launch) { m_banner.ZoomOut(); m_zoom_banner = false; + m_show_zone_game = false; } else { m_banner.ZoomIn(); m_zoom_banner = true; + m_show_zone_game = false; } } else if(m_btnMgr.selected(m_gameBtnSettings)) @@ -495,7 +511,7 @@ void CMenu::_game(bool launch) if(!m_gameSound.IsPlaying()) startGameSound = -6; } - else if(launch || m_btnMgr.selected(m_gameBtnPlay) || (!WPadIR_Valid(0) && !WPadIR_Valid(1) && !WPadIR_Valid(2) && !WPadIR_Valid(3) && m_btnMgr.selected((u32)-1))) + else if(launch || m_btnMgr.selected(m_gameBtnPlay) || m_btnMgr.selected(m_gameBtnPlayFull) || (!WPadIR_Valid(0) && !WPadIR_Valid(1) && !WPadIR_Valid(2) && !WPadIR_Valid(3) && m_btnMgr.selected((u32)-1))) { _hideGame(); dir_discHdr *hdr = m_cf.getHdr(); @@ -592,30 +608,37 @@ void CMenu::_game(bool launch) m_fa.unload(); _setBg(m_mainBg, m_mainBgLQ); } - if(m_show_zone_game) + if(m_show_zone_game && !m_zoom_banner) { bool b = m_gcfg1.getBool("FAVORITES", id, false); m_btnMgr.show(b ? m_gameBtnFavoriteOn : m_gameBtnFavoriteOff); m_btnMgr.hide(b ? m_gameBtnFavoriteOff : m_gameBtnFavoriteOn); m_btnMgr.show(m_gameBtnPlay); m_btnMgr.show(m_gameBtnBack); - for (u32 i = 0; i < ARRAY_SIZE(m_gameLblUser); ++i) - if (m_gameLblUser[i] != -1u) + m_btnMgr.hide(m_gameBtnPlayFull); + m_btnMgr.hide(m_gameBtnBackFull); + for(u32 i = 0; i < ARRAY_SIZE(m_gameLblUser); ++i) + { + if(m_gameLblUser[i] != -1u) m_btnMgr.show(m_gameLblUser[i]); - - if (!m_locked) + } + if(!m_locked) { b = m_gcfg1.getBool("ADULTONLY", id, false); m_btnMgr.show(b ? m_gameBtnAdultOn : m_gameBtnAdultOff); m_btnMgr.hide(b ? m_gameBtnAdultOff : m_gameBtnAdultOn); m_btnMgr.show(m_gameBtnSettings); } - if ((m_cf.getHdr()->type != TYPE_HOMEBREW && m_cf.getHdr()->type != TYPE_CHANNEL) && !m_locked) m_btnMgr.show(m_gameBtnDelete); } else { + if(m_zoom_banner) + { + m_btnMgr.show(m_gameBtnPlayFull); + m_btnMgr.show(m_gameBtnBackFull); + } m_btnMgr.hide(m_gameBtnFavoriteOn); m_btnMgr.hide(m_gameBtnFavoriteOff); m_btnMgr.hide(m_gameBtnAdultOn); @@ -1424,6 +1447,8 @@ void CMenu::_initGameMenu(CMenu::SThemeData &theme) m_gameBtnAdultOff = _addPicButton(theme, "GAME/ADULTONLY_OFF", texAdultOff, texAdultOffSel, 532, 170, 48, 48); m_gameBtnSettings = _addPicButton(theme, "GAME/SETTINGS_BTN", texSettings, texSettingsSel, 460, 242, 48, 48); m_gameBtnDelete = _addPicButton(theme, "GAME/DELETE_BTN", texDelete, texDeleteSel, 532, 242, 48, 48); + m_gameBtnPlayFull = _addButton(theme, "GAME/PLAY_FULL_BTN", theme.btnFont, L"", 100, 380, 200, 56, theme.btnFontColor); + m_gameBtnBackFull = _addButton(theme, "GAME/BACK_FULL_BTN", theme.btnFont, L"", 340, 380, 200, 56, theme.btnFontColor); m_gameButtonsZone.x = m_theme.getInt("GAME/ZONES", "buttons_x", 0); m_gameButtonsZone.y = m_theme.getInt("GAME/ZONES", "buttons_y", 0); @@ -1439,16 +1464,18 @@ void CMenu::_initGameMenu(CMenu::SThemeData &theme) _setHideAnim(m_gameBtnAdultOff, "GAME/ADULTONLY_OFF", 0, 0, -1.5f, -1.5f); _setHideAnim(m_gameBtnSettings, "GAME/SETTINGS_BTN", 0, 0, -1.5f, -1.5f); _setHideAnim(m_gameBtnDelete, "GAME/DELETE_BTN", 0, 0, -1.5f, -1.5f); + _setHideAnim(m_gameBtnPlayFull, "GAME/PLAY_FULL_BTN", 200, 0, 1.f, 0.f); + _setHideAnim(m_gameBtnBackFull, "GAME/BACK_FULL_BTN", 200, 0, 1.f, 0.f); _hideGame(true); _textGame(); - - m_zoom_banner = false; } void CMenu::_textGame(void) { m_btnMgr.setText(m_gameBtnPlay, _t("gm1", L"Play")); m_btnMgr.setText(m_gameBtnBack, _t("gm2", L"Back")); + m_btnMgr.setText(m_gameBtnPlayFull, _t("gm1", L"Play")); + m_btnMgr.setText(m_gameBtnBackFull, _t("gm2", L"Back")); } struct IMD5Header