#include "preset.hpp" #include "button.hpp" #include "dusk/config.hpp" #include "dusk/settings.h" #include "ui.hpp" #include namespace dusk::ui { namespace { void applyPresetClassic() { auto& s = getSettings(); s.video.lockAspectRatio.setValue(true); s.game.bloomMode.setValue(BloomMode::Classic); s.game.depthOfFieldMode.setValue(DepthOfFieldMode::Classic); s.game.enableAchievementToasts.setValue(false); s.game.enableControllerToasts.setValue(false); s.game.internalResolutionScale.setValue(1); s.game.shadowResolutionMultiplier.setValue(1); s.game.hideTvSettingsScreen.setValue(false); s.game.menuScalingMode.setValue(MenuScaling::GameCube); s.game.enableMenuPointer.setValue(false); AuroraSetViewportPolicy(AURORA_VIEWPORT_FIT); } void applyPresetDusk() { auto& s = getSettings(); s.game.hideTvSettingsScreen.setValue(true); s.game.noReturnRupees.setValue(true); s.game.disableRupeeCutscenes.setValue(true); s.game.noSwordRecoil.setValue(true); s.game.fastClimbing.setValue(true); s.game.noMissClimbing.setValue(true); s.game.fastTears.setValue(true); s.game.biggerWallets.setValue(true); s.game.invertCameraXAxis.setValue(true); s.game.invertFirstPersonYAxis.setValue(true); s.game.no2ndFishForCat.setValue(true); s.game.buttonFishing.setValue(true); s.game.enableAchievementToasts.setValue(true); s.game.enableControllerToasts.setValue(true); s.game.enableQuickTransform.setValue(true); s.game.instantSaves.setValue(true); s.game.midnasLamentNonStop.setValue(true); s.game.enableFrameInterpolation.setValue(FrameInterpMode::Unlimited); s.game.sunsSong.setValue(true); s.game.bloomMode.setValue(BloomMode::Dusk); s.game.depthOfFieldMode.setValue(DepthOfFieldMode::Dusk); s.game.internalResolutionScale.setValue(0); s.game.shadowResolutionMultiplier.setValue(4); s.game.enableGyroAim.setValue(true); s.game.autoSave.setValue(true); s.game.menuScalingMode.setValue(MenuScaling::Dusklight); s.game.enhancedMapMenus.setValue(true); s.game.enableMenuPointer.setValue(true); } } // namespace PresetWindow::PresetWindow() : WindowSmall("modal") { auto* header = append(mDialog, "modal-header"); auto* title = append(header, "modal-title"); append_text(title, "Welcome to Dusklight"); auto* headIcon = append(header, "icon"); headIcon->SetClass("celebration", true); auto* intro = append(mDialog, "modal-body"); append_text(intro, "Choose a preset to get started. You can change any setting later from the Settings menu."); auto* grid = append(mDialog, "preset-grid"); struct PresetInfo { const char* name; const char* desc; void (*apply)(); }; static constexpr PresetInfo kPresets[] = { { "Classic", "Enhancements disabled to match the GameCube version. " "Good for speedrunning or simple nostalgia!", applyPresetClassic, }, { "Dusklight", "Graphics & quality of life tweaks, including some from the Wii U version. " "Our recommended way to play!", applyPresetDusk, }, }; for (const auto& preset : kPresets) { auto* col = append(grid, "preset-option"); auto btn = std::make_unique