mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
Refresh buttons after installing homebrew.
This commit is contained in:
1 parent
40dcd585a0
commit
adb2ebe87f
2 files changed
+20
-3
No files matched your search
+16
-2
@@ -187,7 +187,8 @@ void ProductItemView::Update(const InputState &input_state) {
|
||||
// This is a "details" view of a game. Lets you install it.
|
||||
class ProductView : public UI::LinearLayout {
|
||||
public:
|
||||
ProductView(const StoreEntry &entry) : LinearLayout(UI::ORIENT_VERTICAL), entry_(entry), installButton_(0) {
|
||||
ProductView(const StoreEntry &entry)
|
||||
: LinearLayout(UI::ORIENT_VERTICAL), entry_(entry), installButton_(0), wasInstalled_(false) {
|
||||
CreateViews();
|
||||
}
|
||||
|
||||
@@ -198,8 +199,13 @@ private:
|
||||
UI::EventReturn OnInstall(UI::EventParams &e);
|
||||
UI::EventReturn OnUninstall(UI::EventParams &e);
|
||||
|
||||
bool IsGameInstalled() {
|
||||
return g_GameManager.IsGameInstalled(entry_.file);
|
||||
}
|
||||
|
||||
StoreEntry entry_;
|
||||
UI::Button *installButton_;
|
||||
bool wasInstalled_;
|
||||
};
|
||||
|
||||
void ProductView::CreateViews() {
|
||||
@@ -213,10 +219,12 @@ void ProductView::CreateViews() {
|
||||
Add(new TextView(entry_.author));
|
||||
|
||||
I18NCategory *st = GetI18NCategory("Store");
|
||||
if (!g_GameManager.IsGameInstalled(entry_.file)) {
|
||||
wasInstalled_ = IsGameInstalled();
|
||||
if (!wasInstalled_) {
|
||||
installButton_ = Add(new Button(st->T("Install")));
|
||||
installButton_->OnClick.Handle(this, &ProductView::OnInstall);
|
||||
} else {
|
||||
installButton_ = nullptr;
|
||||
Add(new TextView(st->T("Already Installed")));
|
||||
Add(new Button(st->T("Uninstall")))->OnClick.Handle(this, &ProductView::OnUninstall);
|
||||
}
|
||||
@@ -232,6 +240,12 @@ void ProductView::CreateViews() {
|
||||
}
|
||||
|
||||
void ProductView::Update(const InputState &input_state) {
|
||||
if (wasInstalled_ != IsGameInstalled()) {
|
||||
CreateViews();
|
||||
}
|
||||
if (installButton_) {
|
||||
installButton_->SetEnabled(!g_GameManager.IsInstallInProgress());
|
||||
}
|
||||
View::Update(input_state);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user