mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-16 00:15:08 +01:00
Display the HDD size correctly
This commit is contained in:
parent
e0e6815b8f
commit
ec5ed33c3b
@ -40,7 +40,6 @@
|
|||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
|
|
||||||
struct discHdr *dvdheader = NULL;
|
struct discHdr *dvdheader = NULL;
|
||||||
static bool Exiting = false;
|
|
||||||
|
|
||||||
GameBrowseMenu::GameBrowseMenu()
|
GameBrowseMenu::GameBrowseMenu()
|
||||||
: GuiWindow(screenwidth, screenheight)
|
: GuiWindow(screenwidth, screenheight)
|
||||||
@ -48,7 +47,6 @@ GameBrowseMenu::GameBrowseMenu()
|
|||||||
returnMenu = MENU_NONE;
|
returnMenu = MENU_NONE;
|
||||||
gameSelectedOld = -1;
|
gameSelectedOld = -1;
|
||||||
lastrawtime = 0;
|
lastrawtime = 0;
|
||||||
Exiting = false;
|
|
||||||
show_searchwindow = false;
|
show_searchwindow = false;
|
||||||
gameBrowser = NULL;
|
gameBrowser = NULL;
|
||||||
searchBar = NULL;
|
searchBar = NULL;
|
||||||
@ -115,6 +113,8 @@ GameBrowseMenu::GameBrowseMenu()
|
|||||||
usedSpaceTxt = new GuiText(" ", 18, thColor("r=55 g=190 b=237 a=255 - hdd info color"));
|
usedSpaceTxt = new GuiText(" ", 18, thColor("r=55 g=190 b=237 a=255 - hdd info color"));
|
||||||
usedSpaceTxt->SetAlignment(thAlign("center - hdd info align hor"), thAlign("top - hdd info align ver"));
|
usedSpaceTxt->SetAlignment(thAlign("center - hdd info align hor"), thAlign("top - hdd info align ver"));
|
||||||
usedSpaceTxt->SetPosition(thInt("0 - hdd info pos x"), thInt("400 - hdd info pos y"));
|
usedSpaceTxt->SetPosition(thInt("0 - hdd info pos x"), thInt("400 - hdd info pos y"));
|
||||||
|
usedSpaceTxt->SetVisible(false);
|
||||||
|
SetFreeSpace(0.0f, 0.0f);
|
||||||
|
|
||||||
gamecntTxt = new GuiText((char *) NULL, 18, thColor("r=55 g=190 b=237 a=255 - game count color"));
|
gamecntTxt = new GuiText((char *) NULL, 18, thColor("r=55 g=190 b=237 a=255 - game count color"));
|
||||||
gamecntBtn = new GuiButton(100, 18);
|
gamecntBtn = new GuiButton(100, 18);
|
||||||
@ -366,7 +366,6 @@ GameBrowseMenu::GameBrowseMenu()
|
|||||||
|
|
||||||
GameBrowseMenu::~GameBrowseMenu()
|
GameBrowseMenu::~GameBrowseMenu()
|
||||||
{
|
{
|
||||||
Exiting = true;
|
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
|
|
||||||
SetEffect(EFFECT_FADE, -20);
|
SetEffect(EFFECT_FADE, -20);
|
||||||
@ -850,6 +849,8 @@ void GameBrowseMenu::ReloadBrowser()
|
|||||||
Append(usedSpaceTxt);
|
Append(usedSpaceTxt);
|
||||||
if (thInt("1 - show game count: 1 for on and 0 for off") == 1) //force show game cnt info
|
if (thInt("1 - show game count: 1 for on and 0 for off") == 1) //force show game cnt info
|
||||||
Append(gamecntBtn);
|
Append(gamecntBtn);
|
||||||
|
if (!Settings.ShowGameCount)
|
||||||
|
Remove(gamecntBtn);
|
||||||
if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_SD_RELOAD_BUTTON))
|
if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_SD_RELOAD_BUTTON))
|
||||||
Append(sdcardBtn);
|
Append(sdcardBtn);
|
||||||
Append(poweroffBtn);
|
Append(poweroffBtn);
|
||||||
@ -1685,32 +1686,23 @@ void GameBrowseMenu::UpdateCallback(void * e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameBrowseMenu::UpdateFreeSpace(void * arg)
|
void GameBrowseMenu::SetFreeSpace(float freespace, float used)
|
||||||
{
|
{
|
||||||
char spaceinfo[30];
|
|
||||||
spaceinfo[0] = 0;
|
|
||||||
|
|
||||||
if(Settings.ShowFreeSpace)
|
|
||||||
{
|
|
||||||
float freespace = 0.0, used = 0.0;
|
|
||||||
int ret = WBFS_DiskSpace(&used, &freespace);
|
|
||||||
if(ret >= 0)
|
|
||||||
{
|
|
||||||
if (strcmp(Settings.db_language, "JA") == 0)
|
if (strcmp(Settings.db_language, "JA") == 0)
|
||||||
{
|
usedSpaceTxt->SetText(fmt("%.2fGB %s %.2fGB %s", freespace + used, tr( "of" ), freespace, tr( "free" )));
|
||||||
// needs to be "total...used" for Japanese
|
|
||||||
snprintf(spaceinfo, sizeof(spaceinfo), "%.2fGB %s %.2fGB %s", (freespace + used), tr( "of" ), freespace, tr( "free" ));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
usedSpaceTxt->SetText(fmt("%.2fGB %s %.2fGB %s", freespace, tr( "of" ), freespace + used, tr( "free" )));
|
||||||
snprintf(spaceinfo, sizeof(spaceinfo), "%.2fGB %s %.2fGB %s", freespace, tr( "of" ), (freespace + used), tr( "free" ));
|
}
|
||||||
}
|
|
||||||
}
|
void GameBrowseMenu::UpdateFreeSpace(void * arg)
|
||||||
}
|
{
|
||||||
|
if (Settings.ShowFreeSpace)
|
||||||
if(Exiting)
|
{
|
||||||
return;
|
float freespace = 0.0, used = 0.0;
|
||||||
|
usedSpaceTxt->SetVisible(true);
|
||||||
usedSpaceTxt->SetText(spaceinfo);
|
int ret = WBFS_DiskSpace(&used, &freespace);
|
||||||
|
if (ret >= 0)
|
||||||
|
SetFreeSpace(freespace, used);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ class GameBrowseMenu : public GuiWindow
|
|||||||
void LoadCover(struct discHdr *header);
|
void LoadCover(struct discHdr *header);
|
||||||
void CheckDiscSlotUpdate();
|
void CheckDiscSlotUpdate();
|
||||||
void UpdateFreeSpace(void *arg);
|
void UpdateFreeSpace(void *arg);
|
||||||
|
void SetFreeSpace(float freespace, float used);
|
||||||
void UpdateClock();
|
void UpdateClock();
|
||||||
static void UpdateCallback(void * e);
|
static void UpdateCallback(void * e);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user