mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-04 23:35:12 +01:00
Use the first available language entry in NACPs rather than hardcoding
American English Without this, if an NACP didn't contain a title for a US english it would show in the UI as blank.
This commit is contained in:
parent
26025d9adf
commit
7114ad1734
@ -8,8 +8,14 @@ namespace skyline::vfs {
|
||||
backing->Read(&nacpContents);
|
||||
|
||||
// TODO: Select based on language settings, complete struct, yada yada
|
||||
ApplicationTitle &languageEntry = nacpContents.titleEntries[0];
|
||||
applicationName = std::string(languageEntry.applicationName.data(), languageEntry.applicationName.size());
|
||||
applicationPublisher = std::string(languageEntry.applicationPublisher.data(), languageEntry.applicationPublisher.size());
|
||||
|
||||
// Iterate till we get to the first populated entry
|
||||
for (auto &entry : nacpContents.titleEntries) {
|
||||
if (entry.applicationName.front() == '\0')
|
||||
continue;
|
||||
|
||||
applicationName = std::string(entry.applicationName.data(), entry.applicationName.size());
|
||||
applicationPublisher = std::string(entry.applicationPublisher.data(), entry.applicationPublisher.size());
|
||||
}
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ namespace skyline::vfs {
|
||||
* @brief This struct encapsulates all the data within an NACP file
|
||||
*/
|
||||
struct NacpData {
|
||||
ApplicationTitle titleEntries[0x10]; //!< Title entries for each language
|
||||
std::array<ApplicationTitle, 0x10> titleEntries; //!< Title entries for each language
|
||||
u8 _pad_[0x4000 - (0x10 * 0x300)];
|
||||
} nacpContents{};
|
||||
static_assert(sizeof(NacpData) == 0x4000);
|
||||
|
Loading…
Reference in New Issue
Block a user