From 5bb740c3739d7d2b7f347844cfce1545ba50bb77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 9 Nov 2025 22:02:40 +0100 Subject: [PATCH 1/4] Control mapping: Remove some old uses of std::bind, and an unnecessary enum. --- UI/ControlMappingScreen.cpp | 95 ++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 54 deletions(-) diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 87ca89afa9..dc75458cec 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -72,21 +72,11 @@ private: void OnReplace(UI::EventParams ¶ms); void OnReplaceAll(UI::EventParams ¶ms); - void MappedCallback(const MultiInputMapping &kdf); - - enum Action { - NONE, - REPLACEONE, - REPLACEALL, - ADD, - }; + int pspKey_; UI::Choice *addButton_ = nullptr; UI::Choice *replaceAllButton_ = nullptr; std::vector rows_; - Action action_ = NONE; - int actionIndex_ = 0; - int pspKey_; std::string keyName_; ScreenManager *scrm_; }; @@ -167,73 +157,67 @@ void SingleControlMapper::Refresh() { } } -void SingleControlMapper::MappedCallback(const MultiInputMapping &kdf) { - if (kdf.empty()) { - // Don't want to try to add this. - return; - } - - switch (action_) { - case ADD: - KeyMap::SetInputMapping(pspKey_, kdf, false); - addButton_->SetFocus(); - break; - case REPLACEALL: - KeyMap::SetInputMapping(pspKey_, kdf, true); - replaceAllButton_->SetFocus(); - break; - case REPLACEONE: - { - bool success = KeyMap::ReplaceSingleKeyMapping(pspKey_, actionIndex_, kdf); +void SingleControlMapper::OnReplace(UI::EventParams ¶ms) { + const int index = atoi(params.v->Tag().c_str()); + scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, [this, index](KeyMap::MultiInputMapping mapping) { + if (mapping.empty()) + return; + bool success = KeyMap::ReplaceSingleKeyMapping(pspKey_, index, mapping); if (!success) { replaceAllButton_->SetFocus(); // Last got removed as a duplicate - } else if (actionIndex_ < (int)rows_.size()) { - rows_[actionIndex_]->SetFocus(); + } else if (index < (int)rows_.size()) { + rows_[index]->SetFocus(); } else { SetFocus(); } - break; - } - default: - SetFocus(); - break; - } - KeyMap::UpdateNativeMenuKeys(); - g_IsMappingMouseInput = false; -} - -void SingleControlMapper::OnReplace(UI::EventParams ¶ms) { - actionIndex_ = atoi(params.v->Tag().c_str()); - action_ = REPLACEONE; - scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING)); + KeyMap::UpdateNativeMenuKeys(); + g_IsMappingMouseInput = false; + }, I18NCat::KEYMAPPING)); } void SingleControlMapper::OnReplaceAll(UI::EventParams ¶ms) { - action_ = REPLACEALL; - scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING)); + scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, [this](KeyMap::MultiInputMapping mapping) { + if (mapping.empty()) + return; + KeyMap::SetInputMapping(pspKey_, mapping, true); + replaceAllButton_->SetFocus(); + KeyMap::UpdateNativeMenuKeys(); + g_IsMappingMouseInput = false; + }, I18NCat::KEYMAPPING)); } void SingleControlMapper::OnAdd(UI::EventParams ¶ms) { - action_ = ADD; - scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING)); + scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, [this](KeyMap::MultiInputMapping mapping) { + if (mapping.empty()) + return; + KeyMap::SetInputMapping(pspKey_, mapping, false); + addButton_->SetFocus(); + KeyMap::UpdateNativeMenuKeys(); + g_IsMappingMouseInput = false; + }, I18NCat::KEYMAPPING)); } + void SingleControlMapper::OnAddMouse(UI::EventParams ¶ms) { - action_ = ADD; g_IsMappingMouseInput = true; - scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING)); + scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, [this](KeyMap::MultiInputMapping mapping) { + if (mapping.empty()) + return; + KeyMap::SetInputMapping(pspKey_, mapping, false); + addButton_->SetFocus(); + KeyMap::UpdateNativeMenuKeys(); + g_IsMappingMouseInput = false; + }, I18NCat::KEYMAPPING)); } void SingleControlMapper::OnDelete(UI::EventParams ¶ms) { int index = atoi(params.v->Tag().c_str()); KeyMap::DeleteNthMapping(pspKey_, index); - if (index + 1 < (int)rows_.size()) rows_[index]->SetFocus(); else SetFocus(); } - struct BindingCategory { const char *catName; int firstKey; @@ -1030,7 +1014,10 @@ void VisualMappingScreen::MapNext(bool successive) { } else { psp_->SelectButton(nextKey_); } - auto dialog = new KeyMappingNewKeyDialog(nextKey_, true, std::bind(&VisualMappingScreen::HandleKeyMapping, this, std::placeholders::_1), I18NCat::KEYMAPPING); + + auto dialog = new KeyMappingNewKeyDialog(nextKey_, true, [this](KeyMap::MultiInputMapping mapping) { + HandleKeyMapping(mapping); + }, I18NCat::KEYMAPPING); Bounds bounds = screenManager()->getUIContext()->GetLayoutBounds(); dialog->SetPopupOffset(psp_->GetPopupOffset() * bounds.h); From fd6dbd38135244eeeeef4dce12893d1b3303b428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 9 Nov 2025 22:18:57 +0100 Subject: [PATCH 2/4] Add a title to the upload files screen --- UI/UploadScreen.cpp | 5 +++++ UI/UploadScreen.h | 1 + assets/lang/ar_AE.ini | 1 + assets/lang/az_AZ.ini | 1 + assets/lang/be_BY.ini | 1 + assets/lang/bg_BG.ini | 1 + assets/lang/ca_ES.ini | 1 + assets/lang/cz_CZ.ini | 1 + assets/lang/da_DK.ini | 1 + assets/lang/de_DE.ini | 1 + assets/lang/dr_ID.ini | 1 + assets/lang/en_US.ini | 1 + assets/lang/es_ES.ini | 1 + assets/lang/es_LA.ini | 1 + assets/lang/fa_IR.ini | 1 + assets/lang/fi_FI.ini | 1 + assets/lang/fr_FR.ini | 1 + assets/lang/gl_ES.ini | 1 + assets/lang/gr_EL.ini | 1 + assets/lang/he_IL.ini | 1 + assets/lang/he_IL_invert.ini | 1 + assets/lang/hr_HR.ini | 1 + assets/lang/hu_HU.ini | 1 + assets/lang/id_ID.ini | 1 + assets/lang/it_IT.ini | 1 + assets/lang/ja_JP.ini | 1 + assets/lang/jv_ID.ini | 1 + assets/lang/ko_KR.ini | 1 + assets/lang/ku_SO.ini | 1 + assets/lang/lo_LA.ini | 1 + assets/lang/lt-LT.ini | 1 + assets/lang/ms_MY.ini | 1 + assets/lang/nl_NL.ini | 1 + assets/lang/no_NO.ini | 1 + assets/lang/pl_PL.ini | 1 + assets/lang/pt_BR.ini | 1 + assets/lang/pt_PT.ini | 1 + assets/lang/ro_RO.ini | 1 + assets/lang/ru_RU.ini | 1 + assets/lang/sv_SE.ini | 1 + assets/lang/tg_PH.ini | 1 + assets/lang/th_TH.ini | 1 + assets/lang/tr_TR.ini | 1 + assets/lang/uk_UA.ini | 1 + assets/lang/vi_VN.ini | 1 + assets/lang/zh_CN.ini | 1 + assets/lang/zh_TW.ini | 1 + assets/ui_images/images.svg | 22 +++++++++++----------- 48 files changed, 62 insertions(+), 11 deletions(-) diff --git a/UI/UploadScreen.cpp b/UI/UploadScreen.cpp index b2c4eb8082..c8dea29d37 100644 --- a/UI/UploadScreen.cpp +++ b/UI/UploadScreen.cpp @@ -66,6 +66,11 @@ void UploadScreen::RecreateStatus() { } } +std::string_view UploadScreen::GetTitle() const { + auto n = GetI18NCategory(I18NCat::NETWORKING); + return n->T("Upload files"); +} + void UploadScreen::update() { UIScreen::update(); bool running = WebServerRunning(WebServerFlags::FILE_UPLOAD); diff --git a/UI/UploadScreen.h b/UI/UploadScreen.h index d02ab55ea8..7db4b0d13c 100644 --- a/UI/UploadScreen.h +++ b/UI/UploadScreen.h @@ -40,6 +40,7 @@ public: protected: void update() override; + std::string_view GetTitle() const override; const char *tag() const override { return "Upload"; } diff --git a/assets/lang/ar_AE.ini b/assets/lang/ar_AE.ini index be7d556a39..fbe8359740 100644 --- a/assets/lang/ar_AE.ini +++ b/assets/lang/ar_AE.ini @@ -1003,6 +1003,7 @@ Send = إرسال Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = نقل الملفات Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/az_AZ.ini b/assets/lang/az_AZ.ini index 2189b0266e..af89da9578 100644 --- a/assets/lang/az_AZ.ini +++ b/assets/lang/az_AZ.ini @@ -998,6 +998,7 @@ Send = Göndər Send Discord Presence information = Discord "Bol Varlıq" bilgisini göndər Some network functionality in this game is not working = Bu oyundakı bəzi bağlantı işləvsəlliklər işləmir To play in Infrastructure Mode, you must enter a username = İnfrastruktur Modunda oynamaq üçün işlədici adı yazmalısınız +Transfer files = Faylları köçürmək Unable to find UPnP device = UPnP qurğusu tapılmır UPnP (port-forwarding) = UPnP (port yönləndirməsi) UPnP need to be reinitialized = UPnP, yenidən başladılmalıdır diff --git a/assets/lang/be_BY.ini b/assets/lang/be_BY.ini index e21939b08b..87a9f273ad 100644 --- a/assets/lang/be_BY.ini +++ b/assets/lang/be_BY.ini @@ -962,6 +962,7 @@ Send = Адправіць Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Перадаць файлы Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/bg_BG.ini b/assets/lang/bg_BG.ini index 2e12560d08..1ab2976173 100644 --- a/assets/lang/bg_BG.ini +++ b/assets/lang/bg_BG.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Прехвърляне на файлове Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/ca_ES.ini b/assets/lang/ca_ES.ini index 695786d320..0363ea9b6f 100644 --- a/assets/lang/ca_ES.ini +++ b/assets/lang/ca_ES.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transferir fitxers Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/cz_CZ.ini b/assets/lang/cz_CZ.ini index 293efff626..2e2540c6fe 100644 --- a/assets/lang/cz_CZ.ini +++ b/assets/lang/cz_CZ.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Přenos souborů Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/da_DK.ini b/assets/lang/da_DK.ini index bd39bc4128..ee9b01d233 100644 --- a/assets/lang/da_DK.ini +++ b/assets/lang/da_DK.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Overfør filer Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/de_DE.ini b/assets/lang/de_DE.ini index f6fc2d5d8e..0c59f33d11 100644 --- a/assets/lang/de_DE.ini +++ b/assets/lang/de_DE.ini @@ -985,6 +985,7 @@ Send = Senden Send Discord Presence information = Discord "Rich Presence"-Information senden Some network functionality in this game is not working = Einige Netzwerkfunktionen in diesem Spiel funktionieren nicht To play in Infrastructure Mode, you must enter a username = Um im Infrastrukturmodus zu spielen, musst du einen Benutzernamen eingeben +Transfer files = Dateien übertragen Unable to find UPnP device = UPnP-Gerät konnte nicht gefunden werden UPnP (port-forwarding) = UPnP (Port-Weiterleitung) UPnP need to be reinitialized = UPnP muss neu initialisiert werden diff --git a/assets/lang/dr_ID.ini b/assets/lang/dr_ID.ini index 2ccd259558..e3cc32a374 100644 --- a/assets/lang/dr_ID.ini +++ b/assets/lang/dr_ID.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transfer file Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/en_US.ini b/assets/lang/en_US.ini index 19b0d67808..d8ea305ea6 100644 --- a/assets/lang/en_US.ini +++ b/assets/lang/en_US.ini @@ -986,6 +986,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transfer files Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/es_ES.ini b/assets/lang/es_ES.ini index c4e6c6a61a..3947e586aa 100644 --- a/assets/lang/es_ES.ini +++ b/assets/lang/es_ES.ini @@ -996,6 +996,7 @@ Send = Enviar Send Discord Presence information = Enviar información de "Rich Presence" a Discord Some network functionality in this game is not working = Algunas funciones de red en este juego no funcionan. To play in Infrastructure Mode, you must enter a username = Para jugar en el modo Infraestructura, debes introducir un nombre de usuario +Transfer files = Transferir archivos Unable to find UPnP device = Dispositivo UPnP no encontrado UPnP (port-forwarding) = UPnP (redirección de puertos) UPnP need to be reinitialized = Es necesario reiniciar UPnP diff --git a/assets/lang/es_LA.ini b/assets/lang/es_LA.ini index 9cc283d496..f589e5f809 100644 --- a/assets/lang/es_LA.ini +++ b/assets/lang/es_LA.ini @@ -995,6 +995,7 @@ Send = Enviar Send Discord Presence information = Enviar información al Discord "Rich Presence" Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transferir archivos Unable to find UPnP device = No se encuentra el dispositivo UPnP UPnP (port-forwarding) = UPnP (redirección de puertos) UPnP need to be reinitialized = La función de UPnP debe reinicializarse. diff --git a/assets/lang/fa_IR.ini b/assets/lang/fa_IR.ini index 4a746b2753..c029bdba22 100644 --- a/assets/lang/fa_IR.ini +++ b/assets/lang/fa_IR.ini @@ -995,6 +995,7 @@ Send = ارسال Send Discord Presence information = ارسال اطلاعات "Rich Presence" به دیسکورد Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = انتقال فایل‌ها Unable to find UPnP device = پیدا کردن دستگاه UPnP ممکن نیست UPnP (port-forwarding) = UPnP (هدایت درگاه) UPnP need to be reinitialized = UPnP باید بازراه‌اندازی شود diff --git a/assets/lang/fi_FI.ini b/assets/lang/fi_FI.ini index 917f8b44a2..4e1224c5d1 100644 --- a/assets/lang/fi_FI.ini +++ b/assets/lang/fi_FI.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Siirrä tiedostoja Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/fr_FR.ini b/assets/lang/fr_FR.ini index 2e0a909909..98c0d9dfc3 100644 --- a/assets/lang/fr_FR.ini +++ b/assets/lang/fr_FR.ini @@ -995,6 +995,7 @@ Send = Envoyer Send Discord Presence information = Envoyer l'information "Rich Presence" de Discord Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transférer des fichiers Unable to find UPnP device = Appareil UPnP introuvable UPnP (port-forwarding) = UPnP (redirection de port) UPnP need to be reinitialized = UPnP doit être réinitialisé diff --git a/assets/lang/gl_ES.ini b/assets/lang/gl_ES.ini index 01753dd7d0..61a0d841d9 100644 --- a/assets/lang/gl_ES.ini +++ b/assets/lang/gl_ES.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transferir arquivos Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/gr_EL.ini b/assets/lang/gr_EL.ini index 7ab96705eb..3d8c069e4a 100644 --- a/assets/lang/gr_EL.ini +++ b/assets/lang/gr_EL.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Αποστολή "Rich Presence" πληροφοριών σε Discord Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Μεταφορά αρχείων Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/he_IL.ini b/assets/lang/he_IL.ini index 34dabf18e0..3620d0fd2d 100644 --- a/assets/lang/he_IL.ini +++ b/assets/lang/he_IL.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = העבר קבצים Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/he_IL_invert.ini b/assets/lang/he_IL_invert.ini index 1b16298e0b..884ee7c1a9 100644 --- a/assets/lang/he_IL_invert.ini +++ b/assets/lang/he_IL_invert.ini @@ -992,6 +992,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = קבצים העבר Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/hr_HR.ini b/assets/lang/hr_HR.ini index 5a00d2a9cf..3854ecc341 100644 --- a/assets/lang/hr_HR.ini +++ b/assets/lang/hr_HR.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Šalji Discord "Rich Presence" informaciju Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Prenesi datoteke Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/hu_HU.ini b/assets/lang/hu_HU.ini index ee6f4c6eec..a8ee499b1a 100644 --- a/assets/lang/hu_HU.ini +++ b/assets/lang/hu_HU.ini @@ -995,6 +995,7 @@ Send = Küldés Send Discord Presence information = "Rich Presence" információ küldése Discordnak Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Fájlok átvitele Unable to find UPnP device = UPnP eszköz nem található UPnP (port-forwarding) = UPnP (port átirányítás) UPnP need to be reinitialized = UPnP újra-inicializálás szükséges diff --git a/assets/lang/id_ID.ini b/assets/lang/id_ID.ini index be1a325e11..25269862b3 100644 --- a/assets/lang/id_ID.ini +++ b/assets/lang/id_ID.ini @@ -995,6 +995,7 @@ Send = Kirim Send Discord Presence information = Kirim informasi "Kritik dan Saran" ke Discord Some network functionality in this game is not working = Beberapa fungsi jaringan dalam game ini tidak berfungsi To play in Infrastructure Mode, you must enter a username = Untuk bermain dalam Mode Infrastruktur, Anda harus memasukkan nama pengguna +Transfer files = Transfer file Unable to find UPnP device = Tidak dapat menemukan perangkat UPnP UPnP (port-forwarding) = UPnP (penerusan port) UPnP need to be reinitialized = UPnP perlu diinisialisasi ulang diff --git a/assets/lang/it_IT.ini b/assets/lang/it_IT.ini index 6806acd85c..2b239f90c5 100644 --- a/assets/lang/it_IT.ini +++ b/assets/lang/it_IT.ini @@ -963,6 +963,7 @@ Send = Invia Send Discord Presence information = Invia informazioni Discord "Rich Presence" Some network functionality in this game is not working = Alcune funzionalità di rete in questo gioco non funzionano To play in Infrastructure Mode, you must enter a username = Per giocare in modalità Infrastruttura, è necessario inserire un nome utente +Transfer files = Trasferisci file Unable to find UPnP device = Impossibile trovare il dispositivo UPnP UPnP (port-forwarding) = UPnP (reindirizzamento della porta) UPnP need to be reinitialized = UPnP dev'essere reinizializzato diff --git a/assets/lang/ja_JP.ini b/assets/lang/ja_JP.ini index 9625d04b0a..bc7e408626 100644 --- a/assets/lang/ja_JP.ini +++ b/assets/lang/ja_JP.ini @@ -962,6 +962,7 @@ Send = 送信する Send Discord Presence information = Discordのプレゼンス情報を送信する Some network functionality in this game is not working = このゲームの一部のネットワーク機能が動作していません To play in Infrastructure Mode, you must enter a username = インフラストラクチャモードでプレイするには、ユーザー名を入力する必要があります +Transfer files = ファイルを転送 Unable to find UPnP device = UPnPデバイスがみつかりません UPnP (port-forwarding) = UPnP(ポートフォワーディング) UPnP need to be reinitialized = UPnPの再初期化が必要です diff --git a/assets/lang/jv_ID.ini b/assets/lang/jv_ID.ini index 42fe2fb808..ca61092652 100644 --- a/assets/lang/jv_ID.ini +++ b/assets/lang/jv_ID.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transfer file Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/ko_KR.ini b/assets/lang/ko_KR.ini index 5b99a6a8b6..609e9a15cb 100644 --- a/assets/lang/ko_KR.ini +++ b/assets/lang/ko_KR.ini @@ -962,6 +962,7 @@ Send = 보내기 Send Discord Presence information = 디스코드 "리치 프레즌스" 정보 보내기 Some network functionality in this game is not working = 이 게임의 일부 네트워크 기능이 작동하지 않았음 To play in Infrastructure Mode, you must enter a username = 인프라 모드에서 플레이하려면 사용자 이름을 입력해야 함 +Transfer files = 파일 전송 Unable to find UPnP device = UPnP 장치를 찾을 수 없습니다. UPnP (port-forwarding) = UPnP (포트 포워딩) UPnP need to be reinitialized = UPnP를 다시 초기화해야 합니다. diff --git a/assets/lang/ku_SO.ini b/assets/lang/ku_SO.ini index 61a7db8b5f..709b6c21a8 100644 --- a/assets/lang/ku_SO.ini +++ b/assets/lang/ku_SO.ini @@ -976,6 +976,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Pelanên transfer bike Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/lo_LA.ini b/assets/lang/lo_LA.ini index a466dc6c02..baa0d08645 100644 --- a/assets/lang/lo_LA.ini +++ b/assets/lang/lo_LA.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = ເກັບໃສ່ໄຟລ໌ Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/lt-LT.ini b/assets/lang/lt-LT.ini index 02e73dc103..f30e393fc7 100644 --- a/assets/lang/lt-LT.ini +++ b/assets/lang/lt-LT.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Perkelti failus Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/ms_MY.ini b/assets/lang/ms_MY.ini index ec2c3461c8..977117ef06 100644 --- a/assets/lang/ms_MY.ini +++ b/assets/lang/ms_MY.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Pindahkan fail Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/nl_NL.ini b/assets/lang/nl_NL.ini index 383c3241cd..4d2ec8fb86 100644 --- a/assets/lang/nl_NL.ini +++ b/assets/lang/nl_NL.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Bestanden overdragen Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/no_NO.ini b/assets/lang/no_NO.ini index d19046758d..2a9168a784 100644 --- a/assets/lang/no_NO.ini +++ b/assets/lang/no_NO.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Overfør filer Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/pl_PL.ini b/assets/lang/pl_PL.ini index 13f21be89b..288c7ee9c7 100644 --- a/assets/lang/pl_PL.ini +++ b/assets/lang/pl_PL.ini @@ -991,6 +991,7 @@ Send = Wyślij Send Discord Presence information = Przesyłaj informacje Discord Rich Presence Some network functionality in this game is not working = Niektóre funkcje sieciowe w tej grze nie działają To play in Infrastructure Mode, you must enter a username = Aby grać w trybie infrastruktury, musisz wprowadzić nazwę użytkownika. +Transfer files = Przenieś pliki Unable to find UPnP device = Nie udało się zlokalizować urządzenia UPnP UPnP (port-forwarding) = UPnP (przekierowanie portów) UPnP need to be reinitialized = Należy ponownie zainicjować UPnP diff --git a/assets/lang/pt_BR.ini b/assets/lang/pt_BR.ini index da424a74d5..e0f9712e08 100644 --- a/assets/lang/pt_BR.ini +++ b/assets/lang/pt_BR.ini @@ -985,6 +985,7 @@ Send = Enviar Send Discord Presence information = Enviar informação da "Rich Presence" no Discord Some network functionality in this game is not working = Algumas funcionalidades da rede neste jogo não estão funcionando To play in Infrastructure Mode, you must enter a username = Pra jogar no Modo de Infra-estrutura você deve inserir um nome de usuário +Transfer files = Transferir arquivos Unable to find UPnP device = Incapaz de achar o dispositivo UPnP UPnP (port-forwarding) = UPnP (abertura das portas) UPnP need to be reinitialized = O UPnP precisa ser reinicializado diff --git a/assets/lang/pt_PT.ini b/assets/lang/pt_PT.ini index 758abf64db..a7a48552da 100644 --- a/assets/lang/pt_PT.ini +++ b/assets/lang/pt_PT.ini @@ -987,6 +987,7 @@ Send = Enviar Send Discord Presence information = Enviar informação de "Rich Presence" no Discord Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transferir ficheiros Unable to find UPnP device = Não é possível encontrar o dispositivo UPnP UPnP (port-forwarding) = UPnP (abertura das portas) UPnP need to be reinitialized = O UPnP precisa ser reiniciado diff --git a/assets/lang/ro_RO.ini b/assets/lang/ro_RO.ini index 37fc255190..4a2b57a609 100644 --- a/assets/lang/ro_RO.ini +++ b/assets/lang/ro_RO.ini @@ -996,6 +996,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Transferați fișiere Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/ru_RU.ini b/assets/lang/ru_RU.ini index ecbc728eac..be5b016370 100644 --- a/assets/lang/ru_RU.ini +++ b/assets/lang/ru_RU.ini @@ -962,6 +962,7 @@ Send = Отправить Send Discord Presence information = Отправлять информацию об игре в Discord Some network functionality in this game is not working = Некоторые сетевые функции в этой игре не работают To play in Infrastructure Mode, you must enter a username = Для игры в режиме инфраструктуры необходимо ввести имя пользователя +Transfer files = Перенос файлов Unable to find UPnP device = Невозможно найти устройство UPnP UPnP (port-forwarding) = UPnP (проброс портов) UPnP need to be reinitialized = Необходимо перезапустить UPnP diff --git a/assets/lang/sv_SE.ini b/assets/lang/sv_SE.ini index 9ecedbe362..5679360687 100644 --- a/assets/lang/sv_SE.ini +++ b/assets/lang/sv_SE.ini @@ -963,6 +963,7 @@ Send = Skicka Send Discord Presence information = Visa Discord "Rich Presence"-information Some network functionality in this game is not working = Viss nätverksfunktionalitet i detta spel fungerar ej To play in Infrastructure Mode, you must enter a username = För att spela i infrastrukturläge måste du ange ett användarnamn +Transfer files = Överför filer Unable to find UPnP device = Kunde inte hitta UPnP-enhet UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP behöver ominitialiseras diff --git a/assets/lang/tg_PH.ini b/assets/lang/tg_PH.ini index fff606760e..fac3e7a7fc 100644 --- a/assets/lang/tg_PH.ini +++ b/assets/lang/tg_PH.ini @@ -996,6 +996,7 @@ Send = I-Send Send Discord Presence information = Magpadala ng impormasyon sa 'Rich Presence' ni Discord. Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Файли интиқол кунед Unable to find UPnP device = Hindi mahanap ang UPnP device UPnP (port-forwarding) = UPnP (pagpapasa ng port) UPnP need to be reinitialized = Kailangang muling simulan ang UPnP diff --git a/assets/lang/th_TH.ini b/assets/lang/th_TH.ini index 70af88ccab..3235b31359 100644 --- a/assets/lang/th_TH.ini +++ b/assets/lang/th_TH.ini @@ -1014,6 +1014,7 @@ Send = ส่ง Send Discord Presence information = แสดงชื่อเกมที่กำลังเล่นอยู่ไปยังแอพ Discord Some network functionality in this game is not working = ฟังก์ชั่นของเครือข่ายบางอย่างในเกมนี้อาจจะใช้งานไม่ได้ To play in Infrastructure Mode, you must enter a username = การเล่นในโหมด Infrastructure คุณจะต้องป้อนชื่อผู้ใช้งาน +Transfer files = โอนไฟล์ Unable to find UPnP device = ไม่พบอุปกรณ์ UPnP UPnP (port-forwarding) = โพรโตคอล UPnP (ฟอร์เวิร์ด พอร์ต อัตโนมัติ) UPnP need to be reinitialized = UPnP จำเป็นต้องเริ่มการทำงานใหม่ diff --git a/assets/lang/tr_TR.ini b/assets/lang/tr_TR.ini index 13e6895c16..75413084d3 100644 --- a/assets/lang/tr_TR.ini +++ b/assets/lang/tr_TR.ini @@ -997,6 +997,7 @@ Send = Gönder Send Discord Presence information = Discord Zengin Varlık Bilgisi Gönder Some network functionality in this game is not working = Bu oyundaki bazı ağ işlevleri çalışmıyor To play in Infrastructure Mode, you must enter a username = Altyapı modunda oynamak için bir kullanıcı adı girmelisiniz +Transfer files = Dosyaları aktar Unable to find UPnP device = UPnP cihazı bulunamıyor UPnP (port-forwarding) = UPnP (Port Yönlendirme) UPnP need to be reinitialized = UPnP yeniden başlatılmalı diff --git a/assets/lang/uk_UA.ini b/assets/lang/uk_UA.ini index 74e53a5f2a..682d06d4c0 100644 --- a/assets/lang/uk_UA.ini +++ b/assets/lang/uk_UA.ini @@ -995,6 +995,7 @@ Send = Надіслати Send Discord Presence information = Відправляти інформацію про гру в Діскорд Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Передати файли Unable to find UPnP device = Неможливо знайти пристрій UPnP UPnP (port-forwarding) = UPnP (переадресація портів) UPnP need to be reinitialized = UPnP необхідно повторно ініціалізувати diff --git a/assets/lang/vi_VN.ini b/assets/lang/vi_VN.ini index 5a33cd8924..f3a6270842 100644 --- a/assets/lang/vi_VN.ini +++ b/assets/lang/vi_VN.ini @@ -995,6 +995,7 @@ Send = Send Send Discord Presence information = Send Discord "Rich Presence" information Some network functionality in this game is not working = Some network functionality in this game is not working To play in Infrastructure Mode, you must enter a username = To play in Infrastructure Mode, you must enter a username +Transfer files = Chuyển tệp Unable to find UPnP device = Unable to find UPnP device UPnP (port-forwarding) = UPnP (port forwarding) UPnP need to be reinitialized = UPnP need to be reinitialized diff --git a/assets/lang/zh_CN.ini b/assets/lang/zh_CN.ini index 08e8414771..13e9998e30 100644 --- a/assets/lang/zh_CN.ini +++ b/assets/lang/zh_CN.ini @@ -996,6 +996,7 @@ Send = 发送 Send Discord Presence information = Discord 显示在线状态 Some network functionality in this game is not working = 此游戏中的某些网络功能不起作用 To play in Infrastructure Mode, you must enter a username = 您必须输入用户名,才能在基础模式下游玩 +Transfer files = 传输文件 Unable to find UPnP device = 未找到UPnP设备 UPnP (port-forwarding) = UPnP (端口转发) UPnP need to be reinitialized = UPnP 需要重新初始化 diff --git a/assets/lang/zh_TW.ini b/assets/lang/zh_TW.ini index aedad88df8..1b5e430703 100644 --- a/assets/lang/zh_TW.ini +++ b/assets/lang/zh_TW.ini @@ -962,6 +962,7 @@ Send = 傳送 Send Discord Presence information = 傳送 Discord「Rich Presence」資訊 Some network functionality in this game is not working = 此遊戲中的某些網路功能無法工作 To play in Infrastructure Mode, you must enter a username = 您必須輸入使用者名稱,才能在基礎模式下游玩 +Transfer files = 傳輸檔案 Unable to find UPnP device = 找不到 UPnP 裝置 UPnP (port-forwarding) = UPnP (連接埠轉送) UPnP need to be reinitialized = UPnP 需要重新初始化 diff --git a/assets/ui_images/images.svg b/assets/ui_images/images.svg index 5405972a5a..cd57482af1 100644 --- a/assets/ui_images/images.svg +++ b/assets/ui_images/images.svg @@ -24,9 +24,9 @@ inkscape:pagecheckerboard="true" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" - inkscape:zoom="2.8284273" - inkscape:cx="130.81475" - inkscape:cy="363.62964" + inkscape:zoom="16.000001" + inkscape:cx="88.062495" + inkscape:cy="536.09372" inkscape:window-width="3840" inkscape:window-height="2071" inkscape:window-x="-9" @@ -4291,14 +4291,14 @@ d="m 394.50099,118.40641 -313.625408,0 C 19.303582,118.40641 0,177.316 0,238.889 0,300.462 19.303582,358.17138 80.875582,358.17138 l 313.625408,0 c 61.573,0 83.27701,-57.71038 83.27701,-119.28238 0,-61.573 -21.70401,-120.48259 -83.27701,-120.48259 z m -46.97508,203.70597 c 5.624,0 -4.558,10.18 -10.18,10.18 l -216.71733,0 c -5.622,0 -10.179,-4.556 -10.179,-10.18 V 154.46541 c 0,-5.623 4.557,-10.18 10.179,-10.18 l 216.71633,0 c 5.622,0 10.18,4.556 10.18,10.18 v 167.64697 z m 28.9719,-62.74938 c -0.132,0 -0.232,0.07 -0.365,0.07 -9.877,0 -17.886,-8.017 -17.886,-17.901 0,-9.868 8.009,-17.885 17.886,-17.885 0.132,0 0.233,0.07 0.365,0.07 9.713,0.209 17.536,8.079 17.536,17.815 0,9.752 -7.822,17.623 -17.536,17.831 z m 36.527,36.961 c -9.877,0 -17.886,-8.009 -17.886,-17.893 0,-9.884 8.009,-17.893 17.886,-17.893 9.892,0 17.901,8.009 17.901,17.893 -0.001,9.884 -8.01,17.893 -17.901,17.893 z m 0,-73.781 c -9.877,0 -17.886,-8.009 -17.886,-17.893 0,-9.884 8.009,-17.893 17.886,-17.893 9.892,0 17.901,8.009 17.901,17.893 -0.001,9.883 -8.01,17.893 -17.901,17.893 z m 36.89,36.89 c -9.877,0 -17.886,-8.017 -17.886,-17.901 0,-9.868 8.009,-17.885 17.886,-17.885 9.892,0 17.901,8.017 17.901,17.885 0,9.884 -8.009,17.901 -17.901,17.901 z" style="fill:#ffffff;fill-opacity:1" sodipodi:nodetypes="ssssssssssssssscscssscscsssssssssssssss" - id="path113" /> Date: Sun, 9 Nov 2025 22:33:03 +0100 Subject: [PATCH 3/4] More padding fixes --- Common/UI/View.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index 8e5cb7870e..3e446169ca 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -468,14 +468,15 @@ void Choice::ClickInternal() { void Choice::GetContentDimensionsBySpec(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert, float &w, float &h) const { float totalW = 0.0f; float totalH = 0.0f; + int paddingLeft = 12; + int paddingRight = 12; + if (!text_.empty() && !hideTitle_) { - int paddingLeft = 12; - int paddingRight = 12; if (rightIconImage_.isValid()) { paddingRight = ITEM_HEIGHT; } - float availWidth = horiz.size - paddingLeft - paddingRight - textPadding_.horiz() - totalW; + float availWidth = horiz.size - paddingLeft - paddingRight - textPadding_.horiz(); if (availWidth < 0.0f) { // Let it have as much space as it needs. availWidth = MAX_ITEM_SIZE; @@ -487,20 +488,19 @@ void Choice::GetContentDimensionsBySpec(const UIContext &dc, MeasureSpec horiz, float textW = 0.0f, textH = 0.0f; dc.MeasureTextRect(dc.GetTheme().uiFont, scale, scale, text_, availBounds, &textW, &textH, FLAG_WRAP_TEXT); totalH = std::max(totalH, textH); - totalW += textW; if (image_.isValid()) { - totalW += 12; - totalW += totalH; + paddingLeft = ITEM_HEIGHT; } + totalW = paddingLeft + textW + paddingRight + textPadding_.horiz(); } else { if (image_.isValid()) { dc.Draw()->GetAtlas()->measureImage(image_, &w, &h); - totalW = w * imgScale_ + 6; + totalW = w * imgScale_ + paddingLeft + paddingRight; totalH = h * imgScale_; } } - w = totalW + (text_.empty() ? 16 : 24); + w = totalW; h = totalH + 16; h = std::max(h, ITEM_HEIGHT); } From 412c746179c3d467349d61f391c4b006a93a4809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 9 Nov 2025 23:10:53 +0100 Subject: [PATCH 4/4] Add tilt (accelerometer) input support for DualSense controllers on Windows --- Core/Config.cpp | 3 --- UI/NativeApp.cpp | 1 + Windows/HidInputDevice.cpp | 32 +++++++++++++++++++++++++------- Windows/HidInputDevice.h | 6 ++++++ Windows/InputDevice.cpp | 9 +++++++++ Windows/InputDevice.h | 5 ++++- Windows/main.cpp | 2 +- 7 files changed, 46 insertions(+), 12 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index f68ddfba9a..7239221be4 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -957,8 +957,6 @@ static const ConfigSetting controlSettings[] = { ConfigSetting("Custom18Mapping", "Custom18Image", "Custom18Shape", "Custom18Toggle", "Custom18Repeat", SETTING_IDX(g_Config, CustomButton, 18), {0, 3, 9, false, false}, CfgFlag::PER_GAME), ConfigSetting("Custom19Mapping", "Custom19Image", "Custom19Shape", "Custom19Toggle", "Custom19Repeat", SETTING_IDX(g_Config, CustomButton, 19), {0, 4, 9, false, false}, CfgFlag::PER_GAME), - -#ifdef MOBILE_DEVICE ConfigSetting("TiltBaseAngleY", SETTING(g_Config, fTiltBaseAngleY), 0.9f, CfgFlag::PER_GAME), ConfigSetting("TiltInvertX", SETTING(g_Config, bInvertTiltX), false, CfgFlag::PER_GAME), ConfigSetting("TiltInvertY", SETTING(g_Config, bInvertTiltY), false, CfgFlag::PER_GAME), @@ -968,7 +966,6 @@ static const ConfigSetting controlSettings[] = { ConfigSetting("TiltInverseDeadzone", SETTING(g_Config, fTiltInverseDeadzone), 0.0f, CfgFlag::PER_GAME), ConfigSetting("TiltCircularDeadzone", SETTING(g_Config, bTiltCircularDeadzone), true, CfgFlag::PER_GAME), ConfigSetting("TiltInputType", SETTING(g_Config, iTiltInputType), 0, CfgFlag::PER_GAME), -#endif ConfigSetting("DisableDpadDiagonals", SETTING(g_Config, bDisableDpadDiagonals), false, CfgFlag::PER_GAME), ConfigSetting("GamepadOnlyFocused", SETTING(g_Config, bGamepadOnlyFocused), false, CfgFlag::PER_GAME), diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 25d3c2832c..26556b66ea 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1477,6 +1477,7 @@ void NativeMouseDelta(float dx, float dy) { SendMouseDeltaAxis(); } +// TODO: Should include a device ID here, since accelerometers can be on pads for example (DualSense). void NativeAccelerometer(float tiltX, float tiltY, float tiltZ) { if (g_Config.iTiltInputType == TILT_NULL) { // if tilt events are disabled, don't do anything special. diff --git a/Windows/HidInputDevice.cpp b/Windows/HidInputDevice.cpp index 53809e4e92..1ebb83ea71 100644 --- a/Windows/HidInputDevice.cpp +++ b/Windows/HidInputDevice.cpp @@ -226,7 +226,7 @@ struct DualSenseOutputReport { u8 rumbleLeft; u8 pad[2]; u8 muteLED; - u8 micMute; + u8 micMute; // 10 u8 other[32]; u8 enableBrightness; u8 fade; @@ -491,6 +491,8 @@ bool ReadDualShockInput(HANDLE handle, HIDControllerState *state) { state->triggerAxes[PS_TRIGGER_L2] = report.l2_analog; state->triggerAxes[PS_TRIGGER_R2] = report.r2_analog; + state->accValid = false; + u32 buttons{}; int frameCounter = report.buttons[2] >> 2; report.buttons[2] &= 3; @@ -506,6 +508,8 @@ bool ReadDualShockInput(HANDLE handle, HIDControllerState *state) { // So strange that this is different! struct DualSenseInputReport { + u8 firstByte; // must be 1 + u8 lx; u8 ly; u8 rx; @@ -514,11 +518,13 @@ struct DualSenseInputReport { u8 l2_analog; u8 r2_analog; - u8 frameCounter; + u8 frameCounter; // 7 - u8 buttons[3]; + u8 buttons[3]; // 8-10 + u8 pad[5]; // 11,12,13,14,15 - // TODO: More stuff (battery, tilt, etc). + s16 gyroscope[3]; + s16 accelerometer[3]; }; bool ReadDualSenseInput(HANDLE handle, HIDControllerState *state) { @@ -536,14 +542,13 @@ bool ReadDualSenseInput(HANDLE handle, HIDControllerState *state) { } // OK, check the first byte to figure out what we're dealing with here. - int offset = 1; if (inputReport[0] != 1) { // Wrong data return false; } // const bool isBluetooth = (reportId == 0x11 || reportId == 0x31); - memcpy(&report, inputReport + offset, sizeof(report)); + memcpy(&report, inputReport, sizeof(report)); // Center the sticks. state->stickAxes[PS_STICK_LX] = report.lx - 128; @@ -555,6 +560,13 @@ bool ReadDualSenseInput(HANDLE handle, HIDControllerState *state) { state->triggerAxes[PS_TRIGGER_L2] = report.l2_analog; state->triggerAxes[PS_TRIGGER_R2] = report.r2_analog; + const float accelScale = (1.0f / 8192.0f) * 9.81f; + // We need to remap the axes a bit. + state->accValid = true; + state->accelerometer[0] = -report.accelerometer[2] * accelScale; + state->accelerometer[1] = -report.accelerometer[0] * accelScale; + state->accelerometer[2] = report.accelerometer[1] * accelScale; + u32 buttons{}; report.buttons[2] &= 3; // Remove noise memcpy(&buttons, &report.buttons[0], 3); @@ -563,6 +575,8 @@ bool ReadDualSenseInput(HANDLE handle, HIDControllerState *state) { buttons &= ~0xF; buttons |= DecodeHatSwitch(report.buttons[0] & 0xF); + INFO_LOG(Log::sceCtrl, "DualSense accel: %0.2f %0.2f %0.2f", state->accelerometer[0], state->accelerometer[1], state->accelerometer[2]); + state->buttons = buttons; return true; } @@ -607,7 +621,7 @@ static void DecodeSwitchProStick(const u8 *stickData, s8 *outX, s8 *outY) { // INFO_LOG(Log::sceCtrl, "Switch Pro input: x=%d, y=%d, cx=%d, cy=%d", x, y, *outX, *outY); } -bool ReadSwitchProInput(HANDLE handle, HIDControllerState *state) { +static bool ReadSwitchProInput(HANDLE handle, HIDControllerState *state) { BYTE inputReport[SwitchPro_INPUT_REPORT_LEN]{}; // 64-byte input report for Switch Pro DWORD bytesRead = 0; if (!ReadFile(handle, inputReport, sizeof(inputReport), &bytesRead, nullptr)) { @@ -737,6 +751,10 @@ int HidInputDevice::UpdateState() { } } + if (state.accValid) { + NativeAccelerometer(state.accelerometer[0], state.accelerometer[1], state.accelerometer[2]); + } + prevState_ = state; return UPDATESTATE_NO_SLEEP; // The ReadFile sleeps for us, effectively. } else { diff --git a/Windows/HidInputDevice.h b/Windows/HidInputDevice.h index 163e9eeaa7..7cf44261cb 100644 --- a/Windows/HidInputDevice.h +++ b/Windows/HidInputDevice.h @@ -21,6 +21,9 @@ struct HIDControllerState { // Buttons. Here the mapping is specific to the controller type and resolved // later. u32 buttons; // Bitmask, PSButton enum + + bool accValid = false; + float accelerometer[3]; // X, Y, Z }; struct ButtonInputMapping; @@ -34,6 +37,9 @@ public: void Shutdown() override; static void AddSupportedDevices(std::set *deviceVIDPIDs); + bool HasAccelerometer() const override { + return subType_ == HIDControllerType::DS5; + } private: void ReleaseAllKeys(const ButtonInputMapping *buttonMappings, int count); InputDeviceID DeviceID(int pad); diff --git a/Windows/InputDevice.cpp b/Windows/InputDevice.cpp index 2effbf71b5..0bb12c4a74 100644 --- a/Windows/InputDevice.cpp +++ b/Windows/InputDevice.cpp @@ -86,3 +86,12 @@ void InputManager::StopPolling() { runThread_.store(false, std::memory_order_relaxed); inputThread_.join(); } + +bool InputManager::AnyAccelerometer() const { + for (const auto &device : devices_) { + if (device->HasAccelerometer()) { + return true; + } + } + return false; +} diff --git a/Windows/InputDevice.h b/Windows/InputDevice.h index d774f2c704..d29bc93d64 100644 --- a/Windows/InputDevice.h +++ b/Windows/InputDevice.h @@ -26,10 +26,11 @@ class InputDevice { public: - virtual ~InputDevice() {} + virtual ~InputDevice() = default; virtual void Init() {} virtual void Shutdown() {} + virtual bool HasAccelerometer() const { return false; } enum { UPDATESTATE_SKIP_PAD = 0x1234, UPDATESTATE_NO_SLEEP = 0x2345}; virtual int UpdateState() = 0; @@ -55,6 +56,8 @@ public: devices_.emplace_back(std::unique_ptr(device)); } + bool AnyAccelerometer() const; + private: void InputThread(); diff --git a/Windows/main.cpp b/Windows/main.cpp index 2cd5a6ace5..ec2ce66450 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -446,7 +446,7 @@ bool System_GetPropertyBool(SystemProperty prop) { return false; #endif case SYSPROP_HAS_ACCELEROMETER: - return true; // for debugging + return g_InputManager.AnyAccelerometer(); default: return false; }