mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Core: Use a shared_ptr for i18n categories.
This does not make them thread safe, but it reduces the chances of a crash a bit (see #12594.)
This commit is contained in:
parent
a4ba5d4859
commit
5009698cc0
54 changed files with 244 additions and 240 deletions
|
@ -340,7 +340,7 @@ void CWCheatEngine::CreateCheatFile() {
|
|||
fclose(f);
|
||||
}
|
||||
if (!File::Exists(activeCheatFile)) {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
host->NotifyUserMessage(err->T("Unable to create cheat file, disk may be full"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ void PSPDialog::DisplayButtons(int flags, const char *caption)
|
|||
truncate_cpy(safeCaption, caption);
|
||||
}
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
float x1 = 183.5f, x2 = 261.5f;
|
||||
if (GetCommonParam()->buttonSwap == 1) {
|
||||
x1 = 261.5f;
|
||||
|
|
|
@ -156,7 +156,7 @@ void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo, bool hasOK)
|
|||
|
||||
if (hasYesNo)
|
||||
{
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
const char *choiceText;
|
||||
u32 yesColor, noColor;
|
||||
float x, w;
|
||||
|
@ -193,7 +193,7 @@ void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo, bool hasOK)
|
|||
}
|
||||
|
||||
if (hasOK) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
float x, w;
|
||||
x = 240.0f;
|
||||
w = 15.0f;
|
||||
|
|
|
@ -62,14 +62,14 @@ void PSPNetconfDialog::DrawBanner() {
|
|||
|
||||
// TODO: Draw a hexagon icon
|
||||
PPGeDrawImage(10, 6, 12.0f, 12.0f, 1, 10, 1, 10, 10, 10, CalcFadedColor(0xFFFFFFFF));
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
PPGeDrawText(di->T("Network Connection"), 30, 11, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||
}
|
||||
|
||||
int PSPNetconfDialog::Update(int animSpeed) {
|
||||
UpdateButtons();
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto err = GetI18NCategory("Error");
|
||||
const float WRAP_WIDTH = 254.0f;
|
||||
const int confirmBtnImage = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? I_CROSS : I_CIRCLE;
|
||||
const int confirmBtn = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? CTRL_CROSS : CTRL_CIRCLE;
|
||||
|
|
|
@ -917,7 +917,7 @@ int PSPOskDialog::Update(int animSpeed) {
|
|||
PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x63636363));
|
||||
RenderKeyboard();
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
PPGeDrawImage(I_SQUARE, 365, 222, 16, 16, 0, CalcFadedColor(0xFFFFFFFF));
|
||||
PPGeDrawText(di->T("Space"), 390, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||
|
|
|
@ -280,7 +280,7 @@ const std::string PSPSaveDialog::GetSelectedSaveDirName() const
|
|||
|
||||
void PSPSaveDialog::DisplayBanner(int which)
|
||||
{
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
PPGeDrawRect(0, 0, 480, 23, CalcFadedColor(0x65636358));
|
||||
const char *title;
|
||||
switch (which)
|
||||
|
@ -394,7 +394,7 @@ void PSPSaveDialog::DisplaySaveDataInfo1()
|
|||
{
|
||||
std::lock_guard<std::mutex> guard(paramLock);
|
||||
if (param.GetFileInfo(currentSelectedSave).size == 0) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
PPGeDrawText(di->T("NEW DATA"), 180, 136, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||
} else {
|
||||
char title[512];
|
||||
|
@ -539,7 +539,7 @@ void PSPSaveDialog::DisplayMessage(std::string text, bool hasYesNo)
|
|||
float h2 = h * (float)n / 2.0f;
|
||||
if (hasYesNo)
|
||||
{
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
const char *choiceText;
|
||||
u32 yesColor, noColor;
|
||||
float x, w;
|
||||
|
@ -621,7 +621,7 @@ int PSPSaveDialog::Update(int animSpeed)
|
|||
cancelButtonFlag = CTRL_CIRCLE;
|
||||
}
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
switch (display)
|
||||
{
|
||||
|
|
|
@ -392,7 +392,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
|
|||
|
||||
if (!pspFileSystem.GetFileInfo(dirPath).exists) {
|
||||
if (!pspFileSystem.MkDir(dirPath)) {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
host->NotifyUserMessage(err->T("Unable to write savedata, disk may be full"));
|
||||
}
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
|
|||
}
|
||||
|
||||
if (EncryptData(decryptMode, cryptedData, &cryptedSize, &aligned_len, cryptedHash, (hasKey ? param->key : 0)) != 0) {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
host->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;
|
||||
|
@ -689,7 +689,7 @@ void SavedataParam::LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, co
|
|||
|
||||
// Don't notify the user if we're not going to upgrade the save.
|
||||
if (!g_Config.bEncryptSave) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
host->NotifyUserMessage(di->T("When you save, it will load on a PSP, but not an older PPSSPP"), 6.0f);
|
||||
host->NotifyUserMessage(di->T("Old savedata detected"), 6.0f);
|
||||
}
|
||||
|
@ -701,7 +701,7 @@ void SavedataParam::LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, co
|
|||
}
|
||||
if (g_Config.bSavedataUpgrade) {
|
||||
decryptMode = prevCryptMode;
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
host->NotifyUserMessage(di->T("When you save, it will not work on outdated PSP Firmware anymore"), 6.0f);
|
||||
host->NotifyUserMessage(di->T("Old savedata detected"), 6.0f);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ u32 BlockDevice::CalculateCRC() {
|
|||
}
|
||||
|
||||
void BlockDevice::NotifyReadError() {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
if (!reportedError_) {
|
||||
host->NotifyUserMessage(err->T("Game disc read error - ISO corrupt"), 6.0f);
|
||||
reportedError_ = true;
|
||||
|
|
|
@ -251,7 +251,7 @@ bool DirectoryFileHandle::Open(const std::string &basePath, std::string &fileNam
|
|||
|
||||
if (w32err == ERROR_DISK_FULL || w32err == ERROR_NOT_ENOUGH_QUOTA) {
|
||||
// This is returned when the disk is full.
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
host->NotifyUserMessage(err->T("Disk full while writing data"));
|
||||
error = SCE_KERNEL_ERROR_ERRNO_NO_PERM;
|
||||
} else if (!success) {
|
||||
|
@ -315,7 +315,7 @@ bool DirectoryFileHandle::Open(const std::string &basePath, std::string &fileNam
|
|||
}
|
||||
} else if (errno == ENOSPC) {
|
||||
// This is returned when the disk is full.
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
host->NotifyUserMessage(err->T("Disk full while writing data"));
|
||||
error = SCE_KERNEL_ERROR_ERRNO_NO_PERM;
|
||||
} else {
|
||||
|
@ -383,7 +383,7 @@ size_t DirectoryFileHandle::Write(const u8* pointer, s64 size)
|
|||
|
||||
if (diskFull) {
|
||||
ERROR_LOG(FILESYS, "Disk full");
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
host->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.
|
||||
|
|
|
@ -1457,7 +1457,7 @@ int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){
|
|||
int sent = send(metasocket, (char*)&packet, sizeof(packet), 0);
|
||||
changeBlockingMode(metasocket, 1); // Change to non-blocking
|
||||
if (sent > 0) {
|
||||
I18NCategory *n = GetI18NCategory("Networking");
|
||||
auto n = GetI18NCategory("Networking");
|
||||
host->NotifyUserMessage(n->T("Network Initialized"), 1.0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -720,7 +720,7 @@ void __DisplayFlip(int cyclesLate) {
|
|||
static bool hasNotifiedSlow = false;
|
||||
if (!g_Config.bHideSlowWarnings && !hasNotifiedSlow && PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL && IsRunningSlow()) {
|
||||
#ifndef _DEBUG
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
if (g_Config.bSoftwareRendering) {
|
||||
host->NotifyUserMessage(err->T("Running slow: Try turning off Software Rendering"), 6.0f, 0xFF30D0D0);
|
||||
} else {
|
||||
|
|
|
@ -381,7 +381,7 @@ namespace SaveState
|
|||
return StringFromFormat("%s (%c)", title.c_str(), slotChar);
|
||||
}
|
||||
if (detectSlot(UNDO_STATE_EXTENSION)) {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("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) + ")";
|
||||
|
@ -402,7 +402,7 @@ namespace SaveState
|
|||
}
|
||||
|
||||
// The file can't be loaded - let's note that.
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
return File::GetFilename(filename) + " " + sy->T("(broken)");
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,7 @@ namespace SaveState
|
|||
if (!fn.empty()) {
|
||||
Load(fn, callback, cbUserData);
|
||||
} else {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
if (callback)
|
||||
callback(Status::FAILURE, sy->T("Failed to load state. Error in the file system."), cbUserData);
|
||||
}
|
||||
|
@ -494,7 +494,7 @@ namespace SaveState
|
|||
SaveScreenshot(shot, Callback(), 0);
|
||||
Save(fn + ".tmp", renameCallback, cbUserData);
|
||||
} else {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
if (callback)
|
||||
callback(Status::FAILURE, sy->T("Failed to save state. Error in the file system."), cbUserData);
|
||||
}
|
||||
|
@ -729,7 +729,7 @@ namespace SaveState
|
|||
std::string reason;
|
||||
std::string title;
|
||||
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
const char *i18nLoadFailure = sc->T("Load savestate failed", "");
|
||||
const char *i18nSaveFailure = sc->T("Save State Failed", "");
|
||||
if (strlen(i18nLoadFailure) == 0)
|
||||
|
|
|
@ -168,7 +168,7 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, bool isOverride) {
|
|||
}
|
||||
|
||||
if (filenameWarning) {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
host->NotifyUserMessage(err->T("textures.ini filenames may not be cross-platform"), 6.0f);
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ bool GameManager::InstallGame(const std::string &url, const std::string &fileNam
|
|||
return InstallRawISO(fileName, shortFilename, deleteAfter);
|
||||
}
|
||||
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
installInProgress_ = true;
|
||||
|
||||
std::string pspGame = GetSysDirectory(DIRECTORY_GAME);
|
||||
|
@ -312,7 +312,7 @@ bool GameManager::InstallGame(const std::string &url, const std::string &fileNam
|
|||
}
|
||||
|
||||
bool GameManager::DetectTexturePackDest(struct zip *z, int iniIndex, std::string *dest) {
|
||||
I18NCategory *iz = GetI18NCategory("InstallZip");
|
||||
auto iz = GetI18NCategory("InstallZip");
|
||||
|
||||
struct zip_stat zstat;
|
||||
zip_stat_index(z, iniIndex, 0, &zstat);
|
||||
|
@ -491,7 +491,7 @@ bool GameManager::InstallMemstickGame(struct zip *z, const std::string &zipfile,
|
|||
size_t allBytes = 0;
|
||||
size_t bytesCopied = 0;
|
||||
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
|
||||
auto fileAllowed = [&](const char *fn) {
|
||||
if (!allowRoot && strchr(fn, '/') == 0)
|
||||
|
|
|
@ -1906,7 +1906,7 @@ void FramebufferManagerCommon::UpdateFramebufUsage(VirtualFramebuffer *vfb) {
|
|||
}
|
||||
|
||||
void FramebufferManagerCommon::ShowScreenResolution() {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
|
||||
std::ostringstream messageStream;
|
||||
messageStream << gr->T("Internal Resolution") << ": ";
|
||||
|
|
|
@ -101,7 +101,7 @@ GPU_DX9::GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
|||
// Disable hardware tessellation bacause DX9 is still unsupported.
|
||||
g_Config.bHardwareTessellation = false;
|
||||
ERROR_LOG(G3D, "Hardware Tessellation is unsupported, falling back to software tessellation");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
host->NotifyUserMessage(gr->T("Turn off Hardware Tessellation - unsupported"), 2.5f, 0xFF3030FF);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -588,7 +588,7 @@ VSShader *ShaderManagerDX9::ApplyShader(int prim, u32 vertType) {
|
|||
vs = new VSShader(device_, VSID, codeBuffer_, useHWTransform);
|
||||
|
||||
if (vs->Failed()) {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
ERROR_LOG(G3D, "Shader compilation failed, falling back to software transform");
|
||||
if (!g_Config.bHideSlowWarnings) {
|
||||
host->NotifyUserMessage(gr->T("hardware transform error - falling back to software"), 2.5f, 0xFF3030FF);
|
||||
|
|
|
@ -112,7 +112,7 @@ GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
|||
if (!gstate_c.SupportsAll(GPU_SUPPORTS_VERTEX_TEXTURE_FETCH | GPU_SUPPORTS_TEXTURE_FLOAT) || !hasTexelFetch) {
|
||||
g_Config.bHardwareTessellation = false;
|
||||
ERROR_LOG(G3D, "Hardware Tessellation is unsupported, falling back to software tessellation");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
host->NotifyUserMessage(gr->T("Turn off Hardware Tessellation - unsupported"), 2.5f, 0xFF3030FF);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -678,7 +678,7 @@ Shader *ShaderManagerGLES::ApplyVertexShader(int prim, u32 vertType, VShaderID *
|
|||
// Vertex shader not in cache. Let's compile it.
|
||||
vs = CompileVertexShader(*VSID);
|
||||
if (vs->Failed()) {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
ERROR_LOG(G3D, "Shader compilation failed, falling back to software transform");
|
||||
if (!g_Config.bHideSlowWarnings) {
|
||||
host->NotifyUserMessage(gr->T("hardware transform error - falling back to software"), 2.5f, 0xFF3030FF);
|
||||
|
|
|
@ -219,7 +219,7 @@ void TextureCacheGLES::StartFrame() {
|
|||
lowMemoryMode_ = true;
|
||||
decimationCounter_ = 0;
|
||||
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
if (standardScaleFactor_ > 1) {
|
||||
host->NotifyUserMessage(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f);
|
||||
} else {
|
||||
|
|
|
@ -1122,7 +1122,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.
|
||||
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
if (scaleFactor > 1) {
|
||||
host->NotifyUserMessage(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f);
|
||||
} else {
|
||||
|
|
|
@ -471,7 +471,7 @@ bool MainUI::event(QEvent *e) {
|
|||
}
|
||||
break;
|
||||
} else if (e->type() == browseFolderEvent) {
|
||||
I18NCategory *mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
QString fileName = QFileDialog::getExistingDirectory(nullptr, mm->T("Choose folder"), g_Config.currentDirectory.c_str());
|
||||
if (QDir(fileName).exists()) {
|
||||
NativeMessageReceived("browse_folderSelect", fileName.toStdString().c_str());
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
|
||||
void Combo_keyScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
I18NCategory *co = GetI18NCategory("Controls");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
root_->Add(new ItemHeader(co->T("Combo 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));
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
static const int comboKeyImages[5] = {
|
||||
I_1, I_2, I_3, I_4, I_5,
|
||||
|
@ -113,7 +113,7 @@ void Combo_keyScreen::CreateViews() {
|
|||
|
||||
std::map<std::string, int>::iterator imageFinder;
|
||||
|
||||
I18NCategory *mc = GetI18NCategory("MappableControls");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
|
||||
for (auto i = keyToggles.begin(); i != keyToggles.end(); ++i) {
|
||||
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
|
|
|
@ -88,7 +88,7 @@ void ControlMapper::Update() {
|
|||
void ControlMapper::Refresh() {
|
||||
bool hasFocus = UI::GetFocusedView() == this;
|
||||
Clear();
|
||||
I18NCategory *mc = GetI18NCategory("MappableControls");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
|
||||
std::map<std::string, int> keyImages;
|
||||
keyImages["Circle"] = I_CIRCLE;
|
||||
|
@ -186,28 +186,28 @@ void ControlMapper::MappedCallback(KeyDef kdf) {
|
|||
UI::EventReturn ControlMapper::OnReplace(UI::EventParams ¶ms) {
|
||||
actionIndex_ = atoi(params.v->Tag().c_str());
|
||||
action_ = REPLACEONE;
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn ControlMapper::OnReplaceAll(UI::EventParams ¶ms) {
|
||||
action_ = REPLACEALL;
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn ControlMapper::OnAdd(UI::EventParams ¶ms) {
|
||||
action_ = ADD;
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
UI::EventReturn ControlMapper::OnAddMouse(UI::EventParams ¶ms) {
|
||||
action_ = ADD;
|
||||
g_Config.bMapMouse = true;
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ void ControlMappingScreen::CreateViews() {
|
|||
using namespace UI;
|
||||
mappers_.clear();
|
||||
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
|
@ -275,7 +275,7 @@ UI::EventReturn ControlMappingScreen::OnAutoConfigure(UI::EventParams ¶ms) {
|
|||
for (auto s = seenPads.begin(), end = seenPads.end(); s != end; ++s) {
|
||||
items.push_back(*s);
|
||||
}
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
ListPopupScreen *autoConfList = new ListPopupScreen(km->T("Autoconfigure for device"), items, -1);
|
||||
if (params.v)
|
||||
autoConfList->SetPopupOrigin(params.v);
|
||||
|
@ -306,8 +306,8 @@ void ControlMappingScreen::KeyMapped(int pspkey) { // Notification to let us re
|
|||
void KeyMappingNewKeyDialog::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
I18NCategory *mc = GetI18NCategory("MappableControls");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
|
||||
std::string pspButtonName = KeyMap::GetPspButtonName(this->pspBtn_);
|
||||
|
||||
|
@ -334,7 +334,7 @@ bool KeyMappingNewKeyDialog::key(const KeyInput &key) {
|
|||
void KeyMappingNewMouseKeyDialog::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *km = GetI18NCategory("KeyMapping");
|
||||
auto km = GetI18NCategory("KeyMapping");
|
||||
|
||||
parent->Add(new TextView(std::string(km->T("You can press ESC to cancel.")), new LinearLayoutParams(Margins(10, 0))));
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ bool AnalogTestScreen::axis(const AxisInput &axis) {
|
|||
void AnalogTestScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
|
||||
|
@ -627,8 +627,8 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
|
|||
void TouchTestScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
LinearLayout *theTwo = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(1.0f));
|
||||
root_->Add(theTwo);
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
|
||||
#include "i18n/i18n.h"
|
||||
#include "ui/view.h"
|
||||
|
@ -51,7 +52,7 @@ private:
|
|||
|
||||
class KeyMappingNewKeyDialog : public PopupScreen {
|
||||
public:
|
||||
explicit KeyMappingNewKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, I18NCategory *i18n)
|
||||
explicit KeyMappingNewKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, std::shared_ptr<I18NCategory> i18n)
|
||||
: PopupScreen(i18n->T("Map Key"), "Cancel", ""), callback_(callback), mapped_(false) {
|
||||
pspBtn_ = btn;
|
||||
}
|
||||
|
@ -74,7 +75,7 @@ private:
|
|||
|
||||
class KeyMappingNewMouseKeyDialog : public PopupScreen {
|
||||
public:
|
||||
explicit KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, I18NCategory *i18n)
|
||||
explicit KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, std::shared_ptr<I18NCategory> i18n)
|
||||
: PopupScreen(i18n->T("Map Mouse"), "", ""), callback_(callback), mapped_(false) {
|
||||
pspBtn_ = btn;
|
||||
}
|
||||
|
|
|
@ -79,8 +79,8 @@ void CwCheatScreen::CreateCodeList() {
|
|||
|
||||
void CwCheatScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
I18NCategory *cw = GetI18NCategory("CwCheats");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto cw = GetI18NCategory("CwCheats");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
CreateCodeList();
|
||||
g_Config.bReloadCheats = true;
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
|
|
@ -66,8 +66,8 @@ static const char *logLevelList[] = {
|
|||
|
||||
void DevMenu::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto sy = GetI18NCategory("System");
|
||||
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
|
||||
LinearLayout *items = new LinearLayout(ORIENT_VERTICAL);
|
||||
|
@ -189,7 +189,7 @@ void LogScreen::update() {
|
|||
|
||||
void LogScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
LinearLayout *outer = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
root_ = outer;
|
||||
|
@ -223,8 +223,8 @@ UI::EventReturn LogScreen::OnSubmit(UI::EventParams &e) {
|
|||
void LogConfigScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
root_ = new ScrollView(ORIENT_VERTICAL);
|
||||
|
||||
|
@ -294,7 +294,7 @@ UI::EventReturn LogConfigScreen::OnLogLevelChange(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn LogConfigScreen::OnLogLevel(UI::EventParams &e) {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
auto logLevelScreen = new LogLevelScreen(dev->T("Log Level"));
|
||||
logLevelScreen->OnChoice.Handle(this, &LogConfigScreen::OnLogLevelChange);
|
||||
|
@ -364,8 +364,8 @@ static const JitDisableFlag jitDisableFlags[] = {
|
|||
void JitDebugScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
root_ = new ScrollView(ORIENT_VERTICAL);
|
||||
|
||||
|
@ -417,9 +417,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.
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *si = GetI18NCategory("SysInfo");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto si = GetI18NCategory("SysInfo");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f));
|
||||
|
@ -674,7 +674,7 @@ void SystemInfoScreen::CreateViews() {
|
|||
void AddressPromptScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
addrView_ = new TextView(dev->T("Enter address"), ALIGN_HCENTER, false);
|
||||
parent->Add(addrView_);
|
||||
|
@ -728,7 +728,7 @@ void AddressPromptScreen::BackspaceDigit() {
|
|||
}
|
||||
|
||||
void AddressPromptScreen::UpdatePreviewDigits() {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
if (addr_ != 0) {
|
||||
char temp[32];
|
||||
|
@ -761,8 +761,8 @@ bool AddressPromptScreen::key(const KeyInput &key) {
|
|||
|
||||
// Three panes: Block chooser, MIPS view, ARM/x86 view
|
||||
void JitCompareScreen::CreateViews() {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
using namespace UI;
|
||||
|
||||
|
@ -807,7 +807,7 @@ void JitCompareScreen::UpdateDisasm() {
|
|||
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
JitBlockCacheDebugInterface *blockCacheDebug = MIPSComp::jit->GetBlockCacheDebugInterface();
|
||||
|
||||
|
@ -898,7 +898,7 @@ UI::EventReturn JitCompareScreen::OnShowStats(UI::EventParams &e) {
|
|||
|
||||
|
||||
UI::EventReturn JitCompareScreen::OnSelectBlock(UI::EventParams &e) {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
auto addressPrompt = new AddressPromptScreen(dev->T("Block address"));
|
||||
addressPrompt->OnChoice.Handle(this, &JitCompareScreen::OnBlockAddress);
|
||||
|
@ -1042,7 +1042,7 @@ struct { DebugShaderType type; const char *name; } shaderTypes[] = {
|
|||
void ShaderListScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
LinearLayout *layout = new LinearLayout(ORIENT_VERTICAL);
|
||||
root_ = layout;
|
||||
|
@ -1071,7 +1071,7 @@ UI::EventReturn ShaderListScreen::OnShaderClick(UI::EventParams &e) {
|
|||
void ShaderViewScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
LinearLayout *layout = new LinearLayout(ORIENT_VERTICAL);
|
||||
root_ = layout;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
@ -31,7 +32,7 @@
|
|||
|
||||
class DevMenu : public PopupScreen {
|
||||
public:
|
||||
DevMenu(I18NCategory *i18n) : PopupScreen(i18n->T("Dev Tools")) {}
|
||||
DevMenu(std::shared_ptr<I18NCategory> i18n) : PopupScreen(i18n->T("Dev Tools")) {}
|
||||
|
||||
void CreatePopupContents(UI::ViewGroup *parent) override;
|
||||
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||
|
|
|
@ -101,7 +101,7 @@ void Discord::SetPresenceGame(const char *gameTitle) {
|
|||
}
|
||||
|
||||
#ifdef ENABLE_DISCORD
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
|
||||
DiscordRichPresence discordPresence{};
|
||||
discordPresence.state = gameTitle;
|
||||
|
@ -127,7 +127,7 @@ void Discord::SetPresenceMenu() {
|
|||
}
|
||||
|
||||
#ifdef ENABLE_DISCORD
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
|
||||
DiscordRichPresence discordPresence{};
|
||||
discordPresence.state = sc->T("In menu");
|
||||
|
|
|
@ -231,9 +231,9 @@ void DisplayLayoutScreen::CreateViews() {
|
|||
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
I18NCategory *co = GetI18NCategory("Controls");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ extern bool g_TakeScreenshot;
|
|||
|
||||
static void __EmuScreenVblank()
|
||||
{
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
|
||||
if (frameStep_ && lastNumFlips != gpuStats.numFlips)
|
||||
{
|
||||
|
@ -192,7 +192,7 @@ void EmuScreen::bootGame(const std::string &filename) {
|
|||
if (!bootAllowStorage(filename))
|
||||
return;
|
||||
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
|
||||
invalid_ = true;
|
||||
|
||||
|
@ -267,17 +267,17 @@ void EmuScreen::bootGame(const std::string &filename) {
|
|||
}
|
||||
|
||||
if (PSP_CoreParameter().compat.flags().RequireBufferedRendering && g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
host->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.bBlockTransferGPU == false) {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
host->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) {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
host->NotifyUserMessage(gr->T("DefaultCPUClockRequired", "Warning: This game requires the CPU clock to be set to default."), 15.0f);
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ void EmuScreen::bootComplete() {
|
|||
NOTICE_LOG(BOOT, "Loading %s...", PSP_CoreParameter().fileToStart.c_str());
|
||||
autoLoad();
|
||||
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
|
||||
#ifndef MOBILE_DEVICE
|
||||
if (g_Config.bFirstRun) {
|
||||
|
@ -318,7 +318,7 @@ void EmuScreen::bootComplete() {
|
|||
#endif
|
||||
|
||||
if (Core_GetPowerSaving()) {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
#ifdef __ANDROID__
|
||||
osm.Show(sy->T("WARNING: Android battery save mode is on"), 2.0f, 0xFFFFFF, -1, true, "core_powerSaving");
|
||||
#else
|
||||
|
@ -474,7 +474,7 @@ bool EmuScreen::touch(const TouchInput &touch) {
|
|||
}
|
||||
|
||||
void EmuScreen::onVKeyDown(int virtualKeyCode) {
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
|
||||
switch (virtualKeyCode) {
|
||||
case VIRTKEY_UNTHROTTLE:
|
||||
|
@ -635,7 +635,7 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
|
|||
}
|
||||
|
||||
void EmuScreen::onVKeyUp(int virtualKeyCode) {
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
|
||||
switch (virtualKeyCode) {
|
||||
case VIRTKEY_UNTHROTTLE:
|
||||
|
@ -959,8 +959,8 @@ protected:
|
|||
void EmuScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *sc = GetI18NCategory("Screen");
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto sc = GetI18NCategory("Screen");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
|
||||
const Bounds &bounds = screenManager()->getUIContext()->GetBounds();
|
||||
InitPadLayout(bounds.w, bounds.h);
|
||||
|
@ -1030,7 +1030,7 @@ void EmuScreen::CreateViews() {
|
|||
}
|
||||
|
||||
UI::EventReturn EmuScreen::OnDevTools(UI::EventParams ¶ms) {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
DevMenu *devMenu = new DevMenu(dev);
|
||||
if (params.v)
|
||||
devMenu->SetPopupOrigin(params.v);
|
||||
|
@ -1072,7 +1072,7 @@ void EmuScreen::update() {
|
|||
quit_ = true;
|
||||
return;
|
||||
}
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
std::string errLoadingFile = gamePath_ + "\n";
|
||||
errLoadingFile.append(err->T("Error loading file", "Could not load game"));
|
||||
errLoadingFile.append(" ");
|
||||
|
|
|
@ -78,8 +78,8 @@ GPUDriverTestScreen::~GPUDriverTestScreen() {
|
|||
void GPUDriverTestScreen::CreateViews() {
|
||||
// Don't bother with views for now.
|
||||
using namespace UI;
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *cr = GetI18NCategory("PSPCredits");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
|
||||
AnchorLayout *anchor = new AnchorLayout();
|
||||
root_ = anchor;
|
||||
|
|
|
@ -50,9 +50,9 @@ void GameScreen::CreateViews() {
|
|||
if (info && !info->id.empty())
|
||||
saveDirs = info->GetSaveDataDirectories(); // Get's very heavy, let's not do it in update()
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
I18NCategory *pa = GetI18NCategory("Pause");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
|
||||
// Information in the top left.
|
||||
// Back button to the bottom left.
|
||||
|
@ -176,8 +176,8 @@ void GameScreen::CallbackDeleteConfig(bool yes) {
|
|||
|
||||
UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
|
||||
{
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
screenManager()->push(
|
||||
new PromptScreen(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)));
|
||||
|
@ -188,7 +188,7 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
|
|||
void GameScreen::render() {
|
||||
UIScreen::render();
|
||||
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
|
||||
Draw::DrawContext *thin3d = screenManager()->getDrawContext();
|
||||
|
||||
|
@ -277,8 +277,8 @@ UI::EventReturn GameScreen::OnGameSettings(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnDeleteSaveData(UI::EventParams &e) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("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
|
||||
|
@ -303,8 +303,8 @@ void GameScreen::CallbackDeleteSaveData(bool yes) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnDeleteGame(UI::EventParams &e) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(NULL, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE);
|
||||
if (info) {
|
||||
screenManager()->push(
|
||||
|
@ -380,7 +380,7 @@ SetBackgroundPopupScreen::SetBackgroundPopupScreen(const std::string &title, con
|
|||
}
|
||||
|
||||
void SetBackgroundPopupScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
auto ga = GetI18NCategory("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))));
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ void SetBackgroundPopupScreen::update() {
|
|||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnSetBackground(UI::EventParams &e) {
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
auto ga = GetI18NCategory("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_);
|
||||
|
|
|
@ -110,7 +110,7 @@ bool DoesBackendSupportHWTess() {
|
|||
}
|
||||
|
||||
static std::string PostShaderTranslateName(const char *value) {
|
||||
I18NCategory *ps = GetI18NCategory("PostShaders");
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
const ShaderInfo *info = GetPostShaderInfo(value);
|
||||
if (info) {
|
||||
return ps->T(value, info ? info->name.c_str() : value);
|
||||
|
@ -149,16 +149,16 @@ void GameSettingsScreen::CreateViews() {
|
|||
// Scrolling action menu to the right.
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
I18NCategory *co = GetI18NCategory("Controls");
|
||||
I18NCategory *a = GetI18NCategory("Audio");
|
||||
I18NCategory *sa = GetI18NCategory("Savedata");
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
I18NCategory *n = GetI18NCategory("Networking");
|
||||
I18NCategory *ms = GetI18NCategory("MainSettings");
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
I18NCategory *ri = GetI18NCategory("RemoteISO");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto a = GetI18NCategory("Audio");
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto n = GetI18NCategory("Networking");
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
|
@ -291,7 +291,7 @@ void GameSettingsScreen::CreateViews() {
|
|||
graphicsSettings->Add(new ItemHeader(gr->T("Features")));
|
||||
// Hide postprocess option on unsupported backends to avoid confusion.
|
||||
if (GetGPUBackend() != GPUBackend::DIRECT3D9) {
|
||||
I18NCategory *ps = GetI18NCategory("PostShaders");
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
postProcChoice_ = graphicsSettings->Add(new ChoiceWithValueDisplay(&g_Config.sPostShaderName, gr->T("Postprocessing Shader"), &PostShaderTranslateName));
|
||||
postProcChoice_->OnClick.Handle(this, &GameSettingsScreen::OnPostProcShader);
|
||||
postProcEnable_ = !g_Config.bSoftwareRendering && (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);
|
||||
|
@ -871,7 +871,7 @@ void RecreateActivity() {
|
|||
System_SendMessage("recreate", "");
|
||||
ILOG("Got back from recreate");
|
||||
} else {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
System_SendMessage("toast", gr->T("Must Restart", "You must restart PPSSPP for this change to take effect"));
|
||||
}
|
||||
}
|
||||
|
@ -918,7 +918,7 @@ UI::EventReturn GameSettingsScreen::OnJitAffectingSetting(UI::EventParams &e) {
|
|||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeMemStickDir(UI::EventParams &e) {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
System_SendMessage("inputbox", (std::string(sy->T("Memory Stick Folder")) + ":" + g_Config.memStickDirectory).c_str());
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
@ -956,7 +956,7 @@ UI::EventReturn GameSettingsScreen::OnSavePathMydoc(UI::EventParams &e) {
|
|||
UI::EventReturn GameSettingsScreen::OnSavePathOther(UI::EventParams &e) {
|
||||
const std::string PPSSPPpath = File::GetExeDirectory();
|
||||
if (otherinstalled_) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
std::string folder = W32Util::BrowseForFolder(MainWindow::GetHWND(), di->T("Choose PPSSPP save folder"));
|
||||
if (folder.size()) {
|
||||
g_Config.memStickDirectory = folder;
|
||||
|
@ -1085,8 +1085,8 @@ void GameSettingsScreen::onFinish(DialogResult result) {
|
|||
void GameSettingsScreen::sendMessage(const char *message, const char *value) {
|
||||
UIDialogScreenWithGameBackground::sendMessage(message, value);
|
||||
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
if (!strcmp(message, "inputbox_completed")) {
|
||||
std::vector<std::string> inputboxValue;
|
||||
|
@ -1121,7 +1121,7 @@ void GameSettingsScreen::sendMessage(const char *message, const char *value) {
|
|||
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
void GameSettingsScreen::CallbackMemstickFolder(bool yes) {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
|
||||
if (yes) {
|
||||
std::string memstickDirFile = g_Config.internalDataDirectory + "/memstick_dir.txt";
|
||||
|
@ -1177,7 +1177,7 @@ void GameSettingsScreen::CallbackRenderingDevice(bool yes) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnRenderingBackend(UI::EventParams &e) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
// It only makes sense to show the restart prompt if the backend was actually changed.
|
||||
if (g_Config.iGPUBackend != (int)GetGPUBackend()) {
|
||||
|
@ -1188,7 +1188,7 @@ UI::EventReturn GameSettingsScreen::OnRenderingBackend(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnRenderingDevice(UI::EventParams &e) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
// It only makes sense to show the restart prompt if the device was actually changed.
|
||||
std::string *deviceNameSetting = GPUDeviceNameSetting();
|
||||
|
@ -1205,7 +1205,7 @@ UI::EventReturn GameSettingsScreen::OnCameraDeviceChange(UI::EventParams& e) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnAudioDevice(UI::EventParams &e) {
|
||||
I18NCategory *a = GetI18NCategory("Audio");
|
||||
auto a = GetI18NCategory("Audio");
|
||||
if (g_Config.sAudioDevice == a->T("Auto")) {
|
||||
g_Config.sAudioDevice.clear();
|
||||
}
|
||||
|
@ -1231,7 +1231,7 @@ UI::EventReturn GameSettingsScreen::OnChangeNickname(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnChangeproAdhocServerAddress(UI::EventParams &e) {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
System_SendMessage("inputbox", ("IP:" + g_Config.proAdhocServer).c_str());
|
||||
|
@ -1254,7 +1254,7 @@ UI::EventReturn GameSettingsScreen::OnComboKey(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnLanguage(UI::EventParams &e) {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto langScreen = new NewLanguageScreen(dev->T("Language"));
|
||||
langScreen->OnChoice.Handle(this, &GameSettingsScreen::OnLanguageChange);
|
||||
if (e.v)
|
||||
|
@ -1273,7 +1273,7 @@ UI::EventReturn GameSettingsScreen::OnLanguageChange(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnPostProcShader(UI::EventParams &e) {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto procScreen = new PostProcScreen(gr->T("Postprocessing Shader"));
|
||||
procScreen->OnChoice.Handle(this, &GameSettingsScreen::OnPostProcShaderChange);
|
||||
if (e.v)
|
||||
|
@ -1337,11 +1337,11 @@ void DeveloperToolsScreen::CreateViews() {
|
|||
settingsScroll->SetTag("DevToolsSettings");
|
||||
root_->Add(settingsScroll);
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
I18NCategory *a = GetI18NCategory("Audio");
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto a = GetI18NCategory("Audio");
|
||||
auto sy = GetI18NCategory("System");
|
||||
|
||||
AddStandardBack(root_);
|
||||
|
||||
|
@ -1413,8 +1413,8 @@ void GameSettingsScreen::CallbackRestoreDefaults(bool yes) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnRestoreDefaultSettings(UI::EventParams &e) {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
if (g_Config.bGameSpecific)
|
||||
{
|
||||
screenManager()->push(
|
||||
|
@ -1506,9 +1506,9 @@ void DeveloperToolsScreen::update() {
|
|||
|
||||
void HostnameSelectScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *n = GetI18NCategory("Networking");
|
||||
auto sy = GetI18NCategory("System");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto n = GetI18NCategory("Networking");
|
||||
|
||||
LinearLayout *valueRow = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, Margins(0, 0, 0, 10)));
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ void InstallZipScreen::CreateViews() {
|
|||
FileInfo fileInfo;
|
||||
bool success = getFileInfo(zipPath_.c_str(), &fileInfo);
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *iz = GetI18NCategory("InstallZip");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto iz = GetI18NCategory("InstallZip");
|
||||
|
||||
Margins actionMenuMargins(0, 100, 15, 0);
|
||||
|
||||
|
@ -106,7 +106,7 @@ UI::EventReturn InstallZipScreen::OnInstall(UI::EventParams ¶ms) {
|
|||
}
|
||||
|
||||
void InstallZipScreen::update() {
|
||||
I18NCategory *iz = GetI18NCategory("InstallZip");
|
||||
auto iz = GetI18NCategory("InstallZip");
|
||||
|
||||
using namespace UI;
|
||||
if (g_GameManager.GetState() != GameManagerState::IDLE) {
|
||||
|
|
|
@ -523,7 +523,7 @@ void GameBrowser::Refresh() {
|
|||
Clear();
|
||||
|
||||
Add(new Spacer(1.0f));
|
||||
I18NCategory *mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
|
||||
// No topbar on recent screen
|
||||
if (DisplayTopBar()) {
|
||||
|
@ -777,7 +777,7 @@ void MainScreen::CreateViews() {
|
|||
|
||||
bool vertical = UseVerticalLayout();
|
||||
|
||||
I18NCategory *mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
|
||||
Margins actionMenuMargins(0, 10, 10, 0);
|
||||
|
||||
|
@ -954,7 +954,7 @@ void MainScreen::CreateViews() {
|
|||
root_->SetDefaultFocusView(tabHolder_);
|
||||
}
|
||||
|
||||
I18NCategory *u = GetI18NCategory("Upgrade");
|
||||
auto u = GetI18NCategory("Upgrade");
|
||||
|
||||
upgradeBar_ = 0;
|
||||
if (!g_Config.upgradeMessage.empty()) {
|
||||
|
@ -1255,8 +1255,8 @@ void MainScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
|||
void UmdReplaceScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
Margins actionMenuMargins(0, 100, 15, 0);
|
||||
I18NCategory *mm = GetI18NCategory("MainMenu");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
TabHolder *leftColumn = new TabHolder(ORIENT_HORIZONTAL, 64, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0));
|
||||
leftColumn->SetTag("UmdReplace");
|
||||
|
|
|
@ -183,7 +183,7 @@ void HandleCommonMessages(const char *message, const char *value, ScreenManager
|
|||
UpdateUIState(UISTATE_MENU);
|
||||
manager->push(new GameSettingsScreen(""));
|
||||
} else if (!strcmp(message, "language screen") && isActiveScreen) {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
auto dev = GetI18NCategory("Developer");
|
||||
auto langScreen = new NewLanguageScreen(dev->T("Language"));
|
||||
langScreen->OnChoice.Add([](UI::EventParams &) {
|
||||
NativeMessageReceived("recreateviews", "");
|
||||
|
@ -247,7 +247,7 @@ void UIDialogScreenWithBackground::DrawBackground(UIContext &dc) {
|
|||
|
||||
void UIDialogScreenWithBackground::AddStandardBack(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
parent->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(150, 64, 10, NONE, NONE, 10)))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ void UIDialogScreenWithBackground::sendMessage(const char *message, const char *
|
|||
|
||||
PromptScreen::PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText, std::function<void(bool)> callback)
|
||||
: message_(message), callback_(callback) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
yesButtonText_ = di->T(yesButtonText.c_str());
|
||||
noButtonText_ = di->T(noButtonText.c_str());
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ void PromptScreen::TriggerFinish(DialogResult result) {
|
|||
}
|
||||
|
||||
PostProcScreen::PostProcScreen(const std::string &title) : ListPopupScreen(title) {
|
||||
I18NCategory *ps = GetI18NCategory("PostShaders");
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
ReloadAllPostShaderInfo();
|
||||
shaders_ = GetAllPostShaderInfo();
|
||||
std::vector<std::string> items;
|
||||
|
@ -487,8 +487,8 @@ void LogoScreen::render() {
|
|||
|
||||
::DrawBackground(dc, alpha);
|
||||
|
||||
I18NCategory *cr = GetI18NCategory("PSPCredits");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
auto gr = GetI18NCategory("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);
|
||||
|
@ -518,8 +518,8 @@ void LogoScreen::render() {
|
|||
|
||||
void CreditsScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *cr = GetI18NCategory("PSPCredits");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto cr = GetI18NCategory("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)));
|
||||
|
@ -589,7 +589,7 @@ UI::EventReturn CreditsScreen::OnDiscord(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn CreditsScreen::OnShare(UI::EventParams &e) {
|
||||
I18NCategory *cr = GetI18NCategory("PSPCredits");
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
System_SendMessage("sharetext", cr->T("CheckOutPPSSPP", "Check out PPSSPP, the awesome PSP emulator: http://www.ppsspp.org/"));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ void CreditsScreen::update() {
|
|||
void CreditsScreen::render() {
|
||||
UIScreen::render();
|
||||
|
||||
I18NCategory *cr = GetI18NCategory("PSPCredits");
|
||||
auto cr = GetI18NCategory("PSPCredits");
|
||||
|
||||
std::string specialthanksMaxim = "Maxim ";
|
||||
specialthanksMaxim += cr->T("specialthanksMaxim", "for his amazing Atrac3+ decoder work");
|
||||
|
|
|
@ -661,7 +661,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
|||
}
|
||||
|
||||
|
||||
I18NCategory *des = GetI18NCategory("DesktopUI");
|
||||
auto des = GetI18NCategory("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.
|
||||
|
@ -956,7 +956,7 @@ void TakeScreenshot() {
|
|||
if (success) {
|
||||
osm.Show(filename);
|
||||
} else {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
osm.Show(err->T("Could not save screenshot file"));
|
||||
}
|
||||
}
|
||||
|
@ -1105,7 +1105,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
|
|||
UIBackgroundInit(*uiContext);
|
||||
}
|
||||
if (msg == "savestate_displayslot") {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("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");
|
||||
|
@ -1119,7 +1119,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
|
|||
}
|
||||
if (msg == "core_powerSaving") {
|
||||
if (value != "false") {
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto sy = GetI18NCategory("System");
|
||||
#ifdef __ANDROID__
|
||||
osm.Show(sy->T("WARNING: Android battery save mode is on"), 2.0f, 0xFFFFFF, -1, true, "core_powerSaving");
|
||||
#else
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include "i18n/i18n.h"
|
||||
#include "gfx_es2/draw_buffer.h"
|
||||
#include "ui/view.h"
|
||||
|
@ -155,7 +156,7 @@ void AsyncImageFileView::Draw(UIContext &dc) {
|
|||
|
||||
class ScreenshotViewScreen : public PopupScreen {
|
||||
public:
|
||||
ScreenshotViewScreen(std::string filename, std::string title, int slot, I18NCategory *i18n)
|
||||
ScreenshotViewScreen(std::string filename, std::string title, int slot, std::shared_ptr<I18NCategory> i18n)
|
||||
: PopupScreen(title, i18n->T("Load State"), "Back"), filename_(filename), slot_(slot) {} // PopupScreen will translate Back on its own
|
||||
|
||||
int GetSlot() const {
|
||||
|
@ -232,7 +233,7 @@ SaveSlotView::SaveSlotView(const std::string &gameFilename, int slot, UI::Layout
|
|||
AsyncImageFileView *fv = Add(new AsyncImageFileView(screenshotFilename_, IS_DEFAULT, wq, new UI::LayoutParams(82 * 2, 47 * 2)));
|
||||
fv->SetOverlayText(StringFromFormat("%d", slot_ + 1));
|
||||
|
||||
I18NCategory *pa = GetI18NCategory("Pause");
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
|
||||
LinearLayout *buttons = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT));
|
||||
buttons->SetSpacing(2.0);
|
||||
|
@ -321,8 +322,8 @@ void GamePauseScreen::CreateViews() {
|
|||
using namespace UI;
|
||||
Margins scrollMargins(0, 20, 0, 0);
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
I18NCategory *pa = GetI18NCategory("Pause");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
|
@ -377,12 +378,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()) {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory("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) {
|
||||
I18NCategory *mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory("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);
|
||||
|
@ -421,7 +422,7 @@ UI::EventReturn GamePauseScreen::OnScreenshotClicked(UI::EventParams &e) {
|
|||
if (SaveState::HasSaveInSlot(gamePath_, slot)) {
|
||||
std::string fn = v->GetScreenshotFilename();
|
||||
std::string title = v->GetScreenshotTitle();
|
||||
I18NCategory *pa = GetI18NCategory("Pause");
|
||||
auto pa = GetI18NCategory("Pause");
|
||||
Screen *screen = new ScreenshotViewScreen(fn, title, v->GetSlot(), pa);
|
||||
screenManager()->push(screen);
|
||||
}
|
||||
|
@ -487,8 +488,8 @@ UI::EventReturn GamePauseScreen::OnCreateConfig(UI::EventParams &e)
|
|||
|
||||
UI::EventReturn GamePauseScreen::OnDeleteConfig(UI::EventParams &e)
|
||||
{
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ga = GetI18NCategory("Game");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ga = GetI18NCategory("Game");
|
||||
screenManager()->push(
|
||||
new PromptScreen(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)));
|
||||
|
|
|
@ -181,8 +181,8 @@ void RemoteISOScreen::update() {
|
|||
}
|
||||
|
||||
void RemoteISOScreen::CreateViews() {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ri = GetI18NCategory("RemoteISO");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
|
@ -276,8 +276,8 @@ RemoteISOConnectScreen::~RemoteISOConnectScreen() {
|
|||
}
|
||||
|
||||
void RemoteISOConnectScreen::CreateViews() {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ri = GetI18NCategory("RemoteISO");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
|
@ -300,7 +300,7 @@ void RemoteISOConnectScreen::CreateViews() {
|
|||
}
|
||||
|
||||
void RemoteISOConnectScreen::update() {
|
||||
I18NCategory *ri = GetI18NCategory("RemoteISO");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
|
||||
UIScreenWithBackground::update();
|
||||
|
||||
|
@ -412,8 +412,8 @@ RemoteISOBrowseScreen::RemoteISOBrowseScreen(const std::string &url, const std::
|
|||
void RemoteISOBrowseScreen::CreateViews() {
|
||||
bool vertical = UseVerticalLayout();
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *ri = GetI18NCategory("RemoteISO");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
|
||||
Margins actionMenuMargins(0, 10, 10, 0);
|
||||
|
||||
|
@ -478,7 +478,7 @@ void RemoteISOSettingsScreen::update() {
|
|||
}
|
||||
|
||||
void RemoteISOSettingsScreen::CreateViews() {
|
||||
I18NCategory *ri = GetI18NCategory("RemoteISO");
|
||||
auto ri = GetI18NCategory("RemoteISO");
|
||||
|
||||
ViewGroup *remoteisoSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
remoteisoSettingsScroll->SetTag("RemoteISOSettings");
|
||||
|
|
|
@ -66,7 +66,7 @@ RatingChoice::RatingChoice(const char *captionKey, int *value, LayoutParams *lay
|
|||
: LinearLayout(ORIENT_VERTICAL, layoutParams), value_(value) {
|
||||
SetSpacing(0.0f);
|
||||
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
group_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
Add(new TextView(rp->T(captionKey), FLAG_WRAP_TEXT, false))->SetShadow(true);
|
||||
Add(group_);
|
||||
|
@ -98,7 +98,7 @@ RatingChoice *RatingChoice::SetEnabledPtr(bool *ptr) {
|
|||
}
|
||||
|
||||
void RatingChoice::SetupChoices() {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
AddChoice(0, rp->T("Bad"));
|
||||
AddChoice(1, rp->T("OK"));
|
||||
AddChoice(2, rp->T("Great"));
|
||||
|
@ -146,7 +146,7 @@ CompatRatingChoice::CompatRatingChoice(const char *captionKey, int *value, Layou
|
|||
}
|
||||
|
||||
void CompatRatingChoice::SetupChoices() {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
group_->Clear();
|
||||
AddChoice(0, rp->T("Perfect"));
|
||||
AddChoice(1, rp->T("Plays"));
|
||||
|
@ -219,9 +219,9 @@ EventReturn ReportScreen::HandleReportingChange(EventParams &e) {
|
|||
}
|
||||
|
||||
void ReportScreen::CreateViews() {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto sy = GetI18NCategory("System");
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
|
@ -301,7 +301,7 @@ void ReportScreen::UpdateSubmit() {
|
|||
}
|
||||
|
||||
void ReportScreen::UpdateOverallDescription() {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
const char *desc;
|
||||
uint32_t c = 0xFFFFFFFF;
|
||||
switch (overall_) {
|
||||
|
@ -351,8 +351,8 @@ ReportFinishScreen::ReportFinishScreen(const std::string &gamePath, ReportingOve
|
|||
}
|
||||
|
||||
void ReportFinishScreen::CreateViews() {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
Margins actionMenuMargins(0, 20, 15, 0);
|
||||
Margins contentMargins(0, 20, 5, 5);
|
||||
|
@ -386,7 +386,7 @@ void ReportFinishScreen::CreateViews() {
|
|||
}
|
||||
|
||||
void ReportFinishScreen::update() {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
|
||||
if (!setStatus_) {
|
||||
Reporting::ReportStatus status = Reporting::GetStatus();
|
||||
|
@ -412,7 +412,7 @@ void ReportFinishScreen::update() {
|
|||
}
|
||||
|
||||
void ReportFinishScreen::ShowSuggestions() {
|
||||
I18NCategory *rp = GetI18NCategory("Reporting");
|
||||
auto rp = GetI18NCategory("Reporting");
|
||||
|
||||
auto suggestions = Reporting::CompatibilitySuggestions();
|
||||
if (score_ == ReportingOverallScore::PERFECT || score_ == ReportingOverallScore::PLAYABLE) {
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
LinearLayout *toprow = new LinearLayout(ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
content->Add(toprow);
|
||||
|
||||
I18NCategory *sa = GetI18NCategory("Savedata");
|
||||
auto sa = GetI18NCategory("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");
|
||||
|
@ -108,7 +108,7 @@ public:
|
|||
content->Add(new TextView(GetFileDateAsString(savePath_), 0, true, new LinearLayoutParams(Margins(10, 5))))->SetTextColor(textStyle.fgColor);
|
||||
}
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
LinearLayout *buttons = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
buttons->Add(new Button(di->T("Back"), new LinearLayoutParams(1.0)))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
buttons->Add(new Button(di->T("Delete"), new LinearLayoutParams(1.0)))->OnClick.Handle(this, &SavedataPopupScreen::OnDeleteButtonClick);
|
||||
|
@ -394,8 +394,8 @@ void SavedataBrowser::Refresh() {
|
|||
Clear();
|
||||
|
||||
Add(new Spacer(1.0f));
|
||||
I18NCategory *mm = GetI18NCategory("MainMenu");
|
||||
I18NCategory *sa = GetI18NCategory("Savedata");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
|
||||
SortedLinearLayout *gl = new SortedLinearLayout(UI::ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
gl->SetSpacing(4.0f);
|
||||
|
@ -458,8 +458,8 @@ SavedataScreen::~SavedataScreen() {
|
|||
|
||||
void SavedataScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
I18NCategory *sa = GetI18NCategory("Savedata");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto sa = GetI18NCategory("Savedata");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
std::string savedata_dir = GetSysDirectory(DIRECTORY_SAVEDATA);
|
||||
std::string savestate_dir = GetSysDirectory(DIRECTORY_SAVESTATE);
|
||||
|
||||
|
|
|
@ -240,8 +240,8 @@ void ProductView::CreateViews() {
|
|||
Add(new TextView(entry_.name));
|
||||
Add(new TextView(entry_.author));
|
||||
|
||||
I18NCategory *st = GetI18NCategory("Store");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto st = GetI18NCategory("Store");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
wasInstalled_ = IsGameInstalled();
|
||||
if (!wasInstalled_) {
|
||||
installButton_ = Add(new Button(st->T("Install")));
|
||||
|
@ -431,8 +431,8 @@ void StoreScreen::CreateViews() {
|
|||
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *st = GetI18NCategory("Store");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto st = GetI18NCategory("Store");
|
||||
|
||||
// Top bar
|
||||
LinearLayout *topBar = root_->Add(new LinearLayout(ORIENT_HORIZONTAL));
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
void TiltAnalogSettingsScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *co = GetI18NCategory("Controls");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
root_ = new ScrollView(ORIENT_VERTICAL);
|
||||
root_->SetTag("TiltAnalogSettings");
|
||||
|
|
|
@ -356,8 +356,8 @@ void TouchControlLayoutScreen::CreateViews() {
|
|||
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *co = GetI18NCategory("Controls");
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
|
@ -395,7 +395,7 @@ void TouchControlLayoutScreen::CreateViews() {
|
|||
// serves no other purpose.
|
||||
AnchorLayout *controlsHolder = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
I18NCategory *ms = GetI18NCategory("MainSettings");
|
||||
auto ms = GetI18NCategory("MainSettings");
|
||||
|
||||
//tabHolder->AddTab(ms->T("Controls"), controlsHolder);
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ private:
|
|||
void TouchControlVisibilityScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *co = GetI18NCategory("Controls");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
|
@ -91,7 +91,7 @@ void TouchControlVisibilityScreen::CreateViews() {
|
|||
toggles_.push_back({ "Alt speed 2", &g_Config.touchSpeed2Key.show, -1 });
|
||||
toggles_.push_back({ "Rapid Fire", &g_Config.touchRapidFireKey.show, -1 });
|
||||
|
||||
I18NCategory *mc = GetI18NCategory("MappableControls");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
|
||||
for (auto toggle : toggles_) {
|
||||
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
|
|
|
@ -135,7 +135,7 @@ void MainThreadFunc() {
|
|||
if (g_Config.sFailedGPUBackends.find("ALL") != std::string::npos) {
|
||||
Reporting::ReportMessage("Graphics init error: %s", "ALL");
|
||||
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
const char *defaultErrorAll = "Failed initializing any graphics. Try upgrading your graphics drivers.";
|
||||
const char *genericError = err->T("GenericAllGraphicsError", defaultErrorAll);
|
||||
std::wstring title = ConvertUTF8ToWString(err->T("GenericGraphicsError", "Graphics Error"));
|
||||
|
@ -163,7 +163,7 @@ void MainThreadFunc() {
|
|||
W32Util::ExitAndRestart();
|
||||
}
|
||||
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
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:";
|
||||
|
|
|
@ -142,7 +142,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?";
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
|
||||
std::wstring error;
|
||||
|
||||
|
|
|
@ -236,7 +236,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
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
auto err = GetI18NCategory("Error");
|
||||
|
||||
std::string glVersion = (const char *)glGetString(GL_VERSION);
|
||||
std::string glRenderer = (const char *)glGetString(GL_RENDERER);
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace MainWindow {
|
|||
}
|
||||
|
||||
void CreateHelpMenu(HMENU menu) {
|
||||
I18NCategory *des = GetI18NCategory("DesktopUI");
|
||||
auto des = GetI18NCategory("DesktopUI");
|
||||
|
||||
const std::wstring visitMainWebsite = ConvertUTF8ToWString(des->T("www.ppsspp.org"));
|
||||
const std::wstring visitForum = ConvertUTF8ToWString(des->T("PPSSPP Forums"));
|
||||
|
@ -171,7 +171,7 @@ namespace MainWindow {
|
|||
return false;
|
||||
}
|
||||
|
||||
I18NCategory *ps = GetI18NCategory("PostShaders");
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
|
||||
HMENU shaderMenu = GetSubmenuById(menu, ID_OPTIONS_SHADER_MENU);
|
||||
EmptySubMenu(shaderMenu);
|
||||
|
@ -202,7 +202,7 @@ namespace MainWindow {
|
|||
}
|
||||
|
||||
static void TranslateMenuItem(const HMENU hMenu, const int menuID, const std::wstring& accelerator = L"", const char *key = nullptr) {
|
||||
I18NCategory *des = GetI18NCategory("DesktopUI");
|
||||
auto des = GetI18NCategory("DesktopUI");
|
||||
|
||||
std::wstring translated;
|
||||
if (key == nullptr || !strcmp(key, "")) {
|
||||
|
@ -474,7 +474,7 @@ namespace MainWindow {
|
|||
}
|
||||
|
||||
static void setRenderingMode(int mode) {
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
|
||||
g_Config.iRenderingMode = mode;
|
||||
switch (g_Config.iRenderingMode) {
|
||||
|
@ -499,7 +499,7 @@ namespace MainWindow {
|
|||
g_Config.iFrameSkip = FRAMESKIP_OFF;
|
||||
}
|
||||
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
|
||||
std::ostringstream messageStream;
|
||||
messageStream << gr->T("Frame Skipping") << ":" << " ";
|
||||
|
@ -519,7 +519,7 @@ namespace MainWindow {
|
|||
g_Config.iFrameSkipType = 0;
|
||||
}
|
||||
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
|
||||
std::ostringstream messageStream;
|
||||
messageStream << gr->T("Frame Skipping Type") << ":" << " ";
|
||||
|
@ -553,7 +553,7 @@ namespace MainWindow {
|
|||
void MainWindowMenu_Process(HWND hWnd, WPARAM wParam) {
|
||||
std::string fn;
|
||||
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
auto gr = GetI18NCategory("Graphics");
|
||||
|
||||
int wmId = LOWORD(wParam);
|
||||
int wmEvent = HIWORD(wParam);
|
||||
|
|
|
@ -297,7 +297,7 @@ void System_SendMessage(const char *command, const char *parameter) {
|
|||
} else if (!strcmp(command, "browse_file")) {
|
||||
MainWindow::BrowseAndBoot("");
|
||||
} else if (!strcmp(command, "browse_folder")) {
|
||||
I18NCategory *mm = GetI18NCategory("MainMenu");
|
||||
auto mm = GetI18NCategory("MainMenu");
|
||||
std::string folder = W32Util::BrowseForFolder(MainWindow::GetHWND(), mm->T("Choose folder"));
|
||||
if (folder.size())
|
||||
NativeMessageReceived("browse_folderSelect", folder.c_str());
|
||||
|
|
|
@ -15,7 +15,7 @@ std::string I18NRepo::LanguageID() {
|
|||
|
||||
void I18NRepo::Clear() {
|
||||
for (auto iter = cats_.begin(); iter != cats_.end(); ++iter) {
|
||||
delete iter->second;
|
||||
iter->second.reset();
|
||||
}
|
||||
cats_.clear();
|
||||
}
|
||||
|
@ -52,14 +52,14 @@ void I18NCategory::SetMap(const std::map<std::string, std::string> &m) {
|
|||
}
|
||||
}
|
||||
|
||||
I18NCategory *I18NRepo::GetCategory(const char *category) {
|
||||
std::shared_ptr<I18NCategory> I18NRepo::GetCategory(const char *category) {
|
||||
auto iter = cats_.find(category);
|
||||
if (iter != cats_.end()) {
|
||||
return iter->second;
|
||||
} else {
|
||||
I18NCategory *c = new I18NCategory(this, category);
|
||||
cats_[category] = c;
|
||||
return c;
|
||||
cats_[category].reset(c);
|
||||
return cats_[category];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ bool I18NRepo::LoadIni(const std::string &languageID, const std::string &overrid
|
|||
|
||||
for (auto iter = sections.begin(); iter != sections.end(); ++iter) {
|
||||
if (iter->name() != "") {
|
||||
cats_[iter->name()] = LoadSection(&(*iter), iter->name().c_str());
|
||||
cats_[iter->name()].reset(LoadSection(&(*iter), iter->name().c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ void I18NRepo::SaveIni(const std::string &languageID) {
|
|||
ini.Save(GetIniPath(languageID));
|
||||
}
|
||||
|
||||
void I18NRepo::SaveSection(IniFile &ini, IniFile::Section *section, I18NCategory *cat) {
|
||||
void I18NRepo::SaveSection(IniFile &ini, IniFile::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) {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
// As usual, everything is UTF-8. Nothing else allowed.
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
@ -76,7 +77,7 @@ public:
|
|||
|
||||
std::string LanguageID();
|
||||
|
||||
I18NCategory *GetCategory(const char *categoryName);
|
||||
std::shared_ptr<I18NCategory> GetCategory(const char *categoryName);
|
||||
bool HasCategory(const char *categoryName) const {
|
||||
return cats_.find(categoryName) != cats_.end();
|
||||
}
|
||||
|
@ -86,9 +87,9 @@ private:
|
|||
std::string GetIniPath(const std::string &languageID) const;
|
||||
void Clear();
|
||||
I18NCategory *LoadSection(const IniFile::Section *section, const char *name);
|
||||
void SaveSection(IniFile &ini, IniFile::Section *section, I18NCategory *cat);
|
||||
void SaveSection(IniFile &ini, IniFile::Section *section, std::shared_ptr<I18NCategory> cat);
|
||||
|
||||
std::map<std::string, I18NCategory *> cats_;
|
||||
std::map<std::string, std::shared_ptr<I18NCategory>> cats_;
|
||||
std::string languageID_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(I18NRepo);
|
||||
|
@ -98,7 +99,7 @@ extern I18NRepo i18nrepo;
|
|||
|
||||
// These are simply talking to the one global instance of I18NRepo.
|
||||
|
||||
inline I18NCategory *GetI18NCategory(const char *categoryName) {
|
||||
inline std::shared_ptr<I18NCategory> GetI18NCategory(const char *categoryName) {
|
||||
if (!categoryName)
|
||||
return nullptr;
|
||||
return i18nrepo.GetCategory(categoryName);
|
||||
|
|
|
@ -233,7 +233,7 @@ UI::EventReturn UIScreen::OnCancel(UI::EventParams &e) {
|
|||
|
||||
PopupScreen::PopupScreen(std::string title, std::string button1, std::string button2)
|
||||
: box_(0), defaultButton_(nullptr), title_(title) {
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
if (!button1.empty())
|
||||
button1_ = di->T(button1.c_str());
|
||||
if (!button2.empty())
|
||||
|
@ -427,7 +427,7 @@ std::string ChopTitle(const std::string &title) {
|
|||
UI::EventReturn PopupMultiChoice::HandleClick(UI::EventParams &e) {
|
||||
restoreFocus_ = HasFocus();
|
||||
|
||||
I18NCategory *category = category_ ? GetI18NCategory(category_) : nullptr;
|
||||
auto category = category_ ? GetI18NCategory(category_) : nullptr;
|
||||
|
||||
std::vector<std::string> choices;
|
||||
for (int i = 0; i < numChoices_; i++) {
|
||||
|
@ -450,7 +450,7 @@ void PopupMultiChoice::Update() {
|
|||
void PopupMultiChoice::UpdateText() {
|
||||
if (!choices_)
|
||||
return;
|
||||
I18NCategory *category = GetI18NCategory(category_);
|
||||
auto category = GetI18NCategory(category_);
|
||||
// Clamp the value to be safe.
|
||||
if (*value_ < minVal_ || *value_ > minVal_ + numChoices_ - 1) {
|
||||
valueText_ = "(invalid choice)"; // Shouldn't happen. Should be no need to translate this.
|
||||
|
@ -865,7 +865,7 @@ void ChoiceWithValueDisplay::Draw(UIContext &dc) {
|
|||
int paddingX = 12;
|
||||
dc.SetFontStyle(dc.theme->uiFont);
|
||||
|
||||
I18NCategory *category = GetI18NCategory(category_);
|
||||
auto category = GetI18NCategory(category_);
|
||||
std::ostringstream valueText;
|
||||
if (translateCallback_ && sValue_) {
|
||||
valueText << translateCallback_(sValue_->c_str());
|
||||
|
|
Loading…
Add table
Reference in a new issue