Add share button to credits screen on Android

This commit is contained in:
Henrik Rydgård 2013-12-11 18:05:57 +01:00
parent d53285a94d
commit e6ac52619c
3 changed files with 12 additions and 1 deletions

View file

@ -387,6 +387,9 @@ void CreditsScreen::CreateViews() {
root_->Add(new Button(c->T("PPSSPP Forums"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnForums);
root_->Add(new Button("www.ppsspp.org", new AnchorLayoutParams(260, 64, 10, NONE, NONE, 158, false)))->OnClick.Handle(this, &CreditsScreen::OnPPSSPPOrg);
}
#ifdef ANDROID
root_->Add(new Button(c->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnShare);
#endif
#ifdef GOLD
root_->Add(new ImageView(I_ICONGOLD, IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false)));
#else
@ -418,6 +421,12 @@ UI::EventReturn CreditsScreen::OnChineseForum(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn CreditsScreen::OnShare(UI::EventParams &e) {
I18NCategory *c = GetI18NCategory("PSPCredits");
System_SendMessage("sharetext", c->T("CheckOutPPSSPP", "Check out PPSSPP, the awesome PSP emulator: http://www.ppsspp.org/"));
return UI::EVENT_DONE;
}
UI::EventReturn CreditsScreen::OnOK(UI::EventParams &e) {
screenManager()->finishDialog(this, DR_OK);
return UI::EVENT_DONE;

View file

@ -108,6 +108,7 @@ public:
CreditsScreen() : frames_(0) {}
void update(InputState &input);
void render();
virtual void CreateViews();
private:
@ -117,6 +118,7 @@ private:
UI::EventReturn OnPPSSPPOrg(UI::EventParams &e);
UI::EventReturn OnForums(UI::EventParams &e);
UI::EventReturn OnChineseForum(UI::EventParams &e);
UI::EventReturn OnShare(UI::EventParams &e);
int frames_;
};

2
native

@ -1 +1 @@
Subproject commit d680a346dc0d243a1e46018e83846de83d533fb0
Subproject commit d20700d5bb1dfa30c735f16cc2c04d7be6a5ab4b