From 056c47124d2beda9a40b568c744d269e864c7fe8 Mon Sep 17 00:00:00 2001 From: fledge68 Date: Tue, 14 Aug 2012 15:42:34 +0000 Subject: [PATCH] - separated help text from about text and added a 'help' button to the home menu. updated english text. --- source/defines.h | 2 +- source/menu/menu.hpp | 6 +-- source/menu/menu_about.cpp | 72 +++++++++++++++++-------------- source/menu/menu_home.cpp | 34 ++++++++++----- wii/wiiflow/Languages/english.ini | 2 + 5 files changed, 70 insertions(+), 46 deletions(-) diff --git a/source/defines.h b/source/defines.h index bc106b79..5561da64 100644 --- a/source/defines.h +++ b/source/defines.h @@ -30,7 +30,7 @@ #define THANKS \ "Lustar, CedWii, Benjay, Domi78, Oops, \ Celtiore, Jiiwah, FluffyKiwi, Roku93, Yardape8000, \ -Spayrosam, Bluescreen81, Chappy23, fledge68, \ +Spayrosam, Bluescreen81, Chappy23, Fledge68, \ BlindDude, Bubba, DJTaz, OggZee, entropy, \ Usptactical, WiiPower, Hermes, Spidy1000, megazig, \ Dimok, Kovani, Drexyl, DvZ, Etheboss, stfour, \ diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index dfcf19e7..ebdb708d 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -1,6 +1,6 @@ #ifndef __MENU_HPP #define __MENU_HPP -//#define SHOWMEM 1 +//#define SHOWMEM //#define SHOWMEMGECKO #include @@ -966,7 +966,7 @@ private: void _game(bool launch = false); void _download(string gameId = string()); void _code(void); - void _about(void); + void _about(bool help = false); bool _wbfsOp(WBFS_OP op); void _cfTheme(void); void _system(void); @@ -975,7 +975,7 @@ private: void _CheatSettings(); bool _Source(); void _PluginSettings(); - void _CategorySettings(bool fromGameSet=false); + void _CategorySettings(bool fromGameSet = false); bool _Home(); bool _ExitTo(); // diff --git a/source/menu/menu_about.cpp b/source/menu/menu_about.cpp index 39f35d60..13baf740 100644 --- a/source/menu/menu_about.cpp +++ b/source/menu/menu_about.cpp @@ -16,9 +16,11 @@ u16 m_aboutLblTitle; u16 m_aboutLblInfo; u16 m_aboutLblUser[4]; u16 m_aboutLblIOS; +bool showHelp; -void CMenu::_about(void) +void CMenu::_about(bool help) { + showHelp = help; int amount_of_skips = 0; int thanks_x = 0, thanks_y = 0; u32 thanks_w = 0, thanks_h = 0; @@ -99,7 +101,7 @@ void CMenu::_initAboutMenu(CMenu::SThemeData &theme) _addUserLabels(theme, m_aboutLblUser, ARRAY_SIZE(m_aboutLblUser), "ABOUT"); m_aboutBg = _texture(theme.texSet, "ABOUT/BG", "texture", theme.bg); m_aboutLblTitle = _addTitle(theme, "ABOUT/TITLE", theme.titleFont, L"", 20, 30, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); - m_aboutLblInfo = _addText(theme, "ABOUT/INFO", theme.txtFont, L"", 40, 120, 560, 280, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); + m_aboutLblInfo = _addText(theme, "ABOUT/INFO", theme.txtFont, L"", 40, 115, 560, 270, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_aboutLblIOS = _addLabel(theme, "ABOUT/IOS", theme.txtFont, L"", 240, 400, 360, 56, theme.txtFontColor, FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_MIDDLE); _setHideAnim(m_aboutLblTitle, "ABOUT/TITLE", 0, 0, -2.f, 0.f); @@ -111,43 +113,48 @@ void CMenu::_initAboutMenu(CMenu::SThemeData &theme) void CMenu::_textAbout(void) { - m_btnMgr.setText(m_aboutLblTitle, wfmt( L"%s (%s-r%s)", APP_NAME, APP_VERSION, SVN_REV), false); - - wstringEx help_text; - FILE *f = fopen(fmt("%s/%s.txt", m_helpDir.c_str(), m_curLanguage.c_str()), "r"); - if(f) + if(showHelp) { - fseek(f, 0, SEEK_END); - u32 fsize = ftell(f); - char *help = (char*)malloc(fsize + 1); //+1 for null character - memset(help, 0, fsize + 1); - fseek(f, 0, SEEK_SET); - fread(help, 1, fsize, f); - help[fsize] = '\0'; - help_text.fromUTF8(help); - free(help); - fclose(f); + m_btnMgr.setText(m_aboutLblTitle, _t("about10", L"Help Guide")); + wstringEx help_text; + FILE *f = fopen(fmt("%s/%s.txt", m_helpDir.c_str(), m_curLanguage.c_str()), "r"); + if(f) + { + fseek(f, 0, SEEK_END); + u32 fsize = ftell(f); + char *help = (char*)MEM2_alloc(fsize+1); //+1 for null character + fseek(f, 0, SEEK_SET); + fread(help, 1, fsize, f); + help[fsize] = '\0'; + help_text.fromUTF8(help); + MEM2_free(help); + fclose(f); + } + else + help_text.fromUTF8((char*)english_txt); + + m_btnMgr.setText(m_aboutLblInfo, wfmt(L"%s", help_text.toUTF8().c_str()), false); } else - help_text.fromUTF8((char*)english_txt); + { + m_btnMgr.setText(m_aboutLblTitle, wfmt( L"%s (%s-r%s)", APP_NAME, APP_VERSION, SVN_REV), false); + + wstringEx developers(wfmt(_fmt("about6", L"\nCurrent Developers:\n%s"), DEVELOPERS)); + wstringEx pDevelopers(wfmt(_fmt("about7", L"Past Developers:\n%s"), PAST_DEVELOPERS)); - wstringEx developers(wfmt(_fmt("about6", L"\nCurrent Developers:\n%s"), DEVELOPERS)); - wstringEx pDevelopers(wfmt(_fmt("about7", L"Past Developers:\n%s"), PAST_DEVELOPERS)); + wstringEx origLoader(wfmt(_fmt("about1", L"Original Loader By:\n%s"), LOADER_AUTHOR)); + wstringEx origGUI(wfmt(_fmt("about2", L"Original GUI By:\n%s"), GUI_AUTHOR)); - wstringEx origLoader(wfmt(_fmt("about1", L"Original Loader By:\n%s"), LOADER_AUTHOR)); - wstringEx origGUI(wfmt(_fmt("about2", L"Original GUI By:\n%s"), GUI_AUTHOR)); + wstringEx codethx(wfmt(_fmt("about8", L"Bits of Code Obtained From:\n%s"), THANKS_CODE)); + wstringEx sites(wfmt(_fmt("about9", L"Supporting Websites:\n%s"), THANKS_SITES)); - wstringEx codethx(wfmt(_fmt("about8", L"Bits of Code Obtained From:\n%s"), THANKS_CODE)); - wstringEx sites(wfmt(_fmt("about9", L"Supporting Websites:\n%s"), THANKS_SITES)); + wstringEx translator(wfmt(L", %s", m_loc.getWString(m_curLanguage, "translation_author").toUTF8().c_str())); + wstringEx thanks(wfmt(_fmt("about4", L"Thanks To:\n%s"), THANKS)); + if(translator.size() > 3) + thanks.append(translator); - wstringEx translator(wfmt(L", %s", m_loc.getWString(m_curLanguage, "translation_author").toUTF8().c_str())); - wstringEx thanks(wfmt(_fmt("about4", L"Thanks To:\n%s"), THANKS)); - if(translator.size() > 3) - thanks.append(translator); - - m_btnMgr.setText(m_aboutLblInfo, - wfmt(L"%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s", - help_text.toUTF8().c_str(), + m_btnMgr.setText(m_aboutLblInfo, + wfmt(L"%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s", developers.toUTF8().c_str(), pDevelopers.toUTF8().c_str(), origLoader.toUTF8().c_str(), @@ -157,6 +164,7 @@ void CMenu::_textAbout(void) thanks.toUTF8().c_str()), false ); + } m_btnMgr.setText(m_aboutLblIOS, wfmt(_fmt("ios", L"IOS%i base %i v%i"), CurrentIOS.Version, CurrentIOS.Base, CurrentIOS.Revision), true); } diff --git a/source/menu/menu_home.cpp b/source/menu/menu_home.cpp index 0ee1263d..d7669611 100644 --- a/source/menu/menu_home.cpp +++ b/source/menu/menu_home.cpp @@ -10,6 +10,7 @@ u32 m_exittoLblTitle; u32 m_homeBtnSettings; u32 m_homeBtnReloadCache; u32 m_homeBtnUpdate; +u32 m_homeBtnHelp; u32 m_homeBtnAbout; u32 m_homeBtnExitTo; @@ -65,6 +66,14 @@ bool CMenu::_Home(void) _showHome(); m_cf.startCoverLoader(); } + else if(m_btnMgr.selected(m_homeBtnHelp)) + { + _hideHome(); + _about(true); + if(m_exit) + break; + _showHome(); + } else if(m_btnMgr.selected(m_homeBtnAbout)) { _hideHome(); @@ -158,6 +167,7 @@ void CMenu::_showHome(void) m_btnMgr.show(m_homeBtnSettings); m_btnMgr.show(m_homeBtnReloadCache); m_btnMgr.show(m_homeBtnUpdate); + m_btnMgr.show(m_homeBtnHelp); m_btnMgr.show(m_homeBtnAbout); m_btnMgr.show(m_homeBtnExitTo); } @@ -181,6 +191,7 @@ void CMenu::_hideHome(bool instant) m_btnMgr.hide(m_homeBtnSettings, instant); m_btnMgr.hide(m_homeBtnReloadCache, instant); m_btnMgr.hide(m_homeBtnUpdate, instant); + m_btnMgr.hide(m_homeBtnHelp, instant); m_btnMgr.hide(m_homeBtnAbout, instant); m_btnMgr.hide(m_homeBtnExitTo, instant); } @@ -206,15 +217,17 @@ void CMenu::_initHomeAndExitToMenu(CMenu::SThemeData &theme) _setHideAnim(m_homeLblTitle, "HOME/TITLE", 0, 0, -2.f, 0.f); - m_homeBtnSettings = _addButton(theme, "HOME/SETTINGS", theme.btnFont, L"", 220, 120, 270, 56, theme.btnFontColor); - m_homeBtnReloadCache = _addButton(theme, "HOME/RELOAD_CACHE", theme.btnFont, L"", 220, 180, 270, 56, theme.btnFontColor); - m_homeBtnUpdate = _addButton(theme, "HOME/UPDATE", theme.btnFont, L"", 220, 240, 270, 56, theme.btnFontColor); - m_homeBtnAbout = _addButton(theme, "HOME/ABOUT", theme.btnFont, L"", 220, 300, 270, 56, theme.btnFontColor); - m_homeBtnExitTo = _addButton(theme, "HOME/EXIT_TO", theme.btnFont, L"", 220, 360, 270, 56, theme.btnFontColor); + m_homeBtnSettings = _addButton(theme, "HOME/SETTINGS", theme.btnFont, L"", 60, 120, 250, 56, theme.btnFontColor); + m_homeBtnReloadCache = _addButton(theme, "HOME/RELOAD_CACHE", theme.btnFont, L"", 60, 230, 250, 56, theme.btnFontColor); + m_homeBtnUpdate = _addButton(theme, "HOME/UPDATE", theme.btnFont, L"", 60, 340, 250, 56, theme.btnFontColor); + m_homeBtnHelp = _addButton(theme, "HOME/HELP", theme.btnFont, L"", 330, 120, 250, 56, theme.btnFontColor); + m_homeBtnAbout = _addButton(theme, "HOME/ABOUT", theme.btnFont, L"", 330, 230, 250, 56, theme.btnFontColor); + m_homeBtnExitTo = _addButton(theme, "HOME/EXIT_TO", theme.btnFont, L"", 330, 340, 250, 56, theme.btnFontColor); _setHideAnim(m_homeBtnSettings, "HOME/SETTINGS", 0, 0, -2.f, 0.f); _setHideAnim(m_homeBtnReloadCache, "HOME/RELOAD_CACHE", 0, 0, -2.f, 0.f); _setHideAnim(m_homeBtnUpdate, "HOME/UPDATE", 0, 0, -2.f, 0.f); + _setHideAnim(m_homeBtnHelp, "HOME/HELP", 0, 0, -2.f, 0.f); _setHideAnim(m_homeBtnAbout, "HOME/ABOUT", 0, 0, -2.f, 0.f); _setHideAnim(m_homeBtnExitTo, "HOME/EXIT_TO", 0, 0, -2.f, 0.f); @@ -226,11 +239,11 @@ void CMenu::_initHomeAndExitToMenu(CMenu::SThemeData &theme) _setHideAnim(m_exittoLblTitle, "EXIT_TO/TITLE", 0, 0, -2.f, 0.f); - m_homeBtnExitToHBC = _addButton(theme, "EXIT_TO/HBC", theme.btnFont, L"", 220, 120, 270, 56, theme.btnFontColor); - m_homeBtnExitToMenu = _addButton(theme, "EXIT_TO/MENU", theme.btnFont, L"", 220, 180, 270, 56, theme.btnFontColor); - m_homeBtnExitToPriiloader = _addButton(theme, "EXIT_TO/PRIILOADER", theme.btnFont, L"", 220, 240, 270, 56, theme.btnFontColor); - m_homeBtnExitToBootmii = _addButton(theme, "EXIT_TO/BOOTMII", theme.btnFont, L"", 220, 300, 270, 56, theme.btnFontColor); - m_homeBtnExitToNeek = _addButton(theme, "EXIT_TO/NEEK", theme.btnFont, L"", 220, 360, 270, 56, theme.btnFontColor); + m_homeBtnExitToHBC = _addButton(theme, "EXIT_TO/HBC", theme.btnFont, L"", 185, 120, 270, 56, theme.btnFontColor); + m_homeBtnExitToMenu = _addButton(theme, "EXIT_TO/MENU", theme.btnFont, L"", 185, 180, 270, 56, theme.btnFontColor); + m_homeBtnExitToPriiloader = _addButton(theme, "EXIT_TO/PRIILOADER", theme.btnFont, L"", 185, 240, 270, 56, theme.btnFontColor); + m_homeBtnExitToBootmii = _addButton(theme, "EXIT_TO/BOOTMII", theme.btnFont, L"", 185, 300, 270, 56, theme.btnFontColor); + m_homeBtnExitToNeek = _addButton(theme, "EXIT_TO/NEEK", theme.btnFont, L"", 185, 360, 270, 56, theme.btnFontColor); _setHideAnim(m_homeBtnExitToHBC, "EXIT_TO/HBC", 0, 0, -2.f, 0.f); _setHideAnim(m_homeBtnExitToMenu, "EXIT_TO/MENU", 0, 0, -2.f, 0.f); _setHideAnim(m_homeBtnExitToPriiloader, "EXIT_TO/PRIILOADER", 0, 0, -2.f, 0.f); @@ -248,6 +261,7 @@ void CMenu::_textHome(void) m_btnMgr.setText(m_homeBtnSettings, _t("home1", L"Settings")); m_btnMgr.setText(m_homeBtnReloadCache, _t("home2", L"Reload Cache")); m_btnMgr.setText(m_homeBtnUpdate, _t("home3", L"Update")); + m_btnMgr.setText(m_homeBtnHelp, _t("home6", L"Help")); m_btnMgr.setText(m_homeBtnAbout, _t("home4", L"About")); m_btnMgr.setText(m_homeBtnExitTo, _t("home5", L"Exit To")); } diff --git a/wii/wiiflow/Languages/english.ini b/wii/wiiflow/Languages/english.ini index 27b1d83d..2035fe8c 100644 --- a/wii/wiiflow/Languages/english.ini +++ b/wii/wiiflow/Languages/english.ini @@ -7,6 +7,7 @@ about6=Current Developers:\n%s about7=Past Developers:\n%s about8=Bits of Code Obtained From:\n%s about9=Supporting Websites:\n%s +about10=Help Guide alphabetically=aphabetically appname=%s v%s aspect169=Force 16:9 @@ -218,6 +219,7 @@ home2=Reload Cache home3=Update home4=About home5=Exit To +home6=Help hooktype1=VBI hooktype2=KPAD Read hooktype3=Joypad