mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-23 13:55:39 +01:00
Merge pull request #3058 from FearlessTobi/port-4948
Port citra-emu/citra#4948: "citra_qt: add amiibo drag and drop support"
This commit is contained in:
commit
bec7e3b7d9
@ -1839,6 +1839,10 @@ void GMainWindow::OnLoadAmiibo() {
|
||||
return;
|
||||
}
|
||||
|
||||
LoadAmiibo(filename);
|
||||
}
|
||||
|
||||
void GMainWindow::LoadAmiibo(const QString& filename) {
|
||||
Core::System& system{Core::System::GetInstance()};
|
||||
Service::SM::ServiceManager& sm = system.ServiceManager();
|
||||
auto nfc = sm.GetService<Service::NFP::Module::Interface>("nfp:user");
|
||||
@ -2189,11 +2193,20 @@ static bool IsSingleFileDropEvent(QDropEvent* event) {
|
||||
}
|
||||
|
||||
void GMainWindow::dropEvent(QDropEvent* event) {
|
||||
if (IsSingleFileDropEvent(event) && ConfirmChangeGame()) {
|
||||
const QMimeData* mimeData = event->mimeData();
|
||||
QString filename = mimeData->urls().at(0).toLocalFile();
|
||||
if (!IsSingleFileDropEvent(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::dragEnterEvent(QDragEnterEvent* event) {
|
||||
|
@ -142,6 +142,7 @@ private:
|
||||
|
||||
void ShowTelemetryCallout();
|
||||
void SetDiscordEnabled(bool state);
|
||||
void LoadAmiibo(const QString& filename);
|
||||
|
||||
void SelectAndSetCurrentUser();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user