Skip to content

Commit

Permalink
Merge branch 'Vita3K:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
backgamon authored May 21, 2024
2 parents 189ccbb + 76bd1ce commit f270efa
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 37 deletions.
14 changes: 11 additions & 3 deletions lang/system/en-gb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Error code: {}</an_error_occurred>
<name>Name</name>
<num>Num</num>
<not_connected>No compatible controllers connected.
Please connect a controller that is compatible with SDL2.</not_connected>
Connect a controller that is compatible with SDL2.</not_connected>
<motion_support>Gamepad has motion support</motion_support>
<rebind_controls>Rebind Controls</rebind_controls>
<led_color>LED Color</led_color>
Expand Down Expand Up @@ -467,7 +467,7 @@ and also for Asian regional font support. (Generally Recommended)</firmware_font
<delete_pkg>Delete the pkg file?</delete_pkg>
<delete_bin_rif>Delete the work.bin/rif file?</delete_bin_rif>
<failed_install_package>Failed to install package.
Please check pkg and work.bin/rif file or zRIF key.</failed_install_package>
Check pkg and work.bin/rif file or zRIF key.</failed_install_package>
</pkg_install>
<archive_install>
<select_install_type>Select install type</select_install_type>
Expand All @@ -483,7 +483,7 @@ Please check pkg and work.bin/rif file or zRIF key.</failed_install_package>
<license_install>
<successed_install_license>Successfully installed license.</successed_install_license>
<failed_install_license>Failed to install license.
Please check work.bin/rif file or zRIF key.</failed_install_license>
Check work.bin/rif file or zRIF key.</failed_install_license>
</license_install>
<reinstall>
<reinstall_content>Reinstall this content?</reinstall_content>
Expand Down Expand Up @@ -518,6 +518,14 @@ Please check work.bin/rif file or zRIF key.</failed_install_license>
</help>
</live_area>

<message>
<load_app_failed>Failed to load "{}".
Check vita3k.log to see console output for details.
1. Do you have installed firmware?
2. Dump your own app(s)/game(s) and install it on Vita3K.
3. If you want to install or boot Vitamin, it is not supported.</load_app_failed>
</message>

<performance_overlay>
<avg>Avg</avg>
<min>Min</min>
Expand Down
14 changes: 11 additions & 3 deletions lang/system/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Error code: {}</an_error_occurred>
<name>Name</name>
<num>Num</num>
<not_connected>No compatible controllers connected.
Please connect a controller that is compatible with SDL2.</not_connected>
Connect a controller that is compatible with SDL2.</not_connected>
<motion_support>Gamepad has motion support</motion_support>
<rebind_controls>Rebind Controls</rebind_controls>
<led_color>LED Color</led_color>
Expand Down Expand Up @@ -467,7 +467,7 @@ and also for Asian regional font support. (Generally Recommended)</firmware_font
<delete_pkg>Delete the pkg file?</delete_pkg>
<delete_bin_rif>Delete the work.bin/rif file?</delete_bin_rif>
<failed_install_package>Failed to install package.
Please check pkg and work.bin/rif file or zRIF key.</failed_install_package>
Check pkg and work.bin/rif file or zRIF key.</failed_install_package>
</pkg_install>
<archive_install>
<select_install_type>Select install type</select_install_type>
Expand All @@ -483,7 +483,7 @@ Please check pkg and work.bin/rif file or zRIF key.</failed_install_package>
<license_install>
<successed_install_license>Successfully installed license.</successed_install_license>
<failed_install_license>Failed to install license.
Please check work.bin/rif file or zRIF key.</failed_install_license>
Check work.bin/rif file or zRIF key.</failed_install_license>
</license_install>
<reinstall>
<reinstall_content>Reinstall this content?</reinstall_content>
Expand Down Expand Up @@ -518,6 +518,14 @@ Please check work.bin/rif file or zRIF key.</failed_install_license>
</help>
</live_area>

<message>
<load_app_failed>Failed to load "{}".
Check vita3k.log to see console output for details.
1. Do you have installed firmware?
2. Dump your own app(s)/game(s) and install it on Vita3K.
3. If you want to install or boot Vitamin, it is not supported.</load_app_failed>
</message>

<performance_overlay>
<avg>Avg</avg>
<min>Min</min>
Expand Down
10 changes: 9 additions & 1 deletion lang/system/zh-s.xml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,14 @@
</help>
</live_area>

<message>
<load_app_failed>无法读取“{}”,
请检查vita3k.log查看控制台输出的详细信息。
1、您是否已安装了固件?
2、提取您已拥有的应用程序/游戏,并在Vita3K安装。
3、如果您想要安装/运行Vitamin是不支持的。</load_app_failed>
</message>

<performance_overlay>
<avg>平均</avg>
<min>最低</min>
Expand Down Expand Up @@ -647,7 +655,7 @@
并非所有显卡都与此兼容。</spirv_shader_description>
<clean_shaders>清除着色器缓存以及日志</clean_shaders>
<fps_hack>FPS修改</fps_hack>
<fps_hack_description>游戏修改允许一些以30 FPS运行的游戏在模拟器上以60 FPS的速度运行
<fps_hack_description>游戏修改允许一些以30FPS运行的游戏在模拟器上以60FPS的速度运行
请注意这只是一个修改,仅适用于某些游戏。
在其他游戏中,它可能没有效果或使其出现两倍速。</fps_hack_description>
</gpu>
Expand Down
12 changes: 10 additions & 2 deletions lang/system/zh-t.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<vita3k_website>更多資訊請造訪我們的網站:</vita3k_website>
<ko-fi_website>如果您想支持我們,您可以捐贈或者訂閱我們的:</ko-fi_website>
<vita3k_staff>Vita3K人員名單</vita3k_staff>
<developers>開發人員</developers>
<developers>開發者</developers>
<contributors>參與者</contributors>
<supporters>支持者</supporters>
</about>
Expand Down Expand Up @@ -516,6 +516,14 @@
</help>
</live_area>

<message>
<load_app_failed>無法讀取“{}”,
請檢查vita3k.log查閲控制臺輸出的詳細資訊。
1、您是否已安裝了韌體?
2、傾印您已擁有的应用程式/遊戲,並在Vita3K安裝。
3、如果您想要安裝/運行Vitamin是不支援的。</load_app_failed>
</message>

<performance_overlay>
<avg>平均</avg>
<min>最低</min>
Expand Down Expand Up @@ -647,7 +655,7 @@
並非所有顯卡都與此兼容。</spirv_shader_description>
<clean_shaders>清除著色器快取以及記錄</clean_shaders>
<fps_hack>FPS修改</fps_hack>
<fps_hack_description>遊戲修改允許一些以30 FPS運行的遊戲在模擬器上以60 FPS的速度運行
<fps_hack_description>遊戲修改允許一些以30FPS運行的遊戲在模擬器上以60FPS的速度運行
請注意這只是一個修改,僅適用於某些遊戲。
在其他遊戲中,它可能沒有效果或使其出現兩倍速。</fps_hack_description>
</gpu>
Expand Down
2 changes: 0 additions & 2 deletions lang/user/ua.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@
<license>Ліцензія</license>
<shaders_cache>Кеш шейдерів</shaders_cache>
<shaders_log>Журнал шейдерів</shaders_log>
<export_textures>Експорт текстур</export_textures>
<import_textures>Імпорт текстур</import_textures>
<manual>Довідка</manual>
<update>Оновити</update>
<update_history>Оновити історію</update_history>
Expand Down
6 changes: 3 additions & 3 deletions vita3k/app/src/app_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void update_viewport(EmuEnvState &state) {
break;

default:
LOG_ERROR("Unimplemented backend render: {}.", static_cast<int>(state.renderer->current_backend));
LOG_ERROR("Unimplemented backend renderer: {}.", static_cast<int>(state.renderer->current_backend));
break;
}

Expand Down Expand Up @@ -288,7 +288,7 @@ bool init(EmuEnvState &state, Config &cfg, const Root &root_paths) {
break;

default:
LOG_ERROR("Unimplemented backend render: {}.", state.cfg.backend_renderer);
LOG_ERROR("Unimplemented backend renderer: {}.", state.cfg.backend_renderer);
break;
}

Expand Down Expand Up @@ -342,7 +342,7 @@ bool init(EmuEnvState &state, Config &cfg, const Root &root_paths) {
break;

default:
error_dialog(fmt::format("Unknown backend render: {}.", state.cfg.backend_renderer));
error_dialog(fmt::format("Unknown backend renderer: {}.", state.cfg.backend_renderer));
break;
}
return false;
Expand Down
3 changes: 2 additions & 1 deletion vita3k/config/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,12 @@ ExitCode init_config(Config &cfg, int argc, char **argv, const Root &root_paths)
LOG_INFO_IF(cfg.load_config, "Custom configuration file loaded successfully.");

logging::set_level(static_cast<spdlog::level::level_enum>(cfg.log_level));
static constexpr std::array<const char *, 7> LIST_LOG_LEVEL = { "Trace", "Debug", "Info", "Warning", "Error", "Critical", "Off" };

LOG_INFO_IF(cfg.content_path, "input-content-path: {}", cfg.content_path->string());
LOG_INFO_IF(cfg.run_app_path, "input-installed-path: {}", *cfg.run_app_path);
LOG_INFO("{}: {}", cfg[e_backend_renderer], cfg.backend_renderer);
LOG_INFO("{}: {}", cfg[e_log_level], cfg.log_level);
LOG_INFO("{}: {}", cfg[e_log_level], LIST_LOG_LEVEL[cfg.log_level]);
LOG_INFO_IF(cfg.log_active_shaders, "{}: enabled", cfg[e_log_active_shaders]);
LOG_INFO_IF(cfg.log_uniforms, "{}: enabled", cfg[e_log_uniforms]);
}
Expand Down
9 changes: 5 additions & 4 deletions vita3k/gui/src/common_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <SDL.h>

namespace gui {
static void draw_ime_dialog(DialogState &common_dialog, float FONT_SCALE) {
static void draw_ime_dialog(EmuEnvState &emuenv, DialogState &common_dialog, float FONT_SCALE) {
ImGui::SetNextWindowSize(ImVec2(0, 0));
ImGui::Begin("##ime_dialog", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize);
ImGui::SetWindowFontScale(FONT_SCALE);
Expand All @@ -50,7 +50,8 @@ static void draw_ime_dialog(DialogState &common_dialog, float FONT_SCALE) {
common_dialog.ime.max_length + 1);
}
ImGui::SameLine();
if (ImGui::Button(common_dialog.lang.common["submit"].c_str())) {
auto &common = common_dialog.lang.common;
if (ImGui::Button(common["submit"].c_str()) || ImGui::IsKeyPressed(static_cast<ImGuiKey>(emuenv.cfg.keyboard_button_cross))) {
common_dialog.ime.status = SCE_IME_DIALOG_BUTTON_ENTER;
common_dialog.status = SCE_COMMON_DIALOG_STATUS_FINISHED;
common_dialog.result = SCE_COMMON_DIALOG_RESULT_OK;
Expand All @@ -59,7 +60,7 @@ static void draw_ime_dialog(DialogState &common_dialog, float FONT_SCALE) {
}
if (common_dialog.ime.cancelable) {
ImGui::SameLine();
if (ImGui::Button(common_dialog.lang.common["cancel"].c_str())) {
if (ImGui::Button(common["cancel"].c_str()) || ImGui::IsKeyPressed(static_cast<ImGuiKey>(emuenv.cfg.keyboard_button_circle))) {
common_dialog.ime.status = SCE_IME_DIALOG_BUTTON_CLOSE;
common_dialog.status = SCE_COMMON_DIALOG_STATUS_FINISHED;
common_dialog.result = SCE_COMMON_DIALOG_RESULT_USER_CANCELED;
Expand Down Expand Up @@ -652,7 +653,7 @@ void draw_common_dialog(GuiState &gui, EmuEnvState &emuenv) {
if (emuenv.common_dialog.status == SCE_COMMON_DIALOG_STATUS_RUNNING) {
switch (emuenv.common_dialog.type) {
case IME_DIALOG:
draw_ime_dialog(emuenv.common_dialog, RES_SCALE.x);
draw_ime_dialog(emuenv, emuenv.common_dialog, RES_SCALE.x);
break;
case MESSAGE_DIALOG:
draw_message_dialog(emuenv.common_dialog, RES_SCALE.x, SCALE);
Expand Down
6 changes: 2 additions & 4 deletions vita3k/gui/src/live_area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,12 +1168,10 @@ void draw_live_area_screen(GuiState &gui, EmuEnvState &emuenv) {
ImGui::Spacing();
};
TextColoredCentered(gui, GUI_COLOR_TEXT, "control_setting");
if (gui.modules.empty()) {
if (gui.modules.empty())
TextColoredCentered(gui, GUI_COLOR_TEXT, "firmware_not_detected");
}
if (!gui.fw_font) {
if (!gui.fw_font)
TextColoredCentered(gui, GUI_COLOR_TEXT, "firmware_font_not_detected");
}
ImGui::Separator();
ImGui::Spacing();
ImGui::TextColored(GUI_COLOR_TEXT_TITLE, "%s", lang["live_area_help"].c_str());
Expand Down
18 changes: 9 additions & 9 deletions vita3k/gui/src/themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,30 +475,30 @@ void draw_start_screen(GuiState &gui, EmuEnvState &emuenv) {
ImGui::PopFont();

ImGui::PushFont(gui.large_font);
const auto DEFAULT_LARGE_FONT_SCALE = ImGui::GetFontSize() / (116.f * SCALE.x);
const auto LARGE_FONT_SIZE = (116.f * SCALE.x) * DEFAULT_FONT_SCALE;
const auto PIX_LARGE_FONT_SCALE = (96.f * SCALE.x) / ImGui::GetFontSize();
const auto DEFAULT_LARGE_FONT_SCALE = ImGui::GetFontSize() / (116.f * SCALE.y);
const auto LARGE_FONT_SIZE = (116.f * SCALE.y) * DEFAULT_FONT_SCALE;
const auto PIX_LARGE_FONT_SCALE = (96.f * SCALE.y) / ImGui::GetFontSize();

const auto CLOCK_STR = DATE_TIME[DateTime::CLOCK];
const auto CALC_CLOCK_SIZE = ImGui::CalcTextSize(CLOCK_STR.c_str());
const auto CLOCK_SIZE = ImVec2(CALC_CLOCK_SIZE.x, CALC_CLOCK_SIZE.y * PIX_LARGE_FONT_SCALE);
const auto CLOCK_SIZE = ImVec2(CALC_CLOCK_SIZE.x * RES_SCALE.x, CALC_CLOCK_SIZE.y * PIX_LARGE_FONT_SCALE);

const auto DAY_MOMENT_STR = DATE_TIME[DateTime::DAY_MOMENT];
const auto CALC_DAY_MOMENT_SIZE = ImGui::CalcTextSize(DAY_MOMENT_STR.c_str());
const auto DAY_MOMENT_LARGE_FONT_SIZE = (56.f * SCALE.x) * DEFAULT_LARGE_FONT_SCALE;
const auto LARGE_FONT_DAY_MOMENT_SCALE = DAY_MOMENT_LARGE_FONT_SIZE / ImGui::GetFontSize();
const auto DAY_MOMENT_SIZE = is_12_hour_format ? ImVec2(CALC_DAY_MOMENT_SIZE.x * LARGE_FONT_DAY_MOMENT_SCALE, CALC_DAY_MOMENT_SIZE.y * LARGE_FONT_DAY_MOMENT_SCALE * PIX_LARGE_FONT_SCALE) : ImVec2(0.f, 0.f);
const auto DAY_MOMENT_SIZE = is_12_hour_format ? ImVec2((CALC_DAY_MOMENT_SIZE.x * LARGE_FONT_DAY_MOMENT_SCALE) * RES_SCALE.x, (CALC_DAY_MOMENT_SIZE.y * LARGE_FONT_DAY_MOMENT_SCALE) * PIX_LARGE_FONT_SCALE) : ImVec2(0.f, 0.f);

auto CLOCK_POS = ImVec2(WINDOW_POS_MAX.x - (start_param.clock_pos.x * SCALE.x), WINDOW_POS_MAX.y - (start_param.clock_pos.y * SCALE.y));
if (start_param.date_layout == DateLayout::RIGHT_DOWN)
CLOCK_POS.x -= (CLOCK_SIZE.x * RES_SCALE.x) + (DAY_MOMENT_SIZE.x * RES_SCALE.x);
CLOCK_POS.x -= CLOCK_SIZE.x + DAY_MOMENT_SIZE.x;
else if (string_utils::stoi_def(DATE_TIME[DateTime::HOUR], 0, "hour") < 10)
CLOCK_POS.x += ImGui::CalcTextSize("0").x * RES_SCALE.x;

draw_list->AddText(gui.large_font, LARGE_FONT_SIZE * RES_SCALE.x, CLOCK_POS, start_param.date_color, CLOCK_STR.c_str());
draw_list->AddText(gui.large_font, LARGE_FONT_SIZE * RES_SCALE.y, CLOCK_POS, start_param.date_color, CLOCK_STR.c_str());
if (is_12_hour_format) {
const auto DAY_MOMENT_POS = ImVec2(CLOCK_POS.x + ((CLOCK_SIZE.x + (6.f * SCALE.x)) * RES_SCALE.x), CLOCK_POS.y + ((CLOCK_SIZE.y - DAY_MOMENT_SIZE.y) * RES_SCALE.y));
draw_list->AddText(gui.large_font, DAY_MOMENT_LARGE_FONT_SIZE * RES_SCALE.x, DAY_MOMENT_POS, start_param.date_color, DAY_MOMENT_STR.c_str());
const auto DAY_MOMENT_POS = ImVec2(CLOCK_POS.x + CLOCK_SIZE.x + (6.f * SCALE.x), CLOCK_POS.y + (CLOCK_SIZE.y - DAY_MOMENT_SIZE.y));
draw_list->AddText(gui.large_font, DAY_MOMENT_LARGE_FONT_SIZE * RES_SCALE.y, DAY_MOMENT_POS, start_param.date_color, DAY_MOMENT_STR.c_str());
}
ImGui::PopFont();

Expand Down
2 changes: 1 addition & 1 deletion vita3k/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ bool handle_events(EmuEnvState &emuenv, GuiState &gui) {

ExitCode load_app(int32_t &main_module_id, EmuEnvState &emuenv) {
if (load_app_impl(main_module_id, emuenv) != Success) {
std::string message = fmt::format("Failed to load \"{}\"\nSee console output for details.", emuenv.pref_path / "ux0/app" / emuenv.io.app_path / emuenv.self_path);
std::string message = fmt::format(fmt::runtime(emuenv.common_dialog.lang.message["load_app_failed"].c_str()), emuenv.pref_path / "ux0/app" / emuenv.io.app_path / emuenv.self_path);
app::error_dialog(message, emuenv.window.get());
return ModuleLoadFailed;
}
Expand Down
1 change: 1 addition & 0 deletions vita3k/io/include/io/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#pragma once

#include <cstddef>
#include <vector>

class ReadOnlyInMemFile {
Expand Down
7 changes: 4 additions & 3 deletions vita3k/lang/include/lang/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct DialogLangState {
{ "submit", "Submit" },
{ "yes", "Yes" }
};
std::map<std::string, std::string> message = { { "load_app_failed", "Failed to load \"{}\".\nCheck vita3k.log to see console output for details.\n1. Do you have installed firmware?\n2. Dump your own app(s)/game(s) and install it on Vita3K.\n3. If you want to install or boot Vitamin, it is not supported." } };
std::map<std::string, std::string> trophy = { { "preparing_start_app", "Preparing to start the application..." } };
struct SaveData {
std::map<std::string, std::string> deleting = {
Expand Down Expand Up @@ -257,7 +258,7 @@ struct LangState {
{ "connected", "{} controllers connected" },
{ "name", "Name" },
{ "num", "Num" },
{ "not_connected", "No compatible controllers connected.\nPlease connect a controller that is compatible with SDL2." },
{ "not_connected", "No compatible controllers connected.\nConnect a controller that is compatible with SDL2." },
{ "motion_support", "Gamepad has motion support" },
{ "rebind_controls", "Rebind Controls" },
{ "led_color", "LED Color" },
Expand Down Expand Up @@ -389,7 +390,7 @@ struct LangState {
{ "copy_paste_zrif", "Ctrl (Cmd) + C to copy, Ctrl (Cmd) + V to paste." },
{ "delete_pkg", "Delete the pkg file?" },
{ "delete_bin_rif", "Delete the work.bin/rif file?" },
{ "failed_install_package", "Failed to install package.\nPlease check pkg and work.bin/rif file or zRIF key." }
{ "failed_install_package", "Failed to install package.\nCheck pkg and work.bin/rif file or zRIF key." }
};
std::map<std::string, std::string> archive_install = {
{ "select_install_type", "Select install type" },
Expand All @@ -404,7 +405,7 @@ struct LangState {
};
std::map<std::string, std::string> license_install = {
{ "successed_install_license", "Successfully installed license." },
{ "failed_install_license", "Failed to install license.\nPlease check work.bin/rif file or zRIF key." }
{ "failed_install_license", "Failed to install license.\nCheck work.bin/rif file or zRIF key." }
};
std::map<std::string, std::string> reinstall = {
{ "reinstall_content", "Reinstall this content?" },
Expand Down
5 changes: 4 additions & 1 deletion vita3k/lang/src/lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace lang {

static const std::vector<std::string> list_user_lang_static = {
"id", "ms"
"id", "ms", "ua"
};

void init_lang(LangState &lang, EmuEnvState &emuenv) {
Expand Down Expand Up @@ -289,6 +289,9 @@ void init_lang(LangState &lang, EmuEnvState &emuenv) {
set_lang_string(lang.live_area.help, live_area.child("help"));
}

// Message
set_lang_string(emuenv.common_dialog.lang.message, lang_child.child("message"));

// Performance Overlay
set_lang_string(lang.performance_overlay, lang_child.child("performance_overlay"));

Expand Down

0 comments on commit f270efa

Please sign in to comment.