mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 19:28:43 +12:00
GUI: improve prx library selection
Sorts the libraries in the settings dialog alphabetically, so they are easier to find. Sorts selected and unselected modules alphabetically seperatly.
This commit is contained in:
parent
effd379c25
commit
5c4af45bf5
1 changed files with 22 additions and 4 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
// Node location
|
// Node location
|
||||||
using cfg_location = std::vector<const char*>;
|
using cfg_location = std::vector<const char*>;
|
||||||
|
@ -313,7 +314,14 @@ SettingsDialog::SettingsDialog(wxWindow* parent)
|
||||||
|
|
||||||
std::vector<std::string> lle_module_list;
|
std::vector<std::string> lle_module_list;
|
||||||
{
|
{
|
||||||
|
// Sort string vector alphabetically
|
||||||
|
static const auto sort_string_vector = [](std::vector<std::string>& vec)
|
||||||
|
{
|
||||||
|
std::sort(vec.begin(), vec.end(), [](const std::string &str1, const std::string &str2) { return str1 < str2; });
|
||||||
|
};
|
||||||
|
|
||||||
auto&& data = loaded["Core"]["Load libraries"].as<std::vector<std::string>, std::initializer_list<std::string>>({});
|
auto&& data = loaded["Core"]["Load libraries"].as<std::vector<std::string>, std::initializer_list<std::string>>({});
|
||||||
|
sort_string_vector(data);
|
||||||
|
|
||||||
// List selected modules first
|
// List selected modules first
|
||||||
for (const auto& unk : data)
|
for (const auto& unk : data)
|
||||||
|
@ -325,16 +333,26 @@ SettingsDialog::SettingsDialog(wxWindow* parent)
|
||||||
const std::string& lle_dir = vfs::get("/dev_flash/sys/external/"); // TODO
|
const std::string& lle_dir = vfs::get("/dev_flash/sys/external/"); // TODO
|
||||||
|
|
||||||
std::unordered_set<std::string> set(data.begin(), data.end());
|
std::unordered_set<std::string> set(data.begin(), data.end());
|
||||||
|
std::vector<std::string> lle_module_list_unselected;
|
||||||
|
|
||||||
for (const auto& prxf : fs::dir(lle_dir))
|
for (const auto& prxf : fs::dir(lle_dir))
|
||||||
{
|
{
|
||||||
// List found unselected modules
|
// List found unselected modules
|
||||||
if (!prxf.is_directory && ppu_prx_loader(fs::file(lle_dir + prxf.name)) == elf_error::ok && !set.count(prxf.name))
|
if (!prxf.is_directory && ppu_prx_loader(fs::file(lle_dir + prxf.name)) == elf_error::ok && !set.count(prxf.name))
|
||||||
{
|
{
|
||||||
chbox_list_core_lle->Check(chbox_list_core_lle->Append(prxf.name), false);
|
lle_module_list_unselected.push_back(prxf.name);
|
||||||
lle_module_list.push_back(prxf.name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort_string_vector(lle_module_list_unselected);
|
||||||
|
|
||||||
|
for (const auto& prxf : lle_module_list_unselected)
|
||||||
|
{
|
||||||
|
chbox_list_core_lle->Check(chbox_list_core_lle->Append(prxf), false);
|
||||||
|
lle_module_list.push_back(prxf);
|
||||||
|
}
|
||||||
|
|
||||||
|
lle_module_list_unselected.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
radiobox_pad_helper ppu_decoder_modes({ "Core", "PPU Decoder" });
|
radiobox_pad_helper ppu_decoder_modes({ "Core", "PPU Decoder" });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue