diff --git a/resources/font/keymap_keyboard.ttf b/resources/font/keymap_keyboard.ttf index 6ea75f4c3..1fd64c2b7 100644 Binary files a/resources/font/keymap_keyboard.ttf and b/resources/font/keymap_keyboard.ttf differ diff --git a/resources/font/keymap_keyboard_swap.ttf b/resources/font/keymap_keyboard_swap.ttf new file mode 100644 index 000000000..a7214f600 Binary files /dev/null and b/resources/font/keymap_keyboard_swap.ttf differ diff --git a/wiliwili/include/utils/config_helper.hpp b/wiliwili/include/utils/config_helper.hpp index 5ca636d7d..374f497a0 100644 --- a/wiliwili/include/utils/config_helper.hpp +++ b/wiliwili/include/utils/config_helper.hpp @@ -36,6 +36,7 @@ enum class SettingItem { APP_LANG, // 应用语言 APP_RESOURCES, // 自定义界面布局 APP_UI_SCALE, // 界面缩放 + APP_SWAP_ABXY, // A-B 交换 和 X-Y 交换 SCROLL_SPEED, // 列表滑动速度 HISTORY_REPORT, PLAYER_STRATEGY, diff --git a/wiliwili/source/utils/config_helper.cpp b/wiliwili/source/utils/config_helper.cpp index 2ad680217..cc2daef4e 100644 --- a/wiliwili/source/utils/config_helper.cpp +++ b/wiliwili/source/utils/config_helper.cpp @@ -99,6 +99,7 @@ std::unordered_map ProgramConfig::SETTING_MAP = { {SettingItem::DANMAKU_STYLE_FONT, {"danmaku_style_font", {"stroke", "incline", "shadow", "pure"}, {}, 0}}, /// bool + {SettingItem::APP_SWAP_ABXY, {"app_swap_abxy", {}, {}, 0}}, {SettingItem::GAMEPAD_VIBRATION, {"gamepad_vibration", {}, {}, 1}}, #if defined(IOS) || defined(__PSV__) {SettingItem::HIDE_BOTTOM_BAR, {"hide_bottom_bar", {}, {}, 1}}, @@ -115,14 +116,11 @@ std::unordered_map ProgramConfig::SETTING_MAP = { {SettingItem::FULLSCREEN, {"fullscreen", {}, {}, 1}}, #endif {SettingItem::HISTORY_REPORT, {"history_report", {}, {}, 1}}, + {SettingItem::PLAYER_AUTO_PLAY, {"player_auto_play", {}, {}, 1}}, {SettingItem::PLAYER_BOTTOM_BAR, {"player_bottom_bar", {}, {}, 1}}, {SettingItem::PLAYER_HIGHLIGHT_BAR, {"player_highlight_bar", {}, {}, 0}}, {SettingItem::PLAYER_SKIP_OPENING_CREDITS, {"player_skip_opening_credits", {}, {}, 1}}, -#if defined(__PSV__) || defined(PS4) || defined(__SWITCH__) {SettingItem::PLAYER_LOW_QUALITY, {"player_low_quality", {}, {}, 1}}, -#else - {SettingItem::PLAYER_LOW_QUALITY, {"player_low_quality", {}, {}, 0}}, -#endif #if defined(IOS) || defined(__PSV__) || defined(__SWITCH__) {SettingItem::PLAYER_HWDEC, {"player_hwdec", {}, {}, 1}}, #else @@ -617,6 +615,13 @@ void ProgramConfig::load() { // 初始化一些在创建窗口之后才能初始化的内容 brls::Application::getWindowCreationDoneEvent()->subscribe([this]() { + // 是否交换按键 + if (getBoolOption(SettingItem::APP_SWAP_ABXY)) { + // 对于 PSV/PS4 来说,初始化时会加载系统设置,可能在那时已经交换过按键 + // 所以这里需要读取 isSwapInputKeys 的值,而不是直接设置为 true + brls::Application::setSwapInputKeys(!brls::Application::isSwapInputKeys()); + } + // 初始化弹幕字体 std::string danmakuFont = getConfigDir() + "/danmaku.ttf"; // 只在应用模式下加载自定义字体 减少switch上的内存占用 @@ -829,7 +834,11 @@ void ProgramConfig::init() { } else if (icon == "ps") { brls::FontLoader::USER_ICON_PATH = BRLS_ASSET("font/keymap_ps.ttf"); } else { - brls::FontLoader::USER_ICON_PATH = BRLS_ASSET("font/keymap_keyboard.ttf"); + if (getBoolOption(SettingItem::APP_SWAP_ABXY)) { + brls::FontLoader::USER_ICON_PATH = BRLS_ASSET("font/keymap_keyboard_swap.ttf"); + } else { + brls::FontLoader::USER_ICON_PATH = BRLS_ASSET("font/keymap_keyboard.ttf"); + } } #endif }