From e1523224e82aef45feb8f4bb498387dd4ef252c7 Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Sat, 6 Jun 2009 19:39:48 +0000 Subject: [PATCH] *Fixed OGG Menu Crash after changing the path --- source/Settings.cpp | 9 +++++---- source/SettingsPrompts.cpp | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/source/Settings.cpp b/source/Settings.cpp index dddf11ab..473220f9 100644 --- a/source/Settings.cpp +++ b/source/Settings.cpp @@ -1,4 +1,3 @@ -#include #include #include "menu.h" @@ -997,16 +996,19 @@ int MenuSettings() optionBrowser2.SetEffect(EFFECT_FADE, 20); while(optionBrowser2.GetEffect() > 0) usleep(50); + char * oggfile; - oggfile = strrchr(Settings.ogg_path, '/')+1; while(!exit) { VIDEO_WaitVSync (); - if(!strcmp("notset", Settings.ogg_path) || !strcmp("",Settings.oggload_path)) + bool returnhere = true; + + if(!strcmp("notset", Settings.ogg_path)) options2.SetValue(0, "%s", LANGUAGE.Standard); else { + oggfile = strrchr(Settings.ogg_path, '/')+1; options2.SetValue(0, "%s", oggfile); } @@ -1066,7 +1068,6 @@ int MenuSettings() w.SetEffect(EFFECT_FADE, -20); while(w.GetEffect()>0) usleep(50); mainWindow->Remove(&w); - bool returnhere = true; while(returnhere) returnhere = MenuOGG(); HaltGui(); diff --git a/source/SettingsPrompts.cpp b/source/SettingsPrompts.cpp index c289446f..59baa31e 100644 --- a/source/SettingsPrompts.cpp +++ b/source/SettingsPrompts.cpp @@ -180,6 +180,11 @@ bool MenuOGG() while(!returnhere) { + if(shutdown == 1) + Sys_Shutdown(); + if(reset == 1) + Sys_Reboot(); + if (backBtn.GetState() == STATE_CLICKED) { if(nothingchanged == 1 && countoggs > 0) { if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { @@ -188,6 +193,7 @@ bool MenuOGG() bgMusic->PlayOggFile(Settings.ogg_path); } } + backBtn.ResetState(); break; } @@ -425,6 +431,11 @@ int MenuLanguageSelect() while(!returnhere) { + if(shutdown == 1) + Sys_Shutdown(); + if(reset == 1) + Sys_Reboot(); + if (backBtn.GetState() == STATE_CLICKED) { backBtn.ResetState();