mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-04-28 12:27:59 +03:00
Added install audio buttons
Some checks failed
GenerateBuilds / generate-port-o2r (push) Has been cancelled
GenerateBuilds / build-windows (push) Has been cancelled
GenerateBuilds / build-macos (push) Has been cancelled
GenerateBuilds / build-linux (push) Has been cancelled
GenerateBuilds / build-switch (push) Has been cancelled
Some checks failed
GenerateBuilds / generate-port-o2r (push) Has been cancelled
GenerateBuilds / build-windows (push) Has been cancelled
GenerateBuilds / build-macos (push) Has been cancelled
GenerateBuilds / build-linux (push) Has been cancelled
GenerateBuilds / build-switch (push) Has been cancelled
This commit is contained in:
parent
75a018f929
commit
dba0ad2576
3 changed files with 31 additions and 9 deletions
|
@ -263,18 +263,26 @@ GameEngine::GameEngine() {
|
|||
context->GetResourceManager()->SetAltAssetsEnabled(prevAltAssets);
|
||||
}
|
||||
|
||||
bool GameEngine::GenAssetFile() {
|
||||
bool GameEngine::GenAssetFile(bool exitOnFail) {
|
||||
auto extractor = new GameExtractor();
|
||||
|
||||
if (!extractor->SelectGameFromUI()) {
|
||||
ShowMessage("Error", "No ROM selected.\n\nExiting...");
|
||||
exit(1);
|
||||
if (exitOnFail) {
|
||||
exit(1);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
auto game = extractor->ValidateChecksum();
|
||||
if (!game.has_value()) {
|
||||
ShowMessage("Unsupported ROM", "The provided ROM is not supported.\n\nCheck the readme for a list of supported versions.");
|
||||
exit(1);
|
||||
if (exitOnFail) {
|
||||
exit(1);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ShowMessage(("Found " + game.value()).c_str(), "The extraction process will now begin.\n\nThis may take a few minutes.", SDL_MESSAGEBOX_INFORMATION);
|
||||
|
|
|
@ -30,7 +30,7 @@ class GameEngine {
|
|||
|
||||
GameEngine();
|
||||
void StartFrame() const;
|
||||
static bool GenAssetFile();
|
||||
static bool GenAssetFile(bool exitOnFail = true);
|
||||
static void Create();
|
||||
static void HandleAudioThread();
|
||||
static void StartAudioFrame();
|
||||
|
|
|
@ -175,9 +175,12 @@ void DrawSettingsMenu(){
|
|||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
if(GameEngine::HasVersion(SF64_VER_EU)){
|
||||
UIWidgets::Spacer(0);
|
||||
if (UIWidgets::BeginMenu("Language")) {
|
||||
UIWidgets::Spacer(0);
|
||||
|
||||
if (UIWidgets::BeginMenu("Language")) {
|
||||
ImGui::Dummy(ImVec2(150, 0.0f));
|
||||
if(GameEngine::HasVersion(SF64_VER_EU)){
|
||||
UIWidgets::Spacer(0);
|
||||
if (UIWidgets::CVarCombobox("Voices", "gVoiceLanguage", voiceLangs,
|
||||
{
|
||||
.tooltip = "Changes the language of the voice acting in the game",
|
||||
|
@ -185,9 +188,20 @@ void DrawSettingsMenu(){
|
|||
})) {
|
||||
Audio_SetVoiceLanguage(CVarGetInteger("gVoiceLanguage", 0));
|
||||
};
|
||||
ImGui::Dummy(ImVec2(ImGui::CalcTextSize(voiceLangs[0]).x + 55, 0.0f));
|
||||
ImGui::EndMenu();
|
||||
} else {
|
||||
if(UIWidgets::Button("Install EU Audio")){
|
||||
if(!GameEngine::GenAssetFile()){
|
||||
GameEngine::ShowMessage("Success", "EU Audio Installed, restart the game to apply changes.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue