mirror of
https://github.com/yuzu-emu/yuzu-mainline.git
synced 2024-12-25 02:35:41 +00:00
citra_qt: add amiibo drag and drop support
Co-Authored-By: Valentin Vanelslande <vvanelslandedev@gmail.com>
This commit is contained in:
parent
11e39da02b
commit
727ba2f2d0
|
@ -1839,6 +1839,10 @@ void GMainWindow::OnLoadAmiibo() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoadAmiibo(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GMainWindow::LoadAmiibo(const QString& filename) {
|
||||||
Core::System& system{Core::System::GetInstance()};
|
Core::System& system{Core::System::GetInstance()};
|
||||||
Service::SM::ServiceManager& sm = system.ServiceManager();
|
Service::SM::ServiceManager& sm = system.ServiceManager();
|
||||||
auto nfc = sm.GetService<Service::NFP::Module::Interface>("nfp:user");
|
auto nfc = sm.GetService<Service::NFP::Module::Interface>("nfp:user");
|
||||||
|
@ -2189,12 +2193,21 @@ static bool IsSingleFileDropEvent(QDropEvent* event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::dropEvent(QDropEvent* event) {
|
void GMainWindow::dropEvent(QDropEvent* event) {
|
||||||
if (IsSingleFileDropEvent(event) && ConfirmChangeGame()) {
|
if (!IsSingleFileDropEvent(event)) {
|
||||||
const QMimeData* mimeData = event->mimeData();
|
return;
|
||||||
QString filename = mimeData->urls().at(0).toLocalFile();
|
}
|
||||||
|
|
||||||
|
const QMimeData* mime_data = event->mimeData();
|
||||||
|
const QString filename = mime_data->urls().at(0).toLocalFile();
|
||||||
|
|
||||||
|
if (emulation_running && QFileInfo(filename).suffix() == QStringLiteral("bin")) {
|
||||||
|
LoadAmiibo(filename);
|
||||||
|
} else {
|
||||||
|
if (ConfirmChangeGame()) {
|
||||||
BootGame(filename);
|
BootGame(filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GMainWindow::dragEnterEvent(QDragEnterEvent* event) {
|
void GMainWindow::dragEnterEvent(QDragEnterEvent* event) {
|
||||||
if (IsSingleFileDropEvent(event)) {
|
if (IsSingleFileDropEvent(event)) {
|
||||||
|
|
|
@ -142,6 +142,7 @@ private:
|
||||||
|
|
||||||
void ShowTelemetryCallout();
|
void ShowTelemetryCallout();
|
||||||
void SetDiscordEnabled(bool state);
|
void SetDiscordEnabled(bool state);
|
||||||
|
void LoadAmiibo(const QString& filename);
|
||||||
|
|
||||||
void SelectAndSetCurrentUser();
|
void SelectAndSetCurrentUser();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue