mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-25 01:11:48 +01:00
citra_qt: add amiibo drag and drop support
This commit is contained in:
parent
223bfc9a2a
commit
07eb89c6ee
@ -1463,6 +1463,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::NFC::Module::Interface>("nfc:u");
|
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
|
||||||
@ -1859,10 +1863,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();
|
}
|
||||||
BootGame(filename);
|
|
||||||
|
const QMimeData* mime_data = event->mimeData();
|
||||||
|
const QString& filename = mime_data->urls().at(0).toLocalFile();
|
||||||
|
|
||||||
|
if (emulation_running && QFileInfo(filename).suffix() == "bin") {
|
||||||
|
// Amiibo
|
||||||
|
LoadAmiibo(filename);
|
||||||
|
} else {
|
||||||
|
// Game
|
||||||
|
if (ConfirmChangeGame()) {
|
||||||
|
BootGame(filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ private:
|
|||||||
void ShowNoUpdatePrompt();
|
void ShowNoUpdatePrompt();
|
||||||
void CheckForUpdates();
|
void CheckForUpdates();
|
||||||
void SetDiscordEnabled(bool state);
|
void SetDiscordEnabled(bool state);
|
||||||
|
void LoadAmiibo(const QString& filename);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the filename in the recently loaded files list.
|
* Stores the filename in the recently loaded files list.
|
||||||
|
Loading…
Reference in New Issue
Block a user