mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
I18N: Switch to getting categories by index instead of by string lookup
Also gets rid of the shared_ptr usage, and generally makes things nicer. Needed for later config refactorings, good to get in early.
This commit is contained in:
+67
-60
@@ -1,6 +1,7 @@
|
||||
#include "Common/Data/Text/I18n.h"
|
||||
#include "Common/Data/Format/IniFile.h"
|
||||
#include "Common/File/VFS/VFS.h"
|
||||
#include "Common/Log.h"
|
||||
|
||||
#include "Common/StringUtils.h"
|
||||
|
||||
@@ -14,12 +15,52 @@ std::string I18NRepo::LanguageID() {
|
||||
return languageID_;
|
||||
}
|
||||
|
||||
I18NRepo::I18NRepo() {
|
||||
cats_[(size_t)I18NCat::AUDIO].SetName("Audio");
|
||||
cats_[(size_t)I18NCat::CONTROLS].SetName("Controls");
|
||||
cats_[(size_t)I18NCat::SYSTEM].SetName("System");
|
||||
cats_[(size_t)I18NCat::CWCHEATS].SetName("CwCheats");
|
||||
cats_[(size_t)I18NCat::DESKTOPUI].SetName("DesktopUI");
|
||||
cats_[(size_t)I18NCat::DEVELOPER].SetName("Developer");
|
||||
cats_[(size_t)I18NCat::DIALOG].SetName("Dialog");
|
||||
cats_[(size_t)I18NCat::ERRORS].SetName("Error");
|
||||
cats_[(size_t)I18NCat::GAME].SetName("Game");
|
||||
cats_[(size_t)I18NCat::GRAPHICS].SetName("Graphics");
|
||||
cats_[(size_t)I18NCat::INSTALLZIP].SetName("InstallZip");
|
||||
cats_[(size_t)I18NCat::KEYMAPPING].SetName("KeyMapping");
|
||||
cats_[(size_t)I18NCat::MAINMENU].SetName("MainMenu");
|
||||
cats_[(size_t)I18NCat::MAINSETTINGS].SetName("MainSettings");
|
||||
cats_[(size_t)I18NCat::MAPPABLECONTROLS].SetName("MappableControls");
|
||||
cats_[(size_t)I18NCat::NETWORKING].SetName("Networking");
|
||||
cats_[(size_t)I18NCat::PAUSE].SetName("Pause");
|
||||
cats_[(size_t)I18NCat::POSTSHADERS].SetName("PostShaders");
|
||||
cats_[(size_t)I18NCat::PSPCREDITS].SetName("PSPCredits");
|
||||
cats_[(size_t)I18NCat::MEMSTICK].SetName("MemStick");
|
||||
cats_[(size_t)I18NCat::REMOTEISO].SetName("RemoteISO");
|
||||
cats_[(size_t)I18NCat::REPORTING].SetName("Reporting");
|
||||
cats_[(size_t)I18NCat::SAVEDATA].SetName("Savedata");
|
||||
cats_[(size_t)I18NCat::SCREEN].SetName("Screen");
|
||||
cats_[(size_t)I18NCat::SEARCH].SetName("Search");
|
||||
cats_[(size_t)I18NCat::STORE].SetName("Store");
|
||||
cats_[(size_t)I18NCat::SYSINFO].SetName("SysInfo");
|
||||
cats_[(size_t)I18NCat::SYSTEM].SetName("System");
|
||||
cats_[(size_t)I18NCat::TEXTURESHADERS].SetName("TextureShaders");
|
||||
cats_[(size_t)I18NCat::THEMES].SetName("Themes");
|
||||
cats_[(size_t)I18NCat::UI_ELEMENTS].SetName("UI Elements");
|
||||
cats_[(size_t)I18NCat::UPGRADE].SetName("Upgrade");
|
||||
cats_[(size_t)I18NCat::VR].SetName("VR");
|
||||
}
|
||||
|
||||
void I18NRepo::Clear() {
|
||||
std::lock_guard<std::mutex> guard(catsLock_);
|
||||
for (auto iter = cats_.begin(); iter != cats_.end(); ++iter) {
|
||||
iter->second.reset();
|
||||
for (auto &iter : cats_) {
|
||||
iter.Clear();
|
||||
}
|
||||
cats_.clear();
|
||||
}
|
||||
|
||||
void I18NCategory::Clear() {
|
||||
map_.clear();
|
||||
missedKeyLog_.clear();
|
||||
}
|
||||
|
||||
const char *I18NCategory::T(const char *key, const char *def) {
|
||||
@@ -32,7 +73,6 @@ const char *I18NCategory::T(const char *key, const char *def) {
|
||||
|
||||
auto iter = map_.find(modifiedKey);
|
||||
if (iter != map_.end()) {
|
||||
// INFO_LOG(SYSTEM, "translation key found in %s: %s", name_.c_str(), key);
|
||||
return iter->second.text.c_str();
|
||||
} else {
|
||||
std::lock_guard<std::mutex> guard(missedKeyLock_);
|
||||
@@ -40,7 +80,6 @@ const char *I18NCategory::T(const char *key, const char *def) {
|
||||
missedKeyLog_[key] = def;
|
||||
else
|
||||
missedKeyLog_[key] = modifiedKey;
|
||||
// INFO_LOG(SYSTEM, "Missed translation key in %s: %s", name_.c_str(), key);
|
||||
return def ? def : key;
|
||||
}
|
||||
}
|
||||
@@ -50,21 +89,25 @@ void I18NCategory::SetMap(const std::map<std::string, std::string> &m) {
|
||||
if (map_.find(iter->first) == map_.end()) {
|
||||
std::string text = ReplaceAll(iter->second, "\\n", "\n");
|
||||
map_[iter->first] = I18NEntry(text);
|
||||
// INFO_LOG(SYSTEM, "Language entry: %s -> %s", iter->first.c_str(), text.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<I18NCategory> I18NRepo::GetCategory(const char *category) {
|
||||
I18NCategory *I18NRepo::GetCategory(I18NCat category) {
|
||||
std::lock_guard<std::mutex> guard(catsLock_);
|
||||
auto iter = cats_.find(category);
|
||||
if (iter != cats_.end()) {
|
||||
return iter->second;
|
||||
} else {
|
||||
I18NCategory *c = new I18NCategory(this, category);
|
||||
cats_[category].reset(c);
|
||||
return cats_[category];
|
||||
if (category != I18NCat::NONE)
|
||||
return &cats_[(size_t)category];
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
I18NCategory *I18NRepo::GetCategoryByName(const char *name) {
|
||||
for (auto &iter : cats_) {
|
||||
if (!strcmp(iter.GetName(), name)) {
|
||||
return &iter;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Path I18NRepo::GetIniPath(const std::string &languageID) const {
|
||||
@@ -99,9 +142,10 @@ bool I18NRepo::LoadIni(const std::string &languageID, const Path &overridePath)
|
||||
const std::vector<Section> §ions = ini.Sections();
|
||||
|
||||
std::lock_guard<std::mutex> guard(catsLock_);
|
||||
for (auto iter = sections.begin(); iter != sections.end(); ++iter) {
|
||||
if (iter->name() != "") {
|
||||
cats_[iter->name()].reset(LoadSection(&(*iter), iter->name().c_str()));
|
||||
for (auto &iter : sections) {
|
||||
I18NCategory *cat = GetCategoryByName(iter.name().c_str());
|
||||
if (cat) {
|
||||
cat->LoadSection(iter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,53 +153,16 @@ bool I18NRepo::LoadIni(const std::string &languageID, const Path &overridePath)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::map<std::string, std::vector<std::string>> I18NRepo::GetMissingKeys() const {
|
||||
std::map<std::string, std::vector<std::string>> ret;
|
||||
void I18NRepo::LogMissingKeys() const {
|
||||
std::lock_guard<std::mutex> guard(catsLock_);
|
||||
for (auto &cat : cats_) {
|
||||
for (auto &key : cat.second->Missed()) {
|
||||
ret[cat.first].push_back(key.first);
|
||||
for (auto &key : cat.Missed()) {
|
||||
INFO_LOG(SYSTEM, "Missing translation [%s]: %s (%s)", cat.GetName(), key.first.c_str(), key.second.c_str());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
I18NCategory *I18NRepo::LoadSection(const Section *section, const char *name) {
|
||||
I18NCategory *cat = new I18NCategory(this, name);
|
||||
std::map<std::string, std::string> sectionMap = section->ToMap();
|
||||
cat->SetMap(sectionMap);
|
||||
return cat;
|
||||
}
|
||||
|
||||
// This is a very light touched save variant - it won't overwrite
|
||||
// anything, only create new entries.
|
||||
void I18NRepo::SaveIni(const std::string &languageID) {
|
||||
IniFile ini;
|
||||
ini.Load(GetIniPath(languageID));
|
||||
std::lock_guard<std::mutex> guard(catsLock_);
|
||||
for (auto iter = cats_.begin(); iter != cats_.end(); ++iter) {
|
||||
std::string categoryName = iter->first;
|
||||
Section *section = ini.GetOrCreateSection(categoryName.c_str());
|
||||
SaveSection(ini, section, iter->second);
|
||||
}
|
||||
ini.Save(GetIniPath(languageID));
|
||||
}
|
||||
|
||||
void I18NRepo::SaveSection(IniFile &ini, Section *section, std::shared_ptr<I18NCategory> cat) {
|
||||
const std::map<std::string, std::string> &missed = cat->Missed();
|
||||
|
||||
for (auto iter = missed.begin(); iter != missed.end(); ++iter) {
|
||||
if (!section->Exists(iter->first.c_str())) {
|
||||
std::string text = ReplaceAll(iter->second, "\n", "\\n");
|
||||
section->Set(iter->first, text);
|
||||
}
|
||||
}
|
||||
|
||||
const std::map<std::string, I18NEntry> &entries = cat->GetMap();
|
||||
for (auto iter = entries.begin(); iter != entries.end(); ++iter) {
|
||||
std::string text = ReplaceAll(iter->second.text, "\n", "\\n");
|
||||
section->Set(iter->first, text);
|
||||
}
|
||||
|
||||
cat->ClearMissed();
|
||||
void I18NCategory::LoadSection(const Section §ion) {
|
||||
std::map<std::string, std::string> sectionMap = section.ToMap();
|
||||
SetMap(sectionMap);
|
||||
}
|
||||
|
||||
+55
-32
@@ -9,7 +9,6 @@
|
||||
// As usual, everything is UTF-8. Nothing else allowed.
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -23,6 +22,43 @@ class I18NRepo;
|
||||
class IniFile;
|
||||
class Section;
|
||||
|
||||
enum class I18NCat : uint8_t {
|
||||
AUDIO = 0,
|
||||
CONTROLS,
|
||||
CWCHEATS,
|
||||
DESKTOPUI,
|
||||
DEVELOPER,
|
||||
DIALOG,
|
||||
ERRORS, // Can't name it ERROR, clashes with many defines.
|
||||
GAME,
|
||||
GRAPHICS,
|
||||
INSTALLZIP,
|
||||
KEYMAPPING,
|
||||
MAINMENU,
|
||||
MAINSETTINGS,
|
||||
MAPPABLECONTROLS,
|
||||
NETWORKING,
|
||||
PAUSE,
|
||||
POSTSHADERS,
|
||||
PSPCREDITS,
|
||||
MEMSTICK,
|
||||
REMOTEISO,
|
||||
REPORTING,
|
||||
SAVEDATA,
|
||||
SCREEN,
|
||||
SEARCH,
|
||||
STORE,
|
||||
SYSINFO,
|
||||
SYSTEM,
|
||||
TEXTURESHADERS,
|
||||
THEMES,
|
||||
UI_ELEMENTS,
|
||||
UPGRADE,
|
||||
VR,
|
||||
CATEGORY_COUNT,
|
||||
NONE = CATEGORY_COUNT,
|
||||
};
|
||||
|
||||
struct I18NEntry {
|
||||
I18NEntry(const std::string &t) : text(t), readFlag(false) {}
|
||||
I18NEntry() : readFlag(false) {}
|
||||
@@ -39,9 +75,10 @@ struct I18NCandidate {
|
||||
|
||||
class I18NCategory {
|
||||
public:
|
||||
I18NCategory() {}
|
||||
// NOTE: Name must be a global constant string - it is not copied.
|
||||
I18NCategory(const char *name) : name_(name) {}
|
||||
const char *T(const char *key, const char *def = 0);
|
||||
explicit I18NCategory(const char *name) : name_(name) {}
|
||||
const char *T(const char *key, const char *def = nullptr);
|
||||
const char *T(const std::string &key) {
|
||||
return T(key.c_str(), nullptr);
|
||||
}
|
||||
@@ -54,10 +91,13 @@ public:
|
||||
const std::map<std::string, I18NEntry> &GetMap() { return map_; }
|
||||
void ClearMissed() { missedKeyLog_.clear(); }
|
||||
const char *GetName() const { return name_.c_str(); }
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
I18NCategory(I18NRepo *repo, const char *name) : name_(name) {}
|
||||
void SetName(const char *name) { name_ = name; }
|
||||
void SetMap(const std::map<std::string, std::string> &m);
|
||||
void LoadSection(const Section §ion);
|
||||
|
||||
std::string name_;
|
||||
|
||||
@@ -67,62 +107,45 @@ private:
|
||||
|
||||
// Noone else can create these.
|
||||
friend class I18NRepo;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(I18NCategory);
|
||||
};
|
||||
|
||||
class I18NRepo {
|
||||
public:
|
||||
I18NRepo() {}
|
||||
I18NRepo();
|
||||
~I18NRepo();
|
||||
|
||||
bool IniExists(const std::string &languageID) const;
|
||||
bool LoadIni(const std::string &languageID, const Path &overridePath = Path()); // NOT the filename!
|
||||
void SaveIni(const std::string &languageID);
|
||||
|
||||
std::string LanguageID();
|
||||
|
||||
std::shared_ptr<I18NCategory> GetCategory(const char *categoryName);
|
||||
bool HasCategory(const char *categoryName) const {
|
||||
std::lock_guard<std::mutex> guard(catsLock_);
|
||||
return cats_.find(categoryName) != cats_.end();
|
||||
}
|
||||
const char *T(const char *category, const char *key, const char *def = 0);
|
||||
I18NCategory *GetCategory(I18NCat category);
|
||||
I18NCategory *GetCategoryByName(const char *name);
|
||||
|
||||
std::map<std::string, std::vector<std::string>> GetMissingKeys() const;
|
||||
const char *T(I18NCat category, const char *key, const char *def = nullptr) {
|
||||
return cats_[(size_t)category].T(key, def);
|
||||
}
|
||||
|
||||
void LogMissingKeys() const;
|
||||
|
||||
private:
|
||||
Path GetIniPath(const std::string &languageID) const;
|
||||
void Clear();
|
||||
I18NCategory *LoadSection(const Section *section, const char *name);
|
||||
void SaveSection(IniFile &ini, Section *section, std::shared_ptr<I18NCategory> cat);
|
||||
|
||||
mutable std::mutex catsLock_;
|
||||
std::map<std::string, std::shared_ptr<I18NCategory>> cats_;
|
||||
I18NCategory cats_[(size_t)I18NCat::CATEGORY_COUNT];
|
||||
std::string languageID_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(I18NRepo);
|
||||
};
|
||||
|
||||
extern I18NRepo i18nrepo;
|
||||
|
||||
// These are simply talking to the one global instance of I18NRepo.
|
||||
|
||||
inline std::shared_ptr<I18NCategory> GetI18NCategory(const char *categoryName) {
|
||||
if (!categoryName)
|
||||
return nullptr;
|
||||
return i18nrepo.GetCategory(categoryName);
|
||||
inline I18NCategory *GetI18NCategory(I18NCat cat) {
|
||||
return i18nrepo.GetCategory(cat);
|
||||
}
|
||||
|
||||
inline bool I18NCategoryLoaded(const char *categoryName) {
|
||||
return i18nrepo.HasCategory(categoryName);
|
||||
}
|
||||
|
||||
inline const char *T(const char *category, const char *key, const char *def = 0) {
|
||||
inline const char *T(I18NCat category, const char *key, const char *def = nullptr) {
|
||||
return i18nrepo.T(category, key, def);
|
||||
}
|
||||
|
||||
inline std::map<std::string, std::vector<std::string>> GetI18NMissingKeys() {
|
||||
return i18nrepo.GetMissingKeys();
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ UI::EventReturn ListPopupScreen::OnListChoice(UI::EventParams &e) {
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
PopupContextMenuScreen::PopupContextMenuScreen(const ContextMenuItem *items, size_t itemCount, I18NCategory *category, UI::View *sourceView)
|
||||
PopupContextMenuScreen::PopupContextMenuScreen(const ContextMenuItem *items, size_t itemCount, I18NCat category, UI::View *sourceView)
|
||||
: PopupScreen("", "", ""), items_(items), itemCount_(itemCount), category_(category), sourceView_(sourceView)
|
||||
{
|
||||
enabled_.resize(itemCount, true);
|
||||
@@ -55,9 +55,11 @@ PopupContextMenuScreen::PopupContextMenuScreen(const ContextMenuItem *items, siz
|
||||
}
|
||||
|
||||
void PopupContextMenuScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
auto category = GetI18NCategory(category_);
|
||||
|
||||
for (size_t i = 0; i < itemCount_; i++) {
|
||||
if (items_[i].imageID) {
|
||||
Choice *choice = new Choice(category_->T(items_[i].text), ImageID(items_[i].imageID));
|
||||
Choice *choice = new Choice(category->T(items_[i].text), ImageID(items_[i].imageID));
|
||||
parent->Add(choice);
|
||||
if (enabled_[i]) {
|
||||
choice->OnClick.Add([=](EventParams &p) {
|
||||
@@ -90,7 +92,7 @@ std::string ChopTitle(const std::string &title) {
|
||||
UI::EventReturn PopupMultiChoice::HandleClick(UI::EventParams &e) {
|
||||
restoreFocus_ = HasFocus();
|
||||
|
||||
auto category = category_ ? GetI18NCategory(category_) : nullptr;
|
||||
auto category = GetI18NCategory(category_);
|
||||
|
||||
std::vector<std::string> choices;
|
||||
for (int i = 0; i < numChoices_; i++) {
|
||||
@@ -289,7 +291,7 @@ void SliderPopupScreen::UpdateTextBox() {
|
||||
void SliderPopupScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
UIContext &dc = *screenManager()->getUIContext();
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
sliderValue_ = *value_;
|
||||
if (disabled_ && sliderValue_ < 0)
|
||||
@@ -337,7 +339,7 @@ void SliderPopupScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
void SliderFloatPopupScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
UIContext &dc = *screenManager()->getUIContext();
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
sliderValue_ = *value_;
|
||||
LinearLayout *vert = parent->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(UI::Margins(10, 10))));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common/Data/Text/I18N.h"
|
||||
#include "Common/UI/UIScreen.h"
|
||||
#include "Common/UI/UI.h"
|
||||
#include "Common/UI/View.h"
|
||||
@@ -159,7 +160,7 @@ struct ContextMenuItem {
|
||||
// Once a selection has been made,
|
||||
class PopupContextMenuScreen : public PopupScreen {
|
||||
public:
|
||||
PopupContextMenuScreen(const ContextMenuItem *items, size_t itemCount, I18NCategory *category, UI::View *sourceView);
|
||||
PopupContextMenuScreen(const ContextMenuItem *items, size_t itemCount, I18NCat category, UI::View *sourceView);
|
||||
void CreatePopupContents(ViewGroup *parent) override;
|
||||
|
||||
const char *tag() const override { return "ContextMenuPopup"; }
|
||||
@@ -176,7 +177,7 @@ protected:
|
||||
private:
|
||||
const ContextMenuItem *items_;
|
||||
size_t itemCount_;
|
||||
I18NCategory *category_;
|
||||
I18NCat category_;
|
||||
UI::View *sourceView_;
|
||||
std::vector<bool> enabled_;
|
||||
};
|
||||
@@ -200,7 +201,7 @@ protected:
|
||||
class PopupMultiChoice : public AbstractChoiceWithValueDisplay {
|
||||
public:
|
||||
PopupMultiChoice(int *value, const std::string &text, const char **choices, int minVal, int numChoices,
|
||||
const char *category, ScreenManager *screenManager, UI::LayoutParams *layoutParams = nullptr)
|
||||
I18NCat category, ScreenManager *screenManager, UI::LayoutParams *layoutParams = nullptr)
|
||||
: AbstractChoiceWithValueDisplay(text, layoutParams), value_(value), choices_(choices), minVal_(minVal), numChoices_(numChoices),
|
||||
category_(category), screenManager_(screenManager) {
|
||||
if (*value >= numChoices + minVal)
|
||||
@@ -234,7 +235,7 @@ private:
|
||||
void ChoiceCallback(int num);
|
||||
virtual void PostChoiceCallback(int num) {}
|
||||
|
||||
const char *category_;
|
||||
I18NCat category_;
|
||||
ScreenManager *screenManager_;
|
||||
std::string valueText_;
|
||||
bool restoreFocus_ = false;
|
||||
@@ -245,7 +246,7 @@ private:
|
||||
class PopupMultiChoiceDynamic : public PopupMultiChoice {
|
||||
public:
|
||||
PopupMultiChoiceDynamic(std::string *value, const std::string &text, std::vector<std::string> choices,
|
||||
const char *category, ScreenManager *screenManager, UI::LayoutParams *layoutParams = nullptr)
|
||||
I18NCat category, ScreenManager *screenManager, UI::LayoutParams *layoutParams = nullptr)
|
||||
: UI::PopupMultiChoice(&valueInt_, text, nullptr, 0, (int)choices.size(), category, screenManager, layoutParams),
|
||||
valueStr_(value) {
|
||||
choices_ = new const char *[numChoices_];
|
||||
@@ -378,7 +379,7 @@ public:
|
||||
ChoiceWithValueDisplay(int *value, const std::string &text, LayoutParams *layoutParams = 0)
|
||||
: AbstractChoiceWithValueDisplay(text, layoutParams), iValue_(value) {}
|
||||
|
||||
ChoiceWithValueDisplay(std::string *value, const std::string &text, const char *category, LayoutParams *layoutParams = 0)
|
||||
ChoiceWithValueDisplay(std::string *value, const std::string &text, I18NCat category, LayoutParams *layoutParams = 0)
|
||||
: AbstractChoiceWithValueDisplay(text, layoutParams), sValue_(value), category_(category) {}
|
||||
|
||||
ChoiceWithValueDisplay(std::string *value, const std::string &text, std::string(*translateCallback)(const char *value), LayoutParams *layoutParams = 0)
|
||||
@@ -390,7 +391,7 @@ private:
|
||||
|
||||
std::string *sValue_ = nullptr;
|
||||
int *iValue_ = nullptr;
|
||||
const char *category_ = nullptr;
|
||||
I18NCat category_ = I18NCat::CATEGORY_COUNT;
|
||||
std::string(*translateCallback_)(const char *value) = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -517,7 +517,7 @@ void ListView::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert)
|
||||
}
|
||||
|
||||
std::string ListView::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return DescribeListOrdered(u->T("List:"));
|
||||
}
|
||||
|
||||
@@ -552,4 +552,4 @@ bool StringVectorListAdaptor::AddEventCallback(View *view, std::function<EventRe
|
||||
return EVENT_DONE;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -218,7 +218,7 @@ UI::EventReturn UIScreen::OnCancel(UI::EventParams &e) {
|
||||
|
||||
PopupScreen::PopupScreen(std::string title, std::string button1, std::string button2)
|
||||
: title_(title) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
if (!button1.empty())
|
||||
button1_ = di->T(button1.c_str());
|
||||
if (!button2.empty())
|
||||
|
||||
+9
-9
@@ -530,7 +530,7 @@ void Choice::Draw(UIContext &dc) {
|
||||
}
|
||||
|
||||
std::string Choice::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 choice"), "%1", text_);
|
||||
}
|
||||
|
||||
@@ -578,7 +578,7 @@ void InfoItem::Draw(UIContext &dc) {
|
||||
}
|
||||
|
||||
std::string InfoItem::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(ReplaceAll(u->T("%1: %2"), "%1", text_), "%2", rightText_);
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ void ItemHeader::GetContentDimensionsBySpec(const UIContext &dc, MeasureSpec hor
|
||||
}
|
||||
|
||||
std::string ItemHeader::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 heading"), "%1", text_);
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ void PopupHeader::Draw(UIContext &dc) {
|
||||
}
|
||||
|
||||
std::string PopupHeader::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 heading"), "%1", text_);
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ void CheckBox::Draw(UIContext &dc) {
|
||||
}
|
||||
|
||||
std::string CheckBox::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
std::string text = ReplaceAll(u->T("%1 checkbox"), "%1", text_);
|
||||
if (!smallText_.empty()) {
|
||||
text += "\n" + smallText_;
|
||||
@@ -857,7 +857,7 @@ void Button::GetContentDimensions(const UIContext &dc, float &w, float &h) const
|
||||
}
|
||||
|
||||
std::string Button::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 button"), "%1", GetText());
|
||||
}
|
||||
|
||||
@@ -919,7 +919,7 @@ void RadioButton::GetContentDimensions(const UIContext &dc, float &w, float &h)
|
||||
}
|
||||
|
||||
std::string RadioButton::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 radio button"), "%1", text_);
|
||||
}
|
||||
|
||||
@@ -1107,7 +1107,7 @@ void TextEdit::GetContentDimensions(const UIContext &dc, float &w, float &h) con
|
||||
}
|
||||
|
||||
std::string TextEdit::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 text field"), "%1", GetText());
|
||||
}
|
||||
|
||||
@@ -1291,7 +1291,7 @@ void ProgressBar::Draw(UIContext &dc) {
|
||||
}
|
||||
|
||||
std::string ProgressBar::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
float percent = progress_ * 100.0f;
|
||||
return ReplaceAll(u->T("Progress: %1%"), "%1", StringFromInt((int)percent));
|
||||
}
|
||||
|
||||
@@ -731,7 +731,7 @@ void LinearLayout::Layout() {
|
||||
}
|
||||
|
||||
std::string LinearLayoutList::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return DescribeListOrdered(u->T("List:"));
|
||||
}
|
||||
|
||||
@@ -943,7 +943,7 @@ void GridLayout::Layout() {
|
||||
}
|
||||
|
||||
std::string GridLayoutList::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return DescribeListOrdered(u->T("List:"));
|
||||
}
|
||||
|
||||
@@ -1168,7 +1168,7 @@ void ChoiceStrip::Draw(UIContext &dc) {
|
||||
}
|
||||
|
||||
std::string ChoiceStrip::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return DescribeListUnordered(u->T("Choices:"));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -377,7 +377,7 @@ void CWCheatEngine::CreateCheatFile() {
|
||||
fclose(f);
|
||||
}
|
||||
if (!File::Exists(filename_)) {
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
System_NotifyUserMessage(err->T("Unable to create cheat file, disk may be full"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ void PSPDialog::DisplayButtons(int flags, const char *caption)
|
||||
|
||||
PPGeStyle textStyle = FadedStyle(PPGeAlign::BOX_LEFT, FONT_SCALE);
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
float x1 = 183.5f, x2 = 261.5f;
|
||||
if (GetCommonParam()->buttonSwap == 1) {
|
||||
x1 = 261.5f;
|
||||
|
||||
@@ -147,7 +147,7 @@ int PSPMsgDialog::Init(unsigned int paramAddr) {
|
||||
|
||||
|
||||
void PSPMsgDialog::FormatErrorCode(uint32_t code) {
|
||||
auto err = GetI18NCategory("Dialog");
|
||||
auto err = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
switch (code) {
|
||||
case SCE_UTILITY_SAVEDATA_ERROR_LOAD_DATA_BROKEN:
|
||||
@@ -180,7 +180,7 @@ void PSPMsgDialog::FormatErrorCode(uint32_t code) {
|
||||
}
|
||||
|
||||
void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo, bool hasOK) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
PPGeStyle buttonStyle = FadedStyle(PPGeAlign::BOX_CENTER, FONT_SCALE);
|
||||
PPGeStyle messageStyle = FadedStyle(PPGeAlign::BOX_HCENTER, FONT_SCALE);
|
||||
|
||||
@@ -94,7 +94,7 @@ void PSPNetconfDialog::DrawBanner() {
|
||||
|
||||
// TODO: Draw a hexagon icon
|
||||
PPGeDrawImage(10, 5, 11.0f, 10.0f, 1, 10, 1, 10, 10, 10, FadedImageStyle());
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
PPGeDrawText(di->T("Network Connection"), 31, 10, textStyle);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ void PSPNetconfDialog::DrawIndicator() {
|
||||
}
|
||||
|
||||
void PSPNetconfDialog::DisplayMessage(std::string text1, std::string text2a, std::string text2b, std::string text3a, std::string text3b, bool hasYesNo, bool hasOK) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
PPGeStyle buttonStyle = FadedStyle(PPGeAlign::BOX_CENTER, FONT_SCALE);
|
||||
PPGeStyle messageStyle = FadedStyle(PPGeAlign::BOX_HCENTER, FONT_SCALE);
|
||||
@@ -238,8 +238,8 @@ int PSPNetconfDialog::Update(int animSpeed) {
|
||||
|
||||
UpdateButtons();
|
||||
UpdateCommon();
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
u64 now = (u64)(time_now_d() * 1000000.0);
|
||||
|
||||
// It seems JPCSP doesn't check for NETCONF_STATUS_APNET
|
||||
|
||||
@@ -86,7 +86,7 @@ void PSPNpSigninDialog::DrawBanner() {
|
||||
|
||||
// TODO: Draw a hexagon icon
|
||||
PPGeDrawImage(10, 5, 11.0f, 10.0f, 1, 10, 1, 10, 10, 10, FadedImageStyle());
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
PPGeDrawText(di->T("Sign In"), 31, 10, textStyle);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ void PSPNpSigninDialog::DrawLogo() {
|
||||
}
|
||||
|
||||
void PSPNpSigninDialog::DisplayMessage(std::string text1, std::string text2a, std::string text2b, std::string text3a, std::string text3b, bool hasYesNo, bool hasOK) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
PPGeStyle buttonStyle = FadedStyle(PPGeAlign::BOX_CENTER, FONT_SCALE);
|
||||
PPGeStyle messageStyle = FadedStyle(PPGeAlign::BOX_HCENTER, FONT_SCALE);
|
||||
@@ -235,8 +235,8 @@ int PSPNpSigninDialog::Update(int animSpeed) {
|
||||
|
||||
UpdateButtons();
|
||||
UpdateCommon();
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
u64 now = (u64)(time_now_d() * 1000000.0);
|
||||
|
||||
if (request.npSigninStatus == NP_SIGNIN_STATUS_NONE) {
|
||||
|
||||
@@ -985,7 +985,7 @@ int PSPOskDialog::Update(int animSpeed) {
|
||||
PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x63636363));
|
||||
RenderKeyboard();
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
PPGeStyle actionStyle = FadedStyle(PPGeAlign::BOX_LEFT, 0.5f);
|
||||
PPGeStyle guideStyle = FadedStyle(PPGeAlign::BOX_LEFT, 0.6f);
|
||||
|
||||
@@ -341,7 +341,7 @@ const std::string PSPSaveDialog::GetSelectedSaveDirName() const
|
||||
|
||||
void PSPSaveDialog::DisplayBanner(int which)
|
||||
{
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
PPGeDrawRect(0, 0, 480, 23, CalcFadedColor(0x65636358));
|
||||
|
||||
PPGeStyle textStyle = FadedStyle(PPGeAlign::BOX_VCENTER, 0.6f);
|
||||
@@ -512,12 +512,12 @@ void PSPSaveDialog::DisplaySaveDataInfo1() {
|
||||
PPGeStyle saveTitleStyle = FadedStyle(PPGeAlign::BOX_LEFT, 0.55f);
|
||||
|
||||
if (saveInfo.broken) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
PPGeStyle textStyle = FadedStyle(PPGeAlign::BOX_VCENTER, 0.6f);
|
||||
PPGeDrawText(di->T("Corrupted Data"), 180, 136, textStyle);
|
||||
PPGeDrawText(saveInfo.title, 175, 159, saveTitleStyle);
|
||||
} else if (saveInfo.size == 0) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
PPGeStyle textStyle = FadedStyle(PPGeAlign::BOX_VCENTER, 0.6f);
|
||||
PPGeDrawText(di->T("NEW DATA"), 180, 136, textStyle);
|
||||
} else {
|
||||
@@ -590,7 +590,7 @@ void PSPSaveDialog::DisplayMessage(std::string text, bool hasYesNo)
|
||||
float h2 = h / 2.0f;
|
||||
if (hasYesNo)
|
||||
{
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
const char *choiceText;
|
||||
float x, w;
|
||||
if (yesnoChoice == 1) {
|
||||
@@ -657,7 +657,7 @@ int PSPSaveDialog::Update(int animSpeed)
|
||||
|
||||
UpdateCommon();
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
switch (display)
|
||||
{
|
||||
|
||||
@@ -455,7 +455,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
|
||||
|
||||
if (!pspFileSystem.GetFileInfo(dirPath).exists) {
|
||||
if (!pspFileSystem.MkDir(dirPath)) {
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
System_NotifyUserMessage(err->T("Unable to write savedata, disk may be full"));
|
||||
}
|
||||
}
|
||||
@@ -484,7 +484,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
|
||||
}
|
||||
|
||||
if (EncryptData(decryptMode, cryptedData, &cryptedSize, &aligned_len, cryptedHash, (hasKey ? param->key : 0)) != 0) {
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
System_NotifyUserMessage(err->T("Save encryption failed. This save won't work on real PSP"), 6.0f);
|
||||
ERROR_LOG(SCEUTILITY,"Save encryption failed. This save won't work on real PSP");
|
||||
delete[] cryptedData;
|
||||
@@ -774,7 +774,7 @@ u32 SavedataParam::LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, con
|
||||
|
||||
// Don't notify the user if we're not going to upgrade the save.
|
||||
if (!g_Config.bEncryptSave) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
System_NotifyUserMessage(di->T("When you save, it will load on a PSP, but not an older PPSSPP"), 6.0f);
|
||||
System_NotifyUserMessage(di->T("Old savedata detected"), 6.0f);
|
||||
}
|
||||
@@ -786,7 +786,7 @@ u32 SavedataParam::LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, con
|
||||
}
|
||||
if (g_Config.bSavedataUpgrade) {
|
||||
decryptMode = prevCryptMode;
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
System_NotifyUserMessage(di->T("When you save, it will not work on outdated PSP Firmware anymore"), 6.0f);
|
||||
System_NotifyUserMessage(di->T("Old savedata detected"), 6.0f);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ u32 BlockDevice::CalculateCRC(volatile bool *cancel) {
|
||||
}
|
||||
|
||||
void BlockDevice::NotifyReadError() {
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
if (!reportedError_) {
|
||||
System_NotifyUserMessage(err->T("Game disc read error - ISO corrupt"), 6.0f);
|
||||
reportedError_ = true;
|
||||
|
||||
@@ -190,7 +190,7 @@ bool DirectoryFileHandle::Open(const Path &basePath, std::string &fileName, File
|
||||
|
||||
if (w32err == ERROR_DISK_FULL || w32err == ERROR_NOT_ENOUGH_QUOTA) {
|
||||
// This is returned when the disk is full.
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
System_NotifyUserMessage(err->T("Disk full while writing data"));
|
||||
error = SCE_KERNEL_ERROR_ERRNO_NO_PERM;
|
||||
} else if (!success) {
|
||||
@@ -288,7 +288,7 @@ bool DirectoryFileHandle::Open(const Path &basePath, std::string &fileName, File
|
||||
}
|
||||
} else if (errno == ENOSPC) {
|
||||
// This is returned when the disk is full.
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
System_NotifyUserMessage(err->T("Disk full while writing data"));
|
||||
error = SCE_KERNEL_ERROR_ERRNO_NO_PERM;
|
||||
} else {
|
||||
@@ -363,7 +363,7 @@ size_t DirectoryFileHandle::Write(const u8* pointer, s64 size)
|
||||
|
||||
if (diskFull) {
|
||||
ERROR_LOG(FILESYS, "Disk full");
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
System_NotifyUserMessage(err->T("Disk full while writing data"));
|
||||
// We only return an error when the disk is actually full.
|
||||
// When writing this would cause the disk to be full, so it wasn't written, we return 0.
|
||||
|
||||
@@ -1312,7 +1312,7 @@ void timeoutFriendsRecursive(SceNetAdhocctlPeerInfo * node, int32_t* count) {
|
||||
|
||||
void sendChat(std::string chatString) {
|
||||
SceNetAdhocctlChatPacketC2S chat;
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
chat.base.opcode = OPCODE_CHAT;
|
||||
//TODO check network inited, check send success or not, chatlog.pushback error on failed send, pushback error on not connected
|
||||
if (friendFinderRunning) {
|
||||
@@ -1359,7 +1359,7 @@ int GetChatMessageCount() {
|
||||
// TODO: We should probably change this thread into PSPThread (or merging it into the existing AdhocThread PSPThread) as there are too many global vars being used here which also being used within some HLEs
|
||||
int friendFinder(){
|
||||
SetCurrentThreadName("FriendFinder");
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
// Receive Buffer
|
||||
int rxpos = 0;
|
||||
uint8_t rx[1024];
|
||||
@@ -2162,7 +2162,7 @@ int getPTPSocketCount() {
|
||||
}
|
||||
|
||||
int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
int iResult = 0;
|
||||
metasocket = (int)INVALID_SOCKET;
|
||||
metasocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
|
||||
@@ -1857,7 +1857,7 @@ int create_listen_socket(uint16_t port)
|
||||
// Notify User
|
||||
else {
|
||||
ERROR_LOG(SCENET, "AdhocServer: Bind returned %i (Socket error %d)", bindresult, errno);
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_NotifyUserMessage(std::string(n->T("AdhocServer Failed to Bind Port")) + " " + std::to_string(port), 3.0, 0x0000ff);
|
||||
}
|
||||
|
||||
|
||||
@@ -570,7 +570,7 @@ void __DisplayFlip(int cyclesLate) {
|
||||
PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL &&
|
||||
DisplayIsRunningSlow()) {
|
||||
#ifndef _DEBUG
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
if (g_Config.bSoftwareRendering) {
|
||||
System_NotifyUserMessage(err->T("Running slow: Try turning off Software Rendering"), 6.0f, 0xFF30D0D0);
|
||||
} else {
|
||||
|
||||
@@ -270,7 +270,7 @@ static void __GameModeNotify(u64 userdata, int cyclesLate) {
|
||||
// Shows a warning if the sender/source port is different than what it supposed to be.
|
||||
if (senderport != ADHOC_GAMEMODE_PORT && senderport != gameModePeerPorts[sendermac]) {
|
||||
char name[9] = {};
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
peerlock.lock();
|
||||
SceNetAdhocctlPeerInfo* peer = findFriend(&sendermac);
|
||||
if (peer != NULL)
|
||||
@@ -1505,7 +1505,7 @@ static int sceNetAdhocPdpCreate(const char *mac, int port, int bufferSize, u32 f
|
||||
// Port not available (exclusively in use?)
|
||||
if (iResult == SOCKET_ERROR) {
|
||||
ERROR_LOG(SCENET, "Socket error (%i) when binding port %u", errno, ntohs(addr.sin_port));
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_NotifyUserMessage(std::string(n->T("Failed to Bind Port")) + " " + std::to_string(port + portOffset) + "\n" + std::string(n->T("Please change your Port Offset")), 3.0, 0x0000ff);
|
||||
|
||||
return hleLogDebug(SCENET, ERROR_NET_ADHOC_PORT_NOT_AVAIL, "port not available");
|
||||
@@ -3522,7 +3522,7 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac,
|
||||
}
|
||||
else {
|
||||
ERROR_LOG(SCENET, "Socket error (%i) when binding port %u", errno, ntohs(addr.sin_port));
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_NotifyUserMessage(std::string(n->T("Failed to Bind Port")) + " " + std::to_string(sport + portOffset) + "\n" + std::string(n->T("Please change your Port Offset")), 3.0, 0x0000ff);
|
||||
}
|
||||
|
||||
@@ -4115,7 +4115,7 @@ static int sceNetAdhocPtpListen(const char *srcmac, int sport, int bufsize, int
|
||||
}
|
||||
}
|
||||
else {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_NotifyUserMessage(std::string(n->T("Failed to Bind Port")) + " " + std::to_string(sport + portOffset) + "\n" + std::string(n->T("Please change your Port Offset")), 3.0, 0x0000ff);
|
||||
}
|
||||
|
||||
@@ -7627,7 +7627,7 @@ int matchingEventThread(int matchingId)
|
||||
int matchingInputThread(int matchingId) // TODO: The MatchingInput thread is using sceNetAdhocPdpRecv & sceNetAdhocPdpSend functions so it might be better to run this on PSP thread instead of real thread
|
||||
{
|
||||
SetCurrentThreadName("MatchingInput");
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
// Multithreading Lock
|
||||
peerlock.lock();
|
||||
// Cast Context
|
||||
|
||||
+8
-8
@@ -479,7 +479,7 @@ namespace SaveState
|
||||
return StringFromFormat("%s (%c)", title.c_str(), slotChar);
|
||||
}
|
||||
if (detectSlot(UNDO_STATE_EXTENSION)) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
// Allow the number to be positioned where it makes sense.
|
||||
std::string undo = sy->T("undo %c");
|
||||
return title + " (" + StringFromFormat(undo.c_str(), slotChar) + ")";
|
||||
@@ -500,7 +500,7 @@ namespace SaveState
|
||||
}
|
||||
|
||||
// The file can't be loaded - let's note that.
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
return filename.GetFilename() + " " + sy->T("(broken)");
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ namespace SaveState
|
||||
Load(fn, slot, callback, cbUserData);
|
||||
}
|
||||
} else {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
if (callback)
|
||||
callback(Status::FAILURE, sy->T("Failed to load state. Error in the file system."), cbUserData);
|
||||
}
|
||||
@@ -591,7 +591,7 @@ namespace SaveState
|
||||
bool UndoLoad(const Path &gameFilename, Callback callback, void *cbUserData)
|
||||
{
|
||||
if (g_Config.sStateLoadUndoGame != GenerateFullDiscId(gameFilename)) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
if (callback)
|
||||
callback(Status::FAILURE, sy->T("Error: load undo state is from a different game"), cbUserData);
|
||||
return false;
|
||||
@@ -602,7 +602,7 @@ namespace SaveState
|
||||
Load(fn, LOAD_UNDO_SLOT, callback, cbUserData);
|
||||
return true;
|
||||
} else {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
if (callback)
|
||||
callback(Status::FAILURE, sy->T("Failed to load state for load undo. Error in the file system."), cbUserData);
|
||||
return false;
|
||||
@@ -641,7 +641,7 @@ namespace SaveState
|
||||
SaveScreenshot(shot, Callback(), 0);
|
||||
Save(fn.WithExtraExtension(".tmp"), slot, renameCallback, cbUserData);
|
||||
} else {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
if (callback)
|
||||
callback(Status::FAILURE, sy->T("Failed to save state. Error in the file system."), cbUserData);
|
||||
}
|
||||
@@ -857,7 +857,7 @@ namespace SaveState
|
||||
}
|
||||
|
||||
static Status TriggerLoadWarnings(std::string &callbackMessage) {
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
|
||||
if (g_Config.bHideStateWarnings)
|
||||
return Status::SUCCESS;
|
||||
@@ -913,7 +913,7 @@ namespace SaveState
|
||||
std::string callbackMessage;
|
||||
std::string title;
|
||||
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
const char *i18nLoadFailure = sc->T("Load savestate failed", "");
|
||||
const char *i18nSaveFailure = sc->T("Save State Failed", "");
|
||||
if (strlen(i18nLoadFailure) == 0)
|
||||
|
||||
@@ -301,7 +301,7 @@ bool GameManager::InstallGame(Path url, Path fileName, bool deleteAfter) {
|
||||
return InstallRawISO(fileName, shortFilename, deleteAfter);
|
||||
}
|
||||
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
installInProgress_ = true;
|
||||
|
||||
Path pspGame = GetSysDirectory(DIRECTORY_GAME);
|
||||
@@ -352,7 +352,7 @@ bool GameManager::InstallGame(Path url, Path fileName, bool deleteAfter) {
|
||||
}
|
||||
|
||||
bool GameManager::DetectTexturePackDest(struct zip *z, int iniIndex, Path &dest) {
|
||||
auto iz = GetI18NCategory("InstallZip");
|
||||
auto iz = GetI18NCategory(I18NCat::INSTALLZIP);
|
||||
|
||||
struct zip_stat zstat;
|
||||
zip_stat_index(z, iniIndex, 0, &zstat);
|
||||
@@ -532,7 +532,7 @@ bool GameManager::InstallMemstickGame(struct zip *z, const Path &zipfile, const
|
||||
size_t allBytes = 0;
|
||||
size_t bytesCopied = 0;
|
||||
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
|
||||
auto fileAllowed = [&](const char *fn) {
|
||||
if (!allowRoot && strchr(fn, '/') == 0)
|
||||
@@ -630,7 +630,7 @@ bool GameManager::InstallMemstickZip(struct zip *z, const Path &zipfile, const P
|
||||
size_t allBytes = 0;
|
||||
size_t bytesCopied = 0;
|
||||
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
|
||||
// We don't need the zip anymore, as we're going to copy it as-is.
|
||||
zip_close(z);
|
||||
|
||||
@@ -189,7 +189,7 @@ bool PortManager::Initialize(const unsigned int timeout) {
|
||||
|
||||
ERROR_LOG(SCENET, "PortManager - upnpDiscover failed (error: %i) or No UPnP device detected", error);
|
||||
if (g_Config.bEnableUPnP) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_NotifyUserMessage(n->T("Unable to find UPnP device"), 2.0f, 0x0000ff);
|
||||
}
|
||||
m_InitState = UPNP_INITSTATE_NONE;
|
||||
@@ -206,7 +206,7 @@ bool PortManager::Add(const char* protocol, unsigned short port, unsigned short
|
||||
char port_str[16];
|
||||
char intport_str[16];
|
||||
int r;
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
|
||||
if (intport == 0)
|
||||
intport = port;
|
||||
@@ -263,7 +263,7 @@ bool PortManager::Add(const char* protocol, unsigned short port, unsigned short
|
||||
bool PortManager::Remove(const char* protocol, unsigned short port) {
|
||||
#ifdef WITH_UPNP
|
||||
char port_str[16];
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
|
||||
INFO_LOG(SCENET, "PortManager::Remove(%s, %d)", protocol, port);
|
||||
if (urls == NULL || urls->controlURL == NULL || urls->controlURL[0] == '\0')
|
||||
|
||||
@@ -2651,7 +2651,7 @@ void FramebufferManagerCommon::UpdateFramebufUsage(VirtualFramebuffer *vfb) {
|
||||
}
|
||||
|
||||
void FramebufferManagerCommon::ShowScreenResolution() {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
|
||||
std::ostringstream messageStream;
|
||||
messageStream << gr->T("Internal Resolution") << ": ";
|
||||
|
||||
@@ -284,7 +284,7 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, bool isOverride) {
|
||||
}
|
||||
|
||||
if (filenameWarning) {
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
System_NotifyUserMessage(err->T("textures.ini filenames may not be cross-platform (banned characters)"), 6.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ GPU_DX9::GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
||||
if (g_Config.bHardwareTessellation) {
|
||||
// Disable hardware tessellation bacause DX9 is still unsupported.
|
||||
ERROR_LOG(G3D, "Hardware Tessellation is unsupported, falling back to software tessellation");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("Turn off Hardware Tessellation - unsupported"), 2.5f, 0xFF3030FF);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ VSShader *ShaderManagerDX9::ApplyShader(bool useHWTransform, bool useHWTessellat
|
||||
vs = new VSShader(device_, VSID, codeBuffer_, useHWTransform);
|
||||
}
|
||||
if (!vs || vs->Failed()) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
if (!vs) {
|
||||
// TODO: Report this?
|
||||
ERROR_LOG(G3D, "Shader generation failed, falling back to software transform");
|
||||
|
||||
@@ -121,7 +121,7 @@ GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
||||
// Disable hardware tessellation if device is unsupported.
|
||||
if (!drawEngine_.SupportsHWTessellation()) {
|
||||
ERROR_LOG(G3D, "Hardware Tessellation is unsupported, falling back to software tessellation");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("Turn off Hardware Tessellation - unsupported"), 2.5f, 0xFF3030FF);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -800,7 +800,7 @@ Shader *ShaderManagerGLES::ApplyVertexShader(bool useHWTransform, bool useHWTess
|
||||
// Vertex shader not in cache. Let's compile it.
|
||||
vs = CompileVertexShader(*VSID);
|
||||
if (!vs || vs->Failed()) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
ERROR_LOG(G3D, "Vertex shader generation failed, falling back to software transform");
|
||||
if (!g_Config.bHideSlowWarnings) {
|
||||
System_NotifyUserMessage(gr->T("hardware transform error - falling back to software"), 2.5f, 0xFF3030FF);
|
||||
|
||||
@@ -148,7 +148,7 @@ void TextureCacheGLES::StartFrame() {
|
||||
lowMemoryMode_ = true;
|
||||
decimationCounter_ = 0;
|
||||
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
if (standardScaleFactor_ > 1) {
|
||||
System_NotifyUserMessage(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f);
|
||||
} else {
|
||||
|
||||
@@ -511,7 +511,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
||||
// TODO: We should stall the GPU here and wipe things out of memory.
|
||||
// As is, it will almost definitely fail the second time, but next frame it may recover.
|
||||
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
if (plan.scaleFactor > 1) {
|
||||
System_NotifyUserMessage(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f);
|
||||
} else {
|
||||
|
||||
+4
-4
@@ -18,7 +18,7 @@
|
||||
|
||||
void ChatMenu::CreateContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
LinearLayout *outer = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT,400));
|
||||
scroll_ = outer->Add(new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0)));
|
||||
LinearLayout *bottom = outer->Add(new LinearLayout(ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
|
||||
@@ -47,7 +47,7 @@ void ChatMenu::CreateContents(UI::ViewGroup *parent) {
|
||||
void ChatMenu::CreateSubviews(const Bounds &screenBounds) {
|
||||
using namespace UI;
|
||||
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
float width = 550.0f;
|
||||
|
||||
switch (g_Config.iChatScreenPosition) {
|
||||
@@ -96,7 +96,7 @@ UI::EventReturn ChatMenu::OnSubmit(UI::EventParams &e) {
|
||||
chatEdit_->SetFocus();
|
||||
sendChat(chat);
|
||||
#elif PPSSPP_PLATFORM(ANDROID)
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_InputBoxGetString(n->T("Chat"), "", [](const std::string &value, int) {
|
||||
sendChat(value);
|
||||
});
|
||||
@@ -165,7 +165,7 @@ void ChatMenu::UpdateChat() {
|
||||
}
|
||||
|
||||
void ChatMenu::Update() {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
|
||||
AnchorLayout::Update();
|
||||
if (scroll_ && toBottom_) {
|
||||
|
||||
+18
-24
@@ -94,7 +94,7 @@ SingleControlMapper::SingleControlMapper(int pspKey, std::string keyName, Screen
|
||||
|
||||
void SingleControlMapper::Refresh() {
|
||||
Clear();
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
auto mc = GetI18NCategory(I18NCat::MAPPABLECONTROLS);
|
||||
|
||||
std::map<std::string, ImageID> keyImages;
|
||||
keyImages["Circle"] = ImageID("I_CIRCLE");
|
||||
@@ -195,29 +195,25 @@ void SingleControlMapper::MappedCallback(MultiInputMapping kdf) {
|
||||
UI::EventReturn SingleControlMapper::OnReplace(UI::EventParams ¶ms) {
|
||||
actionIndex_ = atoi(params.v->Tag().c_str());
|
||||
action_ = REPLACEONE;
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn SingleControlMapper::OnReplaceAll(UI::EventParams ¶ms) {
|
||||
action_ = REPLACEALL;
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn SingleControlMapper::OnAdd(UI::EventParams ¶ms) {
|
||||
action_ = ADD;
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
UI::EventReturn SingleControlMapper::OnAddMouse(UI::EventParams ¶ms) {
|
||||
action_ = ADD;
|
||||
g_Config.bMapMouse = true;
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
@@ -236,7 +232,7 @@ void ControlMappingScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
mappers_.clear();
|
||||
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory(I18NCat::KEYMAPPING);
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
@@ -300,7 +296,7 @@ UI::EventReturn ControlMappingScreen::OnAutoConfigure(UI::EventParams ¶ms) {
|
||||
for (auto s = seenPads.begin(), end = seenPads.end(); s != end; ++s) {
|
||||
items.push_back(*s);
|
||||
}
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory(I18NCat::KEYMAPPING);
|
||||
UI::ListPopupScreen *autoConfList = new UI::ListPopupScreen(km->T("Autoconfigure for device"), items, -1);
|
||||
if (params.v)
|
||||
autoConfList->SetPopupOrigin(params.v);
|
||||
@@ -324,8 +320,8 @@ void ControlMappingScreen::dialogFinished(const Screen *dialog, DialogResult res
|
||||
void KeyMappingNewKeyDialog::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
auto km = GetI18NCategory(I18NCat::KEYMAPPING);
|
||||
auto mc = GetI18NCategory(I18NCat::MAPPABLECONTROLS);
|
||||
|
||||
std::string pspButtonName = KeyMap::GetPspButtonName(this->pspBtn_);
|
||||
|
||||
@@ -373,7 +369,7 @@ void KeyMappingNewKeyDialog::SetDelay(float t) {
|
||||
void KeyMappingNewMouseKeyDialog::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory(I18NCat::KEYMAPPING);
|
||||
|
||||
parent->Add(new TextView(std::string(km->T("You can press ESC to cancel.")), new LinearLayoutParams(Margins(10, 0))));
|
||||
SetVRAppMode(VRAppMode::VR_CONTROLLER_MAPPING_MODE);
|
||||
@@ -521,14 +517,14 @@ void AnalogSetupScreen::axis(const AxisInput &axis) {
|
||||
void AnalogSetupScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
LinearLayout *leftColumn = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(300.0f, FILL_PARENT)));
|
||||
LinearLayout *rightColumn = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
|
||||
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
ScrollView *scroll = leftColumn->Add(new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0)));
|
||||
|
||||
LinearLayout *scrollContents = scroll->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(300.0f, WRAP_CONTENT)));
|
||||
@@ -617,8 +613,8 @@ void TouchTestScreen::touch(const TouchInput &touch) {
|
||||
void TouchTestScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
LinearLayout *theTwo = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
|
||||
|
||||
@@ -630,7 +626,7 @@ void TouchTestScreen::CreateViews() {
|
||||
|
||||
#if !PPSSPP_PLATFORM(UWP)
|
||||
static const char *renderingBackend[] = { "OpenGL", "Direct3D 9", "Direct3D 11", "Vulkan" };
|
||||
PopupMultiChoice *renderingBackendChoice = root_->Add(new PopupMultiChoice(&g_Config.iGPUBackend, gr->T("Backend"), renderingBackend, (int)GPUBackend::OPENGL, ARRAY_SIZE(renderingBackend), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *renderingBackendChoice = root_->Add(new PopupMultiChoice(&g_Config.iGPUBackend, gr->T("Backend"), renderingBackend, (int)GPUBackend::OPENGL, ARRAY_SIZE(renderingBackend), I18NCat::GRAPHICS, screenManager()));
|
||||
renderingBackendChoice->OnChoice.Handle(this, &TouchTestScreen::OnRenderingBackend);
|
||||
|
||||
if (!g_Config.IsBackendEnabled(GPUBackend::OPENGL))
|
||||
@@ -749,7 +745,7 @@ void RecreateActivity() {
|
||||
System_Notify(SystemNotification::FORCE_RECREATE_ACTIVITY);
|
||||
INFO_LOG(SYSTEM, "Got back from recreate");
|
||||
} else {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_Toast(gr->T("Must Restart", "You must restart PPSSPP for this change to take effect"));
|
||||
}
|
||||
}
|
||||
@@ -1082,7 +1078,7 @@ static std::vector<int> bindAllOrder{
|
||||
void VisualMappingScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory(I18NCat::KEYMAPPING);
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
@@ -1210,14 +1206,12 @@ void VisualMappingScreen::dialogFinished(const Screen *dialog, DialogResult resu
|
||||
}
|
||||
|
||||
void VisualMappingScreen::MapNext(bool successive) {
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
|
||||
if (nextKey_ == VIRTKEY_AXIS_Y_MIN || nextKey_ == VIRTKEY_AXIS_X_MIN || nextKey_ == VIRTKEY_AXIS_X_MAX) {
|
||||
psp_->SelectButton(VIRTKEY_AXIS_Y_MAX);
|
||||
} else {
|
||||
psp_->SelectButton(nextKey_);
|
||||
}
|
||||
auto dialog = new KeyMappingNewKeyDialog(nextKey_, true, std::bind(&VisualMappingScreen::HandleKeyMapping, this, std::placeholders::_1), km);
|
||||
auto dialog = new KeyMappingNewKeyDialog(nextKey_, true, std::bind(&VisualMappingScreen::HandleKeyMapping, this, std::placeholders::_1), I18NCat::KEYMAPPING);
|
||||
|
||||
Bounds bounds = screenManager()->getUIContext()->GetLayoutBounds();
|
||||
dialog->SetPopupOffset(psp_->GetPopupOffset() * bounds.h);
|
||||
|
||||
@@ -57,8 +57,8 @@ private:
|
||||
|
||||
class KeyMappingNewKeyDialog : public PopupScreen {
|
||||
public:
|
||||
explicit KeyMappingNewKeyDialog(int btn, bool replace, std::function<void(KeyMap::MultiInputMapping)> callback, std::shared_ptr<I18NCategory> i18n)
|
||||
: PopupScreen(i18n->T("Map Key"), "Cancel", ""), pspBtn_(btn), callback_(callback) {}
|
||||
explicit KeyMappingNewKeyDialog(int btn, bool replace, std::function<void(KeyMap::MultiInputMapping)> callback, I18NCat i18n)
|
||||
: PopupScreen(T(i18n, "Map Key"), "Cancel", ""), pspBtn_(btn), callback_(callback) {}
|
||||
|
||||
const char *tag() const override { return "KeyMappingNewKey"; }
|
||||
|
||||
@@ -88,8 +88,8 @@ private:
|
||||
|
||||
class KeyMappingNewMouseKeyDialog : public PopupScreen {
|
||||
public:
|
||||
KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyMap::MultiInputMapping)> callback, std::shared_ptr<I18NCategory> i18n)
|
||||
: PopupScreen(i18n->T("Map Mouse"), "", ""), pspBtn_(btn), callback_(callback), mapped_(false) {}
|
||||
KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyMap::MultiInputMapping)> callback, I18NCat i18n)
|
||||
: PopupScreen(T(i18n, "Map Mouse"), "", ""), pspBtn_(btn), callback_(callback), mapped_(false) {}
|
||||
|
||||
const char *tag() const override { return "KeyMappingNewMouseKey"; }
|
||||
|
||||
|
||||
@@ -119,14 +119,14 @@ private:
|
||||
void CustomButtonMappingScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
using namespace CustomKeyData;
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto mc = GetI18NCategory(I18NCat::MAPPABLECONTROLS);
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
root_->Add(new ItemHeader(co->T("Custom Key Setting")));
|
||||
LinearLayout *root__ = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(1.0));
|
||||
root_->Add(root__);
|
||||
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(120, FILL_PARENT));
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
ConfigCustomButton* cfg = nullptr;
|
||||
bool* show = nullptr;
|
||||
|
||||
@@ -80,9 +80,9 @@ void CwCheatScreen::LoadCheatInfo() {
|
||||
|
||||
void CwCheatScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
auto cw = GetI18NCategory("CwCheats");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto cw = GetI18NCategory(I18NCat::CWCHEATS);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
|
||||
+21
-21
@@ -87,8 +87,8 @@ static const char *logLevelList[] = {
|
||||
|
||||
void DevMenuScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
|
||||
LinearLayout *items = new LinearLayout(ORIENT_VERTICAL);
|
||||
@@ -219,7 +219,7 @@ void LogScreen::update() {
|
||||
|
||||
void LogScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
LinearLayout *outer = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
root_ = outer;
|
||||
@@ -253,8 +253,8 @@ UI::EventReturn LogScreen::OnSubmit(UI::EventParams &e) {
|
||||
void LogConfigScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
root_ = new ScrollView(ORIENT_VERTICAL);
|
||||
|
||||
@@ -286,7 +286,7 @@ void LogConfigScreen::CreateViews() {
|
||||
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(cellSize - 50, WRAP_CONTENT));
|
||||
row->SetSpacing(0);
|
||||
row->Add(new CheckBox(&chan->enabled, "", "", new LinearLayoutParams(50, WRAP_CONTENT)));
|
||||
row->Add(new PopupMultiChoice((int *)&chan->level, chan->m_shortName, logLevelList, 1, 6, 0, screenManager(), new LinearLayoutParams(1.0)));
|
||||
row->Add(new PopupMultiChoice((int *)&chan->level, chan->m_shortName, logLevelList, 1, 6, I18NCat::NONE, screenManager(), new LinearLayoutParams(1.0)));
|
||||
grid->Add(row);
|
||||
}
|
||||
}
|
||||
@@ -324,7 +324,7 @@ UI::EventReturn LogConfigScreen::OnLogLevelChange(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn LogConfigScreen::OnLogLevel(UI::EventParams &e) {
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
auto logLevelScreen = new LogLevelScreen(dev->T("Log Level"));
|
||||
logLevelScreen->OnChoice.Handle(this, &LogConfigScreen::OnLogLevelChange);
|
||||
@@ -394,8 +394,8 @@ static const JitDisableFlag jitDisableFlags[] = {
|
||||
void JitDebugScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
root_ = new ScrollView(ORIENT_VERTICAL);
|
||||
|
||||
@@ -459,9 +459,9 @@ void SystemInfoScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
// NOTE: Do not translate this section. It will change a lot and will be impossible to keep up.
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto si = GetI18NCategory("SysInfo");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto si = GetI18NCategory(I18NCat::SYSINFO);
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f));
|
||||
@@ -818,7 +818,7 @@ void SystemInfoScreen::CreateViews() {
|
||||
void AddressPromptScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
addrView_ = new TextView(dev->T("Enter address"), ALIGN_HCENTER, false);
|
||||
parent->Add(addrView_);
|
||||
@@ -872,7 +872,7 @@ void AddressPromptScreen::BackspaceDigit() {
|
||||
}
|
||||
|
||||
void AddressPromptScreen::UpdatePreviewDigits() {
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
if (addr_ != 0) {
|
||||
char temp[32];
|
||||
@@ -905,8 +905,8 @@ bool AddressPromptScreen::key(const KeyInput &key) {
|
||||
|
||||
// Three panes: Block chooser, MIPS view, ARM/x86 view
|
||||
void JitCompareScreen::CreateViews() {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
using namespace UI;
|
||||
|
||||
@@ -951,7 +951,7 @@ void JitCompareScreen::UpdateDisasm() {
|
||||
|
||||
using namespace UI;
|
||||
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
JitBlockCacheDebugInterface *blockCacheDebug = MIPSComp::jit->GetBlockCacheDebugInterface();
|
||||
|
||||
@@ -1044,7 +1044,7 @@ UI::EventReturn JitCompareScreen::OnShowStats(UI::EventParams &e) {
|
||||
|
||||
|
||||
UI::EventReturn JitCompareScreen::OnSelectBlock(UI::EventParams &e) {
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
auto addressPrompt = new AddressPromptScreen(dev->T("Block address"));
|
||||
addressPrompt->OnChoice.Handle(this, &JitCompareScreen::OnBlockAddress);
|
||||
@@ -1187,7 +1187,7 @@ struct { DebugShaderType type; const char *name; } shaderTypes[] = {
|
||||
void ShaderListScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
LinearLayout *layout = new LinearLayout(ORIENT_VERTICAL);
|
||||
root_ = layout;
|
||||
@@ -1216,7 +1216,7 @@ UI::EventReturn ShaderListScreen::OnShaderClick(UI::EventParams &e) {
|
||||
void ShaderViewScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
LinearLayout *layout = new LinearLayout(ORIENT_VERTICAL);
|
||||
root_ = layout;
|
||||
@@ -1255,7 +1255,7 @@ void FrameDumpTestScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
TabHolder *tabHolder;
|
||||
tabHolder = new TabHolder(ORIENT_VERTICAL, 200, new AnchorLayoutParams(10, 0, 10, 0, false));
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
|
||||
class DevMenuScreen : public PopupScreen {
|
||||
public:
|
||||
DevMenuScreen(const Path &gamePath, std::shared_ptr<I18NCategory> i18n) : PopupScreen(i18n->T("Dev Tools")), gamePath_(gamePath) {}
|
||||
DevMenuScreen(const Path &gamePath, I18NCat cat) : PopupScreen(T(cat, "Dev Tools")), gamePath_(gamePath) {}
|
||||
|
||||
const char *tag() const override { return "DevMenu"; }
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ void Discord::SetPresenceGame(const char *gameTitle) {
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DISCORD
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
|
||||
DiscordRichPresence discordPresence{};
|
||||
discordPresence.state = gameTitle;
|
||||
@@ -127,7 +127,7 @@ void Discord::SetPresenceMenu() {
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DISCORD
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
|
||||
DiscordRichPresence discordPresence{};
|
||||
discordPresence.state = sc->T("In menu");
|
||||
|
||||
+11
-11
@@ -166,8 +166,8 @@ UI::EventReturn DisplayLayoutScreen::OnPostProcShaderChange(UI::EventParams &e)
|
||||
}
|
||||
|
||||
static std::string PostShaderTranslateName(const char *value) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto ps = GetI18NCategory(I18NCat::POSTSHADERS);
|
||||
if (!strcmp(value, "Off")) {
|
||||
// Off is a legacy fake item (gonna migrate off it later).
|
||||
return gr->T("Add postprocessing shader");
|
||||
@@ -194,10 +194,10 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto ps = GetI18NCategory(I18NCat::POSTSHADERS);
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
@@ -273,7 +273,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
bottomControls->Add(mode_);
|
||||
|
||||
static const char *displayRotation[] = { "Landscape", "Portrait", "Landscape Reversed", "Portrait Reversed" };
|
||||
auto rotation = new PopupMultiChoice(&g_Config.iInternalScreenRotation, gr->T("Rotation"), displayRotation, 1, ARRAY_SIZE(displayRotation), co->GetName(), screenManager());
|
||||
auto rotation = new PopupMultiChoice(&g_Config.iInternalScreenRotation, gr->T("Rotation"), displayRotation, 1, ARRAY_SIZE(displayRotation), I18NCat::CONTROLS, screenManager());
|
||||
rotation->SetEnabledFunc([] {
|
||||
return !g_Config.bSkipBufferEffects || g_Config.bSoftwareRendering;
|
||||
});
|
||||
@@ -302,7 +302,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
|
||||
if (!IsVREnabled()) {
|
||||
static const char *bufFilters[] = { "Linear", "Nearest", };
|
||||
leftColumn->Add(new PopupMultiChoice(&g_Config.iDisplayFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager()));
|
||||
leftColumn->Add(new PopupMultiChoice(&g_Config.iDisplayFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), I18NCat::GRAPHICS, screenManager()));
|
||||
}
|
||||
|
||||
Draw::DrawContext *draw = screenManager()->getDrawContext();
|
||||
@@ -344,7 +344,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
postProcChoice_ = shaderRow->Add(new Choice(ImageID("I_PLUS")));
|
||||
}
|
||||
postProcChoice_->OnClick.Add([=](EventParams &e) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto procScreen = new PostProcScreen(gr->T("Postprocessing shaders"), i, false);
|
||||
procScreen->SetHasDropShadow(false);
|
||||
procScreen->OnChoice.Handle(this, &DisplayLayoutScreen::OnPostProcShaderChange);
|
||||
@@ -388,7 +388,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
|
||||
auto moreButton = shaderRow->Add(new Choice(ImageID("I_THREE_DOTS"), new LinearLayoutParams(0.0f)));
|
||||
moreButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
|
||||
PopupContextMenuScreen *contextMenu = new UI::PopupContextMenuScreen(postShaderContextMenu, ARRAY_SIZE(postShaderContextMenu), di.get(), moreButton);
|
||||
PopupContextMenuScreen *contextMenu = new UI::PopupContextMenuScreen(postShaderContextMenu, ARRAY_SIZE(postShaderContextMenu), I18NCat::DIALOG, moreButton);
|
||||
screenManager()->push(contextMenu);
|
||||
const ShaderInfo *info = GetPostShaderInfo(g_Config.vPostShaderNames[i]);
|
||||
bool usesLastFrame = info ? info->usePreviousFrame : false;
|
||||
@@ -464,7 +464,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
}
|
||||
|
||||
void PostProcScreen::CreateViews() {
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
auto ps = GetI18NCategory(I18NCat::POSTSHADERS);
|
||||
ReloadAllPostShaderInfo(screenManager()->getDrawContext());
|
||||
shaders_ = GetAllPostShaderInfo();
|
||||
std::vector<std::string> items;
|
||||
|
||||
+14
-15
@@ -110,7 +110,7 @@ extern bool g_TakeScreenshot;
|
||||
|
||||
static void __EmuScreenVblank()
|
||||
{
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
|
||||
if (frameStep_ && lastNumFlips != gpuStats.numFlips)
|
||||
{
|
||||
@@ -259,7 +259,7 @@ void EmuScreen::bootGame(const Path &filename) {
|
||||
if (!bootAllowStorage(filename))
|
||||
return;
|
||||
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
|
||||
invalid_ = true;
|
||||
|
||||
@@ -332,17 +332,17 @@ void EmuScreen::bootGame(const Path &filename) {
|
||||
}
|
||||
|
||||
if (PSP_CoreParameter().compat.flags().RequireBufferedRendering && g_Config.bSkipBufferEffects) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("BufferedRenderingRequired", "Warning: This game requires Rendering Mode to be set to Buffered."), 15.0f);
|
||||
}
|
||||
|
||||
if (PSP_CoreParameter().compat.flags().RequireBlockTransfer && g_Config.bSkipGPUReadbacks) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("BlockTransferRequired", "Warning: This game requires Simulate Block Transfer Mode to be set to On."), 15.0f);
|
||||
}
|
||||
|
||||
if (PSP_CoreParameter().compat.flags().RequireDefaultCPUClock && g_Config.iLockedCPUSpeed != 0) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("DefaultCPUClockRequired", "Warning: This game requires the CPU clock to be set to default."), 15.0f);
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ void EmuScreen::bootComplete() {
|
||||
NOTICE_LOG(BOOT, "Loading %s...", PSP_CoreParameter().fileToStart.c_str());
|
||||
autoLoad();
|
||||
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
|
||||
#ifndef MOBILE_DEVICE
|
||||
if (g_Config.bFirstRun) {
|
||||
@@ -384,7 +384,7 @@ void EmuScreen::bootComplete() {
|
||||
#endif
|
||||
|
||||
if (Core_GetPowerSaving()) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
#ifdef __ANDROID__
|
||||
osm.Show(sy->T("WARNING: Android battery save mode is on"), 2.0f, 0xFFFFFF, -1, true, "core_powerSaving");
|
||||
#else
|
||||
@@ -560,7 +560,7 @@ void EmuScreen::touch(const TouchInput &touch) {
|
||||
}
|
||||
|
||||
void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
|
||||
switch (virtualKeyCode) {
|
||||
case VIRTKEY_FASTFORWARD:
|
||||
@@ -874,9 +874,9 @@ static UI::AnchorLayoutParams *AnchorInCorner(const Bounds &bounds, int corner,
|
||||
void EmuScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||
|
||||
const Bounds &bounds = screenManager()->getUIContext()->GetLayoutBounds();
|
||||
InitPadLayout(bounds.w, bounds.h);
|
||||
@@ -979,8 +979,7 @@ void EmuScreen::CreateViews() {
|
||||
}
|
||||
|
||||
UI::EventReturn EmuScreen::OnDevTools(UI::EventParams ¶ms) {
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
DevMenuScreen *devMenu = new DevMenuScreen(gamePath_, dev);
|
||||
DevMenuScreen *devMenu = new DevMenuScreen(gamePath_, I18NCat::DEVELOPER);
|
||||
if (params.v)
|
||||
devMenu->SetPopupOrigin(params.v);
|
||||
screenManager()->push(devMenu);
|
||||
@@ -1067,7 +1066,7 @@ void EmuScreen::update() {
|
||||
}
|
||||
|
||||
if (errorMessage_.size()) {
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
std::string errLoadingFile = gamePath_.ToVisualString() + "\n";
|
||||
errLoadingFile.append(err->T("Error loading file", "Could not load game"));
|
||||
errLoadingFile.append(" ");
|
||||
@@ -1174,7 +1173,7 @@ static const char *CPUCoreAsString(int core) {
|
||||
static void DrawCrashDump(UIContext *ctx, const Path &gamePath) {
|
||||
const ExceptionInfo &info = Core_GetExceptionInfo();
|
||||
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
FontID ubuntu24("UBUNTU24");
|
||||
|
||||
int x = 20 + System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_LEFT);
|
||||
|
||||
@@ -295,8 +295,8 @@ void GPUDriverTestScreen::CreateViews() {
|
||||
|
||||
// Don't bother with views for now.
|
||||
using namespace UI;
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||
|
||||
AnchorLayout *anchor = new AnchorLayout();
|
||||
root_ = anchor;
|
||||
|
||||
+14
-14
@@ -87,9 +87,9 @@ void GameScreen::CreateViews() {
|
||||
saveDirs = info->GetSaveDataDirectories(); // Get's very heavy, let's not do it in update()
|
||||
}
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
auto pa = GetI18NCategory(I18NCat::PAUSE);
|
||||
|
||||
// Information in the top left.
|
||||
// Back button to the bottom left.
|
||||
@@ -199,7 +199,7 @@ 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_ = rightColumnItems->Add(new ChoiceWithValueDisplay(&CRC32string, ga->T("Calculate CRC"), I18NCat::NONE));
|
||||
btnCalcCRC_->OnClick.Handle(this, &GameScreen::OnDoCRC32);
|
||||
} else {
|
||||
btnCalcCRC_ = nullptr;
|
||||
@@ -240,8 +240,8 @@ void GameScreen::CallbackDeleteConfig(bool yes) {
|
||||
|
||||
UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
|
||||
{
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
screenManager()->push(
|
||||
new PromptScreen(gamePath_, di->T("DeleteConfirmGameConfig", "Do you really want to delete the settings for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
|
||||
std::bind(&GameScreen::CallbackDeleteConfig, this, std::placeholders::_1)));
|
||||
@@ -252,7 +252,7 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
|
||||
void GameScreen::render() {
|
||||
UIScreen::render();
|
||||
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
|
||||
Draw::DrawContext *thin3d = screenManager()->getDrawContext();
|
||||
|
||||
@@ -296,7 +296,7 @@ void GameScreen::render() {
|
||||
}
|
||||
|
||||
if (tvCRC_ && Reporting::HasCRC(gamePath_)) {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::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);
|
||||
@@ -367,8 +367,8 @@ UI::EventReturn GameScreen::OnGameSettings(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnDeleteSaveData(UI::EventParams &e) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(NULL, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE);
|
||||
if (info) {
|
||||
// Check that there's any savedata to delete
|
||||
@@ -393,8 +393,8 @@ void GameScreen::CallbackDeleteSaveData(bool yes) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnDeleteGame(UI::EventParams &e) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(NULL, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE);
|
||||
if (info) {
|
||||
screenManager()->push(
|
||||
@@ -469,7 +469,7 @@ private:
|
||||
};
|
||||
|
||||
void SetBackgroundPopupScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
parent->Add(new UI::TextView(ga->T("One moment please..."), ALIGN_LEFT | ALIGN_VCENTER, false, new UI::LinearLayoutParams(UI::Margins(10, 0, 10, 10))));
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ void SetBackgroundPopupScreen::update() {
|
||||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnSetBackground(UI::EventParams &e) {
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
// This popup is used to prevent any race condition:
|
||||
// g_gameInfoCache may take time to load the data, and a crash could happen if they exit before then.
|
||||
SetBackgroundPopupScreen *pop = new SetBackgroundPopupScreen(ga->T("Setting Background"), gamePath_);
|
||||
|
||||
+106
-106
@@ -135,7 +135,7 @@ static bool UsingHardwareTextureScaling() {
|
||||
}
|
||||
|
||||
static std::string TextureTranslateName(const char *value) {
|
||||
auto ts = GetI18NCategory("TextureShaders");
|
||||
auto ts = GetI18NCategory(I18NCat::TEXTURESHADERS);
|
||||
const TextureShaderInfo *info = GetTextureShaderInfo(value);
|
||||
if (info) {
|
||||
return ts->T(value, info ? info->name.c_str() : value);
|
||||
@@ -182,7 +182,7 @@ bool PathToVisualUsbPath(Path path, std::string &outPath) {
|
||||
}
|
||||
|
||||
static std::string PostShaderTranslateName(const char *value) {
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
auto ps = GetI18NCategory(I18NCat::POSTSHADERS);
|
||||
const ShaderInfo *info = GetPostShaderInfo(value);
|
||||
if (info) {
|
||||
return ps->T(value, info ? info->name.c_str() : value);
|
||||
@@ -211,8 +211,8 @@ void GameSettingsScreen::CreateViews() {
|
||||
// Scrolling action menu to the right.
|
||||
using namespace UI;
|
||||
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
@@ -275,13 +275,13 @@ void GameSettingsScreen::CreateViews() {
|
||||
#if !defined(MOBILE_DEVICE) || PPSSPP_PLATFORM(ANDROID)
|
||||
// Hide search if screen is too small.
|
||||
if (g_display.dp_xres < g_display.dp_yres || g_display.dp_yres >= 500) {
|
||||
auto se = GetI18NCategory("Search");
|
||||
auto se = GetI18NCategory(I18NCat::SEARCH);
|
||||
// Search
|
||||
LinearLayout *searchSettings = AddTab("GameSettingsSearch", ms->T("Search"), true);
|
||||
|
||||
searchSettings->Add(new ItemHeader(se->T("Find settings")));
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_KEYBOARD)) {
|
||||
searchSettings->Add(new ChoiceWithValueDisplay(&searchFilter_, se->T("Filter"), (const char *)nullptr))->OnClick.Handle(this, &GameSettingsScreen::OnChangeSearchFilter);
|
||||
searchSettings->Add(new ChoiceWithValueDisplay(&searchFilter_, se->T("Filter"), I18NCat::NONE))->OnClick.Handle(this, &GameSettingsScreen::OnChangeSearchFilter);
|
||||
} else {
|
||||
searchSettings->Add(new PopupTextInputChoice(&searchFilter_, se->T("Filter"), "", 64, screenManager()))->OnChange.Handle(this, &GameSettingsScreen::OnChangeSearchFilter);
|
||||
}
|
||||
@@ -296,8 +296,8 @@ void GameSettingsScreen::CreateViews() {
|
||||
|
||||
// Graphics
|
||||
void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto vr = GetI18NCategory("VR");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto vr = GetI18NCategory(I18NCat::VR);
|
||||
|
||||
using namespace UI;
|
||||
|
||||
@@ -307,7 +307,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
|
||||
#if !PPSSPP_PLATFORM(UWP)
|
||||
static const char *renderingBackend[] = { "OpenGL", "Direct3D 9", "Direct3D 11", "Vulkan" };
|
||||
PopupMultiChoice *renderingBackendChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iGPUBackend, gr->T("Backend"), renderingBackend, (int)GPUBackend::OPENGL, ARRAY_SIZE(renderingBackend), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *renderingBackendChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iGPUBackend, gr->T("Backend"), renderingBackend, (int)GPUBackend::OPENGL, ARRAY_SIZE(renderingBackend), I18NCat::GRAPHICS, screenManager()));
|
||||
if (g_Config.iGPUBackend != (int)GPUBackend::DIRECT3D9 && !draw->GetDeviceCaps().supportsD3D9) {
|
||||
renderingBackendChoice->HideChoice(1);
|
||||
}
|
||||
@@ -332,13 +332,13 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
if (draw->GetDeviceList().size() > 1) {
|
||||
std::string *deviceNameSetting = GPUDeviceNameSetting();
|
||||
if (deviceNameSetting) {
|
||||
PopupMultiChoiceDynamic *deviceChoice = graphicsSettings->Add(new PopupMultiChoiceDynamic(deviceNameSetting, gr->T("Device"), draw->GetDeviceList(), nullptr, screenManager()));
|
||||
PopupMultiChoiceDynamic *deviceChoice = graphicsSettings->Add(new PopupMultiChoiceDynamic(deviceNameSetting, gr->T("Device"), draw->GetDeviceList(), I18NCat::NONE, screenManager()));
|
||||
deviceChoice->OnChoice.Handle(this, &GameSettingsScreen::OnRenderingDevice);
|
||||
}
|
||||
}
|
||||
|
||||
static const char *internalResolutions[] = { "Auto (1:1)", "1x PSP", "2x PSP", "3x PSP", "4x PSP", "5x PSP", "6x PSP", "7x PSP", "8x PSP", "9x PSP", "10x PSP" };
|
||||
resolutionChoice_ = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iInternalResolution, gr->T("Rendering Resolution"), internalResolutions, 0, ARRAY_SIZE(internalResolutions), gr->GetName(), screenManager()));
|
||||
resolutionChoice_ = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iInternalResolution, gr->T("Rendering Resolution"), internalResolutions, 0, ARRAY_SIZE(internalResolutions), I18NCat::GRAPHICS, screenManager()));
|
||||
resolutionChoice_->OnChoice.Handle(this, &GameSettingsScreen::OnResolutionChange);
|
||||
resolutionChoice_->SetEnabledFunc([] {
|
||||
return !g_Config.bSoftwareRendering && !g_Config.bSkipBufferEffects;
|
||||
@@ -353,7 +353,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
|
||||
if (draw->GetDeviceCaps().multiSampleLevelsMask != 1) {
|
||||
static const char *msaaModes[] = { "Off", "2x", "4x", "8x", "16x" };
|
||||
auto msaaChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iMultiSampleLevel, gr->T("Antialiasing (MSAA)"), msaaModes, 0, ARRAY_SIZE(msaaModes), gr->GetName(), screenManager()));
|
||||
auto msaaChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iMultiSampleLevel, gr->T("Antialiasing (MSAA)"), msaaModes, 0, ARRAY_SIZE(msaaModes), I18NCat::GRAPHICS, screenManager()));
|
||||
msaaChoice->OnChoice.Add([&](UI::EventParams &) -> UI::EventReturn {
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
return UI::EVENT_DONE;
|
||||
@@ -405,9 +405,9 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
|
||||
graphicsSettings->Add(new ItemHeader(gr->T("Frame Rate Control")));
|
||||
static const char *frameSkip[] = {"Off", "1", "2", "3", "4", "5", "6", "7", "8"};
|
||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkip, gr->T("Frame Skipping"), frameSkip, 0, ARRAY_SIZE(frameSkip), gr->GetName(), screenManager()));
|
||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkip, gr->T("Frame Skipping"), frameSkip, 0, ARRAY_SIZE(frameSkip), I18NCat::GRAPHICS, screenManager()));
|
||||
static const char *frameSkipType[] = {"Number of Frames", "Percent of FPS"};
|
||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkipType, gr->T("Frame Skipping Type"), frameSkipType, 0, ARRAY_SIZE(frameSkipType), gr->GetName(), screenManager()));
|
||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkipType, gr->T("Frame Skipping Type"), frameSkipType, 0, ARRAY_SIZE(frameSkipType), I18NCat::GRAPHICS, screenManager()));
|
||||
frameSkipAuto_ = graphicsSettings->Add(new CheckBox(&g_Config.bAutoFrameSkip, gr->T("Auto FrameSkip")));
|
||||
frameSkipAuto_->OnClick.Handle(this, &GameSettingsScreen::OnAutoFrameskip);
|
||||
|
||||
@@ -459,7 +459,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
});
|
||||
|
||||
static const char *quality[] = { "Low", "Medium", "High" };
|
||||
PopupMultiChoice *beziersChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iSplineBezierQuality, gr->T("LowCurves", "Spline/Bezier curves quality"), quality, 0, ARRAY_SIZE(quality), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *beziersChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iSplineBezierQuality, gr->T("LowCurves", "Spline/Bezier curves quality"), quality, 0, ARRAY_SIZE(quality), I18NCat::GRAPHICS, screenManager()));
|
||||
beziersChoice->OnChoice.Add([=](EventParams &e) {
|
||||
if (g_Config.iSplineBezierQuality != 0) {
|
||||
settingInfo_->Show(gr->T("LowCurves Tip", "Only used by some games, controls smoothness of curves"), e.v);
|
||||
@@ -479,7 +479,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
|
||||
if (GetGPUBackend() == GPUBackend::VULKAN || GetGPUBackend() == GPUBackend::OPENGL) {
|
||||
static const char *bufferOptions[] = { "No buffer", "Up to 1", "Up to 2" };
|
||||
PopupMultiChoice *inflightChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iInflightFrames, gr->T("Buffer graphics commands (faster, input lag)"), bufferOptions, 1, ARRAY_SIZE(bufferOptions), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *inflightChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iInflightFrames, gr->T("Buffer graphics commands (faster, input lag)"), bufferOptions, 1, ARRAY_SIZE(bufferOptions), I18NCat::GRAPHICS, screenManager()));
|
||||
inflightChoice->OnChoice.Handle(this, &GameSettingsScreen::OnInflightFramesChoice);
|
||||
}
|
||||
|
||||
@@ -524,11 +524,11 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
#endif
|
||||
|
||||
static const char *texScaleAlgos[] = { "xBRZ", "Hybrid", "Bicubic", "Hybrid + Bicubic", };
|
||||
PopupMultiChoice *texScalingType = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingType, gr->T("Upscale Type"), texScaleAlgos, 0, ARRAY_SIZE(texScaleAlgos), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *texScalingType = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingType, gr->T("Upscale Type"), texScaleAlgos, 0, ARRAY_SIZE(texScaleAlgos), I18NCat::GRAPHICS, screenManager()));
|
||||
texScalingType->SetEnabledFunc([]() {
|
||||
return !g_Config.bSoftwareRendering && !UsingHardwareTextureScaling();
|
||||
});
|
||||
PopupMultiChoice *texScalingChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingLevel, gr->T("Upscale Level"), texScaleLevels, 1, ARRAY_SIZE(texScaleLevels), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *texScalingChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingLevel, gr->T("Upscale Level"), texScaleLevels, 1, ARRAY_SIZE(texScaleLevels), I18NCat::GRAPHICS, screenManager()));
|
||||
// TODO: Better check? When it won't work, it scales down anyway.
|
||||
if (!gl_extensions.OES_texture_npot && GetGPUBackend() == GPUBackend::OPENGL) {
|
||||
texScalingChoice->HideChoice(3); // 3x
|
||||
@@ -563,11 +563,11 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
|
||||
graphicsSettings->Add(new ItemHeader(gr->T("Texture Filtering")));
|
||||
static const char *anisoLevels[] = { "Off", "2x", "4x", "8x", "16x" };
|
||||
PopupMultiChoice *anisoFiltering = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iAnisotropyLevel, gr->T("Anisotropic Filtering"), anisoLevels, 0, ARRAY_SIZE(anisoLevels), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *anisoFiltering = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iAnisotropyLevel, gr->T("Anisotropic Filtering"), anisoLevels, 0, ARRAY_SIZE(anisoLevels), I18NCat::GRAPHICS, screenManager()));
|
||||
anisoFiltering->SetDisabledPtr(&g_Config.bSoftwareRendering);
|
||||
|
||||
static const char *texFilters[] = { "Auto", "Nearest", "Linear", "Auto Max Quality"};
|
||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexFiltering, gr->T("Texture Filter"), texFilters, 1, ARRAY_SIZE(texFilters), gr->GetName(), screenManager()));
|
||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexFiltering, gr->T("Texture Filter"), texFilters, 1, ARRAY_SIZE(texFilters), I18NCat::GRAPHICS, screenManager()));
|
||||
|
||||
#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
|
||||
bool showCardboardSettings = deviceType != DEVICE_TYPE_VR;
|
||||
@@ -589,14 +589,14 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
std::vector<std::string> cameraList = Camera::getDeviceList();
|
||||
if (cameraList.size() >= 1) {
|
||||
graphicsSettings->Add(new ItemHeader(gr->T("Camera")));
|
||||
PopupMultiChoiceDynamic *cameraChoice = graphicsSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sCameraDevice, gr->T("Camera Device"), cameraList, nullptr, screenManager()));
|
||||
PopupMultiChoiceDynamic *cameraChoice = graphicsSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sCameraDevice, gr->T("Camera Device"), cameraList, I18NCat::NONE, screenManager()));
|
||||
cameraChoice->OnChoice.Handle(this, &GameSettingsScreen::OnCameraDeviceChange);
|
||||
}
|
||||
|
||||
graphicsSettings->Add(new ItemHeader(gr->T("Hack Settings", "Hack Settings (these WILL cause glitches)")));
|
||||
|
||||
static const char *bloomHackOptions[] = { "Off", "Safe", "Balanced", "Aggressive" };
|
||||
PopupMultiChoice *bloomHack = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iBloomHack, gr->T("Lower resolution for effects (reduces artifacts)"), bloomHackOptions, 0, ARRAY_SIZE(bloomHackOptions), gr->GetName(), screenManager()));
|
||||
PopupMultiChoice *bloomHack = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iBloomHack, gr->T("Lower resolution for effects (reduces artifacts)"), bloomHackOptions, 0, ARRAY_SIZE(bloomHackOptions), I18NCat::GRAPHICS, screenManager()));
|
||||
bloomHack->SetEnabledFunc([] {
|
||||
return !g_Config.bSoftwareRendering && g_Config.iInternalResolution != 1;
|
||||
});
|
||||
@@ -614,8 +614,8 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
void GameSettingsScreen::CreateAudioSettings(UI::ViewGroup *audioSettings) {
|
||||
using namespace UI;
|
||||
|
||||
auto a = GetI18NCategory("Audio");
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
auto a = GetI18NCategory(I18NCat::AUDIO);
|
||||
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);
|
||||
|
||||
audioSettings->Add(new ItemHeader(ms->T("Audio")));
|
||||
CheckBox *enableSound = audioSettings->Add(new CheckBox(&g_Config.bEnableSound,a->T("Enable Sound")));
|
||||
@@ -636,7 +636,7 @@ void GameSettingsScreen::CreateAudioSettings(UI::ViewGroup *audioSettings) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP)
|
||||
if (IsVistaOrHigher()) {
|
||||
static const char *backend[] = { "Auto", "DSound (compatible)", "WASAPI (fast)" };
|
||||
PopupMultiChoice *audioBackend = audioSettings->Add(new PopupMultiChoice(&g_Config.iAudioBackend, a->T("Audio backend", "Audio backend (restart req.)"), backend, 0, ARRAY_SIZE(backend), a->GetName(), screenManager()));
|
||||
PopupMultiChoice *audioBackend = audioSettings->Add(new PopupMultiChoice(&g_Config.iAudioBackend, a->T("Audio backend", "Audio backend (restart req.)"), backend, 0, ARRAY_SIZE(backend), I18NCat::AUDIO, screenManager()));
|
||||
audioBackend->SetEnabledPtr(&g_Config.bEnableSound);
|
||||
}
|
||||
#endif
|
||||
@@ -669,7 +669,7 @@ void GameSettingsScreen::CreateAudioSettings(UI::ViewGroup *audioSettings) {
|
||||
std::vector<std::string> micList = Microphone::getDeviceList();
|
||||
if (!micList.empty()) {
|
||||
audioSettings->Add(new ItemHeader(a->T("Microphone")));
|
||||
PopupMultiChoiceDynamic *MicChoice = audioSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sMicDevice, a->T("Microphone Device"), micList, nullptr, screenManager()));
|
||||
PopupMultiChoiceDynamic *MicChoice = audioSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sMicDevice, a->T("Microphone Device"), micList, I18NCat::NONE, screenManager()));
|
||||
MicChoice->OnChoice.Handle(this, &GameSettingsScreen::OnMicDeviceChange);
|
||||
}
|
||||
}
|
||||
@@ -677,8 +677,8 @@ void GameSettingsScreen::CreateAudioSettings(UI::ViewGroup *audioSettings) {
|
||||
void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings) {
|
||||
using namespace UI;
|
||||
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);
|
||||
|
||||
int deviceType = System_GetPropertyInt(SYSPROP_DEVICE_TYPE);
|
||||
|
||||
@@ -714,7 +714,7 @@ void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings)
|
||||
gesture->SetEnabledPtr(&g_Config.bShowTouchControls);
|
||||
|
||||
static const char *touchControlStyles[] = { "Classic", "Thin borders", "Glowing borders" };
|
||||
View *style = controlsSettings->Add(new PopupMultiChoice(&g_Config.iTouchButtonStyle, co->T("Button style"), touchControlStyles, 0, ARRAY_SIZE(touchControlStyles), co->GetName(), screenManager()));
|
||||
View *style = controlsSettings->Add(new PopupMultiChoice(&g_Config.iTouchButtonStyle, co->T("Button style"), touchControlStyles, 0, ARRAY_SIZE(touchControlStyles), I18NCat::CONTROLS, screenManager()));
|
||||
style->SetEnabledPtr(&g_Config.bShowTouchControls);
|
||||
|
||||
PopupSliderChoice *opacity = controlsSettings->Add(new PopupSliderChoice(&g_Config.iTouchButtonOpacity, 0, 100, 65, co->T("Button Opacity"), screenManager(), "%"));
|
||||
@@ -783,17 +783,17 @@ void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings)
|
||||
void GameSettingsScreen::CreateNetworkingSettings(UI::ViewGroup *networkingSettings) {
|
||||
using namespace UI;
|
||||
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);
|
||||
|
||||
networkingSettings->Add(new ItemHeader(ms->T("Networking")));
|
||||
|
||||
networkingSettings->Add(new Choice(n->T("Open PPSSPP Multiplayer Wiki Page")))->OnClick.Handle(this, &GameSettingsScreen::OnAdhocGuides);
|
||||
|
||||
networkingSettings->Add(new CheckBox(&g_Config.bEnableWlan, n->T("Enable networking", "Enable networking/wlan (beta)")));
|
||||
networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sMACAddress, n->T("Change Mac Address"), (const char*)nullptr))->OnClick.Handle(this, &GameSettingsScreen::OnChangeMacAddress);
|
||||
networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sMACAddress, n->T("Change Mac Address"), I18NCat::NONE))->OnClick.Handle(this, &GameSettingsScreen::OnChangeMacAddress);
|
||||
static const char* wlanChannels[] = { "Auto", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" };
|
||||
auto wlanChannelChoice = networkingSettings->Add(new PopupMultiChoice(&g_Config.iWlanAdhocChannel, n->T("WLAN Channel"), wlanChannels, 0, ARRAY_SIZE(wlanChannels), n->GetName(), screenManager()));
|
||||
auto wlanChannelChoice = networkingSettings->Add(new PopupMultiChoice(&g_Config.iWlanAdhocChannel, n->T("WLAN Channel"), wlanChannels, 0, ARRAY_SIZE(wlanChannels), I18NCat::NETWORKING, screenManager()));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
wlanChannelChoice->HideChoice(i + 2);
|
||||
wlanChannelChoice->HideChoice(i + 7);
|
||||
@@ -802,7 +802,7 @@ void GameSettingsScreen::CreateNetworkingSettings(UI::ViewGroup *networkingSetti
|
||||
|
||||
networkingSettings->Add(new ItemHeader(n->T("AdHoc Server")));
|
||||
networkingSettings->Add(new CheckBox(&g_Config.bEnableAdhocServer, n->T("Enable built-in PRO Adhoc Server", "Enable built-in PRO Adhoc Server")));
|
||||
networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.proAdhocServer, n->T("Change proAdhocServer Address", "Change proAdhocServer Address (localhost = multiple instance)"), (const char*)nullptr))->OnClick.Handle(this, &GameSettingsScreen::OnChangeproAdhocServerAddress);
|
||||
networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.proAdhocServer, n->T("Change proAdhocServer Address", "Change proAdhocServer Address (localhost = multiple instance)"), I18NCat::NONE))->OnClick.Handle(this, &GameSettingsScreen::OnChangeproAdhocServerAddress);
|
||||
|
||||
networkingSettings->Add(new ItemHeader(n->T("UPnP (port-forwarding)")));
|
||||
networkingSettings->Add(new CheckBox(&g_Config.bEnableUPnP, n->T("Enable UPnP", "Enable UPnP (need a few seconds to detect)")));
|
||||
@@ -817,9 +817,9 @@ void GameSettingsScreen::CreateNetworkingSettings(UI::ViewGroup *networkingSetti
|
||||
networkingSettings->Add(new ItemHeader(n->T("Chat")));
|
||||
networkingSettings->Add(new CheckBox(&g_Config.bEnableNetworkChat, n->T("Enable network chat", "Enable network chat")));
|
||||
static const char *chatButtonPositions[] = { "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right", "Center Left", "Center Right", "None" };
|
||||
networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatButtonPosition, n->T("Chat Button Position"), chatButtonPositions, 0, ARRAY_SIZE(chatButtonPositions), n->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat);
|
||||
networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatButtonPosition, n->T("Chat Button Position"), chatButtonPositions, 0, ARRAY_SIZE(chatButtonPositions), I18NCat::NETWORKING, screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat);
|
||||
static const char *chatScreenPositions[] = { "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right" };
|
||||
networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatScreenPosition, n->T("Chat Screen Position"), chatScreenPositions, 0, ARRAY_SIZE(chatScreenPositions), n->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat);
|
||||
networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatScreenPosition, n->T("Chat Screen Position"), chatScreenPositions, 0, ARRAY_SIZE(chatScreenPositions), I18NCat::NETWORKING, screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat);
|
||||
|
||||
#if (!defined(MOBILE_DEVICE) && !defined(USING_QT_UI)) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID) // Missing only iOS?
|
||||
networkingSettings->Add(new ItemHeader(n->T("QuickChat", "Quick Chat")));
|
||||
@@ -874,11 +874,11 @@ void GameSettingsScreen::CreateNetworkingSettings(UI::ViewGroup *networkingSetti
|
||||
void GameSettingsScreen::CreateToolsSettings(UI::ViewGroup *tools) {
|
||||
using namespace UI;
|
||||
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto sa = GetI18NCategory(I18NCat::SAVEDATA);
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
|
||||
tools->Add(new ItemHeader(ms->T("Tools")));
|
||||
// These were moved here so use the wrong translation objects, to avoid having to change all inis... This isn't a sustainable situation :P
|
||||
@@ -891,9 +891,9 @@ void GameSettingsScreen::CreateToolsSettings(UI::ViewGroup *tools) {
|
||||
void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
using namespace UI;
|
||||
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto vr = GetI18NCategory("VR");
|
||||
auto th = GetI18NCategory("Themes");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto vr = GetI18NCategory(I18NCat::VR);
|
||||
auto th = GetI18NCategory(I18NCat::THEMES);
|
||||
|
||||
systemSettings->Add(new ItemHeader(sy->T("UI")));
|
||||
|
||||
@@ -907,7 +907,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
};
|
||||
|
||||
systemSettings->Add(new ChoiceWithValueDisplay(&g_Config.sLanguageIni, sy->T("Language"), langCodeToName))->OnClick.Add([&](UI::EventParams &e) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto langScreen = new NewLanguageScreen(sy->T("Language"));
|
||||
langScreen->OnChoice.Add([&](UI::EventParams &e) {
|
||||
screenManager()->RecreateAllViews();
|
||||
@@ -935,7 +935,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
|
||||
systemSettings->Add(new CheckBox(&g_Config.bTransparentBackground, sy->T("Transparent UI background")));
|
||||
|
||||
PopupMultiChoiceDynamic *theme = systemSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sThemeName, sy->T("Theme"), GetThemeInfoNames(), th->GetName(), screenManager()));
|
||||
PopupMultiChoiceDynamic *theme = systemSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sThemeName, sy->T("Theme"), GetThemeInfoNames(), I18NCat::THEMES, screenManager()));
|
||||
theme->OnChoice.Add([=](EventParams &e) {
|
||||
UpdateTheme(screenManager()->getUIContext());
|
||||
return UI::EVENT_CONTINUE;
|
||||
@@ -956,7 +956,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
}
|
||||
|
||||
static const char *backgroundAnimations[] = { "No animation", "Floating symbols", "Recent games", "Waves", "Moving background" };
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iBackgroundAnimation, sy->T("UI background animation"), backgroundAnimations, 0, ARRAY_SIZE(backgroundAnimations), sy->GetName(), screenManager()));
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iBackgroundAnimation, sy->T("UI background animation"), backgroundAnimations, 0, ARRAY_SIZE(backgroundAnimations), I18NCat::SYSTEM, screenManager()));
|
||||
|
||||
systemSettings->Add(new ItemHeader(sy->T("PSP Memory Stick")));
|
||||
|
||||
@@ -1048,7 +1048,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
systemSettings->Add(new CheckBox(&g_Config.bIgnoreBadMemAccess, sy->T("Ignore bad memory accesses")));
|
||||
|
||||
static const char *ioTimingMethods[] = { "Fast (lag on slow storage)", "Host (bugs, less lag)", "Simulate UMD delays" };
|
||||
View *ioTimingMethod = systemSettings->Add(new PopupMultiChoice(&g_Config.iIOTimingMethod, sy->T("IO timing method"), ioTimingMethods, 0, ARRAY_SIZE(ioTimingMethods), sy->GetName(), screenManager()));
|
||||
View *ioTimingMethod = systemSettings->Add(new PopupMultiChoice(&g_Config.iIOTimingMethod, sy->T("IO timing method"), ioTimingMethods, 0, ARRAY_SIZE(ioTimingMethods), I18NCat::SYSTEM, screenManager()));
|
||||
systemSettings->Add(new CheckBox(&g_Config.bForceLagSync, sy->T("Force real clock sync (slower, less lag)")))->SetDisabledPtr(&g_Config.bAutoFrameSkip);
|
||||
PopupSliderChoice *lockedMhz = systemSettings->Add(new PopupSliderChoice(&g_Config.iLockedCPUSpeed, 0, 1000, 0, sy->T("Change CPU Clock", "Change CPU Clock (unstable)"), screenManager(), sy->T("MHz, 0:default")));
|
||||
lockedMhz->OnChange.Add([&](UI::EventParams &) {
|
||||
@@ -1063,7 +1063,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_MOBILE) {
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
|
||||
static const char *screenRotation[] = { "Auto", "Landscape", "Portrait", "Landscape Reversed", "Portrait Reversed", "Landscape Auto" };
|
||||
PopupMultiChoice *rot = systemSettings->Add(new PopupMultiChoice(&g_Config.iScreenRotation, co->T("Screen Rotation"), screenRotation, 0, ARRAY_SIZE(screenRotation), co->GetName(), screenManager()));
|
||||
@@ -1078,7 +1078,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
systemSettings->Add(new Choice(sy->T("Restore Default Settings")))->OnClick.Handle(this, &GameSettingsScreen::OnRestoreDefaultSettings);
|
||||
systemSettings->Add(new CheckBox(&g_Config.bEnableStateUndo, sy->T("Savestate slot backups")));
|
||||
static const char *autoLoadSaveStateChoices[] = { "Off", "Oldest Save", "Newest Save", "Slot 1", "Slot 2", "Slot 3", "Slot 4", "Slot 5" };
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iAutoLoadSaveState, sy->T("Auto Load Savestate"), autoLoadSaveStateChoices, 0, ARRAY_SIZE(autoLoadSaveStateChoices), sy->GetName(), screenManager()));
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iAutoLoadSaveState, sy->T("Auto Load Savestate"), autoLoadSaveStateChoices, 0, ARRAY_SIZE(autoLoadSaveStateChoices), I18NCat::SYSTEM, screenManager()));
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_KEYBOARD))
|
||||
systemSettings->Add(new CheckBox(&g_Config.bBypassOSKWithKeyboard, sy->T("Use system native keyboard")));
|
||||
|
||||
@@ -1094,7 +1094,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
|
||||
systemSettings->Add(new ItemHeader(sy->T("PSP Settings")));
|
||||
static const char *models[] = { "PSP-1000", "PSP-2000/3000" };
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iPSPModel, sy->T("PSP Model"), models, 0, ARRAY_SIZE(models), sy->GetName(), screenManager()))->SetEnabled(!PSP_IsInited());
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iPSPModel, sy->T("PSP Model"), models, 0, ARRAY_SIZE(models), I18NCat::SYSTEM, screenManager()))->SetEnabled(!PSP_IsInited());
|
||||
// TODO: Come up with a way to display a keyboard for mobile users,
|
||||
// so until then, this is Windows/Desktop only.
|
||||
#if !defined(MOBILE_DEVICE) // TODO: Add all platforms where KEY_CHAR support is added
|
||||
@@ -1117,17 +1117,17 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
#endif
|
||||
systemSettings->Add(new CheckBox(&g_Config.bDayLightSavings, sy->T("Day Light Saving")));
|
||||
static const char *dateFormat[] = { "YYYYMMDD", "MMDDYYYY", "DDMMYYYY" };
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iDateFormat, sy->T("Date Format"), dateFormat, 0, 3, sy->GetName(), screenManager()));
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iDateFormat, sy->T("Date Format"), dateFormat, 0, 3, I18NCat::SYSTEM, screenManager()));
|
||||
static const char *timeFormat[] = { "24HR", "12HR" };
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iTimeFormat, sy->T("Time Format"), timeFormat, 0, 2, sy->GetName(), screenManager()));
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iTimeFormat, sy->T("Time Format"), timeFormat, 0, 2, I18NCat::SYSTEM, screenManager()));
|
||||
static const char *buttonPref[] = { "Use O to confirm", "Use X to confirm" };
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iButtonPreference, sy->T("Confirmation Button"), buttonPref, 0, 2, sy->GetName(), screenManager()));
|
||||
systemSettings->Add(new PopupMultiChoice(&g_Config.iButtonPreference, sy->T("Confirmation Button"), buttonPref, 0, 2, I18NCat::SYSTEM, screenManager()));
|
||||
}
|
||||
|
||||
void GameSettingsScreen::CreateVRSettings(UI::ViewGroup *vrSettings) {
|
||||
using namespace UI;
|
||||
|
||||
auto vr = GetI18NCategory("VR");
|
||||
auto vr = GetI18NCategory(I18NCat::VR);
|
||||
|
||||
vrSettings->Add(new ItemHeader(vr->T("Virtual reality")));
|
||||
vrSettings->Add(new CheckBox(&g_Config.bEnableVR, vr->T("Virtual reality")));
|
||||
@@ -1154,11 +1154,11 @@ void GameSettingsScreen::CreateVRSettings(UI::ViewGroup *vrSettings) {
|
||||
PopupSliderChoiceFloat *vrMotions = vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fMotionLength, 0.3f, 1.0f, 0.5f, vr->T("Motion needed to generate action"), 0.1f, screenManager(), vr->T("m")));
|
||||
vrMotions->SetEnabledPtr(&g_Config.bEnableMotions);
|
||||
static const char *cameraPitchModes[] = { "Disabled", "Top view -> First person", "First person -> Top view" };
|
||||
vrSettings->Add(new PopupMultiChoice(&g_Config.iCameraPitch, vr->T("Modify camera type"), cameraPitchModes, 0, 3, "", screenManager()));
|
||||
vrSettings->Add(new PopupMultiChoice(&g_Config.iCameraPitch, vr->T("Modify camera type"), cameraPitchModes, 0, 3, I18NCat::NONE, screenManager()));
|
||||
}
|
||||
|
||||
UI::LinearLayout *GameSettingsScreen::AddTab(const char *tag, const std::string &title, bool isSearch) {
|
||||
auto se = GetI18NCategory("Search");
|
||||
auto se = GetI18NCategory(I18NCat::SEARCH);
|
||||
|
||||
using namespace UI;
|
||||
ViewGroup *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
@@ -1194,7 +1194,7 @@ UI::EventReturn GameSettingsScreen::OnScreenRotation(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnAdhocGuides(UI::EventParams &e) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, n->T("MultiplayerHowToURL", "https://github.com/hrydgard/ppsspp/wiki/How-to-play-multiplayer-games-with-PPSSPP"));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
@@ -1257,7 +1257,7 @@ UI::EventReturn GameSettingsScreen::OnSavePathMydoc(UI::EventParams &e) {
|
||||
UI::EventReturn GameSettingsScreen::OnSavePathOther(UI::EventParams &e) {
|
||||
const Path &PPSSPPpath = File::GetExeDirectory();
|
||||
if (otherinstalled_) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
std::string folder = W32Util::BrowseForFolder(MainWindow::GetHWND(), di->T("Choose PPSSPP save folder"));
|
||||
if (folder.size()) {
|
||||
g_Config.memStickDirectory = Path(folder);
|
||||
@@ -1294,7 +1294,7 @@ UI::EventReturn GameSettingsScreen::OnChangeBackground(UI::EventParams &e) {
|
||||
File::Delete(bgJpg);
|
||||
UIBackgroundShutdown();
|
||||
} else {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
System_BrowseForImage(sy->T("Set UI background..."), [](const std::string &value, int) {
|
||||
if (!value.empty()) {
|
||||
Path dest = GetSysDirectory(DIRECTORY_SYSTEM) / (endsWithNoCase(value, ".jpg") ? "background.jpg" : "background.png");
|
||||
@@ -1362,7 +1362,7 @@ void GameSettingsScreen::sendMessage(const char *message, const char *value) {
|
||||
}
|
||||
|
||||
void GameSettingsScreen::ApplySearchFilter() {
|
||||
auto se = GetI18NCategory("Search");
|
||||
auto se = GetI18NCategory(I18NCat::SEARCH);
|
||||
|
||||
bool matches = searchFilter_.empty();
|
||||
for (int t = 0; t < (int)settingTabContents_.size(); ++t) {
|
||||
@@ -1420,7 +1420,7 @@ void GameSettingsScreen::RecreateViews() {
|
||||
}
|
||||
|
||||
void GameSettingsScreen::CallbackMemstickFolder(bool yes) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
|
||||
if (yes) {
|
||||
Path memstickDirFile = g_Config.internalDataDirectory / "memstick_dir.txt";
|
||||
@@ -1496,7 +1496,7 @@ void GameSettingsScreen::CallbackInflightFrames(bool yes) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnRenderingBackend(UI::EventParams &e) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
// It only makes sense to show the restart prompt if the backend was actually changed.
|
||||
if (g_Config.iGPUBackend != (int)GetGPUBackend()) {
|
||||
@@ -1507,7 +1507,7 @@ UI::EventReturn GameSettingsScreen::OnRenderingBackend(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnRenderingDevice(UI::EventParams &e) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
// It only makes sense to show the restart prompt if the device was actually changed.
|
||||
std::string *deviceNameSetting = GPUDeviceNameSetting();
|
||||
@@ -1519,7 +1519,7 @@ UI::EventReturn GameSettingsScreen::OnRenderingDevice(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnInflightFramesChoice(UI::EventParams &e) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
if (g_Config.iInflightFrames != prevInflightFrames_) {
|
||||
screenManager()->push(new PromptScreen(gamePath_, di->T("ChangingInflightFrames", "Changing graphics command buffering requires PPSSPP to restart. Restart now?"), di->T("Yes"), di->T("No"),
|
||||
std::bind(&GameSettingsScreen::CallbackInflightFrames, this, std::placeholders::_1)));
|
||||
@@ -1538,7 +1538,7 @@ UI::EventReturn GameSettingsScreen::OnMicDeviceChange(UI::EventParams& e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnAudioDevice(UI::EventParams &e) {
|
||||
auto a = GetI18NCategory("Audio");
|
||||
auto a = GetI18NCategory(I18NCat::AUDIO);
|
||||
if (g_Config.sAudioDevice == a->T("Auto")) {
|
||||
g_Config.sAudioDevice.clear();
|
||||
}
|
||||
@@ -1548,7 +1548,7 @@ UI::EventReturn GameSettingsScreen::OnAudioDevice(UI::EventParams &e) {
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeQuickChat0(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID)
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_InputBoxGetString(n->T("Enter Quick Chat 1"), g_Config.sQuickChat0, [](const std::string &value, int) {
|
||||
g_Config.sQuickChat0 = value;
|
||||
});
|
||||
@@ -1558,7 +1558,7 @@ UI::EventReturn GameSettingsScreen::OnChangeQuickChat0(UI::EventParams &e) {
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeQuickChat1(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID)
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_InputBoxGetString(n->T("Enter Quick Chat 2"), g_Config.sQuickChat1, [](const std::string &value, int) {
|
||||
g_Config.sQuickChat1 = value;
|
||||
});
|
||||
@@ -1568,7 +1568,7 @@ UI::EventReturn GameSettingsScreen::OnChangeQuickChat1(UI::EventParams &e) {
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeQuickChat2(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID)
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_InputBoxGetString(n->T("Enter Quick Chat 3"), g_Config.sQuickChat2, [](const std::string &value, int) {
|
||||
g_Config.sQuickChat2 = value;
|
||||
});
|
||||
@@ -1578,7 +1578,7 @@ UI::EventReturn GameSettingsScreen::OnChangeQuickChat2(UI::EventParams &e) {
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeQuickChat3(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID)
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_InputBoxGetString(n->T("Enter Quick Chat 4"), g_Config.sQuickChat3, [](const std::string &value, int) {
|
||||
g_Config.sQuickChat3 = value;
|
||||
});
|
||||
@@ -1588,7 +1588,7 @@ UI::EventReturn GameSettingsScreen::OnChangeQuickChat3(UI::EventParams &e) {
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeQuickChat4(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID)
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_InputBoxGetString(n->T("Enter Quick Chat 5"), g_Config.sQuickChat4, [](const std::string &value, int) {
|
||||
g_Config.sQuickChat4 = value;
|
||||
});
|
||||
@@ -1598,7 +1598,7 @@ UI::EventReturn GameSettingsScreen::OnChangeQuickChat4(UI::EventParams &e) {
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeNickname(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || PPSSPP_PLATFORM(ANDROID)
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
System_InputBoxGetString(n->T("Enter a new PSP nickname"), g_Config.sNickName, [](const std::string &value, int) {
|
||||
g_Config.sNickName = StripSpaces(value);
|
||||
});
|
||||
@@ -1607,7 +1607,7 @@ UI::EventReturn GameSettingsScreen::OnChangeNickname(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeproAdhocServerAddress(UI::EventParams &e) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
|
||||
screenManager()->push(new HostnameSelectScreen(&g_Config.proAdhocServer, n->T("proAdhocServer Address:")));
|
||||
|
||||
@@ -1615,8 +1615,8 @@ UI::EventReturn GameSettingsScreen::OnChangeproAdhocServerAddress(UI::EventParam
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeMacAddress(UI::EventParams &e) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
const char *confirmMessage = n->T("ChangeMacSaveConfirm", "Generate a new MAC address?");
|
||||
const char *warningMessage = n->T("ChangeMacSaveWarning", "Some games verify the MAC address when loading savedata, so this may break old saves.");
|
||||
@@ -1636,7 +1636,7 @@ UI::EventReturn GameSettingsScreen::OnChangeMacAddress(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnTextureShader(UI::EventParams &e) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto shaderScreen = new TextureShaderScreen(gr->T("Texture Shader"));
|
||||
shaderScreen->OnChoice.Handle(this, &GameSettingsScreen::OnTextureShaderChange);
|
||||
if (e.v)
|
||||
@@ -1695,7 +1695,7 @@ UI::EventReturn GameSettingsScreen::OnSysInfo(UI::EventParams &e) {
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeSearchFilter(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(__ANDROID__)
|
||||
auto se = GetI18NCategory("Search");
|
||||
auto se = GetI18NCategory(I18NCat::SEARCH);
|
||||
System_InputBoxGetString(se->T("Search term"), searchFilter_, [](const std::string &value, int) {
|
||||
NativeMessageReceived("gameSettings_search", StripSpaces(value).c_str());
|
||||
});
|
||||
@@ -1718,12 +1718,12 @@ void DeveloperToolsScreen::CreateViews() {
|
||||
settingsScroll->SetTag("DevToolsSettings");
|
||||
root_->Add(settingsScroll);
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto a = GetI18NCategory("Audio");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto a = GetI18NCategory(I18NCat::AUDIO);
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto ps = GetI18NCategory(I18NCat::POSTSHADERS);
|
||||
|
||||
AddStandardBack(root_);
|
||||
|
||||
@@ -1736,7 +1736,7 @@ void DeveloperToolsScreen::CreateViews() {
|
||||
// The bool may come in handy for future non-jit platforms though (UWP XB1?)
|
||||
|
||||
static const char *cpuCores[] = {"Interpreter", "Dynarec (JIT)", "IR Interpreter"};
|
||||
PopupMultiChoice *core = list->Add(new PopupMultiChoice(&g_Config.iCpuCore, gr->T("CPU Core"), cpuCores, 0, ARRAY_SIZE(cpuCores), sy->GetName(), screenManager()));
|
||||
PopupMultiChoice *core = list->Add(new PopupMultiChoice(&g_Config.iCpuCore, gr->T("CPU Core"), cpuCores, 0, ARRAY_SIZE(cpuCores), I18NCat::SYSTEM, screenManager()));
|
||||
core->OnChoice.Handle(this, &DeveloperToolsScreen::OnJitAffectingSetting);
|
||||
core->OnChoice.Add([](UI::EventParams &) {
|
||||
g_Config.NotifyUpdatedCpuCore();
|
||||
@@ -1814,7 +1814,7 @@ void DeveloperToolsScreen::CreateViews() {
|
||||
ChoiceWithValueDisplay *stereoShaderChoice = list->Add(new ChoiceWithValueDisplay(&g_Config.sStereoToMonoShader, gr->T("Stereo display shader"), &PostShaderTranslateName));
|
||||
stereoShaderChoice->SetEnabledFunc(enableStereo);
|
||||
stereoShaderChoice->OnClick.Add([=](EventParams &e) {
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto procScreen = new PostProcScreen(gr->T("Stereo display shader"), 0, true);
|
||||
if (e.v)
|
||||
procScreen->SetPopupOrigin(e.v);
|
||||
@@ -1864,9 +1864,9 @@ void GameSettingsScreen::CallbackRestoreDefaults(bool yes) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnRestoreDefaultSettings(UI::EventParams &e) {
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
if (g_Config.bGameSpecific) {
|
||||
screenManager()->push(
|
||||
new PromptScreen(gamePath_, dev->T("RestoreGameDefaultSettings", "Are you sure you want to restore the game-specific settings back to the ppsspp defaults?\n"), di->T("OK"), di->T("Cancel"),
|
||||
@@ -1899,7 +1899,7 @@ UI::EventReturn DeveloperToolsScreen::OnOpenTexturesIniFile(UI::EventParams &e)
|
||||
File::OpenFileInEditor(generatedFilename);
|
||||
} else {
|
||||
// Can't do much here, let's send a "toast" so the user sees that something happened.
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
System_Toast((generatedFilename.ToVisualString() + ": " + dev->T("Texture ini file created")).c_str());
|
||||
}
|
||||
|
||||
@@ -1974,9 +1974,9 @@ void DeveloperToolsScreen::update() {
|
||||
|
||||
void HostnameSelectScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
|
||||
LinearLayout *valueRow = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, Margins(0, 0, 0, 10)));
|
||||
|
||||
@@ -2067,7 +2067,7 @@ UI::EventReturn HostnameSelectScreen::OnDeleteAllClick(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn HostnameSelectScreen::OnEditClick(UI::EventParams& e) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
System_InputBoxGetString(n->T("proAdhocServer Address:"), addrView_->GetText(), [this](const std::string& value, int) {
|
||||
addrView_->SetText(value);
|
||||
@@ -2117,7 +2117,7 @@ void HostnameSelectScreen::ResolverThread() {
|
||||
}
|
||||
|
||||
bool HostnameSelectScreen::CanComplete(DialogResult result) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
|
||||
if (result != DR_OK)
|
||||
return true;
|
||||
@@ -2182,9 +2182,9 @@ void HostnameSelectScreen::OnCompleted(DialogResult result) {
|
||||
void GestureMappingScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto mc = GetI18NCategory(I18NCat::MAPPABLECONTROLS);
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
AddStandardBack(root_);
|
||||
@@ -2204,15 +2204,15 @@ void GestureMappingScreen::CreateViews() {
|
||||
vert->Add(new CheckBox(&g_Config.bGestureControlEnabled, co->T("Enable gesture control")));
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Swipe")));
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeUp, mc->T("Swipe Up"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeDown, mc->T("Swipe Down"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeLeft, mc->T("Swipe Left"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeRight, mc->T("Swipe Right"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeUp, mc->T("Swipe Up"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeDown, mc->T("Swipe Down"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeLeft, mc->T("Swipe Left"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iSwipeRight, mc->T("Swipe Right"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSensitivity, 0.01f, 1.0f, 1.0f, co->T("Swipe sensitivity"), 0.01f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSmoothing, 0.0f, 0.95f, 0.3f, co->T("Swipe smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Double tap")));
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&g_Config.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
|
||||
}
|
||||
|
||||
RestoreSettingsScreen::RestoreSettingsScreen(const char *title)
|
||||
@@ -2221,10 +2221,10 @@ RestoreSettingsScreen::RestoreSettingsScreen(const char *title)
|
||||
void RestoreSettingsScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
// Carefully re-use various translations.
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
|
||||
const char *text = dev->T(
|
||||
"RestoreDefaultSettings",
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ void GamepadView::Update() {
|
||||
}
|
||||
|
||||
std::string GamepadView::DescribeText() const {
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
return co->T(key_);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ void InstallZipScreen::CreateViews() {
|
||||
File::FileInfo fileInfo;
|
||||
bool success = File::GetFileInfo(zipPath_, &fileInfo);
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto iz = GetI18NCategory("InstallZip");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto iz = GetI18NCategory(I18NCat::INSTALLZIP);
|
||||
|
||||
Margins actionMenuMargins(0, 100, 15, 0);
|
||||
|
||||
@@ -112,7 +112,7 @@ UI::EventReturn InstallZipScreen::OnInstall(UI::EventParams ¶ms) {
|
||||
}
|
||||
|
||||
void InstallZipScreen::update() {
|
||||
auto iz = GetI18NCategory("InstallZip");
|
||||
auto iz = GetI18NCategory(I18NCat::INSTALLZIP);
|
||||
|
||||
using namespace UI;
|
||||
if (g_GameManager.GetState() != GameManagerState::IDLE) {
|
||||
|
||||
+12
-12
@@ -429,7 +429,7 @@ void GameButton::Draw(UIContext &dc) {
|
||||
|
||||
std::string GameButton::DescribeText() const {
|
||||
std::shared_ptr<GameInfo> ginfo = g_gameInfoCache->GetInfo(nullptr, gamePath_, 0);
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 button"), "%1", ginfo->GetTitle());
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ UI::EventReturn GameBrowser::LastClick(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameBrowser::BrowseClick(UI::EventParams &e) {
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
System_BrowseForFolder(mm->T("Choose folder"), [this](const std::string &filename, int) {
|
||||
this->SetPath(Path(filename));
|
||||
});
|
||||
@@ -688,7 +688,7 @@ void GameBrowser::Refresh() {
|
||||
Clear();
|
||||
|
||||
Add(new Spacer(1.0f));
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
// No topbar on recent screen
|
||||
if (DisplayTopBar()) {
|
||||
@@ -957,7 +957,7 @@ UI::EventReturn GameBrowser::NavigateClick(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameBrowser::GridSettingsClick(UI::EventParams &e) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto gridSettings = new GridSettingsScreen(sy->T("Games list settings"));
|
||||
gridSettings->OnRecentChanged.Handle(this, &GameBrowser::OnRecentClear);
|
||||
if (e.v)
|
||||
@@ -994,7 +994,7 @@ void MainScreen::CreateViews() {
|
||||
|
||||
bool vertical = UseVerticalLayout();
|
||||
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
Margins actionMenuMargins(0, 10, 10, 0);
|
||||
|
||||
@@ -1131,7 +1131,7 @@ void MainScreen::CreateViews() {
|
||||
logos->Add(new ImageView(ImageID("I_LOGO"), "PPSSPP", IS_DEFAULT, new AnchorLayoutParams(180, 64, 64, -5.0f, NONE, NONE, false)));
|
||||
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
ImageID icon(g_Config.UseFullScreen() ? "I_RESTORE" : "I_FULLSCREEN");
|
||||
fullscreenButton_ = logos->Add(new Button(gr->T("FullScreen", "Full Screen"), icon, new AnchorLayoutParams(48, 48, NONE, 0, 0, NONE, false)));
|
||||
fullscreenButton_->SetIgnoreText(true);
|
||||
@@ -1192,7 +1192,7 @@ void MainScreen::CreateViews() {
|
||||
root_->SetDefaultFocusView(tabHolder_);
|
||||
}
|
||||
|
||||
auto u = GetI18NCategory("Upgrade");
|
||||
auto u = GetI18NCategory(I18NCat::UPGRADE);
|
||||
|
||||
upgradeBar_ = 0;
|
||||
if (!g_Config.upgradeMessage.empty()) {
|
||||
@@ -1280,7 +1280,7 @@ void MainScreen::update() {
|
||||
|
||||
UI::EventReturn MainScreen::OnLoadFile(UI::EventParams &e) {
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) {
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
System_BrowseForFile(mm->T("Load"), BrowseFileType::BOOTABLE, [](const std::string &value, int) {
|
||||
NativeMessageReceived("boot", value.c_str());
|
||||
});
|
||||
@@ -1477,8 +1477,8 @@ void MainScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
void UmdReplaceScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
Margins actionMenuMargins(0, 100, 15, 0);
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
TabHolder *leftColumn = new TabHolder(ORIENT_HORIZONTAL, 64, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0));
|
||||
leftColumn->SetTag("UmdReplace");
|
||||
@@ -1554,8 +1554,8 @@ UI::EventReturn UmdReplaceScreen::OnGameSelectedInstant(UI::EventParams &e) {
|
||||
void GridSettingsScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
|
||||
LinearLayout *items = new LinearLayoutList(ORIENT_VERTICAL);
|
||||
|
||||
+15
-15
@@ -137,7 +137,7 @@ MemStickScreen::MemStickScreen(bool initialSetup)
|
||||
}
|
||||
|
||||
static void AddExplanation(UI::ViewGroup *viewGroup, MemStickScreen::Choice choice, UI::View *extraView = nullptr) {
|
||||
auto iz = GetI18NCategory("MemStick");
|
||||
auto iz = GetI18NCategory(I18NCat::MEMSTICK);
|
||||
using namespace UI;
|
||||
|
||||
int flags = FLAG_WRAP_TEXT;
|
||||
@@ -189,8 +189,8 @@ static void AddExplanation(UI::ViewGroup *viewGroup, MemStickScreen::Choice choi
|
||||
void MemStickScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto iz = GetI18NCategory("MemStick");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto iz = GetI18NCategory(I18NCat::MEMSTICK);
|
||||
|
||||
Margins actionMenuMargins(15, 0, 15, 0);
|
||||
|
||||
@@ -336,10 +336,10 @@ UI::EventReturn MemStickScreen::OnConfirmClick(UI::EventParams ¶ms) {
|
||||
UI::EventReturn MemStickScreen::SetFolderManually(UI::EventParams ¶ms) {
|
||||
// The old way, from before scoped storage.
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
System_InputBoxGetString(sy->T("Memory Stick Folder"), g_Config.memStickDirectory.ToString(), [&](const std::string &value, int) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
std::string newPath = value;
|
||||
size_t pos = newPath.find_last_not_of("/");
|
||||
@@ -445,7 +445,7 @@ UI::EventReturn MemStickScreen::UseStorageRoot(UI::EventParams ¶ms) {
|
||||
}
|
||||
|
||||
UI::EventReturn MemStickScreen::Browse(UI::EventParams ¶ms) {
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
System_BrowseForFolder(mm->T("Choose folder"), [=](const std::string &value, int) {
|
||||
std::string filename;
|
||||
filename = value;
|
||||
@@ -455,7 +455,7 @@ UI::EventReturn MemStickScreen::Browse(UI::EventParams ¶ms) {
|
||||
Path pendingMemStickFolder = Path(filename);
|
||||
|
||||
if (pendingMemStickFolder == g_Config.memStickDirectory) {
|
||||
auto iz = GetI18NCategory("MemStick");
|
||||
auto iz = GetI18NCategory(I18NCat::MEMSTICK);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -538,9 +538,9 @@ ConfirmMemstickMoveScreen::~ConfirmMemstickMoveScreen() {
|
||||
|
||||
void ConfirmMemstickMoveScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto iz = GetI18NCategory("MemStick");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto iz = GetI18NCategory(I18NCat::MEMSTICK);
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
@@ -605,7 +605,7 @@ UI::EventReturn ConfirmMemstickMoveScreen::OnMoveDataClick(UI::EventParams ¶
|
||||
|
||||
void ConfirmMemstickMoveScreen::update() {
|
||||
UIDialogScreenWithBackground::update();
|
||||
auto iz = GetI18NCategory("MemStick");
|
||||
auto iz = GetI18NCategory(I18NCat::MEMSTICK);
|
||||
|
||||
if (moveDataTask_) {
|
||||
if (progressView_) {
|
||||
@@ -633,8 +633,8 @@ void ConfirmMemstickMoveScreen::update() {
|
||||
}
|
||||
|
||||
UI::EventReturn ConfirmMemstickMoveScreen::OnConfirm(UI::EventParams ¶ms) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto iz = GetI18NCategory("MemStick");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto iz = GetI18NCategory(I18NCat::MEMSTICK);
|
||||
|
||||
// Transfer all the files in /PSP from the original directory.
|
||||
// Should probably be done on a background thread so we can show some UI.
|
||||
@@ -757,7 +757,7 @@ UI::EventReturn ConfirmMemstickMoveScreen::OnConfirm(UI::EventParams ¶ms) {
|
||||
}
|
||||
|
||||
void ConfirmMemstickMoveScreen::FinishFolderMove() {
|
||||
auto iz = GetI18NCategory("MemStick");
|
||||
auto iz = GetI18NCategory(I18NCat::MEMSTICK);
|
||||
|
||||
// Successful so far, switch the memstick folder.
|
||||
if (!SwitchMemstickFolderTo(newMemstickFolder_)) {
|
||||
|
||||
+10
-10
@@ -427,7 +427,7 @@ void HandleCommonMessages(const char *message, const char *value, ScreenManager
|
||||
UpdateUIState(UISTATE_MENU);
|
||||
manager->push(new GameSettingsScreen(Path()));
|
||||
} else if (!strcmp(message, "language screen") && isActiveScreen) {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto langScreen = new NewLanguageScreen(sy->T("Language"));
|
||||
langScreen->OnChoice.Add([](UI::EventParams &) {
|
||||
NativeMessageReceived("recreateviews", "");
|
||||
@@ -504,7 +504,7 @@ void UIDialogScreenWithBackground::DrawBackground(UIContext &dc) {
|
||||
|
||||
void UIDialogScreenWithBackground::AddStandardBack(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
parent->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(150, 64, 10, NONE, NONE, 10)))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ void UIDialogScreenWithBackground::sendMessage(const char *message, const char *
|
||||
|
||||
PromptScreen::PromptScreen(const Path &gamePath, std::string message, std::string yesButtonText, std::string noButtonText, std::function<void(bool)> callback)
|
||||
: UIDialogScreenWithGameBackground(gamePath), message_(message), callback_(callback) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
yesButtonText_ = di->T(yesButtonText.c_str());
|
||||
noButtonText_ = di->T(noButtonText.c_str());
|
||||
}
|
||||
@@ -559,7 +559,7 @@ void PromptScreen::TriggerFinish(DialogResult result) {
|
||||
TextureShaderScreen::TextureShaderScreen(const std::string &title) : ListPopupScreen(title) {}
|
||||
|
||||
void TextureShaderScreen::CreateViews() {
|
||||
auto ps = GetI18NCategory("TextureShaders");
|
||||
auto ps = GetI18NCategory(I18NCat::TEXTURESHADERS);
|
||||
ReloadAllPostShaderInfo(screenManager()->getDrawContext());
|
||||
shaders_ = GetAllTextureShaderInfo();
|
||||
std::vector<std::string> items;
|
||||
@@ -772,8 +772,8 @@ void LogoScreen::render() {
|
||||
screenManager()->getFocusPosition(x, y, z);
|
||||
::DrawBackground(dc, alpha, x, y, z);
|
||||
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
char temp[256];
|
||||
// Manually formatting UTF-8 is fun. \xXX doesn't work everywhere.
|
||||
snprintf(temp, sizeof(temp), "%s Henrik Rydg%c%crd", cr->T("created", "Created by"), 0xC3, 0xA5);
|
||||
@@ -806,8 +806,8 @@ void LogoScreen::render() {
|
||||
|
||||
void CreditsScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
Button *back = root_->Add(new Button(di->T("Back"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 10, false)));
|
||||
@@ -871,7 +871,7 @@ UI::EventReturn CreditsScreen::OnDiscord(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn CreditsScreen::OnShare(UI::EventParams &e) {
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||
System_ShareText(cr->T("CheckOutPPSSPP", "Check out PPSSPP, the awesome PSP emulator: https://www.ppsspp.org/"));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
@@ -888,7 +888,7 @@ void CreditsScreen::update() {
|
||||
void CreditsScreen::render() {
|
||||
UIScreen::render();
|
||||
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
auto cr = GetI18NCategory(I18NCat::PSPCREDITS);
|
||||
|
||||
std::string specialthanksMaxim = "Maxim ";
|
||||
specialthanksMaxim += cr->T("specialthanksMaxim", "for his amazing Atrac3+ decoder work");
|
||||
|
||||
+5
-11
@@ -408,8 +408,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||
|
||||
g_threadManager.Init(cpu_info.num_cores, cpu_info.logical_cpu_count);
|
||||
|
||||
g_Discord.SetPresenceMenu();
|
||||
|
||||
// Make sure UI state is MENU.
|
||||
ResetUIState();
|
||||
|
||||
@@ -710,7 +708,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||
}
|
||||
}
|
||||
|
||||
auto des = GetI18NCategory("DesktopUI");
|
||||
auto des = GetI18NCategory(I18NCat::DESKTOPUI);
|
||||
// Note to translators: do not translate this/add this to PPSSPP-lang's files.
|
||||
// It's intended to be custom for every user.
|
||||
// Only add it to your own personal copies of PPSSPP.
|
||||
@@ -996,7 +994,7 @@ void TakeScreenshot() {
|
||||
if (success) {
|
||||
osm.Show(filename.ToVisualString());
|
||||
} else {
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
osm.Show(err->T("Could not save screenshot file"));
|
||||
}
|
||||
}
|
||||
@@ -1141,7 +1139,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
|
||||
KeyMap::NotifyPadConnected(nextInputDeviceID, value);
|
||||
}
|
||||
else if (msg == "savestate_displayslot") {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
std::string msg = StringFromFormat("%s: %d", sy->T("Savestate Slot"), SaveState::GetCurrentSlot() + 1);
|
||||
// Show for the same duration as the preview.
|
||||
osm.Show(msg, 2.0f, 0xFFFFFF, -1, true, "savestate_slot");
|
||||
@@ -1164,7 +1162,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
|
||||
}
|
||||
else if (msg == "core_powerSaving") {
|
||||
if (value != "false") {
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
osm.Show(sy->T("WARNING: Android battery save mode is on"), 2.0f, 0xFFFFFF, -1, true, "core_powerSaving");
|
||||
#else
|
||||
@@ -1383,11 +1381,7 @@ void NativeShutdown() {
|
||||
|
||||
INFO_LOG(SYSTEM, "NativeShutdown called");
|
||||
|
||||
for (auto &cat : GetI18NMissingKeys()) {
|
||||
for (auto &key : cat.second) {
|
||||
INFO_LOG(SYSTEM, "Missing translation [%s]: %s", cat.first.c_str(), key.c_str());
|
||||
}
|
||||
}
|
||||
i18nrepo.LogMissingKeys();
|
||||
|
||||
ShutdownWebServer();
|
||||
|
||||
|
||||
+11
-12
@@ -60,7 +60,7 @@ static void AfterSaveStateAction(SaveState::Status status, const std::string &me
|
||||
|
||||
class ScreenshotViewScreen : public PopupScreen {
|
||||
public:
|
||||
ScreenshotViewScreen(const Path &filename, std::string title, int slot, std::shared_ptr<I18NCategory> i18n, Path gamePath)
|
||||
ScreenshotViewScreen(const Path &filename, std::string title, int slot, Path gamePath)
|
||||
: PopupScreen(title), filename_(filename), slot_(slot), gamePath_(gamePath) {} // PopupScreen will translate Back on its own
|
||||
|
||||
int GetSlot() const {
|
||||
@@ -76,8 +76,8 @@ protected:
|
||||
|
||||
void CreatePopupContents(UI::ViewGroup *parent) override {
|
||||
using namespace UI;
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto pa = GetI18NCategory(I18NCat::PAUSE);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
|
||||
LinearLayout *content = new LinearLayout(ORIENT_VERTICAL);
|
||||
@@ -179,7 +179,7 @@ SaveSlotView::SaveSlotView(const Path &gameFilename, int slot, bool vertical, UI
|
||||
AsyncImageFileView *fv = Add(new AsyncImageFileView(screenshotFilename_, IS_DEFAULT, new UI::LayoutParams(82 * 2, 47 * 2)));
|
||||
fv->SetOverlayText(StringFromFormat("%d", slot_ + 1));
|
||||
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
auto pa = GetI18NCategory(I18NCat::PAUSE);
|
||||
|
||||
LinearLayout *lines = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT));
|
||||
lines->SetSpacing(2.0f);
|
||||
@@ -271,8 +271,8 @@ void GamePauseScreen::CreateViews() {
|
||||
|
||||
Margins scrollMargins(0, 20, 0, 0);
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
auto pa = GetI18NCategory(I18NCat::PAUSE);
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
@@ -345,12 +345,12 @@ void GamePauseScreen::CreateViews() {
|
||||
// TODO, also might be nice to show overall compat rating here?
|
||||
// Based on their platform or even cpu/gpu/config. Would add an API for it.
|
||||
if (Reporting::IsSupported() && g_paramSFO.GetValueString("DISC_ID").size()) {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
rightColumnItems->Add(new Choice(rp->T("ReportButton", "Report Feedback")))->OnClick.Handle(this, &GamePauseScreen::OnReportFeedback);
|
||||
}
|
||||
rightColumnItems->Add(new Spacer(25.0));
|
||||
if (g_Config.bPauseMenuExitsEmulator) {
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
rightColumnItems->Add(new Choice(mm->T("Exit")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
|
||||
} else {
|
||||
rightColumnItems->Add(new Choice(pa->T("Exit to menu")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
|
||||
@@ -384,8 +384,7 @@ UI::EventReturn GamePauseScreen::OnScreenshotClicked(UI::EventParams &e) {
|
||||
if (SaveState::HasSaveInSlot(gamePath_, slot)) {
|
||||
Path fn = v->GetScreenshotFilename();
|
||||
std::string title = v->GetScreenshotTitle();
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
Screen *screen = new ScreenshotViewScreen(fn, title, v->GetSlot(), pa, gamePath_);
|
||||
Screen *screen = new ScreenshotViewScreen(fn, title, v->GetSlot(), gamePath_);
|
||||
screenManager()->push(screen);
|
||||
}
|
||||
return UI::EVENT_DONE;
|
||||
@@ -464,8 +463,8 @@ UI::EventReturn GamePauseScreen::OnCreateConfig(UI::EventParams &e)
|
||||
|
||||
UI::EventReturn GamePauseScreen::OnDeleteConfig(UI::EventParams &e)
|
||||
{
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ga = GetI18NCategory(I18NCat::GAME);
|
||||
screenManager()->push(
|
||||
new PromptScreen(gamePath_, di->T("DeleteConfirmGameConfig", "Do you really want to delete the settings for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
|
||||
std::bind(&GamePauseScreen::CallbackDeleteConfig, this, std::placeholders::_1)));
|
||||
|
||||
+11
-11
@@ -112,7 +112,7 @@ bool RemoteISOConnectScreen::FindServer(std::string &resultHost, int &resultPort
|
||||
|
||||
std::string subdir = RemoteSubdir();
|
||||
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
auto SetStatus = [&](const std::string &key, const std::string &host, int port) {
|
||||
std::string formatted = ReplaceAll(ri->T(key), "[URL]", StringFromFormat("http://%s:%d/", host.c_str(), port));
|
||||
|
||||
@@ -290,8 +290,8 @@ void RemoteISOScreen::update() {
|
||||
}
|
||||
|
||||
void RemoteISOScreen::CreateViews() {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
@@ -389,8 +389,8 @@ RemoteISOConnectScreen::~RemoteISOConnectScreen() {
|
||||
}
|
||||
|
||||
void RemoteISOConnectScreen::CreateViews() {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
@@ -413,7 +413,7 @@ void RemoteISOConnectScreen::CreateViews() {
|
||||
}
|
||||
|
||||
void RemoteISOConnectScreen::update() {
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
|
||||
UIDialogScreenWithBackground::update();
|
||||
|
||||
@@ -521,8 +521,8 @@ RemoteISOBrowseScreen::RemoteISOBrowseScreen(const std::string &url, const std::
|
||||
}
|
||||
|
||||
void RemoteISOBrowseScreen::CreateViews() {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
|
||||
bool vertical = UseVerticalLayout();
|
||||
|
||||
@@ -589,7 +589,7 @@ void RemoteISOSettingsScreen::update() {
|
||||
}
|
||||
|
||||
void RemoteISOSettingsScreen::CreateViews() {
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
|
||||
ViewGroup *remoteisoSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
remoteisoSettingsScroll->SetTag("RemoteISOSettings");
|
||||
@@ -642,7 +642,7 @@ void RemoteISOSettingsScreen::CreateViews() {
|
||||
|
||||
UI::EventReturn RemoteISOSettingsScreen::OnClickRemoteServer(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(__ANDROID__)
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
System_InputBoxGetString(ri->T("Remote Server"), g_Config.sLastRemoteISOServer, [](const std::string &value, int) {
|
||||
g_Config.sLastRemoteISOServer = value;
|
||||
});
|
||||
@@ -662,7 +662,7 @@ static void CleanupRemoteISOSubdir() {
|
||||
|
||||
UI::EventReturn RemoteISOSettingsScreen::OnClickRemoteISOSubdir(UI::EventParams &e) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(__ANDROID__)
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
System_InputBoxGetString(ri->T("Remote Subdirectory"), g_Config.sRemoteISOSubdir, [](const std::string &value, int) {
|
||||
g_Config.sRemoteISOSubdir = value;
|
||||
// Apply the cleanup logic, too.
|
||||
|
||||
+12
-12
@@ -71,7 +71,7 @@ RatingChoice::RatingChoice(const char *captionKey, int *value, LayoutParams *lay
|
||||
: LinearLayout(ORIENT_VERTICAL, layoutParams), value_(value) {
|
||||
SetSpacing(0.0f);
|
||||
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
group_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
Add(new TextView(rp->T(captionKey), FLAG_WRAP_TEXT, false))->SetShadow(true);
|
||||
Add(group_);
|
||||
@@ -103,7 +103,7 @@ RatingChoice *RatingChoice::SetEnabledPtrs(bool *ptr) {
|
||||
}
|
||||
|
||||
void RatingChoice::SetupChoices() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
AddChoice(0, rp->T("Bad"));
|
||||
AddChoice(1, rp->T("OK"));
|
||||
AddChoice(2, rp->T("Great"));
|
||||
@@ -151,7 +151,7 @@ CompatRatingChoice::CompatRatingChoice(const char *captionKey, int *value, Layou
|
||||
}
|
||||
|
||||
void CompatRatingChoice::SetupChoices() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
group_->Clear();
|
||||
AddChoice(0, rp->T("Perfect"));
|
||||
AddChoice(1, rp->T("Plays"));
|
||||
@@ -247,9 +247,9 @@ EventReturn ReportScreen::HandleReportingChange(EventParams &e) {
|
||||
}
|
||||
|
||||
void ReportScreen::CreateViews() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
@@ -333,7 +333,7 @@ void ReportScreen::UpdateSubmit() {
|
||||
}
|
||||
|
||||
void ReportScreen::UpdateCRCInfo() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
std::string updated;
|
||||
|
||||
if (Reporting::HasCRC(gamePath_)) {
|
||||
@@ -351,7 +351,7 @@ void ReportScreen::UpdateCRCInfo() {
|
||||
}
|
||||
|
||||
void ReportScreen::UpdateOverallDescription() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
const char *desc;
|
||||
uint32_t c = 0xFFFFFFFF;
|
||||
switch (overall_) {
|
||||
@@ -407,8 +407,8 @@ ReportFinishScreen::ReportFinishScreen(const Path &gamePath, ReportingOverallSco
|
||||
}
|
||||
|
||||
void ReportFinishScreen::CreateViews() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
@@ -442,7 +442,7 @@ void ReportFinishScreen::CreateViews() {
|
||||
}
|
||||
|
||||
void ReportFinishScreen::update() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
|
||||
if (!setStatus_) {
|
||||
Reporting::ReportStatus status = Reporting::GetStatus();
|
||||
@@ -468,7 +468,7 @@ void ReportFinishScreen::update() {
|
||||
}
|
||||
|
||||
void ReportFinishScreen::ShowSuggestions() {
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory(I18NCat::REPORTING);
|
||||
|
||||
auto suggestions = Reporting::CompatibilitySuggestions();
|
||||
if (score_ == ReportingOverallScore::PERFECT || score_ == ReportingOverallScore::PLAYABLE) {
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
LinearLayout *toprow = new LinearLayout(ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
content->Add(toprow);
|
||||
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
auto sa = GetI18NCategory(I18NCat::SAVEDATA);
|
||||
if (ginfo->fileType == IdentifiedFileType::PSP_SAVEDATA_DIRECTORY) {
|
||||
std::string savedata_detail = ginfo->paramSFO.GetValueString("SAVEDATA_DETAIL");
|
||||
std::string savedata_title = ginfo->paramSFO.GetValueString("SAVEDATA_TITLE");
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
content->Add(new TextView(GetFileDateAsString(savePath_), 0, true, new LinearLayoutParams(Margins(10, 5))))->SetTextColor(textStyle.fgColor);
|
||||
}
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
LinearLayout *buttons = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
buttons->SetSpacing(0);
|
||||
Margins buttonMargins(5, 5);
|
||||
@@ -408,7 +408,7 @@ void SavedataButton::Draw(UIContext &dc) {
|
||||
}
|
||||
|
||||
std::string SavedataButton::DescribeText() const {
|
||||
auto u = GetI18NCategory("UI Elements");
|
||||
auto u = GetI18NCategory(I18NCat::UI_ELEMENTS);
|
||||
return ReplaceAll(u->T("%1 button"), "%1", title_) + "\n" + subtitle_;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ void SavedataBrowser::Update() {
|
||||
}
|
||||
|
||||
void SavedataBrowser::SetSearchFilter(const std::string &filter) {
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
auto sa = GetI18NCategory(I18NCat::SAVEDATA);
|
||||
|
||||
searchFilter_.resize(filter.size());
|
||||
std::transform(filter.begin(), filter.end(), searchFilter_.begin(), tolower);
|
||||
@@ -538,8 +538,8 @@ void SavedataBrowser::Refresh() {
|
||||
Clear();
|
||||
|
||||
Add(new Spacer(1.0f));
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
auto sa = GetI18NCategory(I18NCat::SAVEDATA);
|
||||
|
||||
// Find games in the current directory and create new ones.
|
||||
std::vector<SavedataButton *> savedataButtons;
|
||||
@@ -612,8 +612,8 @@ SavedataScreen::~SavedataScreen() {
|
||||
|
||||
void SavedataScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto sa = GetI18NCategory(I18NCat::SAVEDATA);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
Path savedata_dir = GetSysDirectory(DIRECTORY_SAVEDATA);
|
||||
Path savestate_dir = GetSysDirectory(DIRECTORY_SAVESTATE);
|
||||
|
||||
@@ -671,7 +671,7 @@ UI::EventReturn SavedataScreen::OnSortClick(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn SavedataScreen::OnSearch(UI::EventParams &e) {
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(__ANDROID__)
|
||||
System_InputBoxGetString(di->T("Filter"), searchFilter_, [](const std::string &value, int ivalue) {
|
||||
if (ivalue) {
|
||||
|
||||
+5
-5
@@ -243,8 +243,8 @@ void ProductView::CreateViews() {
|
||||
Add(new TextView(entry_.name));
|
||||
Add(new TextView(entry_.author));
|
||||
|
||||
auto st = GetI18NCategory("Store");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto st = GetI18NCategory(I18NCat::STORE);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
wasInstalled_ = IsGameInstalled();
|
||||
bool isDownloading = g_GameManager.IsDownloading(DownloadURL());
|
||||
if (!wasInstalled_) {
|
||||
@@ -441,9 +441,9 @@ void StoreScreen::CreateViews() {
|
||||
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto st = GetI18NCategory("Store");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto st = GetI18NCategory(I18NCat::STORE);
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
// Top bar
|
||||
LinearLayout *topBar = root_->Add(new LinearLayout(ORIENT_HORIZONTAL));
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
void TiltAnalogSettingsScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
bool vertical = UseVerticalLayout();
|
||||
|
||||
@@ -102,7 +102,7 @@ void TiltAnalogSettingsScreen::CreateViews() {
|
||||
|
||||
static const char *tiltTypes[] = { "None (Disabled)", "Analog Stick", "D-PAD", "PSP Action Buttons", "L/R Trigger Buttons" };
|
||||
settings->Add(new ItemHeader(co->T("Tilt control setup")));
|
||||
settings->Add(new PopupMultiChoice(&g_Config.iTiltInputType, co->T("Tilt Input Type"), tiltTypes, 0, ARRAY_SIZE(tiltTypes), co->GetName(), screenManager()))->OnChoice.Add(
|
||||
settings->Add(new PopupMultiChoice(&g_Config.iTiltInputType, co->T("Tilt Input Type"), tiltTypes, 0, ARRAY_SIZE(tiltTypes), I18NCat::CONTROLS, screenManager()))->OnChoice.Add(
|
||||
[=](UI::EventParams &p) {
|
||||
//when the tilt event type is modified, we need to reset all tilt settings.
|
||||
//refer to the ResetTiltEvents() function for a detailed explanation.
|
||||
|
||||
@@ -618,8 +618,8 @@ void TouchControlLayoutScreen::CreateViews() {
|
||||
const float leftColumnWidth = 200.0f;
|
||||
layoutAreaScale = 1.0f - (leftColumnWidth + 10.0f) / std::max(bounds.w, 1.0f);
|
||||
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
auto rootLayout = new LinearLayout(ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
rootLayout->SetSpacing(0.0f);
|
||||
|
||||
@@ -46,8 +46,8 @@ void TouchControlVisibilityScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
using namespace CustomKeyData;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
@@ -130,7 +130,7 @@ void TouchControlVisibilityScreen::CreateViews() {
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
auto mc = GetI18NCategory(I18NCat::MAPPABLECONTROLS);
|
||||
for (auto toggle : toggles_) {
|
||||
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
row->SetSpacing(0);
|
||||
@@ -159,9 +159,9 @@ void TouchControlVisibilityScreen::onFinish(DialogResult result) {
|
||||
void RightAnalogMappingScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto mc = GetI18NCategory(I18NCat::MAPPABLECONTROLS);
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
Choice *back = new Choice(di->T("Back"), "", false, new AnchorLayoutParams(leftColumnWidth - 10, WRAP_CONTENT, 10, NONE, NONE, 10));
|
||||
@@ -181,11 +181,11 @@ void RightAnalogMappingScreen::CreateViews() {
|
||||
vert->Add(new CheckBox(&g_Config.bRightAnalogDisableDiagonal, co->T("Disable diagonal input")))->SetEnabledPtr(&g_Config.bRightAnalogCustom);
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Analog Binding")));
|
||||
PopupMultiChoice *rightAnalogUp = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogUp, mc->T("RightAn.Up"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
PopupMultiChoice *rightAnalogDown = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogDown, mc->T("RightAn.Down"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
PopupMultiChoice *rightAnalogLeft = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogLeft, mc->T("RightAn.Left"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
PopupMultiChoice *rightAnalogRight = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogRight, mc->T("RightAn.Right"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
PopupMultiChoice *rightAnalogPress = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogPress, co->T("Keep this button pressed when right analog is pressed"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
PopupMultiChoice *rightAnalogUp = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogUp, mc->T("RightAn.Up"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), I18NCat::MAPPABLECONTROLS, screenManager()));
|
||||
PopupMultiChoice *rightAnalogDown = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogDown, mc->T("RightAn.Down"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), I18NCat::MAPPABLECONTROLS, screenManager()));
|
||||
PopupMultiChoice *rightAnalogLeft = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogLeft, mc->T("RightAn.Left"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), I18NCat::MAPPABLECONTROLS, screenManager()));
|
||||
PopupMultiChoice *rightAnalogRight = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogRight, mc->T("RightAn.Right"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), I18NCat::MAPPABLECONTROLS, screenManager()));
|
||||
PopupMultiChoice *rightAnalogPress = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogPress, co->T("Keep this button pressed when right analog is pressed"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), I18NCat::MAPPABLECONTROLS, screenManager()));
|
||||
rightAnalogUp->SetEnabledPtr(&g_Config.bRightAnalogCustom);
|
||||
rightAnalogDown->SetEnabledPtr(&g_Config.bRightAnalogCustom);
|
||||
rightAnalogLeft->SetEnabledPtr(&g_Config.bRightAnalogCustom);
|
||||
|
||||
@@ -186,7 +186,7 @@ void MainThreadFunc() {
|
||||
if (g_Config.sFailedGPUBackends.find("ALL") != std::string::npos) {
|
||||
Reporting::ReportMessage("Graphics init error: %s", "ALL");
|
||||
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
const char *defaultErrorAll = "PPSSPP failed to startup with any graphics backend. Try upgrading your graphics and other drivers.";
|
||||
const char *genericError = err->T("GenericAllStartupError", defaultErrorAll);
|
||||
std::wstring title = ConvertUTF8ToWString(err->T("GenericGraphicsError", "Graphics Error"));
|
||||
@@ -214,7 +214,7 @@ void MainThreadFunc() {
|
||||
W32Util::ExitAndRestart();
|
||||
}
|
||||
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
Reporting::ReportMessage("Graphics init error: %s", error_string.c_str());
|
||||
|
||||
const char *defaultErrorVulkan = "Failed initializing graphics. Try upgrading your graphics drivers.\n\nWould you like to try switching to OpenGL?\n\nError message:";
|
||||
|
||||
@@ -136,7 +136,7 @@ bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) {
|
||||
|
||||
if (FAILED(hr)) {
|
||||
const char *defaultError = "Your GPU does not appear to support Direct3D 11.\n\nWould you like to try again using Direct3D 9 instead?";
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
|
||||
std::wstring error;
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ bool WindowsGLContext::InitFromRenderThread(std::string *error_message) {
|
||||
|
||||
// GL_VERSION GL_VENDOR GL_RENDERER
|
||||
// "1.4.0 - Build 8.14.10.2364" "intel" intel Pineview Platform
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
|
||||
std::string glVersion = (const char *)glGetString(GL_VERSION);
|
||||
std::string glRenderer = (const char *)glGetString(GL_RENDERER);
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace MainWindow {
|
||||
}
|
||||
|
||||
void CreateHelpMenu(HMENU menu) {
|
||||
auto des = GetI18NCategory("DesktopUI");
|
||||
auto des = GetI18NCategory(I18NCat::DESKTOPUI);
|
||||
|
||||
const std::wstring visitMainWebsite = ConvertUTF8ToWString(des->T("www.ppsspp.org"));
|
||||
const std::wstring visitForum = ConvertUTF8ToWString(des->T("PPSSPP Forums"));
|
||||
@@ -156,7 +156,7 @@ namespace MainWindow {
|
||||
}
|
||||
|
||||
static void TranslateMenuItem(const HMENU hMenu, const int menuID, const std::wstring& accelerator = L"", const char *key = nullptr) {
|
||||
auto des = GetI18NCategory("DesktopUI");
|
||||
auto des = GetI18NCategory(I18NCat::DESKTOPUI);
|
||||
|
||||
std::wstring translated;
|
||||
if (key == nullptr || !strcmp(key, "")) {
|
||||
@@ -318,7 +318,7 @@ namespace MainWindow {
|
||||
if (!browsePauseAfter)
|
||||
Core_EnableStepping(true, "ui.boot", 0);
|
||||
}
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
W32Util::MakeTopMost(GetHWND(), false);
|
||||
|
||||
@@ -387,7 +387,7 @@ namespace MainWindow {
|
||||
g_Config.iFrameSkip = FRAMESKIP_OFF;
|
||||
}
|
||||
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
|
||||
std::ostringstream messageStream;
|
||||
messageStream << gr->T("Frame Skipping") << ":" << " ";
|
||||
@@ -407,7 +407,7 @@ namespace MainWindow {
|
||||
g_Config.iFrameSkipType = 0;
|
||||
}
|
||||
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
|
||||
std::ostringstream messageStream;
|
||||
messageStream << gr->T("Frame Skipping Type") << ":" << " ";
|
||||
@@ -432,7 +432,7 @@ namespace MainWindow {
|
||||
void MainWindowMenu_Process(HWND hWnd, WPARAM wParam) {
|
||||
std::string fn;
|
||||
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
|
||||
int wmId = LOWORD(wParam);
|
||||
// Parse the menu selections:
|
||||
|
||||
+1
-1
@@ -569,7 +569,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||
}
|
||||
case SystemRequestType::GRAPHICS_BACKEND_FAILED_ALERT:
|
||||
{
|
||||
auto err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
const char *backendSwitchError = err->T("GenericBackendSwitchCrash", "PPSSPP crashed while starting. This usually means a graphics driver problem. Try upgrading your graphics drivers.\n\nGraphics backend has been switched:");
|
||||
std::wstring full_error = ConvertUTF8ToWString(StringFromFormat("%s %s", backendSwitchError, param1.c_str()));
|
||||
std::wstring title = ConvertUTF8ToWString(err->T("GenericGraphicsError", "Graphics Error"));
|
||||
|
||||
Reference in New Issue
Block a user