Browse Source
[qt] Ryujinx save data link (#2815)
[qt] Ryujinx save data link (#2815)
This adds an action to the Game List context menu that lets users link save data from Eden to Ryujinx, or vice versa. Unfortunately, this isn't so simple to deal with due to the way Ryujinx's saves work. Ryujinx stores its saves in the... config directory... in `bis/user/save`. Unlike Yuzu, however, it doesn't store things by TitleID, instead it's just a bunch of directories from 000...01 to 000...0f and so on. The way it *maps* TitleID to SaveID is via `imkvdb.arc` in `bis/system/save/8000000000000000/0/` and also an identical copy in the `1` directory for... some reason. `imkvdb.arc` is handled by `FlatMapKeyValueStore` in LibHac, which, as the name implies, is a key-value storage system that `imkvdb.arc`, and seemingly `imkvdb.arc` alone, uses. The way this class is written is really weird, almost as if it's designed to accommodate more types of kvdbs... but for now we can safely assume that there aren't gonna be any other `kvdb` implementations added to HorizonNX. Regardless, the file format is ridiculously simple so I didn't actually need to do a deep dive into C# code... of which I can basically only read Avalonia. A simple `xxd` on the `imkvdb.arc` is all that's needed, and here's everything that matters: - The `IMKV` magic header (4 bytes) - 8 bytes that don't really have anything useful to us, except for a size byte (presumably a `u32`) strewn at offset `0x08` from the start of the file, which is useless to us - Then we start the `IMEN` list. I don't know what the `IM` stands for, but `IMEN` is just, well, an ENtry. Offsets shown are relative to the start of the `IMEN` header. * 4-byte `IMEN` magic header at 0x0 * 8 bytes of filler data. It contains two `0x40` bytes, but I'm not really sure what they do * TitleID (u64) at `0xC`, for example `00a0 df10 501f 0001` for Legends: Arceus (the byte order is swapped) * 0x38 bytes of filler starting at offset 0x14 * SaveID (u64) at `0x4C`, for example `0a00 0000 0000 0000` for my Legends: Arceus save * 0x38 bytes of filler starting at offset 0x54 Full example for Legends: Arceus: ``` 000001b0: 494d 454e 4000 0000 4000 0000 00a0 df10 IMEN@...@....... 000001c0: 501f 0001 0100 0000 0000 0000 0000 0000 P............... 000001d0: 0000 0000 0000 0000 0000 0000 0100 0000 ................ 000001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 000001f0: 0000 0000 0000 0000 0000 0000 0a00 0000 ................ 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000210: 0000 0000 0100 0000 0000 0000 0000 0000 ................ 00000220: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000230: 0000 0000 0000 0000 0000 0000 494d 454e ............IMEN ``` Ultimately, the size of the `IMEN` sits at 0x8C or 140 bytes. With this knowledge reading all the TitleID -> SaveID pairs is basically free, and outside of validation and stuff is like 15 lines of relevant code. Some interesting caveats, though: - There are two entries for some TitleIDs for... some reason? Ignoring the second one seems to work though. - Within each save directory, there are directories `0` and `1`... and only `0` ever seems used??? It's where Ryujinx points you to for save, so I just chose to use that. Once everything is parsed, the rest of the implementation is extremely trivial: - When the user requests a Ryujinx link, match the current program_id to the corresponding SaveID in `imkvdb` - If it doesn't exist, just error out (save data is probably nonexistent) - If it does though, give the user the option to use Eden's current save data OR Ryujinx's current save data. Old save data is deleted depending on which one you chose. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2815 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>pull/2859/head
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
32 changed files with 664 additions and 47 deletions
-
2src/common/CMakeLists.txt
-
1src/common/fs/fs_paths.h
-
33src/common/fs/path_util.cpp
-
18src/common/fs/path_util.h
-
93src/common/fs/ryujinx_compat.cpp
-
40src/common/fs/ryujinx_compat.h
-
43src/common/fs/symlink.cpp
-
12src/common/fs/symlink.h
-
12src/frontend_common/data_manager.cpp
-
4src/frontend_common/data_manager.h
-
3src/qt_common/CMakeLists.txt
-
2src/qt_common/abstract/frontend.cpp
-
6src/qt_common/abstract/frontend.h
-
10src/qt_common/qt_common.cpp
-
23src/qt_common/qt_string_lookup.h
-
6src/qt_common/util/content.cpp
-
6src/qt_common/util/content.h
-
130src/qt_common/util/fs.cpp
-
22src/qt_common/util/fs.h
-
2src/qt_common/util/game.cpp
-
2src/qt_common/util/path.cpp
-
1src/yuzu/CMakeLists.txt
-
2src/yuzu/data_dialog.cpp
-
5src/yuzu/game_list.cpp
-
1src/yuzu/game_list.h
-
61src/yuzu/main.cpp
-
3src/yuzu/main.h
-
9src/yuzu/migration_worker.cpp
-
6src/yuzu/migration_worker.h
-
40src/yuzu/ryujinx_dialog.cpp
-
32src/yuzu/ryujinx_dialog.h
-
81src/yuzu/ryujinx_dialog.ui
@ -0,0 +1,93 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
||||
|
#include "ryujinx_compat.h"
|
||||
|
#include "common/fs/path_util.h"
|
||||
|
#include <cstddef>
|
||||
|
#include <cstring>
|
||||
|
#include <fmt/ranges.h>
|
||||
|
#include <fstream>
|
||||
|
|
||||
|
namespace Common::FS { |
||||
|
|
||||
|
namespace fs = std::filesystem; |
||||
|
|
||||
|
fs::path GetKvdbPath() |
||||
|
{ |
||||
|
return GetLegacyPath(EmuPath::RyujinxDir) / "bis" / "system" / "save" / "8000000000000000" / "0" |
||||
|
/ "imkvdb.arc"; |
||||
|
} |
||||
|
|
||||
|
fs::path GetRyuSavePath(const u64 &save_id) |
||||
|
{ |
||||
|
std::string hex = fmt::format("{:016x}", save_id); |
||||
|
|
||||
|
// TODO: what's the difference between 0 and 1?
|
||||
|
return GetLegacyPath(EmuPath::RyujinxDir) / "bis" / "user" / "save" / hex / "0"; |
||||
|
} |
||||
|
|
||||
|
IMENReadResult ReadKvdb(const fs::path &path, std::vector<IMEN> &imens) |
||||
|
{ |
||||
|
std::ifstream kvdb{path, std::ios::binary | std::ios::ate}; |
||||
|
|
||||
|
if (!kvdb) { |
||||
|
return IMENReadResult::Nonexistent; |
||||
|
} |
||||
|
|
||||
|
size_t file_size = kvdb.tellg(); |
||||
|
|
||||
|
// IMKV header + 8 bytes
|
||||
|
if (file_size < 0xB) { |
||||
|
return IMENReadResult::NoHeader; |
||||
|
} |
||||
|
|
||||
|
// magic (not the wizard kind)
|
||||
|
kvdb.seekg(0, std::ios::beg); |
||||
|
char header[12]; |
||||
|
kvdb.read(header, 12); |
||||
|
|
||||
|
if (std::memcmp(header, IMKV_MAGIC, 4) != 0) { |
||||
|
return IMENReadResult::InvalidMagic; |
||||
|
} |
||||
|
|
||||
|
// calculate num. of imens left
|
||||
|
std::size_t remaining = (file_size - 12); |
||||
|
std::size_t num_imens = remaining / IMEN_SIZE; |
||||
|
|
||||
|
// File is misaligned and probably corrupt (rip)
|
||||
|
if (remaining % IMEN_SIZE != 0) { |
||||
|
return IMENReadResult::Misaligned; |
||||
|
} |
||||
|
|
||||
|
// if there aren't any IMENs, it's empty and we can safely no-op out of here
|
||||
|
if (num_imens == 0) { |
||||
|
return IMENReadResult::NoImens; |
||||
|
} |
||||
|
|
||||
|
imens.reserve(num_imens); |
||||
|
|
||||
|
// initially I wanted to do a struct, but imkvdb is 140 bytes
|
||||
|
// while the compiler will murder you if you try to align u64 to 4 bytes
|
||||
|
for (std::size_t i = 0; i < num_imens; ++i) { |
||||
|
char magic[4]; |
||||
|
u64 title_id = 0; |
||||
|
u64 save_id = 0; |
||||
|
|
||||
|
kvdb.read(magic, 4); |
||||
|
if (std::memcmp(magic, IMEN_MAGIC, 4) != 0) { |
||||
|
return IMENReadResult::InvalidMagic; |
||||
|
} |
||||
|
|
||||
|
kvdb.ignore(0x8); |
||||
|
kvdb.read(reinterpret_cast<char *>(&title_id), 8); |
||||
|
kvdb.ignore(0x38); |
||||
|
kvdb.read(reinterpret_cast<char *>(&save_id), 8); |
||||
|
kvdb.ignore(0x38); |
||||
|
|
||||
|
imens.emplace_back(IMEN{title_id, save_id}); |
||||
|
} |
||||
|
|
||||
|
return IMENReadResult::Success; |
||||
|
} |
||||
|
|
||||
|
} // namespace Common::FS
|
||||
@ -0,0 +1,40 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "common/common_types.h" |
||||
|
#include <filesystem> |
||||
|
#include <vector> |
||||
|
|
||||
|
namespace fs = std::filesystem; |
||||
|
|
||||
|
namespace Common::FS { |
||||
|
|
||||
|
constexpr const char IMEN_MAGIC[4] = {0x49, 0x4d, 0x45, 0x4e}; |
||||
|
constexpr const char IMKV_MAGIC[4] = {0x49, 0x4d, 0x4b, 0x56}; |
||||
|
constexpr const u8 IMEN_SIZE = 0x8c; |
||||
|
|
||||
|
fs::path GetKvdbPath(); |
||||
|
fs::path GetRyuSavePath(const u64 &program_id); |
||||
|
|
||||
|
enum class IMENReadResult { |
||||
|
Nonexistent, // ryujinx not found |
||||
|
NoHeader, // file isn't big enough for header |
||||
|
InvalidMagic, // no IMKV or IMEN header |
||||
|
Misaligned, // file isn't aligned to expected IMEN boundaries |
||||
|
NoImens, // no-op, there are no IMENs |
||||
|
Success, // :) |
||||
|
}; |
||||
|
|
||||
|
struct IMEN |
||||
|
{ |
||||
|
u64 title_id; |
||||
|
u64 save_id; |
||||
|
}; |
||||
|
|
||||
|
static_assert(sizeof(IMEN) == 0x10, "IMEN has incorrect size."); |
||||
|
|
||||
|
IMENReadResult ReadKvdb(const fs::path &path, std::vector<IMEN> &imens); |
||||
|
|
||||
|
} // namespace Common::FS |
||||
@ -0,0 +1,43 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
||||
|
#include "symlink.h"
|
||||
|
|
||||
|
#ifdef _WIN32
|
||||
|
#include <windows.h>
|
||||
|
#include <fmt/format.h>
|
||||
|
#endif
|
||||
|
|
||||
|
namespace fs = std::filesystem; |
||||
|
|
||||
|
// The sole purpose of this file is to treat symlinks like symlinks on POSIX,
|
||||
|
// or treat them as directory junctions on Windows.
|
||||
|
// This is because, for some inexplicable reason, Microsoft has locked symbolic
|
||||
|
// links behind a "security policy", whereas directory junctions--functionally identical
|
||||
|
// for directories, by the way--are not. Why? I don't know.
|
||||
|
|
||||
|
namespace Common::FS { |
||||
|
|
||||
|
bool CreateSymlink(const fs::path &from, const fs::path &to) |
||||
|
{ |
||||
|
#ifdef _WIN32
|
||||
|
const std::string command = fmt::format("mklink /J {} {}", to.string(), from.string()); |
||||
|
return system(command.c_str()) == 0; |
||||
|
#else
|
||||
|
std::error_code ec; |
||||
|
fs::create_directory_symlink(from, to, ec); |
||||
|
return !ec; |
||||
|
#endif
|
||||
|
} |
||||
|
|
||||
|
bool IsSymlink(const fs::path &path) |
||||
|
{ |
||||
|
#ifdef _WIN32
|
||||
|
auto attributes = GetFileAttributesW(path.wstring().c_str()); |
||||
|
return attributes & FILE_ATTRIBUTE_REPARSE_POINT; |
||||
|
#else
|
||||
|
return fs::is_symlink(path); |
||||
|
#endif
|
||||
|
} |
||||
|
|
||||
|
} // namespace Common::FS
|
||||
@ -0,0 +1,12 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include <filesystem> |
||||
|
namespace Common::FS { |
||||
|
|
||||
|
bool CreateSymlink(const std::filesystem::path &from, const std::filesystem::path &to); |
||||
|
bool IsSymlink(const std::filesystem::path &path); |
||||
|
|
||||
|
} // namespace Common::FS |
||||
@ -1,7 +1,7 @@ |
|||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
||||
#include "qt_frontend_util.h"
|
|
||||
|
#include "frontend.h"
|
||||
#include "qt_common/qt_common.h"
|
#include "qt_common/qt_common.h"
|
||||
|
|
||||
#ifdef YUZU_QT_WIDGETS
|
#ifdef YUZU_QT_WIDGETS
|
||||
@ -0,0 +1,130 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
||||
|
#include <filesystem>
|
||||
|
#include "fs.h"
|
||||
|
#include "common/fs/ryujinx_compat.h"
|
||||
|
#include "common/fs/symlink.h"
|
||||
|
#include "frontend_common/data_manager.h"
|
||||
|
#include "qt_common/abstract/frontend.h"
|
||||
|
#include "qt_common/qt_string_lookup.h"
|
||||
|
|
||||
|
namespace fs = std::filesystem; |
||||
|
|
||||
|
namespace QtCommon::FS { |
||||
|
|
||||
|
void LinkRyujinx(std::filesystem::path &from, std::filesystem::path &to) |
||||
|
{ |
||||
|
std::error_code ec; |
||||
|
|
||||
|
// "ignore" errors--if the dir fails to be deleted, error handling later will handle it
|
||||
|
fs::remove_all(to, ec); |
||||
|
|
||||
|
if (Common::FS::CreateSymlink(from, to)) { |
||||
|
QtCommon::Frontend::Information(tr("Linked Save Data"), tr("Save data has been linked.")); |
||||
|
} else { |
||||
|
QtCommon::Frontend::Critical( |
||||
|
tr("Failed to link save data"), |
||||
|
tr("Could not link directory:\n\t%1\nTo:\n\t%2").arg(QString::fromStdString(from.string()), QString::fromStdString(to.string()))); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
bool CheckUnlink(const fs::path &eden_dir, const fs::path &ryu_dir) |
||||
|
{ |
||||
|
bool eden_link = Common::FS::IsSymlink(eden_dir); |
||||
|
bool ryu_link = Common::FS::IsSymlink(ryu_dir); |
||||
|
|
||||
|
if (!(eden_link || ryu_link)) |
||||
|
return false; |
||||
|
|
||||
|
auto result = QtCommon::Frontend::Warning( |
||||
|
tr("Already Linked"), |
||||
|
tr("This title is already linked to Ryujinx. Would you like to unlink it?"), |
||||
|
QtCommon::Frontend::StandardButton::Yes | QtCommon::Frontend::StandardButton::No); |
||||
|
|
||||
|
if (result != QtCommon::Frontend::StandardButton::Yes) |
||||
|
return true; |
||||
|
|
||||
|
fs::path linked; |
||||
|
fs::path orig; |
||||
|
|
||||
|
if (eden_link) { |
||||
|
linked = eden_dir; |
||||
|
orig = ryu_dir; |
||||
|
} else { |
||||
|
linked = ryu_dir; |
||||
|
orig = eden_dir; |
||||
|
} |
||||
|
|
||||
|
// first cleanup the symlink/junction,
|
||||
|
try { |
||||
|
// NB: do NOT use remove_all, as Windows treats this as a remove_all to the target,
|
||||
|
// NOT the junction
|
||||
|
fs::remove(linked); |
||||
|
} catch (std::exception &e) { |
||||
|
QtCommon::Frontend::Critical( |
||||
|
tr("Failed to unlink old directory"), |
||||
|
tr("OS returned error: %1").arg(QString::fromStdString(e.what()))); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
// then COPY the other dir
|
||||
|
try { |
||||
|
fs::copy(orig, linked, fs::copy_options::recursive); |
||||
|
} catch (std::exception &e) { |
||||
|
QtCommon::Frontend::Critical( |
||||
|
tr("Failed to copy save data"), |
||||
|
tr("OS returned error: %1").arg(QString::fromStdString(e.what()))); |
||||
|
} |
||||
|
|
||||
|
QtCommon::Frontend::Information( |
||||
|
tr("Unlink Successful"), |
||||
|
tr("Successfully unlinked Ryujinx save data. Save data has been kept intact.")); |
||||
|
|
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
u64 GetRyujinxSaveID(const u64 &program_id) |
||||
|
{ |
||||
|
auto path = Common::FS::GetKvdbPath(); |
||||
|
std::vector<Common::FS::IMEN> imens; |
||||
|
Common::FS::IMENReadResult res = Common::FS::ReadKvdb(path, imens); |
||||
|
|
||||
|
if (res == Common::FS::IMENReadResult::Success) { |
||||
|
// TODO: this can probably be done with std::find_if but I'm lazy
|
||||
|
for (const Common::FS::IMEN &imen : imens) { |
||||
|
if (imen.title_id == program_id) |
||||
|
return imen.save_id; |
||||
|
} |
||||
|
|
||||
|
QtCommon::Frontend::Critical( |
||||
|
tr("Could not find Ryujinx save data"), |
||||
|
StringLookup::Lookup(StringLookup::RyujinxNoSaveId).arg(program_id, 0, 16)); |
||||
|
} else { |
||||
|
// TODO: make this long thing a function or something
|
||||
|
QString caption = StringLookup::Lookup( |
||||
|
static_cast<StringLookup::StringKey>((int) res + (int) StringLookup::KvdbNonexistent)); |
||||
|
QtCommon::Frontend::Critical(tr("Could not find Ryujinx save data"), caption); |
||||
|
} |
||||
|
|
||||
|
return -1; |
||||
|
} |
||||
|
|
||||
|
std::optional<std::pair<fs::path, fs::path> > GetEmuPaths( |
||||
|
const u64 program_id, const u64 save_id, const std::string &user_id) |
||||
|
{ |
||||
|
fs::path ryu_dir = Common::FS::GetRyuSavePath(save_id); |
||||
|
|
||||
|
if (user_id.empty()) |
||||
|
return std::nullopt; |
||||
|
|
||||
|
std::string hex_program = fmt::format("{:016X}", program_id); |
||||
|
fs::path eden_dir |
||||
|
= FrontendCommon::DataManager::GetDataDir(FrontendCommon::DataManager::DataDir::Saves, |
||||
|
user_id) |
||||
|
/ hex_program; |
||||
|
|
||||
|
return std::make_pair(eden_dir, ryu_dir); |
||||
|
} |
||||
|
|
||||
|
} // namespace QtCommon::FS
|
||||
@ -0,0 +1,22 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
|
||||
|
#include "common/common_types.h" |
||||
|
#include <filesystem> |
||||
|
#include <optional> |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
namespace QtCommon::FS { |
||||
|
|
||||
|
void LinkRyujinx(std::filesystem::path &from, std::filesystem::path &to); |
||||
|
u64 GetRyujinxSaveID(const u64 &program_id); |
||||
|
|
||||
|
/// @brief {eden, ryu} |
||||
|
std::optional<std::pair<std::filesystem::path, std::filesystem::path>> GetEmuPaths( |
||||
|
const u64 program_id, const u64 save_id, const std::string &user_id); |
||||
|
|
||||
|
/// returns FALSE if the dirs are NOT linked |
||||
|
bool CheckUnlink(const std::filesystem::path &eden_dir, const std::filesystem::path &ryu_dir); |
||||
|
|
||||
|
} // namespace QtCommon::FS |
||||
@ -0,0 +1,40 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
||||
|
#include "ryujinx_dialog.h"
|
||||
|
#include "qt_common/util/fs.h"
|
||||
|
#include "ui_ryujinx_dialog.h"
|
||||
|
#include <filesystem>
|
||||
|
|
||||
|
namespace fs = std::filesystem; |
||||
|
|
||||
|
RyujinxDialog::RyujinxDialog(std::filesystem::path eden_path, |
||||
|
std::filesystem::path ryu_path, |
||||
|
QWidget *parent) |
||||
|
: QDialog(parent) |
||||
|
, ui(new Ui::RyujinxDialog) |
||||
|
, m_eden(eden_path.make_preferred()) |
||||
|
, m_ryu(ryu_path.make_preferred()) |
||||
|
{ |
||||
|
ui->setupUi(this); |
||||
|
|
||||
|
connect(ui->eden, &QPushButton::clicked, this, &RyujinxDialog::fromEden); |
||||
|
connect(ui->ryujinx, &QPushButton::clicked, this, &RyujinxDialog::fromRyujinx); |
||||
|
} |
||||
|
|
||||
|
RyujinxDialog::~RyujinxDialog() |
||||
|
{ |
||||
|
delete ui; |
||||
|
} |
||||
|
|
||||
|
void RyujinxDialog::fromEden() |
||||
|
{ |
||||
|
accept(); |
||||
|
QtCommon::FS::LinkRyujinx(m_eden, m_ryu); |
||||
|
} |
||||
|
|
||||
|
void RyujinxDialog::fromRyujinx() |
||||
|
{ |
||||
|
accept(); |
||||
|
QtCommon::FS::LinkRyujinx(m_ryu, m_eden); |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
|
||||
|
#ifndef RYUJINX_DIALOG_H |
||||
|
#define RYUJINX_DIALOG_H |
||||
|
|
||||
|
#include <QDialog> |
||||
|
#include <filesystem> |
||||
|
|
||||
|
namespace Ui { |
||||
|
class RyujinxDialog; |
||||
|
} |
||||
|
|
||||
|
class RyujinxDialog : public QDialog |
||||
|
{ |
||||
|
Q_OBJECT |
||||
|
|
||||
|
public: |
||||
|
explicit RyujinxDialog(std::filesystem::path eden_path, std::filesystem::path ryu_path, QWidget *parent = nullptr); |
||||
|
~RyujinxDialog(); |
||||
|
|
||||
|
private slots: |
||||
|
void fromEden(); |
||||
|
void fromRyujinx(); |
||||
|
|
||||
|
private: |
||||
|
Ui::RyujinxDialog *ui; |
||||
|
std::filesystem::path m_eden; |
||||
|
std::filesystem::path m_ryu; |
||||
|
}; |
||||
|
|
||||
|
#endif // RYUJINX_DIALOG_H |
||||
@ -0,0 +1,81 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<ui version="4.0"> |
||||
|
<class>RyujinxDialog</class> |
||||
|
<widget class="QDialog" name="RyujinxDialog"> |
||||
|
<property name="geometry"> |
||||
|
<rect> |
||||
|
<x>0</x> |
||||
|
<y>0</y> |
||||
|
<width>404</width> |
||||
|
<height>170</height> |
||||
|
</rect> |
||||
|
</property> |
||||
|
<property name="windowTitle"> |
||||
|
<string>Ryujinx Link</string> |
||||
|
</property> |
||||
|
<layout class="QVBoxLayout" name="verticalLayout"> |
||||
|
<item> |
||||
|
<widget class="QLabel" name="label"> |
||||
|
<property name="sizePolicy"> |
||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding"> |
||||
|
<horstretch>0</horstretch> |
||||
|
<verstretch>0</verstretch> |
||||
|
</sizepolicy> |
||||
|
</property> |
||||
|
<property name="text"> |
||||
|
<string>Linking save data to Ryujinx lets both Ryujinx and Eden reference the same save files for your games. |
||||
|
|
||||
|
By selecting "From Eden", previous save data stored in Ryujinx will be deleted, and vice versa for "From Ryujinx".</string> |
||||
|
</property> |
||||
|
<property name="wordWrap"> |
||||
|
<bool>true</bool> |
||||
|
</property> |
||||
|
</widget> |
||||
|
</item> |
||||
|
<item> |
||||
|
<layout class="QHBoxLayout" name="horizontalLayout"> |
||||
|
<item> |
||||
|
<widget class="QPushButton" name="eden"> |
||||
|
<property name="text"> |
||||
|
<string>From Eden</string> |
||||
|
</property> |
||||
|
</widget> |
||||
|
</item> |
||||
|
<item> |
||||
|
<widget class="QPushButton" name="ryujinx"> |
||||
|
<property name="text"> |
||||
|
<string>From Ryujinx</string> |
||||
|
</property> |
||||
|
</widget> |
||||
|
</item> |
||||
|
<item> |
||||
|
<widget class="QPushButton" name="cancel"> |
||||
|
<property name="text"> |
||||
|
<string>Cancel</string> |
||||
|
</property> |
||||
|
</widget> |
||||
|
</item> |
||||
|
</layout> |
||||
|
</item> |
||||
|
</layout> |
||||
|
</widget> |
||||
|
<resources/> |
||||
|
<connections> |
||||
|
<connection> |
||||
|
<sender>cancel</sender> |
||||
|
<signal>clicked()</signal> |
||||
|
<receiver>RyujinxDialog</receiver> |
||||
|
<slot>reject()</slot> |
||||
|
<hints> |
||||
|
<hint type="sourcelabel"> |
||||
|
<x>331</x> |
||||
|
<y>147</y> |
||||
|
</hint> |
||||
|
<hint type="destinationlabel"> |
||||
|
<x>201</x> |
||||
|
<y>84</y> |
||||
|
</hint> |
||||
|
</hints> |
||||
|
</connection> |
||||
|
</connections> |
||||
|
</ui> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue