From 2414db5d62ac86d3ab05253087ef7e20d4366105 Mon Sep 17 00:00:00 2001 From: Croden1999 <851577088@qq.com> Date: Thu, 19 Sep 2024 19:32:57 +0800 Subject: [PATCH] gui: Update and fixed some issues. - gui/control_dialog: Add lang strings and improve the interface. - gui/settings_dialog: Fixed missing ua user language. - gui, gui/lang: Update lang strings and xml files. --- lang/system/en-gb.xml | 29 ++++++++++++++++ lang/system/en.xml | 29 ++++++++++++++++ lang/system/zh-s.xml | 29 ++++++++++++++++ lang/system/zh-t.xml | 29 ++++++++++++++++ vita3k/gui/src/about_dialog.cpp | 2 +- vita3k/gui/src/app_context_menu.cpp | 2 +- vita3k/gui/src/controllers_dialog.cpp | 2 +- vita3k/gui/src/controls_dialog.cpp | 48 +++++++++++++++++---------- vita3k/gui/src/initial_setup.cpp | 2 +- vita3k/gui/src/live_area.cpp | 2 ++ vita3k/gui/src/main_menubar.cpp | 2 +- vita3k/gui/src/settings_dialog.cpp | 30 ++++++++--------- vita3k/gui/src/user_management.cpp | 2 ++ vita3k/gui/src/welcome_dialog.cpp | 2 +- vita3k/lang/include/lang/state.h | 28 ++++++++++++++++ vita3k/lang/src/lang.cpp | 3 ++ 16 files changed, 201 insertions(+), 40 deletions(-) diff --git a/lang/system/en-gb.xml b/lang/system/en-gb.xml index bca70f483..00928830e 100644 --- a/lang/system/en-gb.xml +++ b/lang/system/en-gb.xml @@ -38,6 +38,7 @@ Vita3K: a PS Vita/PS TV Emulator. The world's first functional PS Vita/PS TV emulator. + If you did not download this emulator from Vita3K's official discord, paid for it or it contains ads, uninstall it immediatly. Vita3K is an experimental open-source PlayStation Vita/PlayStation TV emulator written in C++ for Windows, Linux, macOS and Android operating systems. Special credit: The Vita3K icon was designed by: If you're interested in contributing, check out our: @@ -67,6 +68,7 @@ License Shaders Cache Shaders Log + Create Shortcut Manual Update Update History @@ -297,6 +299,7 @@ Connect a controller that is compatible with SDL2. Red Green Blue + Using builtin device motion sensors Reset Controller Binding @@ -526,6 +529,18 @@ Check vita3k.log to see console output for details. 3. If you want to install or boot Vitamin, it is not supported. + + Gamepad Overlay + Show gamepad overlay ingame + Hide Gamepad Overlay + Modify Gamepad Overlay + Overlay Scale + Overlay Opacity + Reset Gamepad + Show front/back touchscreen switch button. + L2/R2 triggers will be displayed only if PSTV mode is enabled. + + Avg Min @@ -618,6 +633,8 @@ Please download and install the last PS Vita firmware. Select your preferred backend renderer. GPU (Reboot to apply) Select the GPU Vita3K should run on. + Add custom driver + Remove custom driver Standard High Renderer Accuracy @@ -651,6 +668,16 @@ It has no drawback but can impact performance.Use Shader Cache Check the box to enable shader cache to pre-compile it at game startup. Uncheck to disable this feature. + Disabled + Double buffer + External host + Page table + Native buffer + Memory mapping method + Memory mapping improved performances, reduces memory usage and fixes many graphical issues. +However, it may be unstable on some GPUs. + Enable Turbo Mode + Provides a way to force the GPU to run at the maximum possible clocks (thermal constraints will still be applied). Use Spir-V Shader (deprecated) Pass generated Spir-V shader directly to driver. Note that some beneficial extensions will be disabled, @@ -734,6 +761,7 @@ You will need to move your old folder to the new location manually.Reset Emulator Path Reset Vita3K emulator path to the default. You will need to move your old folder to the new location manually. + Using a different path requires additional permissions Custom Config Settings Clear Custom Config @@ -896,6 +924,7 @@ After the download is complete, Vita3K will restart automatically and then insta + This emulator is free and was distributed on Vita3K's official discord. If you did not download this application from Vita3K's discord, paid for it or it has ads, consider uninstalling it immediately for your own safety. Vita3K PlayStation Vita Emulator Vita3K is an open-source PlayStation Vita emulator written in C++ for Windows, Linux, macOS and Android. The emulator is still in its development stages so any feedback and testing is greatly appreciated. diff --git a/lang/system/en.xml b/lang/system/en.xml index bca70f483..00928830e 100644 --- a/lang/system/en.xml +++ b/lang/system/en.xml @@ -38,6 +38,7 @@ Vita3K: a PS Vita/PS TV Emulator. The world's first functional PS Vita/PS TV emulator. + If you did not download this emulator from Vita3K's official discord, paid for it or it contains ads, uninstall it immediatly. Vita3K is an experimental open-source PlayStation Vita/PlayStation TV emulator written in C++ for Windows, Linux, macOS and Android operating systems. Special credit: The Vita3K icon was designed by: If you're interested in contributing, check out our: @@ -67,6 +68,7 @@ License Shaders Cache Shaders Log + Create Shortcut Manual Update Update History @@ -297,6 +299,7 @@ Connect a controller that is compatible with SDL2. Red Green Blue + Using builtin device motion sensors Reset Controller Binding @@ -526,6 +529,18 @@ Check vita3k.log to see console output for details. 3. If you want to install or boot Vitamin, it is not supported. + + Gamepad Overlay + Show gamepad overlay ingame + Hide Gamepad Overlay + Modify Gamepad Overlay + Overlay Scale + Overlay Opacity + Reset Gamepad + Show front/back touchscreen switch button. + L2/R2 triggers will be displayed only if PSTV mode is enabled. + + Avg Min @@ -618,6 +633,8 @@ Please download and install the last PS Vita firmware. Select your preferred backend renderer. GPU (Reboot to apply) Select the GPU Vita3K should run on. + Add custom driver + Remove custom driver Standard High Renderer Accuracy @@ -651,6 +668,16 @@ It has no drawback but can impact performance.Use Shader Cache Check the box to enable shader cache to pre-compile it at game startup. Uncheck to disable this feature. + Disabled + Double buffer + External host + Page table + Native buffer + Memory mapping method + Memory mapping improved performances, reduces memory usage and fixes many graphical issues. +However, it may be unstable on some GPUs. + Enable Turbo Mode + Provides a way to force the GPU to run at the maximum possible clocks (thermal constraints will still be applied). Use Spir-V Shader (deprecated) Pass generated Spir-V shader directly to driver. Note that some beneficial extensions will be disabled, @@ -734,6 +761,7 @@ You will need to move your old folder to the new location manually.Reset Emulator Path Reset Vita3K emulator path to the default. You will need to move your old folder to the new location manually. + Using a different path requires additional permissions Custom Config Settings Clear Custom Config @@ -896,6 +924,7 @@ After the download is complete, Vita3K will restart automatically and then insta + This emulator is free and was distributed on Vita3K's official discord. If you did not download this application from Vita3K's discord, paid for it or it has ads, consider uninstalling it immediately for your own safety. Vita3K PlayStation Vita Emulator Vita3K is an open-source PlayStation Vita emulator written in C++ for Windows, Linux, macOS and Android. The emulator is still in its development stages so any feedback and testing is greatly appreciated. diff --git a/lang/system/zh-s.xml b/lang/system/zh-s.xml index 68e1eb206..7bcfb6582 100644 --- a/lang/system/zh-s.xml +++ b/lang/system/zh-s.xml @@ -38,6 +38,7 @@ Vita3K:PS Vita/PS TV模拟器,是全球首个实用的PS Vita/PS TV模拟器。 + 如果您没有从Vita3K的官方Discord下载此模拟器,是付费购买或含有广告,请立即卸载它。 Vita3K是使用C++编写的实验性开源PlayStation Vita/PlayStation TV模拟器,适用于Windows、Linux、macOS以及Android操作系统。 特别鸣谢:Vita3K图标设计由: 如果您有兴趣参与贡献,请浏览我们的: @@ -67,6 +68,7 @@ 授权 着色器缓存 着色器日志 + 创建快捷方式 说明书 升级 更新历史记录 @@ -296,6 +298,7 @@ 绿 + 使用内置设备传感器 重置控制器绑定 @@ -524,6 +527,18 @@ 3、如果您想要安装/运行Vitamin是不支持的。 + + 手柄虚拟按键 + 在游戏中显示手柄虚拟按键 + 隐藏手柄虚拟按键 + 修改手柄虚拟按键 + 虚拟按键缩放 + 虚拟按键不透明度 + 重置手柄布局 + 显示前/后触屏切换按键。 + 仅当启用PSTV模式时,才会显示L2/R2键。 + + 平均 最低 @@ -616,6 +631,8 @@ 选择您喜欢的后端渲染器。 GPU(重启后应用) 选择在Vita3K应运行的GPU。 + 添加自定义驱动 + 移除自定义驱动 标准 渲染精度 @@ -649,6 +666,16 @@ 使用着色器缓存 勾选此项以启用着色器缓存以在游戏启动时对其进行预编译。 取消勾选则禁用该功能。 + 禁用 + 双重缓冲 + 外部主机 + 页表 + 原生缓冲 + 内存映射方式 + 内存映射提高了性能,减少了内存使用量,并修复了许多图形问题。 +但是它在某些GPU上可能不稳定。 + 启用睿频模式 + 提供了一种方法来强制GPU运行在最大合理的频率(温控仍然适用)。 使用Spir-V着色器(已弃用) 将生成的Spir-V着色器直接传递给驱动程序。 请注意,一些有益的扩展功能将被禁用, @@ -731,6 +758,7 @@ 重置模拟器路径 重置Vita3K模拟器为默认路径。 您需要手动将旧文件夹移动到新位置。 + 使用不同路径需要额外权限 自定义配置设置 清除自定义配置 @@ -892,6 +920,7 @@ + 此模拟器是免费的,并在Vita3K的官方Discord上发布。如果您没有从Vita3K的Discord下载此应用程序,是付费购买或含有广告,请考虑立即卸载它以确保您自己的安全。 Vita3K PlayStation Vita模拟器 Vita3K是使用C++编写的开源PlayStation Vita模拟器,适用于Windows、Linux、macOS以及Android。 目前模拟器仍处于开发阶段,因此非常感谢任何反馈和测试。 diff --git a/lang/system/zh-t.xml b/lang/system/zh-t.xml index c9b9f78dd..8ac88aad5 100644 --- a/lang/system/zh-t.xml +++ b/lang/system/zh-t.xml @@ -38,6 +38,7 @@ Vita3K:PS Vita/PS TV模擬器,是全球首個實用的PS Vita/PS TV模擬器。 + 如果您沒有從Vita3K的官方Discord下載此模擬器,是付費購買或包含廣告,請立即卸載它。 Vita3K是使用C++編寫的實驗性開源PlayStation Vita/PlayStation TV模擬器,適用於Windows、Linux、macOS以及Android作業系統。 特別鳴謝:Vita3K圖標設計由: 如果您有興趣參與貢獻,請瀏覽我們的: @@ -67,6 +68,7 @@ 授權 著色器快取 著色器記錄 + 建立快捷方式 說明書 更新 更新履歷 @@ -296,6 +298,7 @@ + 使用內置設備傳感器 重設控制器綁定 @@ -524,6 +527,18 @@ 3、如果您想要安裝/運行Vitamin是不支援的。 + + 手把虛擬按鈕 + 在遊戲中顯示手把虛擬按鈕 + 隱藏手把虛擬按鈕 + 修改手把虛擬按鈕 + 虛擬按鈕縮放 + 虛擬按鈕不透明度 + 重設手把佈局 + 顯示前/後觸屏切換按鈕。 + 僅當啟用PSTV模式時,才會顯示L2/R2按鈕。 + + 平均 最低 @@ -616,6 +631,8 @@ 選擇您喜歡的後端渲染器。 GPU(重啟后應用) 選擇在Vita3K應運行的GPU。 + 添加自訂驅動 + 移除自訂驅動 標準 渲染精度 @@ -649,6 +666,16 @@ 使用著色器快取 勾選此項啟用著色器快取以在遊戲啟動時對其進行預編譯。 取消勾選則禁用該功能。 + 禁用 + 雙重緩衝 + 外部主機 + 頁表 + 原生緩衝 + 內存映射方式 + 內存映射提高了性能,減少內存使用量,並修復了許多圖形問題。 +但是它在某些GPU上可能不穩定。 + 啟用睿頻模式 + 提供了一種方法提來强制GPU運行在最大合理的頻率(溫控仍然適用)。 使用Spir-V著色器(已棄用) 將生成的Spir-V著色器直接傳遞給驅動程式。 請注意,一些有益的擴展功能將被禁用, @@ -731,6 +758,7 @@ 重置模擬器路徑 重置Vita3K模擬器為默認路徑。 您需要手動將舊資料夾移動到默認位置。 + 使用不同路徑需要額外權限 自訂組態設定 清除自訂組態 @@ -892,6 +920,7 @@ + 此模擬器是免費的,並在Vita3K的官方Discord上發佈。如果您沒有從Vita3K的Discord下載此應用程式,是付費購買或含有廣告,請考慮立即卸載它以確保您自己的安全。 Vita3K PlayStation Vita模擬器 Vita3K是使用C++編寫的開源PlayStation Vita模擬器,適用於Windows、Linux、macOS以及Android。 目前模擬器仍處於開發階段,因此非常感謝任何回饋和測試。 diff --git a/vita3k/gui/src/about_dialog.cpp b/vita3k/gui/src/about_dialog.cpp index 954e195c5..55508ec04 100644 --- a/vita3k/gui/src/about_dialog.cpp +++ b/vita3k/gui/src/about_dialog.cpp @@ -81,7 +81,7 @@ void draw_about_dialog(GuiState &gui, EmuEnvState &emuenv) { ImGui::Text("%s", lang["vita3k"].c_str()); #ifdef ANDROID ImGui::Spacing(); - ImGui::TextWrapped("%s", "If you did not download this emulator from Vita3K's official discord, paid for it or it contains ads, uninstall it immediatly."); + ImGui::TextWrapped("%s", lang["for_android"].c_str()); #endif ImGui::Spacing(); ImGui::TextWrapped("%s", lang["about_vita3k"].c_str()); diff --git a/vita3k/gui/src/app_context_menu.cpp b/vita3k/gui/src/app_context_menu.cpp index f706ad3ea..69f3e2675 100644 --- a/vita3k/gui/src/app_context_menu.cpp +++ b/vita3k/gui/src/app_context_menu.cpp @@ -517,7 +517,7 @@ void draw_app_context_menu(GuiState &gui, EmuEnvState &emuenv, const std::string ImGui::EndMenu(); } #else - if(ImGui::MenuItem("Create Shortcut")){ + if(ImGui::MenuItem(lang.main["create_shortcut"].c_str())){ create_shortcut(title_id, APP_INDEX->title); } #endif diff --git a/vita3k/gui/src/controllers_dialog.cpp b/vita3k/gui/src/controllers_dialog.cpp index 5f04c89b1..0a6097626 100644 --- a/vita3k/gui/src/controllers_dialog.cpp +++ b/vita3k/gui/src/controllers_dialog.cpp @@ -382,7 +382,7 @@ void draw_controllers_dialog(GuiState &gui, EmuEnvState &emuenv) { } else if (emuenv.motion.has_device_motion_support){ ImGui::Spacing(); ImGui::PushTextWrapPos(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.f)); - ImGui::TextColored(GUI_COLOR_TEXT_TITLE, "%s", "Using builtin device motion sensors"); + ImGui::TextColored(GUI_COLOR_TEXT_TITLE, "%s", lang["motion_sensors"].c_str()); ImGui::PopTextWrapPos(); } diff --git a/vita3k/gui/src/controls_dialog.cpp b/vita3k/gui/src/controls_dialog.cpp index c9aa4ffd3..d191e4133 100644 --- a/vita3k/gui/src/controls_dialog.cpp +++ b/vita3k/gui/src/controls_dialog.cpp @@ -116,44 +116,47 @@ void set_controller_overlay_opacity(int opacity) { } void draw_controls_dialog(GuiState &gui, EmuEnvState &emuenv) { - static bool overlay_editing = false; - const ImVec2 display_size(emuenv.viewport_size.x, emuenv.viewport_size.y); const auto RES_SCALE = ImVec2(display_size.x / emuenv.res_width_dpi_scale, display_size.y / emuenv.res_height_dpi_scale); - ImGui::SetNextWindowPos(ImVec2(display_size.x / 2.f, display_size.y / 2.f), ImGuiCond_Always, ImVec2(0.5f, 0.5f)); - ImGui::Begin("Overlay", &gui.controls_menu.controls_dialog, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::SetWindowFontScale(RES_SCALE.x); + static const auto BUTTON_SIZE = ImVec2(120.f * emuenv.dpi_scale, 0.f); - if (!gui.controls_menu.controls_dialog) { - set_controller_overlay_state(0); - overlay_editing = false; - } + auto &lang = gui.lang.overlay; + auto &common = emuenv.common_dialog.lang.common; + static bool overlay_editing = false; + ImGui::SetNextWindowPos(ImVec2(display_size.x / 2.f, display_size.y / 2.f), ImGuiCond_Always, ImVec2(0.5f, 0.5f)); + ImGui::Begin("##overlay", &gui.controls_menu.controls_dialog, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize); + ImGui::SetWindowFontScale(RES_SCALE.x); + auto title_str = lang["title"].c_str(); + ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - (ImGui::CalcTextSize(title_str).x / 2.f)); + ImGui::TextColored(GUI_COLOR_TEXT_TITLE, "%s", title_str); + ImGui::Spacing(); + ImGui::Separator(); ImGui::Spacing(); - const auto gmpd = ImGui::CalcTextSize("Gamepad Overlay").x; + const auto gmpd = ImGui::CalcTextSize(lang["gamepad_overlay"].c_str()).x; ImGui::SetCursorPosX((ImGui::GetWindowWidth() / 2.f) - (gmpd / 2.f)); - ImGui::TextColored(GUI_COLOR_TEXT_MENUBAR, "Gamepad Overlay"); + ImGui::TextColored(GUI_COLOR_TEXT_MENUBAR, "%s", lang["gamepad_overlay"].c_str()); ImGui::Spacing(); - if (ImGui::Checkbox("Show gamepad overlay ingame", &emuenv.cfg.enable_gamepad_overlay)) + if (ImGui::Checkbox(lang["enable_gamepad_overlay"].c_str(), &emuenv.cfg.enable_gamepad_overlay)) config::serialize_config(emuenv.cfg, emuenv.cfg.config_path); - const char *overlay_edit_text = overlay_editing ? "Hide Gamepad Overlay" : "Modify Gamepad Overlay"; + const char *overlay_edit_text = overlay_editing ? lang["hide_gamepad_overlay"].c_str() : lang["modify_gamepad_overlay"].c_str(); if (ImGui::Button(overlay_edit_text)) { overlay_editing = !overlay_editing; set_controller_overlay_state(overlay_editing ? get_overlay_display_mask(emuenv.cfg) : 0, overlay_editing); } ImGui::Spacing(); - if (overlay_editing && ImGui::SliderFloat("Overlay scale", &emuenv.cfg.overlay_scale, 0.25f, 4.0f, "%.3f", ImGuiSliderFlags_NoInput | ImGuiSliderFlags_NoRoundToFormat | ImGuiSliderFlags_Logarithmic)) { + if (overlay_editing && ImGui::SliderFloat(lang["overlay_scale"].c_str(), &emuenv.cfg.overlay_scale, 0.25f, 4.0f, "%.3f", ImGuiSliderFlags_NoInput | ImGuiSliderFlags_NoRoundToFormat | ImGuiSliderFlags_Logarithmic)) { set_controller_overlay_scale(emuenv.cfg.overlay_scale); config::serialize_config(emuenv.cfg, emuenv.cfg.config_path); } ImGui::Spacing(); - if (overlay_editing && ImGui::SliderInt("Overlay opacity", &emuenv.cfg.overlay_opacity, 0, 100, "%d%%")) { + if (overlay_editing && ImGui::SliderInt(lang["overlay_opacity"].c_str(), &emuenv.cfg.overlay_opacity, 0, 100, "%d%%")) { set_controller_overlay_opacity(emuenv.cfg.overlay_opacity); config::serialize_config(emuenv.cfg, emuenv.cfg.config_path); } - if (overlay_editing && ImGui::Button("Reset Gamepad")) { + if (overlay_editing && ImGui::Button(lang["reset_gamepad"].c_str())) { set_controller_overlay_state(get_overlay_display_mask(emuenv.cfg), true, true); emuenv.cfg.overlay_scale = 1.0f; emuenv.cfg.overlay_opacity = 100; @@ -163,11 +166,20 @@ void draw_controls_dialog(GuiState &gui, EmuEnvState &emuenv) { } ImGui::Spacing(); ImGui::Separator(); - if(emuenv.cfg.enable_gamepad_overlay && ImGui::Checkbox("Show front/back touchscreen switch button.", &emuenv.cfg.overlay_show_touch_switch)){ + if (emuenv.cfg.enable_gamepad_overlay && ImGui::Checkbox(lang["overlay_show_touch_switch"].c_str(), &emuenv.cfg.overlay_show_touch_switch)) { config::serialize_config(emuenv.cfg, emuenv.cfg.config_path); set_controller_overlay_state(get_overlay_display_mask(emuenv.cfg), overlay_editing); } - ImGui::Text("L2/R2 triggers will be displayed only if PSTV mode is enabled."); + ImGui::Text("%s", lang["l2_r2_triggers"].c_str()); + ImGui::Spacing(); + ImGui::Separator(); + ImGui::Spacing(); + ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - (BUTTON_SIZE.x / 2.f)); + if (ImGui::Button(common["close"].c_str(), BUTTON_SIZE)) { + set_controller_overlay_state(0); + overlay_editing = false; + gui.controls_menu.controls_dialog = false; + } ImGui::End(); } diff --git a/vita3k/gui/src/initial_setup.cpp b/vita3k/gui/src/initial_setup.cpp index a5918a77a..2efadf9dd 100644 --- a/vita3k/gui/src/initial_setup.cpp +++ b/vita3k/gui/src/initial_setup.cpp @@ -105,7 +105,7 @@ void draw_initial_setup(GuiState &gui, EmuEnvState &emuenv) { ImGui::SetCursorPosY(94.f * SCALE.y); ImGui::Separator(); #ifdef ANDROID - const char* path_warning = "Using a different path requires additional permissions"; + const char* path_warning = gui.lang.settings_dialog.emulator["storage_folder_permissions"].c_str(); #endif switch (setup) { case SELECT_LANGUAGE: diff --git a/vita3k/gui/src/live_area.cpp b/vita3k/gui/src/live_area.cpp index 9b8756c43..b8ed254a6 100644 --- a/vita3k/gui/src/live_area.cpp +++ b/vita3k/gui/src/live_area.cpp @@ -1167,7 +1167,9 @@ void draw_live_area_screen(GuiState &gui, EmuEnvState &emuenv) { ImGui::TextColored(col, "%s", str); ImGui::Spacing(); }; +#ifndef ANDROID TextColoredCentered(gui, GUI_COLOR_TEXT, "control_setting"); +#endif if (gui.modules.empty()) TextColoredCentered(gui, GUI_COLOR_TEXT, "firmware_not_detected"); if (!gui.fw_font) diff --git a/vita3k/gui/src/main_menubar.cpp b/vita3k/gui/src/main_menubar.cpp index 0667c08e4..312663853 100644 --- a/vita3k/gui/src/main_menubar.cpp +++ b/vita3k/gui/src/main_menubar.cpp @@ -139,7 +139,7 @@ static void draw_controls_menu(GuiState &gui) { auto &lang = gui.lang.main_menubar.controls; if (ImGui::BeginMenu(lang["title"].c_str())) { #ifdef ANDROID - const char *controls_name = "Overlay"; + const char *controls_name = gui.lang.overlay["title"].c_str(); #else const char *controls_name = lang["keyboard_controls"].c_str(); #endif diff --git a/vita3k/gui/src/settings_dialog.cpp b/vita3k/gui/src/settings_dialog.cpp index 8a9cd014c..5aa8b64d1 100644 --- a/vita3k/gui/src/settings_dialog.cpp +++ b/vita3k/gui/src/settings_dialog.cpp @@ -278,6 +278,7 @@ void init_config(GuiState &gui, EmuEnvState &emuenv, const std::string &app_path // files are not in a folder list_user_lang.push_back("id"); list_user_lang.push_back("ms"); + list_user_lang.push_back("ua"); #endif current_user_lang = emuenv.cfg.user_lang.empty() ? 0 : (vector_utils::find_index(list_user_lang, emuenv.cfg.user_lang) + 1); @@ -670,7 +671,7 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { if (emuenv.cfg.gpu_idx == 0) config.custom_driver_name = ""; - if (ImGui::Button("Add custom driver")) { + if (ImGui::Button(lang.gpu["add_custom_driver"].c_str())) { app::add_custom_driver(emuenv); // also set it to stock after emuenv.cfg.gpu_idx = 0; @@ -681,7 +682,7 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { config.custom_driver_name = gpu_list_str[emuenv.cfg.gpu_idx]; ImGui::SameLine(); - if (ImGui::Button("Remove custom driver")) { + if (ImGui::Button(lang.gpu["remove_custom_driver"].c_str())) { app::remove_custom_driver(emuenv, config.custom_driver_name); // set back to stock emuenv.cfg.gpu_idx = 0; @@ -878,11 +879,11 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { ImGui::BeginDisabled(); std::vector mapping_methods_strings = { - "Disabled", - "Double buffer", - "External host", - "Page table", - "Native buffer" + lang.gpu["disabled"].c_str(), + lang.gpu["double_buffer"].c_str(), + lang.gpu["external_host"].c_str(), + lang.gpu["page_table"].c_str(), + lang.gpu["native_buffer"].c_str() }; std::vector mapping_methods_indexes = { "disabled", @@ -907,9 +908,7 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { if (ImGui::Combo(lang.gpu["mapping_method"].c_str(), ¤t_mapping, mapping_methods_strings.data(), mapping_methods_strings.size())) { config.memory_mapping = mapping_methods_indexes[current_mapping]; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("%s", lang.gpu["mapping_method_description"].c_str()); - } + SetTooltipEx(lang.gpu["mapping_method_description"].c_str()); if (is_ingame) ImGui::EndDisabled(); @@ -917,11 +916,8 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { if (emuenv.renderer->support_custom_drivers()) { ImGui::Spacing(); - ImGui::Checkbox("Enable Turbo Mode", &emuenv.cfg.turbo_mode); - - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Provides a way to force the GPU to run at the maximum possible clocks (thermal constraints will still be applied)"); - } + ImGui::Checkbox(lang.gpu["turbo_mode"].c_str(), &emuenv.cfg.turbo_mode); + SetTooltipEx(lang.gpu["turbo_mode_description"].c_str()); } // Shaders @@ -1053,9 +1049,11 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", lang.emulator["log_compat_warn_description"].c_str()); ImGui::Spacing(); +#ifndef ANDROID ImGui::Checkbox(lang.emulator["check_for_updates"].c_str(), &emuenv.cfg.check_for_updates); if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", lang.emulator["check_for_updates_description"].c_str()); +#endif ImGui::Separator(); const auto perfomance_overley_size = ImGui::CalcTextSize(lang.emulator["performance_overlay"].c_str()).x; ImGui::SetCursorPosX((ImGui::GetWindowWidth() / 2.f) - (perfomance_overley_size / 2.f)); @@ -1110,7 +1108,7 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { ImGui::Spacing(); #ifdef ANDROID - ImGui::TextColored(GUI_COLOR_TEXT, "%s", "Using a different path requires additional permissions"); + ImGui::TextColored(GUI_COLOR_TEXT, "%s", lang.emulator["storage_folder_permissions"].c_str()); ImGui::Spacing(); #endif ImGui::Separator(); diff --git a/vita3k/gui/src/user_management.cpp b/vita3k/gui/src/user_management.cpp index 50a8eeb8c..920e3de03 100644 --- a/vita3k/gui/src/user_management.cpp +++ b/vita3k/gui/src/user_management.cpp @@ -616,11 +616,13 @@ void draw_user_management(GuiState &gui, EmuEnvState &emuenv) { if ((user_item_rect_half > HALF_SIZE_USER) || (user_item_rect_half < HALF_SIZE_USER)) ImGui::SetScrollHereX(0.5f); } +#ifndef ANDROID if (ImGui::BeginPopupContextItem("##user_context_menu")) { if (ImGui::MenuItem(lang["open_user_folder"].c_str())) open_path((user_path / user.first).string()); ImGui::EndPopup(); } +#endif ImGui::SetCursorPos(ImVec2(USER_POS.x + USER_NAME_PADDING, USER_POS.y + MED_AVATAR_SIZE.y + (5.f * SCALE.y))); ImGui::PushTextWrapPos(USER_POS.x + MED_AVATAR_SIZE.x - USER_NAME_PADDING); ImGui::TextColored(GUI_COLOR_TEXT, "%s", user.second.name.c_str()); diff --git a/vita3k/gui/src/welcome_dialog.cpp b/vita3k/gui/src/welcome_dialog.cpp index 69ae9da39..4a06af535 100644 --- a/vita3k/gui/src/welcome_dialog.cpp +++ b/vita3k/gui/src/welcome_dialog.cpp @@ -44,7 +44,7 @@ void draw_welcome_dialog(GuiState &gui, EmuEnvState &emuenv) { ImGui::PopStyleColor(); #ifdef ANDROID ImGui::Spacing(); - ImGui::TextWrapped("%s", "This emulator is free and was distributed on Vita3K's official discord. If you did not download this application from Vita3K's discord, paid for it or it has ads, consider uninstalling it immediately for your own safety."); + ImGui::TextWrapped("%s", lang["for_android"].c_str()); #endif ImGui::Spacing(); ImGui::Separator(); diff --git a/vita3k/lang/include/lang/state.h b/vita3k/lang/include/lang/state.h index 6abcbf1f5..aaff34d76 100644 --- a/vita3k/lang/include/lang/state.h +++ b/vita3k/lang/include/lang/state.h @@ -139,6 +139,7 @@ struct LangState { std::map about = { { "title", "About" }, { "vita3k", "Vita3K: a PS Vita/PS TV Emulator. The world's first functional PS Vita/PS TV emulator." }, + { "for_android", "If you did not download this emulator from Vita3K's official discord, paid for it or it contains ads, uninstall it immediatly." }, { "about_vita3k", "Vita3K is an experimental open-source PlayStation Vita/PlayStation TV emulator written in C++ for Windows, Linux, macOS and Android operating systems." }, { "special_credit", "Special credit: The Vita3K icon was designed by:" }, { "github_website", "If you're interested in contributing, check out our:" }, @@ -168,6 +169,7 @@ struct LangState { { "license", "License" }, { "shaders_cache", "Shaders Cache" }, { "shaders_log", "Shaders Log" }, + { "create_shortcut", "Create Shortcut" }, { "manual", "Manual" }, { "update", "Update" }, { "update_history", "Update History" }, @@ -267,6 +269,7 @@ struct LangState { { "red", "Red" }, { "green", "Green" }, { "blue", "Blue" }, + { "motion_sensors", "Using builtin device motion sensors" }, { "reset_controller_binding", "Reset Controller Binding" } }; std::map controls = { @@ -442,6 +445,18 @@ struct LangState { }; }; LiveArea live_area; + std::map overlay = { + { "title", "Overlay" }, + { "gamepad_overlay", "Gamepad Overlay" }, + { "enable_gamepad_overlay", "Show gamepad overlay ingame" }, + { "hide_gamepad_overlay", "Hide Gamepad Overlay" }, + { "modify_gamepad_overlay", "Modify Gamepad Overlay" }, + { "overlay_scale", "Overlay Scale" }, + { "overlay_opacity", "Overlay Opacity" }, + { "reset_gamepad", "Reset Gamepad" }, + { "overlay_show_touch_switch", "Show front/back touchscreen switch button." }, + { "l2_r2_triggers", "L2/R2 triggers will be displayed only if PSTV mode is enabled." } + }; std::map performance_overlay = { { "avg", "Avg" }, { "min", "Min" }, @@ -540,6 +555,8 @@ struct LangState { { "select_backend_renderer", "Select your preferred backend renderer." }, { "gpu", "GPU (Reboot to apply)" }, { "select_gpu", "Select the GPU Vita3K should run on." }, + { "add_custom_driver", "Add custom driver" }, + { "remove_custom_driver", "Remove custom driver" }, { "standard", "Standard" }, { "high", "High" }, { "renderer_accuracy", "Renderer Accuracy" }, @@ -567,6 +584,15 @@ struct LangState { { "shader_cache_description", "Check the box to enable shader cache to pre-compile it at game startup.\nUncheck to disable this feature." }, { "mapping_method", "Memory mapping method" }, { "mapping_method_description", "Memory mapping improved performances, reduces memory usage and fixes many graphical issues.\nHowever, it may be unstable on some GPUs" }, + { "disabled", "Disabled" }, + { "double_buffer", "Double buffer" }, + { "external_host", "External host" }, + { "page_table", "Page table" }, + { "native_buffer", "Native buffer" }, + { "mapping_method", "Memory mapping method" }, + { "mapping_method_description", "Memory mapping improved performances, reduces memory usage and fixes many graphical issues.\nHowever, it may be unstable on some GPUs." }, + { "turbo_mode", "Enable Turbo Mode" }, + { "turbo_mode_description", "Provides a way to force the GPU to run at the maximum possible clocks (thermal constraints will still be applied)." }, { "spirv_shader", "Use Spir-V Shader (deprecated)" }, { "spirv_shader_description", "Pass generated Spir-V shader directly to driver.\nNote that some beneficial extensions will be disabled,\nand not all GPUs are compatible with this." }, { "clean_shaders", "Clean Shaders Cache and Log" }, @@ -644,6 +670,7 @@ struct LangState { { "change_emu_path_description", "Change Vita3K emulator folder path.\nYou will need to move your old folder to the new location manually." }, { "reset_emu_path", "Reset Emulator Path" }, { "reset_emu_path_description", "Reset Vita3K emulator path to the default.\nYou will need to move your old folder to the new location manually." }, + { "storage_folder_permissions", "Using a different path requires additional permissions" }, { "custom_config_settings", "Custom Config Settings" }, { "clear_custom_config", "Clear Custom Config" } }; @@ -789,6 +816,7 @@ struct LangState { }; std::map welcome = { { "title", "Welcome to Vita3K" }, + { "for_android", "This emulator is free and was distributed on Vita3K's official discord. If you did not download this application from Vita3K's discord, paid for it or it has ads, consider uninstalling it immediately for your own safety." }, { "vita3k", "Vita3K PlayStation Vita Emulator" }, { "about_vita3k", "Vita3K is an open-source PlayStation Vita emulator written in C++ for Windows, Linux, macOS and Android." }, { "development_stage", "The emulator is still in its development stages so any feedback and testing is greatly appreciated." }, diff --git a/vita3k/lang/src/lang.cpp b/vita3k/lang/src/lang.cpp index 31647cf1f..06625bb82 100644 --- a/vita3k/lang/src/lang.cpp +++ b/vita3k/lang/src/lang.cpp @@ -292,6 +292,9 @@ void init_lang(LangState &lang, EmuEnvState &emuenv) { // Message set_lang_string(emuenv.common_dialog.lang.message, lang_child.child("message")); + // Overlay + set_lang_string(lang.overlay, lang_child.child("overlay")); + // Performance Overlay set_lang_string(lang.performance_overlay, lang_child.child("performance_overlay"));