Exemple #1
0
void ProductView::Update() {
	if (wasInstalled_ != IsGameInstalled()) {
		CreateViews();
	}
	if (installButton_) {
		installButton_->SetEnabled(g_GameManager.GetState() == GameManagerState::IDLE);
	}
	if (cancelButton_ && g_GameManager.GetState() != GameManagerState::DOWNLOADING)
		cancelButton_->SetVisibility(UI::V_GONE);
	if (launchButton_)
		launchButton_->SetEnabled(g_GameManager.GetState() == GameManagerState::IDLE);
	View::Update();
}
Exemple #2
0
void ProductView::Update(const InputState &input_state) {
	if (wasInstalled_ != IsGameInstalled()) {
		CreateViews();
	}
	if (installButton_) {
		installButton_->SetEnabled(!g_GameManager.IsInstallInProgress());
	}
	View::Update(input_state);
}
Exemple #3
0
UI::EventReturn ProductView::OnInstall(UI::EventParams &e) {
	std::string zipUrl;
	if (entry_.downloadURL.empty()) {
		// Construct the URL, easy to predict from our server
		zipUrl = storeBaseUrl + "files/" + entry_.file + ".zip";
	} else {
		// Use the provided URL, for external hosting.
		zipUrl = entry_.downloadURL;
	}
	if (installButton_) {
		installButton_->SetEnabled(false);
	}
	INFO_LOG(HLE, "Triggering install of %s", zipUrl.c_str());
	g_GameManager.DownloadAndInstall(zipUrl);
	return UI::EVENT_DONE;
}