mirror of
				https://git.tardis.systems/mirrors/yuzu
				synced 2025-11-04 04:34:07 +01:00 
			
		
		
		
	yuzu: Remove amiibos on drag and drop
This commit is contained in:
		
							parent
							
								
									2984695265
								
							
						
					
					
						commit
						b504df9d02
					
				@ -2937,6 +2937,7 @@ void GMainWindow::OnLoadAmiibo() {
 | 
			
		||||
    if (nfc_state == Service::NFP::DeviceState::TagFound ||
 | 
			
		||||
        nfc_state == Service::NFP::DeviceState::TagMounted) {
 | 
			
		||||
        nfc->CloseAmiibo();
 | 
			
		||||
        QMessageBox::warning(this, tr("Amiibo"), tr("The current amiibo has been removed"));
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -2965,6 +2966,15 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Remove amiibo if one is connected
 | 
			
		||||
    const auto nfc_state = nfc->GetCurrentState();
 | 
			
		||||
    if (nfc_state == Service::NFP::DeviceState::TagFound ||
 | 
			
		||||
        nfc_state == Service::NFP::DeviceState::TagMounted) {
 | 
			
		||||
        nfc->CloseAmiibo();
 | 
			
		||||
        QMessageBox::warning(this, tr("Amiibo"), tr("The current amiibo has been removed"));
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    QFile nfc_file{filename};
 | 
			
		||||
    if (!nfc_file.open(QIODevice::ReadOnly)) {
 | 
			
		||||
        QMessageBox::warning(this, tr("Error opening Amiibo data file"),
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user