mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-04 07:17:12 +02:00
[desktop] Prefer extracred folder name over zip name for non-Atmosphere zip mods (#4043)
e.g. Serfrost's Defogger will now be named "Serfrosts Defogger" by default, instead of "serfrosts_base_defogger_v2-4" Note that for atmosphere mods it still uses the zip folder name, since otherwise their default name will just be the game's Title ID. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4043 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
parent
683e6249c3
commit
27189f39d2
2 changed files with 6 additions and 4 deletions
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <fmt/format.h>
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/fs/fs_types.h"
|
||||
|
|
|
|||
|
|
@ -33,10 +33,13 @@ QStringList GetModFolders(const QString& root, const QString& fallbackName) {
|
|||
std_path = paths[0];
|
||||
|
||||
QString default_name;
|
||||
if (!fallbackName.isEmpty())
|
||||
default_name = fallbackName;
|
||||
else if (!paths.empty())
|
||||
|
||||
// If this is an atmosphere-packed mod, the default name will end up as the game's title ID.
|
||||
// So in this case ignore it and use the zip name instead
|
||||
if (!paths.empty() && std_path.string().find("atmosphere") == std::string::npos)
|
||||
default_name = QString::fromStdString(std_path.filename().string());
|
||||
else if (!fallbackName.isEmpty())
|
||||
default_name = fallbackName;
|
||||
else
|
||||
default_name = root.split(QLatin1Char('/')).last();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue