Skip to content

Commit 145be96

Browse files
committed
1.5 Release candidate
Much more stability and user friendliness random button works now back button to return to category overvieiw Misc formatting changes
1 parent 8e95189 commit 145be96

File tree

12 files changed

+102
-67
lines changed

12 files changed

+102
-67
lines changed

data/images/GET.png

100644100755
-1.77 KB
Loading

data/images/INSTALLED.png

-982 Bytes
Loading

data/images/LOCAL.png

-394 Bytes
Loading

data/images/UPDATE.png

-769 Bytes
Loading

hbas.elf

-4.25 KB
Binary file not shown.

hbas_dbg.elf

-4.33 KB
Binary file not shown.

src/menu/HomebrewLaunchWindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ void HomebrewLaunchWindow::OnLoadButtonClick(GuiButton *button, const GuiControl
352352
ProgressWindow * progress = getProgressWindow();
353353
HomebrewWindow * homebrewWindowTarget = getHomebrewWindow();
354354
homebrewWindowTarget->append(progress);
355+
356+
homebrewWindow->backTabBtn.setState(GuiElement::STATE_DISABLED);
357+
homebrewWindow->randomTabBtn.setState(GuiElement::STATE_DISABLED);
355358

356359
// store information about the desired files to homebrewWindowTarget, so that
357360
// the thread can access it

src/menu/HomebrewWindow.cpp

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#define DEFAULT_WIILOAD_PORT 4299
3131

3232
#define MAX_BUTTONS_ON_PAGE 4
33-
//char * repoUrl = "http://wiiubru.com/appstore";
34-
char * repoUrl = "192.168.1.104:8000";
33+
char * repoUrl = "http://wiiubru.com/appstore";
34+
//char * repoUrl = "192.168.1.104:8000";
3535
//char * repoUrl = "http://wiiubru.com/appstore/appstoretest";
3636

3737
ProgressWindow* progressWindow;
@@ -324,7 +324,7 @@ void HomebrewWindow::loadLocalApps(int mode)
324324
}
325325

326326
const char *cpName = xmlReadSuccess ? metaXml.GetName() : homebrewButtons[idx]->execPath.c_str();
327-
const char *cpDescription = xmlReadSuccess ? metaXml.GetShortDescription() : "";
327+
// const char *cpDescription = xmlReadSuccess ? metaXml.GetShortDescription() : "";
328328
if(strncmp(cpName, "sd:/wiiu/apps/", strlen("sd:/wiiu/apps/")) == 0)
329329
cpName += strlen("sd:/wiiu/apps/");
330330

@@ -564,8 +564,6 @@ HomebrewWindow::HomebrewWindow(int w, int h)
564564
, randomTabBtn(rpxTabImg.getWidth(), rpxTabImg.getHeight())
565565
, touchTrigger(GuiTrigger::CHANNEL_1, GuiTrigger::VPAD_TOUCH)
566566
, wpadTouchTrigger(GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5, GuiTrigger::BUTTON_A)
567-
, buttonLTrigger(GuiTrigger::CHANNEL_ALL, GuiTrigger::BUTTON_L | GuiTrigger::BUTTON_LEFT, true)
568-
, buttonRTrigger(GuiTrigger::CHANNEL_ALL, GuiTrigger::BUTTON_R | GuiTrigger::BUTTON_RIGHT, true)
569567
{
570568
// tcpReceiver.serverReceiveStart.connect(this, &HomebrewWindow::OnTcpReceiveStart);
571569
// tcpReceiver.serverReceiveFinished.connect(this, &HomebrewWindow::OnTcpReceiveFinish);
@@ -615,8 +613,10 @@ HomebrewWindow::HomebrewWindow(int w, int h)
615613
append(&hblVersionText);
616614
append(hblRepoText);
617615

618-
header = new GuiText("Homebrew App Store", 64, glm::vec4(1, 1, 1, 1));
619-
header2 = new GuiText("Select a Category", 40, glm::vec4(1, 1, 1, 1));
616+
// header = new GuiText("Homebrew App Store", 64, glm::vec4(1, 1, 1, 1));
617+
header = new GuiImage(Resources::GetImageData("title.png"));
618+
header->setAlignment(ALIGN_TOP);
619+
header2 = new GuiText("Select a Category", 30, glm::vec4(1, 1, 1, 1));
620620

621621

622622
// for now, do this like this
@@ -630,8 +630,8 @@ HomebrewWindow::HomebrewWindow(int w, int h)
630630
backTabBtn.setAlignment(ALIGN_LEFT);
631631
randomTabBtn.setAlignment(ALIGN_RIGHT);
632632

633-
backTabBtn.setPosition(0, 85);
634-
randomTabBtn.setPosition(0, -85);
633+
backTabBtn.setPosition(0, 0);
634+
randomTabBtn.setPosition(0, 0);
635635

636636
backTabBtn.setEffectGrow();
637637
randomTabBtn.setEffectGrow();
@@ -644,10 +644,6 @@ HomebrewWindow::HomebrewWindow(int w, int h)
644644

645645
backTabBtn.clicked.connect(this, &HomebrewWindow::OnHBLTabButtonClick);
646646
randomTabBtn.clicked.connect(this, &HomebrewWindow::OnRPXTabButtonClick);
647-
648-
649-
append(&backTabBtn);
650-
append(&randomTabBtn);
651647

652648
append(progressWindow);
653649

@@ -696,7 +692,7 @@ void HomebrewWindow::OnCategorySwitch(GuiButton *button, const GuiController *co
696692
{
697693

698694
// remove all category buttons
699-
for (int x=0; x<all_cats.size(); x++)
695+
for (unsigned int x=0; x<all_cats.size(); x++)
700696
{
701697
// detect which number category button was pressed
702698
if (all_cats[x] == button)
@@ -709,6 +705,9 @@ void HomebrewWindow::OnCategorySwitch(GuiButton *button, const GuiController *co
709705
removeE(header);
710706
removeE(header2);
711707

708+
append(&backTabBtn);
709+
append(&randomTabBtn);
710+
712711
loadLocalApps(0);
713712
// change the category based on the click
714713
// filter();
@@ -741,43 +740,58 @@ void HomebrewWindow::displayCategories()
741740
clearScreen();
742741
all_cats.clear();
743742

744-
header->setPosition(0, 260);
743+
header->setPosition(0, 0);
745744
append(header);
746745

747746
header2->setPosition(0, -240);
748747
append(header2);
748+
749+
const char* vals[6] = {"all_gray.png", "games.png", "emulators.png", "tools.png", "loaders.png", "concepts.png"};
749750

750-
appendCategoryButton("all_gray.png", -250, 100);
751-
appendCategoryButton("games.png", 0, 100);
752-
appendCategoryButton("emulators.png", 250, 100);
753-
appendCategoryButton("tools.png", -250, -100);
754-
appendCategoryButton("loaders.png", 0, -100);
755-
appendCategoryButton("concepts.png", 250, -100);
751+
appendCategoryButton((char*)vals[0], -250, 100);
752+
appendCategoryButton((char*)vals[1], 0, 100);
753+
appendCategoryButton((char*)vals[2], 250, 100);
754+
appendCategoryButton((char*)vals[3], -250, -100);
755+
appendCategoryButton((char*)vals[4], 0, -100);
756+
appendCategoryButton((char*)vals[5], 250, -100);
756757

757758

758759
}
759760

760761

761762
void HomebrewWindow::OnHBLTabButtonClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger)
762763
{
763-
if (listingMode < 1 || isFiltering) // already hbl mode
764+
if (screenLocked)
765+
{
766+
if (launchBox)
767+
// dismiss any active window
768+
OnLaunchBoxCloseClick(launchBox);
764769
return;
770+
}
765771

766-
listingMode--;
772+
listingMode = -1;
767773
clearScreen();
768774
filter();
775+
776+
removeE(&backTabBtn);
777+
removeE(&randomTabBtn);
778+
779+
displayCategories();
769780
globalUpdatePosition = true;
770781
}
771782

772783
void HomebrewWindow::OnRPXTabButtonClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger)
773784
{
774-
if (listingMode > 3 || isFiltering) // already rpx mode
775-
return;
785+
if (screenLocked)
786+
{
787+
if (launchBox)
788+
// dismiss any active window
789+
removeE(launchBox);
790+
}
776791

777-
listingMode++;
778-
clearScreen();
779-
filter();
780-
globalUpdatePosition = true;
792+
// click a random button within the displayed apps
793+
int r = rand() % homebrewButtons.size();
794+
OnHomebrewButtonClick(homebrewButtons[r]->button, controller, 0);
781795
}
782796

783797
void HomebrewWindow::OnOpenEffectFinish(GuiElement *element)
@@ -790,6 +804,10 @@ void HomebrewWindow::OnOpenEffectFinish(GuiElement *element)
790804
void HomebrewWindow::OnCloseEffectFinish(GuiElement *element)
791805
{
792806
screenLocked = false;
807+
808+
backTabBtn.clearState(GuiElement::STATE_DISABLED);
809+
randomTabBtn.clearState(GuiElement::STATE_DISABLED);
810+
793811
//! remove element from draw list and push to delete queue
794812
removeE(element);
795813
AsyncDeleter::pushForDelete(element);
@@ -806,6 +824,7 @@ void HomebrewWindow::OnLaunchBoxCloseClick(GuiElement *element)
806824
element->setState(GuiElement::STATE_DISABLED);
807825
element->setEffect(EFFECT_FADE, -10, 0);
808826
element->effectFinished.connect(this, &HomebrewWindow::OnCloseEffectFinish);
827+
launchBox = NULL;
809828
}
810829

811830
void HomebrewWindow::OnHomebrewButtonClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger)
@@ -824,12 +843,13 @@ void HomebrewWindow::OnHomebrewButtonClick(GuiButton *button, const GuiControlle
824843
{
825844
if(button == homebrewButtons[i]->button)
826845
{
827-
HomebrewLaunchWindow * launchBox = new HomebrewLaunchWindow(*homebrewButtons[i], this);
828-
launchBox->setEffect(EFFECT_FADE, 10, 255);
829-
launchBox->setState(GuiElement::STATE_DISABLED);
830-
launchBox->setPosition(0.0f, 30.0f);
831-
launchBox->effectFinished.connect(this, &HomebrewWindow::OnOpenEffectFinish);
832-
launchBox->backButtonClicked.connect(this, &HomebrewWindow::OnLaunchBoxCloseClick);
846+
launchBox = new HomebrewLaunchWindow(*homebrewButtons[i], this);
847+
HomebrewLaunchWindow* launchBox2 = (HomebrewLaunchWindow*)launchBox;
848+
launchBox2->setEffect(EFFECT_FADE, 10, 255);
849+
launchBox2->setState(GuiElement::STATE_DISABLED);
850+
launchBox2->setPosition(0.0f, 30.0f);
851+
launchBox2->effectFinished.connect(this, &HomebrewWindow::OnOpenEffectFinish);
852+
launchBox2->backButtonClicked.connect(this, &HomebrewWindow::OnLaunchBoxCloseClick);
833853
log_printf("creating launchbox");
834854
append(launchBox);
835855
disableButtons = true;

src/menu/HomebrewWindow.h

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,28 @@ class HomebrewWindow : public GuiFrame, public sigslot::has_slots<>
6565
float lastScrollOffY = 0;
6666
// all homebrew buttons
6767
std::vector<homebrewButton*> homebrewButtons;
68+
GuiFrame * launchBox;
69+
70+
71+
GuiSound *buttonClickSound;
72+
GuiImageData * installedButtonImgData;
73+
GuiImageData * getButtonImgData;
74+
GuiImageData * updateButtonImgData;
75+
GuiImageData * localButtonImgData;
76+
77+
GuiText hblVersionText;
78+
GuiText * hblRepoText;
79+
80+
GuiImageData *hblTabImgData;
81+
GuiImageData *rpxTabImgData;
82+
GuiImage hblTabImg;
83+
GuiImage rpxTabImg;
84+
85+
86+
GuiButton backTabBtn;
87+
GuiButton randomTabBtn;
6888

69-
GuiText* header;
89+
GuiImage* header;
7090
GuiText* header2;
7191
std::vector<homebrewButton*> localAppButtons; // will be refreshed a lot
7292
std::vector<homebrewButton*> remoteAppButtons; // will refreshed once
@@ -130,26 +150,10 @@ class HomebrewWindow : public GuiFrame, public sigslot::has_slots<>
130150
void OnTcpReceiveFinish(GuiElement *element, u32 ip, int result);
131151

132152

133-
GuiSound *buttonClickSound;
134-
GuiImageData * installedButtonImgData;
135-
GuiImageData * getButtonImgData;
136-
GuiImageData * updateButtonImgData;
137-
GuiImageData * localButtonImgData;
138153

139-
GuiText hblVersionText;
140-
GuiText * hblRepoText;
141-
142-
GuiImageData *hblTabImgData;
143-
GuiImageData *rpxTabImgData;
144-
GuiImage hblTabImg;
145-
GuiImage rpxTabImg;
146-
GuiButton backTabBtn;
147-
GuiButton randomTabBtn;
148154

149155
GuiTrigger touchTrigger;
150156
GuiTrigger wpadTouchTrigger;
151-
GuiTrigger buttonLTrigger;
152-
GuiTrigger buttonRTrigger;
153157
int listOffset;
154158
int currentLeftPosition;
155159
int targetLeftPosition;

src/menu/MainWindow.cpp

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ MainWindow::MainWindow(int w, int h)
5050
disableSplashScreenNextUpdate = false;
5151
// splashScreenImgData = new GuiImageData(Resources::GetImageData("splash.png");
5252
// splashScreen = new GuiImage(splashScreenImgData);
53-
53+
5454
append(&splashScreen);
5555
showingSplashScreen = true;
56+
57+
// srand(OSGetTime());
5658

5759
for(int i = 0; i < 4; i++)
5860
{
@@ -81,11 +83,17 @@ void asyncRefreshHomebrewApps(CThread* thread, void* args)
8183
{
8284
log_printf("NEW THREAD START: Async refresh homebrew apps");
8385
homebrewWindow->refreshHomebrewApps();
86+
87+
// display another loading message
88+
// toDO: temporary until loadLocalApps is sped up
89+
GuiText* loadingMsg = new GuiText("One Moment Please...", 40, glm::vec4(1, 1, 1, 1));
90+
homebrewWindow->append(loadingMsg);
91+
homebrewWindow->loadLocalApps(0);
92+
homebrewWindow->removeE(loadingMsg);
8493
homebrewWindow->displayCategories();
85-
homebrewWindow->loadLocalApps(0);
86-
// when refresh is done, start preloading the icon cache
87-
CThread * pThread = CThread::create(asyncRefreshHomebrewAppIcons, NULL, CThread::eAttributeAffCore1 | CThread::eAttributePinnedAff, 10);
88-
pThread->resumeThread();
94+
95+
// CThread * pThread = CThread::create(asyncRefreshHomebrewAppIcons, NULL, CThread::eAttributeAffCore1 | CThread::eAttributePinnedAff, 10);
96+
// pThread->resumeThread();
8997
log_printf("EXISTING THREAD END: Async refresh homebrew apps");
9098
}
9199

@@ -168,14 +176,14 @@ void MainWindow::update(GuiController *controller)
168176
if (controller->data.buttons_r & VPAD_BUTTON_MINUS)
169177
joysticksDisabled = !joysticksDisabled;
170178

171-
// get a random app
172-
if (controller->data.buttons_r & VPAD_BUTTON_PLUS)
173-
{
174-
srand(OSGetTime());
175-
int r = rand() % homebrewWindow->curTabButtons.size();
176-
homebrewWindow->OnHomebrewButtonClick(homebrewWindow->curTabButtons[r]->button, controller, 0);
177-
}
178-
179+
// // get a random app
180+
// if (controller->data.buttons_r & VPAD_BUTTON_PLUS)
181+
// {
182+
// srand(OSGetTime());
183+
// int r = rand() % homebrewWindow->curTabButtons.size();
184+
// homebrewWindow->OnHomebrewButtonClick(homebrewWindow->curTabButtons[r]->button, controller, 0);
185+
// }
186+
//
179187

180188
// L button forces a cache refresh
181189
if (showingSplashScreen && controller->data.buttons_h & VPAD_BUTTON_L)

0 commit comments

Comments
 (0)