diff --git a/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp index c6b380f556..544cab563c 100644 --- a/rpcs3/Emu/Io/PadHandler.cpp +++ b/rpcs3/Emu/Io/PadHandler.cpp @@ -558,7 +558,7 @@ void PadHandlerBase::get_mapping(const pad_ensemble& binding) // Find out if special buttons are pressed (introduced by RPCS3). // These buttons will have a delay of one cycle, but whatever. - const bool adjust_pressure = pad->get_pressure_intensity_button_active(cfg->pressure_intensity_toggle_mode.get()); + const bool adjust_pressure = pad->get_pressure_intensity_button_active(cfg->pressure_intensity_toggle_mode.get(), pad->m_player_id); const u32 pressure_intensity_deadzone = cfg->pressure_intensity_deadzone.get(); // Translate any corresponding keycodes to our normal DS3 buttons and triggers diff --git a/rpcs3/Emu/Io/pad_types.cpp b/rpcs3/Emu/Io/pad_types.cpp index 5f04289e6f..8d265dac23 100644 --- a/rpcs3/Emu/Io/pad_types.cpp +++ b/rpcs3/Emu/Io/pad_types.cpp @@ -1,5 +1,7 @@ #include "stdafx.h" #include "pad_types.h" +#include "Emu/system_config.h" +#include "Emu/RSX/Overlays/overlay_message.h" template <> void fmt_class_string::format(std::string& out, u64 arg) @@ -157,7 +159,7 @@ u32 get_axis_keycode(u32 offset, u16 value) } } -bool Pad::get_pressure_intensity_button_active(bool is_toggle_mode) +bool Pad::get_pressure_intensity_button_active(bool is_toggle_mode, u32 player_id) { if (m_pressure_intensity_button_index < 0) { @@ -175,6 +177,19 @@ bool Pad::get_pressure_intensity_button_active(bool is_toggle_mode) if (pressed) { m_pressure_intensity_toggled = !m_pressure_intensity_toggled; + + if (g_cfg.misc.show_pressure_intensity_toggle_hint) + { + const std::string player_id_string = std::to_string(player_id + 1); + if (m_pressure_intensity_toggled) + { + rsx::overlays::queue_message(get_localized_string(localized_string_id::RSX_OVERLAYS_PRESSURE_INTENSITY_TOGGLED_ON, player_id_string.c_str()), 3'000'000); + } + else + { + rsx::overlays::queue_message(get_localized_string(localized_string_id::RSX_OVERLAYS_PRESSURE_INTENSITY_TOGGLED_OFF, player_id_string.c_str()), 3'000'000); + } + } } } diff --git a/rpcs3/Emu/localized_string_id.h b/rpcs3/Emu/localized_string_id.h index 6e2bb3c2dc..c41d7eb002 100644 --- a/rpcs3/Emu/localized_string_id.h +++ b/rpcs3/Emu/localized_string_id.h @@ -31,6 +31,8 @@ enum class localized_string_id RSX_OVERLAYS_LIST_SELECT, RSX_OVERLAYS_LIST_CANCEL, RSX_OVERLAYS_LIST_DENY, + RSX_OVERLAYS_PRESSURE_INTENSITY_TOGGLED_OFF, + RSX_OVERLAYS_PRESSURE_INTENSITY_TOGGLED_ON, CELL_GAME_ERROR_BROKEN_GAMEDATA, CELL_GAME_ERROR_BROKEN_HDDGAME, diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index 4d470363f8..8036dd38bb 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -340,6 +340,7 @@ struct cfg_root : cfg::node cfg::_bool show_trophy_popups{ this, "Show trophy popups", true, true }; cfg::_bool show_shader_compilation_hint{ this, "Show shader compilation hint", true, true }; cfg::_bool show_ppu_compilation_hint{ this, "Show PPU compilation hint", true, true }; + cfg::_bool show_pressure_intensity_toggle_hint{ this, "Show pressure intensity toggle hint", true, true }; cfg::_bool use_native_interface{ this, "Use native user interface", true }; cfg::string gdb_server{ this, "GDB Server", "127.0.0.1:2345" }; cfg::_bool silence_all_logs{ this, "Silence All Logs", false, true }; diff --git a/rpcs3/Input/evdev_joystick_handler.cpp b/rpcs3/Input/evdev_joystick_handler.cpp index cfb5a74713..1507f57a61 100644 --- a/rpcs3/Input/evdev_joystick_handler.cpp +++ b/rpcs3/Input/evdev_joystick_handler.cpp @@ -1084,7 +1084,7 @@ void evdev_joystick_handler::apply_input_events(const std::shared_ptr& pad) // Find out if special buttons are pressed (introduced by RPCS3). // These buttons will have a delay of one cycle, but whatever. - const bool adjust_pressure = pad->get_pressure_intensity_button_active(cfg->pressure_intensity_toggle_mode.get()); + const bool adjust_pressure = pad->get_pressure_intensity_button_active(cfg->pressure_intensity_toggle_mode.get(), pad->m_player_id); const u32 pressure_intensity_deadzone = cfg->pressure_intensity_deadzone.get(); const auto update_values = [&](bool& pressed, u16& final_value, bool is_stick_value, u32 code, u16 val) diff --git a/rpcs3/Input/keyboard_pad_handler.cpp b/rpcs3/Input/keyboard_pad_handler.cpp index c3a14c6a5f..7af3d33d1d 100644 --- a/rpcs3/Input/keyboard_pad_handler.cpp +++ b/rpcs3/Input/keyboard_pad_handler.cpp @@ -122,7 +122,7 @@ void keyboard_pad_handler::Key(const u32 code, bool pressed, u16 value) } } - const bool adjust_pressure = pad.get_pressure_intensity_button_active(m_pressure_intensity_toggle_mode); + const bool adjust_pressure = pad.get_pressure_intensity_button_active(m_pressure_intensity_toggle_mode, pad.m_player_id); const bool adjust_pressure_changed = pad.m_adjust_pressure_last != adjust_pressure; if (adjust_pressure_changed) diff --git a/rpcs3/rpcs3qt/emu_settings_type.h b/rpcs3/rpcs3qt/emu_settings_type.h index 54a9495925..38b19a0691 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.h +++ b/rpcs3/rpcs3qt/emu_settings_type.h @@ -174,6 +174,7 @@ enum class emu_settings_type UseNativeInterface, ShowShaderCompilationHint, ShowPPUCompilationHint, + ShowPressureIntensityToggleHint, WindowTitleFormat, PauseDuringHomeMenu, @@ -354,18 +355,19 @@ inline static const QMap settings_location = { emu_settings_type::SDLMappings, { "Input/Output", "Load SDL GameController Mappings" }}, // Misc - { emu_settings_type::ExitRPCS3OnFinish, { "Miscellaneous", "Exit RPCS3 when process finishes" }}, - { emu_settings_type::StartOnBoot, { "Miscellaneous", "Automatically start games after boot" }}, - { emu_settings_type::PauseOnFocusLoss, { "Miscellaneous", "Pause emulation on RPCS3 focus loss" }}, - { emu_settings_type::StartGameFullscreen, { "Miscellaneous", "Start games in fullscreen mode"}}, - { emu_settings_type::PreventDisplaySleep, { "Miscellaneous", "Prevent display sleep while running games"}}, - { emu_settings_type::ShowTrophyPopups, { "Miscellaneous", "Show trophy popups"}}, - { emu_settings_type::UseNativeInterface, { "Miscellaneous", "Use native user interface"}}, - { emu_settings_type::ShowShaderCompilationHint, { "Miscellaneous", "Show shader compilation hint"}}, - { emu_settings_type::ShowPPUCompilationHint, { "Miscellaneous", "Show PPU compilation hint"}}, - { emu_settings_type::SilenceAllLogs, { "Miscellaneous", "Silence All Logs" }}, - { emu_settings_type::WindowTitleFormat, { "Miscellaneous", "Window Title Format" }}, - { emu_settings_type::PauseDuringHomeMenu, { "Miscellaneous", "Pause Emulation During Home Menu" }}, + { emu_settings_type::ExitRPCS3OnFinish, { "Miscellaneous", "Exit RPCS3 when process finishes" }}, + { emu_settings_type::StartOnBoot, { "Miscellaneous", "Automatically start games after boot" }}, + { emu_settings_type::PauseOnFocusLoss, { "Miscellaneous", "Pause emulation on RPCS3 focus loss" }}, + { emu_settings_type::StartGameFullscreen, { "Miscellaneous", "Start games in fullscreen mode"}}, + { emu_settings_type::PreventDisplaySleep, { "Miscellaneous", "Prevent display sleep while running games"}}, + { emu_settings_type::ShowTrophyPopups, { "Miscellaneous", "Show trophy popups"}}, + { emu_settings_type::UseNativeInterface, { "Miscellaneous", "Use native user interface"}}, + { emu_settings_type::ShowShaderCompilationHint, { "Miscellaneous", "Show shader compilation hint"}}, + { emu_settings_type::ShowPPUCompilationHint, { "Miscellaneous", "Show PPU compilation hint"}}, + { emu_settings_type::ShowPressureIntensityToggleHint, { "Miscellaneous", "Show pressure intensity toggle hint"}}, + { emu_settings_type::SilenceAllLogs, { "Miscellaneous", "Silence All Logs" }}, + { emu_settings_type::WindowTitleFormat, { "Miscellaneous", "Window Title Format" }}, + { emu_settings_type::PauseDuringHomeMenu, { "Miscellaneous", "Pause Emulation During Home Menu" }}, // Networking { emu_settings_type::InternetStatus, { "Net", "Internet enabled"}}, diff --git a/rpcs3/rpcs3qt/localized_emu.h b/rpcs3/rpcs3qt/localized_emu.h index eff8602ff8..e1dba15956 100644 --- a/rpcs3/rpcs3qt/localized_emu.h +++ b/rpcs3/rpcs3qt/localized_emu.h @@ -65,6 +65,8 @@ private: case localized_string_id::RSX_OVERLAYS_LIST_SELECT: return tr("Enter", "Enter Dialog List"); case localized_string_id::RSX_OVERLAYS_LIST_CANCEL: return tr("Back", "Cancel Dialog List"); case localized_string_id::RSX_OVERLAYS_LIST_DENY: return tr("Deny", "Deny Dialog List"); + case localized_string_id::RSX_OVERLAYS_PRESSURE_INTENSITY_TOGGLED_OFF: return tr("Pressure intensity mode of player %0 disabled", "Pressure intensity toggled off").arg(std::forward(args)...); + case localized_string_id::RSX_OVERLAYS_PRESSURE_INTENSITY_TOGGLED_ON: return tr("Pressure intensity mode of player %0 enabled", "Pressure intensity toggled on").arg(std::forward(args)...); case localized_string_id::CELL_GAME_ERROR_BROKEN_GAMEDATA: return tr("ERROR: Game data is corrupted. The application will continue.", "Game Error"); case localized_string_id::CELL_GAME_ERROR_BROKEN_HDDGAME: return tr("ERROR: HDD boot game is corrupted. The application will continue.", "Game Error"); case localized_string_id::CELL_GAME_ERROR_BROKEN_EXIT_GAMEDATA: return tr("ERROR: Game data is corrupted. The application will be terminated.", "Game Error"); diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 5122ffc363..6445f71321 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -1765,6 +1765,9 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_emu_settings->EnhanceCheckBox(ui->showPPUCompilationHint, emu_settings_type::ShowPPUCompilationHint); SubscribeTooltip(ui->showPPUCompilationHint, tooltips.settings.show_ppu_compilation_hint); + m_emu_settings->EnhanceCheckBox(ui->showPressureIntensityToggleHint, emu_settings_type::ShowPressureIntensityToggleHint); + SubscribeTooltip(ui->showPressureIntensityToggleHint, tooltips.settings.show_pressure_intensity_toggle_hint); + m_emu_settings->EnhanceCheckBox(ui->pauseDuringHomeMenu, emu_settings_type::PauseDuringHomeMenu); SubscribeTooltip(ui->pauseDuringHomeMenu, tooltips.settings.pause_during_home_menu); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 336e3a309f..ef7115c67f 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -2979,6 +2979,13 @@ + + + + Show pressure intensity toggle hint + + + diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index e03a0aeff4..94dc6c497d 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -140,6 +140,7 @@ public: const QString hide_mouse_on_idle = tr("Hides the mouse cursor if no mouse movement is detected for the configured time."); const QString show_shader_compilation_hint = tr("Shows 'Compiling shaders' hint using the native overlay."); const QString show_ppu_compilation_hint = tr("Shows 'Compiling PPU modules' hint using the native overlay."); + const QString show_pressure_intensity_toggle_hint = tr("Shows pressure intensity toggle hint using the native overlay."); const QString use_native_interface = tr("Enables use of native HUD within the game window that can interact with game controllers.\nWhen disabled, regular Qt dialogs are used instead.\nCurrently, the on-screen keyboard only supports the English key layout."); const QString pause_during_home_menu = tr("When enabled, opening the home menu will also pause emulation.\nWhile most games pause themselves while the home menu is shown, some do not.\nIn that case it can be helpful to pause the emulation whenever the home menu is open.");