Skip to content

Commit

Permalink
Add some links to Discord where appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Sep 16, 2018
1 parent e2f20f7 commit 5d64107
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
16 changes: 12 additions & 4 deletions UI/MiscScreens.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -527,11 +527,14 @@ void CreditsScreen::CreateViews() {
back->OnClick.Handle(this, &CreditsScreen::OnOK); back->OnClick.Handle(this, &CreditsScreen::OnOK);
root_->SetDefaultFocusView(back); root_->SetDefaultFocusView(back);
if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) { if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) {
root_->Add(new Button(cr->T("Buy Gold"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnSupport); root_->Add(new Button(cr->T("Buy Gold"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnSupport);
} }
root_->Add(new Button(cr->T("PPSSPP Forums"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnForums); root_->Add(new Button(cr->T("PPSSPP Forums"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 158, 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); #if (PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(LINUX)) && !PPSSPP_PLATFORM(ANDROID)
root_->Add(new Button(cr->T("Privacy Policy"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 232, false)))->OnClick.Handle(this, &CreditsScreen::OnPrivacy); root_->Add(new Button(cr->T("Discord"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 232, false)))->OnClick.Handle(this, &CreditsScreen::OnDiscord);
#endif
root_->Add(new Button("www.ppsspp.org", new AnchorLayoutParams(260, 64, 10, NONE, NONE, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnPPSSPPOrg);
root_->Add(new Button(cr->T("Privacy Policy"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnPrivacy);
#ifdef __ANDROID__ #ifdef __ANDROID__
root_->Add(new Button(cr->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnShare); root_->Add(new Button(cr->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnShare);
root_->Add(new Button(cr->T("Twitter @PPSSPP_emu"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 154, false)))->OnClick.Handle(this, &CreditsScreen::OnTwitter); root_->Add(new Button(cr->T("Twitter @PPSSPP_emu"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 154, false)))->OnClick.Handle(this, &CreditsScreen::OnTwitter);
Expand Down Expand Up @@ -576,6 +579,11 @@ UI::EventReturn CreditsScreen::OnForums(UI::EventParams &e) {
return UI::EVENT_DONE; return UI::EVENT_DONE;
} }


UI::EventReturn CreditsScreen::OnDiscord(UI::EventParams &e) {
LaunchBrowser("https://discord.gg/5NJB6dD");
return UI::EVENT_DONE;
}

UI::EventReturn CreditsScreen::OnShare(UI::EventParams &e) { UI::EventReturn CreditsScreen::OnShare(UI::EventParams &e) {
I18NCategory *cr = GetI18NCategory("PSPCredits"); I18NCategory *cr = GetI18NCategory("PSPCredits");
System_SendMessage("sharetext", cr->T("CheckOutPPSSPP", "Check out PPSSPP, the awesome PSP emulator: http://www.ppsspp.org/")); System_SendMessage("sharetext", cr->T("CheckOutPPSSPP", "Check out PPSSPP, the awesome PSP emulator: http://www.ppsspp.org/"));
Expand Down
1 change: 1 addition & 0 deletions UI/MiscScreens.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class CreditsScreen : public UIDialogScreenWithBackground {
UI::EventReturn OnPPSSPPOrg(UI::EventParams &e); UI::EventReturn OnPPSSPPOrg(UI::EventParams &e);
UI::EventReturn OnPrivacy(UI::EventParams &e); UI::EventReturn OnPrivacy(UI::EventParams &e);
UI::EventReturn OnForums(UI::EventParams &e); UI::EventReturn OnForums(UI::EventParams &e);
UI::EventReturn OnDiscord(UI::EventParams &e);
UI::EventReturn OnShare(UI::EventParams &e); UI::EventReturn OnShare(UI::EventParams &e);
UI::EventReturn OnTwitter(UI::EventParams &e); UI::EventReturn OnTwitter(UI::EventParams &e);


Expand Down
6 changes: 6 additions & 0 deletions Windows/MainWindowMenu.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ namespace MainWindow {
const std::wstring visitForum = ConvertUTF8ToWString(des->T("PPSSPP Forums")); const std::wstring visitForum = ConvertUTF8ToWString(des->T("PPSSPP Forums"));
const std::wstring buyGold = ConvertUTF8ToWString(des->T("Buy Gold")); const std::wstring buyGold = ConvertUTF8ToWString(des->T("Buy Gold"));
const std::wstring gitHub = ConvertUTF8ToWString(des->T("GitHub")); const std::wstring gitHub = ConvertUTF8ToWString(des->T("GitHub"));
const std::wstring discord = ConvertUTF8ToWString(des->T("Discord"));
const std::wstring aboutPPSSPP = ConvertUTF8ToWString(des->T("About PPSSPP...")); const std::wstring aboutPPSSPP = ConvertUTF8ToWString(des->T("About PPSSPP..."));


// Simply remove the old help menu and create a new one. // Simply remove the old help menu and create a new one.
Expand All @@ -157,6 +158,7 @@ namespace MainWindow {
// Repeat the process for other languages, if necessary. // Repeat the process for other languages, if necessary.
AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_BUYGOLD, buyGold.c_str()); AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_BUYGOLD, buyGold.c_str());
AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_GITHUB, gitHub.c_str()); AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_GITHUB, gitHub.c_str());
AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_DISCORD, discord.c_str());
AppendMenu(helpMenu, MF_SEPARATOR, 0, 0); AppendMenu(helpMenu, MF_SEPARATOR, 0, 0);
AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_ABOUT, aboutPPSSPP.c_str()); AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_ABOUT, aboutPPSSPP.c_str());
} }
Expand Down Expand Up @@ -1008,6 +1010,10 @@ namespace MainWindow {
ShellExecute(NULL, L"open", L"https://github.com/hrydgard/ppsspp/", NULL, NULL, SW_SHOWNORMAL); ShellExecute(NULL, L"open", L"https://github.com/hrydgard/ppsspp/", NULL, NULL, SW_SHOWNORMAL);
break; break;


case ID_HELP_DISCORD:
ShellExecute(NULL, L"open", L"https://discord.gg/5NJB6dD", NULL, NULL, SW_SHOWNORMAL);
break;

case ID_HELP_ABOUT: case ID_HELP_ABOUT:
DialogManager::EnableAll(FALSE); DialogManager::EnableAll(FALSE);
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
Expand Down
1 change: 1 addition & 0 deletions Windows/resource.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@
#define ID_OPTIONS_WINDOW9X 40175 #define ID_OPTIONS_WINDOW9X 40175
#define ID_OPTIONS_WINDOW10X 40176 #define ID_OPTIONS_WINDOW10X 40176
#define ID_EMULATION_PAUSE 40177 #define ID_EMULATION_PAUSE 40177
#define ID_HELP_DISCORD 40178


// Dummy option to let the buffered rendering hotkey cycle through all the options. // Dummy option to let the buffered rendering hotkey cycle through all the options.
#define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500 #define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500
Expand Down

0 comments on commit 5d64107

Please sign in to comment.