Reporting: Add compat description to UI.

Some users are reporting "Nothing" even with a screenshot that looks
ingame.  Let's try to clarify a bit.

This same place is a good place to put a notice that we're detecting
potential better settings.
This commit is contained in:
Unknown W. Brackets 2016-09-18 16:33:25 -07:00
parent 86df05555b
commit da18755003
2 changed files with 47 additions and 19 deletions

View File

@ -154,8 +154,7 @@ void CompatRatingChoice::SetupChoices() {
}
ReportScreen::ReportScreen(const std::string &gamePath)
: UIDialogScreenWithGameBackground(gamePath), overall_(-1), graphics_(-1), speed_(-1), gameplay_(-1),
includeScreenshot_(true) {
: UIDialogScreenWithGameBackground(gamePath) {
enableReporting_ = Reporting::IsEnabled();
ratingEnabled_ = enableReporting_;
}
@ -172,7 +171,7 @@ void ReportScreen::update() {
}
EventReturn ReportScreen::HandleChoice(EventParams &e) {
if (overall_ == 4) {
if (overall_ == ReportingOverallScore::NONE) {
graphics_ = 0;
speed_ = 0;
gameplay_ = 0;
@ -184,11 +183,12 @@ EventReturn ReportScreen::HandleChoice(EventParams &e) {
ratingEnabled_ = true;
}
UpdateSubmit();
UpdateOverallDescription();
return EVENT_DONE;
}
EventReturn ReportScreen::HandleReportingChange(EventParams &e) {
if (overall_ == 4) {
if (overall_ == ReportingOverallScore::NONE) {
ratingEnabled_ = false;
} else {
ratingEnabled_ = enableReporting_;
@ -245,7 +245,8 @@ void ReportScreen::CreateViews() {
screenshot_ = nullptr;
}
leftColumnItems->Add(new CompatRatingChoice("Overall", &overall_))->SetEnabledPtr(&enableReporting_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
leftColumnItems->Add(new CompatRatingChoice("Overall", (int *)&overall_))->SetEnabledPtr(&enableReporting_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
overallDescription_ = leftColumnItems->Add(new TextView("", new LinearLayoutParams(Margins(10, 0))));
leftColumnItems->Add(new RatingChoice("Graphics", &graphics_))->SetEnabledPtr(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
leftColumnItems->Add(new RatingChoice("Speed", &speed_))->SetEnabledPtr(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
leftColumnItems->Add(new RatingChoice("Gameplay", &gameplay_))->SetEnabledPtr(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
@ -255,6 +256,7 @@ void ReportScreen::CreateViews() {
submit_ = new Choice(rp->T("Submit Feedback"));
rightColumnItems->Add(submit_)->OnClick.Handle(this, &ReportScreen::HandleSubmit);
UpdateSubmit();
UpdateOverallDescription();
rightColumnItems->Add(new Spacer(25.0));
rightColumnItems->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
@ -268,17 +270,32 @@ void ReportScreen::CreateViews() {
}
void ReportScreen::UpdateSubmit() {
submit_->SetEnabled(enableReporting_ && overall_ >= 0 && graphics_ >= 0 && speed_ >= 0 && gameplay_ >= 0);
submit_->SetEnabled(enableReporting_ && overall_ != ReportingOverallScore::INVALID && graphics_ >= 0 && speed_ >= 0 && gameplay_ >= 0);
}
void ReportScreen::UpdateOverallDescription() {
I18NCategory *rp = GetI18NCategory("Reporting");
const char *desc;
switch (overall_) {
case ReportingOverallScore::PERFECT: desc = rp->T("Perfect Description", "Flawless emulation for the entire game - great!"); break;
case ReportingOverallScore::PLAYABLE: desc = rp->T("Plays Description", "Fully playable but might be with glitches"); break;
case ReportingOverallScore::INGAME: desc = rp->T("In-game Description", "Gets into gameplay, but too buggy too complete"); break;
case ReportingOverallScore::MENU: desc = rp->T("Menu/Intro Description", "Can't get into the game itself"); break;
case ReportingOverallScore::NONE: desc = rp->T("Nothing Description", "Completely broken"); break;
default: desc = rp->T("Unselected Overall Description", "How well does this game emulate?"); break;
}
overallDescription_->SetText(desc);
}
EventReturn ReportScreen::HandleSubmit(EventParams &e) {
const char *compat;
switch (overall_) {
case 0: compat = "perfect"; break;
case 1: compat = "playable"; break;
case 2: compat = "ingame"; break;
case 3: compat = "menu"; break;
case 4: compat = "none"; break;
case ReportingOverallScore::PERFECT: compat = "perfect"; break;
case ReportingOverallScore::PLAYABLE: compat = "playable"; break;
case ReportingOverallScore::INGAME: compat = "ingame"; break;
case ReportingOverallScore::MENU: compat = "menu"; break;
case ReportingOverallScore::NONE: compat = "none"; break;
default: compat = "unknown"; break;
}

View File

@ -23,6 +23,15 @@
#include "ui/viewgroup.h"
#include "UI/MiscScreens.h"
enum class ReportingOverallScore : int {
PERFECT = 0,
PLAYABLE = 1,
INGAME = 2,
MENU = 3,
NONE = 4,
INVALID = -1,
};
class ReportScreen : public UIDialogScreenWithGameBackground {
public:
ReportScreen(const std::string &gamePath);
@ -31,24 +40,26 @@ protected:
void update() override;
void CreateViews() override;
void UpdateSubmit();
void UpdateOverallDescription();
UI::EventReturn HandleChoice(UI::EventParams &e);
UI::EventReturn HandleSubmit(UI::EventParams &e);
UI::EventReturn HandleBrowser(UI::EventParams &e);
UI::EventReturn HandleReportingChange(UI::EventParams &e);
UI::Choice *submit_;
UI::View *screenshot_;
UI::TextView *reportingNotice_;
UI::Choice *submit_ = nullptr;
UI::View *screenshot_ = nullptr;
UI::TextView *reportingNotice_ = nullptr;
UI::TextView *overallDescription_ = nullptr;
std::string screenshotFilename_;
int overall_;
int graphics_;
int speed_;
int gameplay_;
ReportingOverallScore overall_ = ReportingOverallScore::INVALID;
int graphics_ = -1;
int speed_ = -1;
int gameplay_ = -1;
bool enableReporting_;
bool ratingEnabled_;
bool includeScreenshot_;
bool includeScreenshot_ = true;
};
class ReportFinishScreen : public UIDialogScreenWithGameBackground {