flow improvements
This commit is contained in:
+27
-4
@@ -10,12 +10,22 @@ namespace ui {
|
||||
this->usersMenu->SetScrollbarColor(COLOR("#170909FF"));
|
||||
|
||||
for (AccountUid const& uid : Account::ids()) {
|
||||
auto username = pu::ui::elm::MenuItem::New(Account::username(uid) + ": " + std::to_string(getTitleCount(uid)));
|
||||
username->SetColor(COLOR("#FFFFFFFF"));
|
||||
this->usersMenu->AddItem(username);
|
||||
auto item = pu::ui::elm::MenuItem::New(Account::username(uid));
|
||||
item->SetColor(COLOR("#FFFFFFFF"));
|
||||
this->usersMenu->AddItem(item);
|
||||
}
|
||||
|
||||
this->loadingBg = pu::ui::elm::Rectangle::New(0, 0, 1280, 720, pu::ui::Color(30, 30, 30, 220));
|
||||
this->loadingBg->SetVisible(false);
|
||||
|
||||
this->loadingText = pu::ui::elm::TextBlock::New(480, 340, "Reading game list...");
|
||||
this->loadingText->SetColor(pu::ui::Color(255, 255, 255, 255));
|
||||
this->loadingText->SetVisible(false);
|
||||
|
||||
this->SetBackgroundColor(BACKGROUND_COLOR);
|
||||
this->Add(this->usersMenu);
|
||||
this->Add(this->loadingBg);
|
||||
this->Add(this->loadingText);
|
||||
}
|
||||
|
||||
int32_t UsersLayout::GetCurrentIndex() {
|
||||
@@ -29,8 +39,21 @@ namespace ui {
|
||||
}
|
||||
|
||||
if (Down & HidNpadButton_A) {
|
||||
printf("current index is %i\n", this->usersMenu->GetSelectedIndex());
|
||||
g_currentUId = Account::ids().at(this->usersMenu->GetSelectedIndex());
|
||||
|
||||
if (!areTitlesLoaded()) {
|
||||
this->usersMenu->SetVisible(false);
|
||||
this->loadingBg->SetVisible(true);
|
||||
this->loadingText->SetVisible(true);
|
||||
mainApp->CallForRender();
|
||||
|
||||
loadTitles();
|
||||
|
||||
this->loadingBg->SetVisible(false);
|
||||
this->loadingText->SetVisible(false);
|
||||
this->usersMenu->SetVisible(true);
|
||||
}
|
||||
|
||||
mainApp->titlesLayout->InitTitles();
|
||||
mainApp->LoadLayout(mainApp->titlesLayout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user