2013-07-15 15:41:24 +00:00
|
|
|
// Copyright (c) 2013- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-10-12 09:32:24 +00:00
|
|
|
#include <functional>
|
2013-07-15 22:29:00 +00:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2016-10-12 09:32:24 +00:00
|
|
|
#include <vector>
|
2013-07-15 22:29:00 +00:00
|
|
|
|
2020-10-04 18:48:47 +00:00
|
|
|
#include "Common/UI/UIScreen.h"
|
|
|
|
#include "Common/File/DirListing.h"
|
2016-03-06 21:16:50 +00:00
|
|
|
|
|
|
|
struct ShaderInfo;
|
2020-08-02 04:26:41 +00:00
|
|
|
struct TextureShaderInfo;
|
2013-07-15 15:41:24 +00:00
|
|
|
|
2013-11-03 03:18:12 +00:00
|
|
|
extern std::string boot_filename;
|
2017-03-25 22:01:33 +00:00
|
|
|
void UIBackgroundInit(UIContext &dc);
|
|
|
|
void UIBackgroundShutdown();
|
2013-11-03 03:18:12 +00:00
|
|
|
|
2013-07-15 15:41:24 +00:00
|
|
|
inline void NoOpVoidBool(bool) {}
|
|
|
|
|
2013-07-21 11:31:46 +00:00
|
|
|
class UIScreenWithBackground : public UIScreen {
|
|
|
|
public:
|
|
|
|
UIScreenWithBackground() : UIScreen() {}
|
|
|
|
protected:
|
2016-10-01 18:23:24 +00:00
|
|
|
void DrawBackground(UIContext &dc) override;
|
|
|
|
void sendMessage(const char *message, const char *value) override;
|
2013-07-21 11:31:46 +00:00
|
|
|
};
|
|
|
|
|
2014-02-09 21:15:53 +00:00
|
|
|
class UIScreenWithGameBackground : public UIScreenWithBackground {
|
|
|
|
public:
|
|
|
|
UIScreenWithGameBackground(const std::string &gamePath)
|
|
|
|
: UIScreenWithBackground(), gamePath_(gamePath) {}
|
2016-10-01 18:23:24 +00:00
|
|
|
void DrawBackground(UIContext &dc) override;
|
|
|
|
void sendMessage(const char *message, const char *value) override;
|
2014-02-09 21:15:53 +00:00
|
|
|
protected:
|
|
|
|
std::string gamePath_;
|
|
|
|
};
|
|
|
|
|
2013-08-17 10:09:50 +00:00
|
|
|
class UIDialogScreenWithBackground : public UIDialogScreen {
|
2013-08-12 22:06:48 +00:00
|
|
|
public:
|
2013-08-17 10:09:50 +00:00
|
|
|
UIDialogScreenWithBackground() : UIDialogScreen() {}
|
2013-08-12 22:06:48 +00:00
|
|
|
protected:
|
2016-10-01 18:23:24 +00:00
|
|
|
void DrawBackground(UIContext &dc) override;
|
|
|
|
void sendMessage(const char *message, const char *value) override;
|
2015-07-04 15:01:32 +00:00
|
|
|
|
|
|
|
void AddStandardBack(UI::ViewGroup *parent);
|
2013-08-12 22:06:48 +00:00
|
|
|
};
|
2013-07-21 11:31:46 +00:00
|
|
|
|
2014-02-09 21:15:53 +00:00
|
|
|
class UIDialogScreenWithGameBackground : public UIDialogScreenWithBackground {
|
|
|
|
public:
|
|
|
|
UIDialogScreenWithGameBackground(const std::string &gamePath)
|
|
|
|
: UIDialogScreenWithBackground(), gamePath_(gamePath) {}
|
2016-10-01 18:23:24 +00:00
|
|
|
void DrawBackground(UIContext &dc) override;
|
|
|
|
void sendMessage(const char *message, const char *value) override;
|
2014-02-09 21:15:53 +00:00
|
|
|
protected:
|
|
|
|
std::string gamePath_;
|
|
|
|
};
|
|
|
|
|
2013-08-12 22:06:48 +00:00
|
|
|
class PromptScreen : public UIDialogScreenWithBackground {
|
2013-07-15 15:41:24 +00:00
|
|
|
public:
|
2015-09-17 18:29:37 +00:00
|
|
|
PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText,
|
2013-09-03 10:42:12 +00:00
|
|
|
std::function<void(bool)> callback = &NoOpVoidBool);
|
2013-07-15 15:41:24 +00:00
|
|
|
|
2016-10-01 18:23:24 +00:00
|
|
|
void CreateViews() override;
|
2013-07-15 15:41:24 +00:00
|
|
|
|
2017-12-03 03:04:33 +00:00
|
|
|
void TriggerFinish(DialogResult result) override;
|
|
|
|
|
2013-07-15 15:41:24 +00:00
|
|
|
private:
|
|
|
|
UI::EventReturn OnYes(UI::EventParams &e);
|
|
|
|
UI::EventReturn OnNo(UI::EventParams &e);
|
|
|
|
|
|
|
|
std::string message_;
|
|
|
|
std::string yesButtonText_;
|
|
|
|
std::string noButtonText_;
|
|
|
|
std::function<void(bool)> callback_;
|
|
|
|
};
|
2013-07-15 22:29:00 +00:00
|
|
|
|
|
|
|
class NewLanguageScreen : public ListPopupScreen {
|
|
|
|
public:
|
2013-08-30 21:26:59 +00:00
|
|
|
NewLanguageScreen(const std::string &title);
|
2013-07-15 22:29:00 +00:00
|
|
|
|
|
|
|
private:
|
2016-10-01 18:23:24 +00:00
|
|
|
void OnCompleted(DialogResult result) override;
|
|
|
|
bool ShowButtons() const override { return true; }
|
2013-07-15 22:29:00 +00:00
|
|
|
std::map<std::string, std::pair<std::string, int>> langValuesMapping;
|
|
|
|
std::map<std::string, std::string> titleCodeMapping;
|
|
|
|
std::vector<FileInfo> langs_;
|
|
|
|
};
|
|
|
|
|
2013-10-12 00:05:55 +00:00
|
|
|
class PostProcScreen : public ListPopupScreen {
|
|
|
|
public:
|
2020-05-18 09:17:45 +00:00
|
|
|
PostProcScreen(const std::string &title, int id);
|
2013-10-12 00:05:55 +00:00
|
|
|
|
|
|
|
private:
|
2016-10-01 18:23:24 +00:00
|
|
|
void OnCompleted(DialogResult result) override;
|
|
|
|
bool ShowButtons() const override { return true; }
|
2013-10-12 00:05:55 +00:00
|
|
|
std::vector<ShaderInfo> shaders_;
|
2020-05-18 09:17:45 +00:00
|
|
|
int id_;
|
2013-10-12 00:05:55 +00:00
|
|
|
};
|
|
|
|
|
2020-08-02 04:26:41 +00:00
|
|
|
class TextureShaderScreen : public ListPopupScreen {
|
|
|
|
public:
|
|
|
|
TextureShaderScreen(const std::string &title);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void OnCompleted(DialogResult result) override;
|
|
|
|
bool ShowButtons() const override { return true; }
|
|
|
|
std::vector<TextureShaderInfo> shaders_;
|
|
|
|
};
|
|
|
|
|
2013-08-14 21:05:02 +00:00
|
|
|
class LogoScreen : public UIScreen {
|
|
|
|
public:
|
2021-02-04 07:54:32 +00:00
|
|
|
LogoScreen(bool gotoGameSettings = false);
|
2014-06-15 11:04:59 +00:00
|
|
|
bool key(const KeyInput &key) override;
|
2017-03-15 04:03:57 +00:00
|
|
|
bool touch(const TouchInput &touch) override;
|
2017-03-15 05:01:18 +00:00
|
|
|
void update() override;
|
2016-10-01 18:23:24 +00:00
|
|
|
void render() override;
|
|
|
|
void sendMessage(const char *message, const char *value) override;
|
|
|
|
void CreateViews() override {}
|
2013-08-14 21:05:02 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Next();
|
2021-02-07 19:09:57 +00:00
|
|
|
int frames_ = 0;
|
2020-05-09 20:52:04 +00:00
|
|
|
bool switched_ = false;
|
|
|
|
bool gotoGameSettings_ = false;
|
2013-08-14 21:05:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CreditsScreen : public UIDialogScreenWithBackground {
|
|
|
|
public:
|
2021-02-04 07:54:32 +00:00
|
|
|
CreditsScreen();
|
2017-03-15 05:01:18 +00:00
|
|
|
void update() override;
|
2016-10-01 18:23:24 +00:00
|
|
|
void render() override;
|
2013-12-11 17:05:57 +00:00
|
|
|
|
2016-10-01 18:23:24 +00:00
|
|
|
void CreateViews() override;
|
2013-08-14 21:05:02 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
UI::EventReturn OnOK(UI::EventParams &e);
|
|
|
|
|
2013-08-19 22:49:25 +00:00
|
|
|
UI::EventReturn OnSupport(UI::EventParams &e);
|
|
|
|
UI::EventReturn OnPPSSPPOrg(UI::EventParams &e);
|
2017-11-29 13:33:28 +00:00
|
|
|
UI::EventReturn OnPrivacy(UI::EventParams &e);
|
2013-08-19 22:49:25 +00:00
|
|
|
UI::EventReturn OnForums(UI::EventParams &e);
|
2018-09-16 18:04:10 +00:00
|
|
|
UI::EventReturn OnDiscord(UI::EventParams &e);
|
2013-12-11 17:05:57 +00:00
|
|
|
UI::EventReturn OnShare(UI::EventParams &e);
|
2013-12-19 13:28:04 +00:00
|
|
|
UI::EventReturn OnTwitter(UI::EventParams &e);
|
2013-08-19 22:49:25 +00:00
|
|
|
|
2021-02-04 07:54:32 +00:00
|
|
|
double startTime_ = 0.0;
|
2013-08-14 21:05:02 +00:00
|
|
|
};
|