Audio Language install refactor.

This commit is contained in:
Sonic Dreamcaster 2025-04-06 00:28:24 -03:00
parent fc87a68896
commit 98d861a481

View file

@ -172,40 +172,36 @@ void DrawSettingsMenu(){
UIWidgets::ReEnableComponent(""); UIWidgets::ReEnableComponent("");
} }
UIWidgets::PaddedEnhancementCheckbox("Surround 5.1 (needs reload)", "gAudioChannelsSetting", 1, 0); UIWidgets::PaddedEnhancementCheckbox("Surround 5.1 (Needs reload)", "gAudioChannelsSetting", 1, 0);
ImGui::EndMenu(); ImGui::EndMenu();
} }
UIWidgets::Spacer(0); if (!GameEngine::HasVersion(SF64_VER_JP) || GameEngine::HasVersion(SF64_VER_EU)) {
UIWidgets::Spacer(0);
if (UIWidgets::BeginMenu("Language")) { if (UIWidgets::BeginMenu("Language")) {
ImGui::Dummy(ImVec2(150, 0.0f)); ImGui::Dummy(ImVec2(150, 0.0f));
if(GameEngine::HasVersion(SF64_VER_EU)){ if (!GameEngine::HasVersion(SF64_VER_JP) && GameEngine::HasVersion(SF64_VER_EU)){
UIWidgets::Spacer(0); //UIWidgets::Spacer(0);
if (UIWidgets::CVarCombobox("Voices", "gVoiceLanguage", voiceLangs, if (UIWidgets::CVarCombobox("Voices", "gVoiceLanguage", voiceLangs,
{ {
.tooltip = "Changes the language of the voice acting in the game", .tooltip = "Changes the language of the voice acting in the game",
.defaultIndex = 0, .defaultIndex = 0,
})) { })) {
Audio_SetVoiceLanguage(CVarGetInteger("gVoiceLanguage", 0)); Audio_SetVoiceLanguage(CVarGetInteger("gVoiceLanguage", 0));
}; };
} else { } else {
if(UIWidgets::Button("Install EU Audio")){ if (UIWidgets::Button("Install JP/EU Audio")) {
if(!GameEngine::GenAssetFile()){ if (GameEngine::GenAssetFile()){
GameEngine::ShowMessage("Success", "EU Audio Installed, restart the game to apply changes."); GameEngine::ShowMessage("Success", "Audio assets Installed, restart the game to apply changes.", SDL_MESSAGEBOX_INFORMATION);
Ship::Context::GetInstance()->GetWindow()->Close();
}
} }
} }
ImGui::EndMenu();
} }
if(!GameEngine::HasVersion(SF64_VER_JP) && UIWidgets::Button("Install JP Audio")) {
if(GameEngine::GenAssetFile()){
GameEngine::ShowMessage("Success", "EU Audio Installed, restart the game to apply changes.");
}
}
ImGui::EndMenu();
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (UIWidgets::BeginMenu("Controller")) { if (UIWidgets::BeginMenu("Controller")) {