Compare commits

...
Sign in to create a new pull request.

27 commits
master ... md5

Author SHA1 Message Date
sum2012
983fcb1369 oop 2022-08-07 21:11:12 +08:00
sum2012
c4fcb4f4e4 clipboard don't work in android 2022-08-07 20:22:01 +08:00
sum2012
fc8a46f718 Updated Chinese 2022-08-07 07:52:38 +08:00
sum2012
d26dcdcf6e Change copy method to clipboard 2022-08-07 07:49:13 +08:00
sum2012
52234956eb Fix Chinese 2022-08-06 23:02:14 +08:00
sum2012
0aea581ed1 oop 2022-08-06 22:17:28 +08:00
sum2012
fdc2c0aedc Fix path issue in Android 2022-08-06 21:23:13 +08:00
sum2012
1237dd5077 oop 2022-08-06 20:07:02 +08:00
sum2012
7b16741f2f Add Language 2022-08-06 17:09:17 +08:00
sum2012
37f616c671 Chinese 2022-08-06 16:21:44 +08:00
sum2012
3cf5716ef1 Remove upgrade 2022-08-06 16:12:11 +08:00
sum2012
7cd3f116b8 WIP, ,windows 2022-08-06 15:27:51 +08:00
sum2012
fe3ee5737b WIP 2022-08-06 15:02:19 +08:00
sum2012
77b4c4d1e7 Try to fix android 2022-08-04 21:17:44 +08:00
sum2012
16d757651c Fix Android game size 2022-08-03 20:08:06 +08:00
sum2012
b8315ecf31 Not test in Android,Full calc baidu nd5 2022-08-02 22:38:41 +08:00
sum2012
4c4b606fc9 Make inputbox for windows 2022-08-02 21:29:09 +08:00
sum2012
d3a895e392 Clean up 2022-08-02 05:58:49 +08:00
sum2012
909bd98e5e Cleanup 2022-08-01 21:14:38 +08:00
sum2012
8cc59238ec Fix 2022-07-31 22:47:05 +08:00
sum2012
6142d4442b Some fix of 262144 2022-07-31 17:29:06 +08:00
sum2012
59e02731a2 Test 262144 md5 in android 2022-07-31 16:55:00 +08:00
sum2012
4f0cafa36d Fix android 2022-07-31 06:48:31 +08:00
sum2012
3adda05663 Testing 2022-07-29 22:12:20 +08:00
sum2012
bdc69201d5 wip 2022-07-26 21:23:31 +08:00
sum2012
64c2cf8082 Work but not good 2022-07-26 19:18:21 +08:00
sum2012
e931176994 First step of md5 2022-07-24 21:55:20 +08:00
8 changed files with 266 additions and 88 deletions

View file

@ -72,7 +72,7 @@ using namespace std::placeholders;
#include "Core/HLE/Plugins.h"
#include "Core/HW/Display.h"
#include "UI/BackgroundAudio.h"
//#include "UI/BackgroundAudio.h"
#include "UI/OnScreenDisplay.h"
#include "UI/GamepadEmu.h"
#include "UI/PauseScreen.h"
@ -240,7 +240,7 @@ void EmuScreen::bootGame(const Path &filename) {
return;
}
g_BackgroundAudio.SetGame(Path());
//g_BackgroundAudio.SetGame(Path());
// Check permission status first, in case we came from a shortcut.
if (!bootAllowStorage(filename))

View file

@ -42,17 +42,20 @@
#include "UI/GameInfoCache.h"
#include "UI/MiscScreens.h"
#include "UI/MainScreen.h"
#include "UI/BackgroundAudio.h"
//#include "UI/BackgroundAudio.h"
#include "Core/Reporting.h"
#include "Common/Crypto/md5.h"
#include <sstream>
#include <string.h>
GameScreen::GameScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {
g_BackgroundAudio.SetGame(gamePath);
//g_BackgroundAudio.SetGame(gamePath);
}
GameScreen::~GameScreen() {
if (CRC32string == "...") {
Reporting::CancelCRC();
}
// if (CRC32string == "...") {
// Reporting::CancelCRC();
// }
}
template <typename I> std::string int2hexstr(I w, size_t hex_len = sizeof(I) << 1) {
@ -67,6 +70,7 @@ void GameScreen::update() {
UIScreen::update();
// Has the user requested a CRC32?
/*
if (CRC32string == "...") {
// Wait until the CRC32 is ready. It might take time on some devices.
if (Reporting::HasCRC(gamePath_)) {
@ -76,7 +80,29 @@ void GameScreen::update() {
tvCRC_->SetText(CRC32string);
btnCalcCRC_->SetVisibility(UI::V_GONE);
}
}
}
tvMD5_->SetText(MD5string);
*/
//btnCalcMD5_->SetVisibility(UI::V_GONE);
}
UI::EventReturn GameScreen::OnCopyBaidMD5(UI::EventParams& e) {
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID)
auto sy = GetI18NCategory("System");
System_InputBoxGetString(sy->T("Copy Baid md5"), MD5string, [](bool result, const std::string& value) {
//if (result) {
//g_Config.sNickName = StripSpaces(value);
}
);
//System_SendMessage("setclipboardtext", MD5string.c_str()); don't work in android
//tvMD5_->SetText(sy->T("Copied code"));
#endif
return UI::EVENT_DONE;
}
void GameScreen::CreateViews() {
@ -94,47 +120,63 @@ void GameScreen::CreateViews() {
// Back button to the bottom left.
// Scrolling action menu to the right.
using namespace UI;
Margins actionMenuMargins(0, 100, 15, 0);
root_ = new LinearLayout(ORIENT_HORIZONTAL);
auto sy = GetI18NCategory("System");
//Margins actionMenuMargins(0, 100, 15, 0);
Margins actionMenuMargins(0, 0, 0, 0);
//root_ = new LinearLayout(ORIENT_HORIZONTAL);
root_ = new LinearLayout(ORIENT_VERTICAL);
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI)
root_->Add(new ChoiceWithValueDisplay(&MD5string, sy->T("Copy Baid md5"), (const char*)nullptr))->OnClick.Handle(this, &GameScreen::OnCopyBaidMD5);
#elif !defined(MOBILE_DEVICE)
root_->Add(new PopupTextInputChoice(&MD5string, sy->T("Copy Baid md5"), "", 254, screenManager()));
#elif PPSSPP_PLATFORM(ANDROID)
if (System_GetPropertyBool(SYSPROP_HAS_KEYBOARD))
root_->Add(new ChoiceWithValueDisplay(&MD5string, sy->T("Copy Baid md5"), (const char*)nullptr))->OnClick.Handle(this, &GameScreen::OnCopyBaidMD5);
else
root_->Add(new PopupTextInputChoice(&MD5string, sy->T("Copy Baid md5"), "", 254, screenManager()));
#endif
ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f));
root_->Add(leftColumn);
leftColumn->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle(this, &GameScreen::OnSwitchBack);
if (info) {
leftColumn->Add(new GameIconView(gamePath_, 2.0f, new AnchorLayoutParams(144 * 2, 80 * 2, 10, 10, NONE, NONE)));
//leftColumn->Add(new GameIconView(gamePath_, 2.0f, new AnchorLayoutParams(144 * 2, 80 * 2, 10, 10, NONE, NONE)));
LinearLayout *infoLayout = new LinearLayout(ORIENT_VERTICAL, new AnchorLayoutParams(10, 200, NONE, NONE));
leftColumn->Add(infoLayout);
tvTitle_ = infoLayout->Add(new TextView(info->GetTitle(), ALIGN_LEFT | FLAG_WRAP_TEXT, false, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvTitle_->SetShadow(true);
tvID_ = infoLayout->Add(new TextView("", ALIGN_LEFT | FLAG_WRAP_TEXT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvID_->SetShadow(true);
//tvTitle_ = infoLayout->Add(new TextView(info->GetTitle(), ALIGN_LEFT | FLAG_WRAP_TEXT, false, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
//tvTitle_->SetShadow(true);
//tvID_ = infoLayout->Add(new TextView("", ALIGN_LEFT | FLAG_WRAP_TEXT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
//tvID_->SetShadow(true);
// This one doesn't need to be updated.
infoLayout->Add(new TextView(gamePath_.ToVisualString(), ALIGN_LEFT | FLAG_WRAP_TEXT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetShadow(true);
tvGameSize_ = infoLayout->Add(new TextView("...", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvGameSize_->SetShadow(true);
tvSaveDataSize_ = infoLayout->Add(new TextView("...", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvSaveDataSize_->SetShadow(true);
tvInstallDataSize_ = infoLayout->Add(new TextView("", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvInstallDataSize_->SetShadow(true);
tvInstallDataSize_->SetVisibility(V_GONE);
tvRegion_ = infoLayout->Add(new TextView("", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvRegion_->SetShadow(true);
tvCRC_ = infoLayout->Add(new TextView("", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvCRC_->SetShadow(true);
tvCRC_->SetVisibility(Reporting::HasCRC(gamePath_) ? V_VISIBLE : V_GONE);
//tvSaveDataSize_ = infoLayout->Add(new TextView("...", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
//tvSaveDataSize_->SetShadow(true);
//tvInstallDataSize_ = infoLayout->Add(new TextView("", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
//tvInstallDataSize_->SetShadow(true);
//tvInstallDataSize_->SetVisibility(V_GONE);
//tvRegion_ = infoLayout->Add(new TextView("", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
//tvRegion_->SetShadow(true);
//tvCRC_ = infoLayout->Add(new TextView("", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
//tvCRC_->SetShadow(true);
//tvCRC_->SetVisibility(Reporting::HasCRC(gamePath_) ? V_VISIBLE : V_GONE);
tvMD5_ = infoLayout->Add(new TextView("", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
tvMD5_->SetShadow(true);
} else {
tvTitle_ = nullptr;
//tvTitle_ = nullptr;
tvGameSize_ = nullptr;
tvSaveDataSize_ = nullptr;
tvInstallDataSize_ = nullptr;
tvRegion_ = nullptr;
tvCRC_ = nullptr;
tvID_ = nullptr;
//tvSaveDataSize_ = nullptr;
//tvInstallDataSize_ = nullptr;
//tvRegion_ = nullptr;
//tvCRC_ = nullptr;
tvMD5_ = nullptr;
//tvID_ = nullptr;
}
ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins));
@ -144,22 +186,22 @@ void GameScreen::CreateViews() {
rightColumnItems->SetSpacing(0.0f);
rightColumn->Add(rightColumnItems);
rightColumnItems->Add(new Choice(ga->T("Play")))->OnClick.Handle(this, &GameScreen::OnPlay);
//rightColumnItems->Add(new Choice(ga->T("Play")))->OnClick.Handle(this, &GameScreen::OnPlay);
btnGameSettings_ = rightColumnItems->Add(new Choice(ga->T("Game Settings")));
btnGameSettings_->OnClick.Handle(this, &GameScreen::OnGameSettings);
btnDeleteGameConfig_ = rightColumnItems->Add(new Choice(ga->T("Delete Game Config")));
btnDeleteGameConfig_->OnClick.Handle(this, &GameScreen::OnDeleteConfig);
btnCreateGameConfig_ = rightColumnItems->Add(new Choice(ga->T("Create Game Config")));
btnCreateGameConfig_->OnClick.Handle(this, &GameScreen::OnCreateConfig);
//btnGameSettings_ = rightColumnItems->Add(new Choice(ga->T("Game Settings")));
//btnGameSettings_->OnClick.Handle(this, &GameScreen::OnGameSettings);
//btnDeleteGameConfig_ = rightColumnItems->Add(new Choice(ga->T("Delete Game Config")));
//btnDeleteGameConfig_->OnClick.Handle(this, &GameScreen::OnDeleteConfig);
//btnCreateGameConfig_ = rightColumnItems->Add(new Choice(ga->T("Create Game Config")));
//btnCreateGameConfig_->OnClick.Handle(this, &GameScreen::OnCreateConfig);
btnGameSettings_->SetVisibility(V_GONE);
btnDeleteGameConfig_->SetVisibility(V_GONE);
btnCreateGameConfig_->SetVisibility(V_GONE);
//btnGameSettings_->SetVisibility(V_GONE);
//btnDeleteGameConfig_->SetVisibility(V_GONE);
//btnCreateGameConfig_->SetVisibility(V_GONE);
btnDeleteSaveData_ = new Choice(ga->T("Delete Save Data"));
rightColumnItems->Add(btnDeleteSaveData_)->OnClick.Handle(this, &GameScreen::OnDeleteSaveData);
btnDeleteSaveData_->SetVisibility(V_GONE);
//btnDeleteSaveData_ = new Choice(ga->T("Delete Save Data"));
//rightColumnItems->Add(btnDeleteSaveData_)->OnClick.Handle(this, &GameScreen::OnDeleteSaveData);
//btnDeleteSaveData_->SetVisibility(V_GONE);
otherChoices_.clear();
@ -197,12 +239,28 @@ void GameScreen::CreateViews() {
}
bool isHomebrew = info && info->region > GAMEREGION_MAX;
/*
if (fileTypeSupportCRC && !isHomebrew && !Reporting::HasCRC(gamePath_) ) {
btnCalcCRC_ = rightColumnItems->Add(new ChoiceWithValueDisplay(&CRC32string, ga->T("Calculate CRC"), (const char*)nullptr));
btnCalcCRC_->OnClick.Handle(this, &GameScreen::OnDoCRC32);
} else {
btnCalcCRC_ = nullptr;
//btnCalcMD5_ = nullptr;
}
*/
if (MD5string != "...") {
//btnCalcMD5_ = rightColumnItems->Add(new ChoiceWithValueDisplay(&MD5string, ga->T("Calculate MD5"), (const char*)nullptr));
//btnGameSettings_ = rightColumnItems->Add(new Choice(ga->T("Game Settings")));
btnCalcMD5_ = rightColumnItems->Add(new Choice(sy->T("Calculate MD5")));
btnCalcMD5_->OnClick.Handle(this, &GameScreen::OnDoMD5);
btnCalcMD5_->SetVisibility(UI::V_VISIBLE);
}
else {
btnCalcMD5_ = nullptr;
btnCalcMD5_->SetVisibility(UI::V_GONE);
}
}
UI::Choice *GameScreen::AddOtherChoice(UI::Choice *choice) {
@ -257,27 +315,33 @@ void GameScreen::render() {
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(thin3d, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE);
if (tvTitle_) {
tvTitle_->SetText(info->GetTitle());
}
//if (tvTitle_) {
//tvTitle_->SetText(info->GetTitle());
//}
if (info->gameSize) {
char temp[256];
if (tvGameSize_) {
snprintf(temp, sizeof(temp), "%s: %1.1f %s", ga->T("Game"), (float)(info->gameSize) / 1024.f / 1024.f, ga->T("MB"));
tvGameSize_->SetText(temp);
sfilesize = info->gameSize;
}
/*
if (tvSaveDataSize_) {
snprintf(temp, sizeof(temp), "%s: %1.2f %s", ga->T("SaveData"), (float)(info->saveDataSize) / 1024.f / 1024.f, ga->T("MB"));
tvSaveDataSize_->SetText(temp);
}
tvSaveDataSize_->SetText("");
if (info->installDataSize > 0 && tvInstallDataSize_) {
snprintf(temp, sizeof(temp), "%s: %1.2f %s", ga->T("InstallData"), (float) (info->installDataSize) / 1024.f / 1024.f, ga->T("MB"));
tvInstallDataSize_->SetText(temp);
tvInstallDataSize_->SetVisibility(UI::V_VISIBLE);
}
*/
}
/*
if (tvRegion_) {
if (info->region >= 0 && info->region < GAMEREGION_MAX && info->region != GAMEREGION_OTHER) {
static const char *regionNames[GAMEREGION_MAX] = {
@ -293,14 +357,16 @@ void GameScreen::render() {
tvRegion_->SetText(ga->T("Homebrew"));
}
}
*/
/*
if (tvCRC_ && Reporting::HasCRC(gamePath_)) {
auto rp = GetI18NCategory("Reporting");
std::string crc = StringFromFormat("%08X", Reporting::RetrieveCRC(gamePath_));
tvCRC_->SetText(ReplaceAll(rp->T("FeedbackCRCValue", "Disc CRC: %1"), "%1", crc));
tvCRC_->SetVisibility(UI::V_VISIBLE);
}
*/
/*
if (tvID_) {
tvID_->SetText(ReplaceAll(info->id_version, "_", " v"));
}
@ -324,6 +390,7 @@ void GameScreen::render() {
choice->SetVisibility(UI::V_VISIBLE);
}
}
*/
}
UI::EventReturn GameScreen::OnShowInFolder(UI::EventParams &e) {
@ -343,6 +410,78 @@ UI::EventReturn GameScreen::OnDoCRC32(UI::EventParams& e) {
return UI::EVENT_DONE;
}
static char hb2hex(unsigned char hb) {
hb = hb & 0xF;
return hb < 10 ? '0' + hb : hb - 10 + 'a';
}
std::string MD5FullFile(const Path filename) {
FILE* in = File::OpenCFile(filename, "rb");
if (!in) {
WARN_LOG(COMMON, "Unable to open %s\n", filename.c_str());
return "";
}
unsigned char buff[BUFSIZ];
md5_context c;
md5_starts(&c);
unsigned char out[16];
long long len = 0;
while ((len = std::fread(buff, sizeof(char), BUFSIZ, in)) > 0) {
md5_update(&c, buff, len);
}
md5_finish(&c, out);
std::string res;
for (size_t i = 0; i < 16; ++i) {
res.push_back(hb2hex(out[i] >> 4));
res.push_back(hb2hex(out[i]));
}
fclose(in);
return res;
}
std::string MD5_262144_File(const Path filename) {
FILE* in = File::OpenCFile(filename, "rb");
if (!in) {
WARN_LOG(COMMON, "Unable to open %s\n", filename.c_str());
return "";
}
unsigned char buff[BUFSIZ];
md5_context c;
md5_starts(&c);
unsigned char out[16];
long len = 0;
int bytes_read = 0;
while ((len = std::fread(buff, sizeof(char), std::min(BUFSIZ, 262144 - bytes_read), in)) > 0) {
md5_update(&c, buff, len);
bytes_read += len;
if (bytes_read == 262144) break;
}
md5_finish(&c, out);
std::string res;
for (size_t i = 0; i < 16; ++i) {
res.push_back(hb2hex(out[i] >> 4));
res.push_back(hb2hex(out[i]));
}
fclose(in);
return res;
}
UI::EventReturn GameScreen::OnDoMD5(UI::EventParams& e) {
MD5string = "";
std::string tmpstr = gamePath_.GetFilename();
size_t pos = tmpstr.rfind('/');
tmpstr = tmpstr.substr(pos + 1);
MD5string = MD5FullFile(gamePath_) + "#";
MD5string = MD5string + MD5_262144_File(gamePath_);
MD5string = MD5string + "#" + std::to_string(sfilesize) + "#" + tmpstr;
btnCalcMD5_->SetEnabled(false);
tvMD5_->SetText(MD5string);
return UI::EVENT_DONE;
}
UI::EventReturn GameScreen::OnSwitchBack(UI::EventParams &e) {
TriggerFinish(DR_OK);

View file

@ -64,15 +64,19 @@ private:
UI::EventReturn OnCwCheat(UI::EventParams &e);
UI::EventReturn OnSetBackground(UI::EventParams &e);
UI::EventReturn OnDoCRC32(UI::EventParams& e);
UI::EventReturn OnDoMD5(UI::EventParams& e);
UI::EventReturn OnCopyBaidMD5(UI::EventParams& e);
// As we load metadata in the background, we need to be able to update these after the fact.
UI::TextView *tvTitle_ = nullptr;
//UI::TextView *tvTitle_ = nullptr;
UI::TextView *tvGameSize_ = nullptr;
UI::TextView *tvSaveDataSize_ = nullptr;
UI::TextView *tvInstallDataSize_ = nullptr;
UI::TextView *tvRegion_ = nullptr;
UI::TextView *tvCRC_ = nullptr;
UI::TextView *tvID_ = nullptr;
//UI::TextView *tvSaveDataSize_ = nullptr;
//UI::TextView *tvInstallDataSize_ = nullptr;
//UI::TextView *tvRegion_ = nullptr;
//UI::TextView *tvCRC_ = nullptr;
UI::TextView *tvMD5_ = nullptr;
UI::TextView* tvBaiduMD5_ = nullptr;
//UI::TextView *tvID_ = nullptr;
UI::Choice *btnGameSettings_ = nullptr;
UI::Choice *btnCreateGameConfig_ = nullptr;
@ -81,8 +85,11 @@ private:
UI::Choice *btnSetBackground_ = nullptr;
UI::Choice *btnCalcCRC_ = nullptr;
UI::Choice* btnCalcMD5_ = nullptr;
std::vector<UI::Choice *> otherChoices_;
std::vector<Path> saveDirs;
std::string CRC32string;
std::string CRC32string = "";
std::string MD5string = "";
u64 sfilesize = 0;
};

View file

@ -45,7 +45,7 @@
#include "Core/ELF/ParamSFO.h"
#include "Core/Util/GameManager.h"
#include "UI/BackgroundAudio.h"
//#include "UI/BackgroundAudio.h"
#include "UI/EmuScreen.h"
#include "UI/MainScreen.h"
#include "UI/GameScreen.h"
@ -964,12 +964,12 @@ UI::EventReturn GameBrowser::OnHomebrewStore(UI::EventParams &e) {
MainScreen::MainScreen() {
System_SendMessage("event", "mainscreen");
g_BackgroundAudio.SetGame(Path());
//g_BackgroundAudio.SetGame(Path());
lastVertical_ = UseVerticalLayout();
}
MainScreen::~MainScreen() {
g_BackgroundAudio.SetGame(Path());
//g_BackgroundAudio.SetGame(Path());
}
void MainScreen::CreateViews() {
@ -1134,15 +1134,16 @@ void MainScreen::CreateViews() {
if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) {
rightColumnItems->Add(new Choice(mm->T("Load", "Load...")))->OnClick.Handle(this, &MainScreen::OnLoadFile);
}
rightColumnItems->Add(new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings);
rightColumnItems->Add(new Choice(mm->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits);
rightColumnItems->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg);
if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) {
Choice *gold = rightColumnItems->Add(new Choice(mm->T("Buy PPSSPP Gold")));
gold->OnClick.Handle(this, &MainScreen::OnSupport);
gold->SetIcon(ImageID("I_ICONGOLD"), 0.5f);
}
//rightColumnItems->Add(new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings);
//rightColumnItems->Add(new Choice(mm->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits);
//rightColumnItems->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg);
//if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) {
//Choice *gold = rightColumnItems->Add(new Choice(mm->T("Buy PPSSPP Gold")));
//gold->OnClick.Handle(this, &MainScreen::OnSupport);
//gold->SetIcon(ImageID("I_ICONGOLD"), 0.5f);
//}
auto dev = GetI18NCategory("Developer");
rightColumnItems->Add(new Choice(dev->T("Language", "Language")))->OnClick.Handle(this, &MainScreen::OnLanguage);
#if !PPSSPP_PLATFORM(UWP)
// Having an exit button is against UWP guidelines.
rightColumnItems->Add(new Spacer(25.0));
@ -1166,10 +1167,10 @@ void MainScreen::CreateViews() {
} else if (tabHolder_->GetVisibility() != V_GONE) {
root_->SetDefaultFocusView(tabHolder_);
}
auto u = GetI18NCategory("Upgrade");
//auto u = GetI18NCategory("Upgrade");
upgradeBar_ = 0;
/*
if (!g_Config.upgradeMessage.empty()) {
upgradeBar_ = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
@ -1184,7 +1185,7 @@ void MainScreen::CreateViews() {
upgradeBar_->Add(new Button(u->T("Details"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDownloadUpgrade);
#endif
upgradeBar_->Add(new Button(u->T("Dismiss"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDismissUpgrade);
// Slip in under root_
LinearLayout *newRoot = new LinearLayout(ORIENT_VERTICAL);
newRoot->Add(root_);
@ -1192,6 +1193,26 @@ void MainScreen::CreateViews() {
root_->ReplaceLayoutParams(new LinearLayoutParams(1.0));
root_ = newRoot;
}
*/
}
UI::EventReturn MainScreen::OnLanguage(UI::EventParams& e) {
auto dev = GetI18NCategory("Developer");
auto langScreen = new NewLanguageScreen(dev->T("Language"));
langScreen->OnChoice.Handle(this, &MainScreen::OnLanguageChange);
if (e.v)
langScreen->SetPopupOrigin(e.v);
screenManager()->push(langScreen);
return UI::EVENT_DONE;
}
UI::EventReturn MainScreen::OnLanguageChange(UI::EventParams& e) {
screenManager()->RecreateAllViews();
if (host) {
host->UpdateUI();
}
return UI::EVENT_DONE;
}
UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) {
@ -1229,11 +1250,13 @@ void MainScreen::sendMessage(const char *message, const char *value) {
if (screenManager()->topScreen() == this) {
if (!strcmp(message, "boot")) {
LaunchFile(screenManager(), Path(std::string(value)));
//LaunchFile(screenManager(), Path(std::string(value)));
screenManager()->push(new GameScreen(Path(std::string(value))));
}
if (!strcmp(message, "browse_fileSelect")) {
INFO_LOG(SYSTEM, "Attempting to launch: '%s'", value);
LaunchFile(screenManager(), Path(std::string(value)));
//LaunchFile(screenManager(), Path(std::string(value)));
screenManager()->push(new GameScreen(Path(std::string(value))));
}
if (!strcmp(message, "browse_folderSelect")) {
std::string filename = value;
@ -1347,8 +1370,8 @@ UI::EventReturn MainScreen::OnGameSelected(UI::EventParams &e) {
// Restore focus if it was highlighted (e.g. by gamepad.)
restoreFocusGamePath_ = highlightedGamePath_;
g_BackgroundAudio.SetGame(path);
lockBackgroundAudio_ = true;
//g_BackgroundAudio.SetGame(path);
//lockBackgroundAudio_ = true;
screenManager()->push(new GameScreen(path));
return UI::EVENT_DONE;
}
@ -1374,7 +1397,7 @@ UI::EventReturn MainScreen::OnGameHighlight(UI::EventParams &e) {
}
if ((!highlightedGamePath_.empty() || e.a == FF_LOSTFOCUS) && !lockBackgroundAudio_) {
g_BackgroundAudio.SetGame(highlightedGamePath_);
// g_BackgroundAudio.SetGame(highlightedGamePath_);
}
lockBackgroundAudio_ = false;
@ -1384,7 +1407,8 @@ UI::EventReturn MainScreen::OnGameHighlight(UI::EventParams &e) {
UI::EventReturn MainScreen::OnGameSelectedInstant(UI::EventParams &e) {
g_Config.Save("MainScreen::OnGameSelectedInstant");
ScreenManager *screen = screenManager();
LaunchFile(screen, Path(e.s));
screenManager()->push(new GameScreen(Path(e.s)));
//LaunchFile(screen, Path(e.s));
return UI::EVENT_DONE;
}
@ -1451,7 +1475,7 @@ void MainScreen::dialogFinished(const Screen *dialog, DialogResult result) {
restoreFocusGamePath_.clear();
} else {
// Not refocusing, so we need to stop the audio.
g_BackgroundAudio.SetGame(Path());
// g_BackgroundAudio.SetGame(Path());
}
}
}

View file

@ -130,6 +130,8 @@ protected:
UI::EventReturn OnDismissUpgrade(UI::EventParams &e);
UI::EventReturn OnAllowStorage(UI::EventParams &e);
UI::EventReturn OnFullScreenToggle(UI::EventParams &e);
UI::EventReturn OnLanguage(UI::EventParams& e);
UI::EventReturn OnLanguageChange(UI::EventParams& e);
UI::LinearLayout *upgradeBar_ = nullptr;
UI::TabHolder *tabHolder_ = nullptr;

View file

@ -372,7 +372,7 @@ namespace MainWindow {
}
void BrowseAndBoot(std::string defaultPath, bool browseDirectory) {
static std::wstring filter = L"All supported file types (*.iso *.cso *.pbp *.elf *.prx *.zip *.ppdmp)|*.pbp;*.elf;*.iso;*.cso;*.prx;*.zip;*.ppdmp|PSP ROMs (*.iso *.cso *.pbp *.elf *.prx)|*.pbp;*.elf;*.iso;*.cso;*.prx|Homebrew/Demos installers (*.zip)|*.zip|All files (*.*)|*.*||";
static std::wstring filter = L"All files (*.*)|*.*||";
for (int i = 0; i < (int)filter.length(); i++) {
if (filter[i] == '|')
filter[i] = '\0';

View file

@ -1,4 +1,4 @@
[Audio]
[Audio]
Alternate speed volume = 自定义速度下的音量
Audio backend = 音频引擎(需要重启)
Audio Error = 音频错误
@ -612,7 +612,7 @@ Give PPSSPP permission to access storage = 给予PPSSPP访问存储空间的权
Homebrew & Demos = 自制游戏与试玩
How to get games = 如何获得游戏?
How to get homebrew & demos = 如何获得自制游戏与试玩?
Load = 载入游戏...
Load = 载入文件...
Loading... = 载入中...
PinPath = 固定
PPSSPP can't load games or save right now = PPSSPP现在不能载入游戏或存档
@ -1086,6 +1086,9 @@ Auto Load Savestate = 自动载入即时存档
AVI Dump started. = AVI转储开始
AVI Dump stopped. = AVI转储停止
Cache ISO in RAM = 在内存中缓存完整ISO
Copied code = 已复制到剪贴薄
Copy Baid md5 = 复制秒传代码
Calculate MD5 = 计算秒传代码
Change CPU Clock = 修改模拟的PSP的CPU频率(不稳定)
Color Tint = 颜色色调
Color Saturation = 颜色饱和度

View file

@ -1,4 +1,4 @@
[Audio]
[Audio]
Alternate speed volume = 自定義速度下的音量
Audio backend = 音訊引擎(需要重新啟動)
Audio Error = 音訊錯誤
@ -616,7 +616,7 @@ Give PPSSPP permission to access storage = 給予PPSSPP存取權限
Homebrew & Demos = 自製遊戲和試玩
How to get games = 如何獲得遊戲
How to get homebrew & demos = 如何獲得自製遊戲和試玩
Load = 載入遊戲...
Load = 載入文件...
Loading... = 載入中...
PinPath = 標記
PPSSPP can't load games or save right now = PPSSPP現在無法載入遊戲或存檔
@ -1097,10 +1097,13 @@ Auto = 自動
Auto Load Savestate = 自動加載保存狀態
AVI Dump started. = AVI轉儲開始
AVI Dump stopped. = AVI轉儲停止
Copied code = 已複制到剪貼薄
Cache ISO in RAM = 將整個ISO檔暫存於記憶體中
Calculate MD5 = 計算秒傳代碼
Change CPU Clock = 調整CPU時鐘(不穩定)
Color Tint = 色調
Color Saturation = 顔色飽和度
Copy Baid md5 = 復製秒傳代碼
Error: load undo state is from a different game = 錯誤: 撤回的即時存檔來自不同游戲
Failed to load state for load undo. Error in the file system. = 無法撤銷加載的即時存檔,文件系統有錯誤。
Floating symbols = 漂浮的符號