mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-31 16:12:50 -04:00
Add support for playing Dusklight using Wii disc images (#2296)
* Add offsets for Wii USA R0/R2, JPN, and PAL Also fix an oopsie where l_pos and l_normal's offsets were swapped * Allow loading Wii discs * Change GameVersion::GcnJpn checks to isRegionJpn() * Change GameVersion::GcnPal checks to isRegionPal() * Add platformSelect and regionSelect templates, simplify a ton of code * Add *_get() macros to simplify REL loads * Actually accept Wii USA Rev. 2 discs * Show the Wii USA revision in prelaunch's disc status * l_normal isn't in Wii RELs, so I'll just hardcode it * Account for various BLO differences Fix crash when opening the map on Wii USA Rev 0 and Wii PAL * Use the streamed version of the file select music * Update language selection * Fix the d-pad/cross button text for Wii PAL Resizing panes that are already 120.0f wide is harmless, so I didn't bother with a GameVersion check * Fix brightness check discrepancy, use IF_DUSK_BLOCK macros when ideal * Update docs and the issue template
This commit is contained in:
+17
-22
@@ -11,6 +11,7 @@
|
||||
#include "dusk/data.hpp"
|
||||
#include "dusk/imgui/ImGuiEngine.hpp"
|
||||
#include "dusk/io.hpp"
|
||||
#include "dusk/language.hpp"
|
||||
#include "dusk/presentation.hpp"
|
||||
#include <borealis/io.hpp>
|
||||
#include <borealis/file_select.hpp>
|
||||
@@ -53,14 +54,6 @@
|
||||
namespace dusk::ui {
|
||||
namespace {
|
||||
|
||||
constexpr std::array kLanguageNames = {
|
||||
"English",
|
||||
"German",
|
||||
"French",
|
||||
"Spanish",
|
||||
"Italian",
|
||||
};
|
||||
|
||||
constexpr std::array kCardFileTypes = {
|
||||
"Card Image",
|
||||
"GCI Folder",
|
||||
@@ -574,18 +567,15 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
.key = "Language",
|
||||
.getValue =
|
||||
[] {
|
||||
const auto& state = prelaunch_state();
|
||||
if (!state.configuredDiscCanLaunch || state.configuredDiscInfo.region != iso::Region::Europe) {
|
||||
return kLanguageNames[0];
|
||||
}
|
||||
const u8 idx = static_cast<u8>(getSettings().game.language.getValue());
|
||||
return kLanguageNames[idx];
|
||||
return language::language_name(getSettings().game.language.getValue());
|
||||
},
|
||||
.isDisabled =
|
||||
[] {
|
||||
const auto& state = prelaunch_state();
|
||||
return !state.configuredDiscCanLaunch ||
|
||||
state.configuredDiscInfo.region != iso::Region::Europe;
|
||||
if (!state.configuredDiscCanLaunch) {
|
||||
return true;
|
||||
}
|
||||
return language::available_languages(state.configuredDiscInfo).size() <= 1;
|
||||
},
|
||||
.isModified =
|
||||
[] {
|
||||
@@ -594,18 +584,22 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
},
|
||||
}),
|
||||
rightPane, [](Pane& pane) {
|
||||
for (int i = 0; i < kLanguageNames.size(); i++) {
|
||||
const auto& state = prelaunch_state();
|
||||
const auto languages = state.configuredDiscCanLaunch
|
||||
? language::available_languages(state.configuredDiscInfo)
|
||||
: language::available_languages({});
|
||||
for (const GameLanguage language : languages) {
|
||||
pane.add_button({
|
||||
.text = kLanguageNames[i],
|
||||
.text = language::language_name(language),
|
||||
.isSelected =
|
||||
[i] {
|
||||
[language] {
|
||||
return getSettings().game.language.getValue() ==
|
||||
static_cast<GameLanguage>(i);
|
||||
language;
|
||||
},
|
||||
})
|
||||
.on_pressed([i] {
|
||||
.on_pressed([language] {
|
||||
mDoAud_seStartMenu(kSoundItemChange);
|
||||
getSettings().game.language.setValue(static_cast<GameLanguage>(i));
|
||||
getSettings().game.language.setValue(language);
|
||||
config::save();
|
||||
});
|
||||
}
|
||||
@@ -1551,6 +1545,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
void SettingsWindow::update() {
|
||||
if (mPrelaunch && top_document() == this) {
|
||||
try_push_verification_modal(*this);
|
||||
try_push_language_unavailable_modal(*this);
|
||||
}
|
||||
|
||||
Window::update();
|
||||
|
||||
Reference in New Issue
Block a user