mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-30 10:58:59 +02:00
Some genius decided to put the entire MainWindow class into main.h and main.cpp, which is not only horrific practice but also completely destroys clangd beyond repair. Please, just don't do this. (this will probably merge conflict to hell and back) Also, fixes a bunch of issues with Ryujinx save data link: - Paths with spaces would cause mklink to fail - Add support for portable directories - Symlink detection was incorrect sometimes(????) - Some other stuff I'm forgetting Furthermore, when selecting "From Eden" and attempting to save in Ryujinx, Ryujinx would destroy the link for... some reason? So to get around this we just copy the Eden data to Ryujinx then treat it like a "From Ryujinx" op Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2929 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
88 lines
2.5 KiB
C++
88 lines
2.5 KiB
C++
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <memory>
|
|
#include <QDialog>
|
|
#include "core/frontend/applets/cabinet.h"
|
|
|
|
class MainWindow;
|
|
class QCheckBox;
|
|
class QComboBox;
|
|
class QDialogButtonBox;
|
|
class QGroupBox;
|
|
class QLabel;
|
|
|
|
namespace InputCommon {
|
|
class InputSubsystem;
|
|
}
|
|
|
|
namespace Ui {
|
|
class QtAmiiboSettingsDialog;
|
|
}
|
|
|
|
namespace Service::NFC {
|
|
class NfcDevice;
|
|
} // namespace Service::NFC
|
|
|
|
class QtAmiiboSettingsDialog final : public QDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit QtAmiiboSettingsDialog(QWidget* parent, Core::Frontend::CabinetParameters parameters_,
|
|
InputCommon::InputSubsystem* input_subsystem_,
|
|
std::shared_ptr<Service::NFC::NfcDevice> nfp_device_);
|
|
~QtAmiiboSettingsDialog() override;
|
|
|
|
int exec() override;
|
|
|
|
std::string GetName() const;
|
|
|
|
private:
|
|
void LoadInfo();
|
|
void LoadAmiiboInfo();
|
|
void LoadAmiiboApiInfo(std::string_view amiibo_id);
|
|
void LoadAmiiboData();
|
|
void LoadAmiiboGameInfo();
|
|
void SetGameDataName(u32 application_area_id);
|
|
void SetSettingsDescription();
|
|
|
|
std::unique_ptr<Ui::QtAmiiboSettingsDialog> ui;
|
|
|
|
InputCommon::InputSubsystem* input_subsystem;
|
|
std::shared_ptr<Service::NFC::NfcDevice> nfp_device;
|
|
|
|
// Parameters sent in from the backend HLE applet.
|
|
Core::Frontend::CabinetParameters parameters;
|
|
|
|
// If false amiibo settings failed to load
|
|
bool is_initialized{};
|
|
};
|
|
|
|
class QtAmiiboSettings final : public QObject, public Core::Frontend::CabinetApplet {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit QtAmiiboSettings(MainWindow& parent);
|
|
~QtAmiiboSettings() override;
|
|
|
|
void Close() const override;
|
|
void ShowCabinetApplet(const Core::Frontend::CabinetCallback& callback_,
|
|
const Core::Frontend::CabinetParameters& parameters,
|
|
std::shared_ptr<Service::NFC::NfcDevice> nfp_device) const override;
|
|
|
|
signals:
|
|
void MainWindowShowAmiiboSettings(const Core::Frontend::CabinetParameters& parameters,
|
|
std::shared_ptr<Service::NFC::NfcDevice> nfp_device) const;
|
|
void MainWindowRequestExit() const;
|
|
|
|
private:
|
|
void MainWindowFinished(bool is_success, const std::string& name);
|
|
|
|
mutable Core::Frontend::CabinetCallback callback;
|
|
};
|