fix double-playing of music, etc.

This commit is contained in:
Chris Forbes
2010-05-05 20:00:54 +12:00
parent 5cdc47ea6b
commit 39920499e0
3 changed files with 7 additions and 3 deletions

View File

@@ -78,6 +78,9 @@ namespace OpenRA
{
if (name == "" || name == null)
return;
if (music != null)
soundEngine.StopSound(music);
var sound = sounds[name];
music = soundEngine.Play2D(sound, true);

View File

@@ -26,11 +26,11 @@ namespace OpenRA.Widgets.Delegates
{
var r = Chrome.rootWidget;
r.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => {
r.CloseWindow();
Game.Disconnect();
return true;
};
r.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => {
r.CloseWindow();
Game.Disconnect();
return true;
};
r.GetWidget("CONNECTION_BUTTON_RETRY").OnMouseUp = mi => {

View File

@@ -209,7 +209,8 @@ namespace OpenRA.Widgets
public void CloseWindow()
{
Chrome.rootWidget.GetWidget(WindowList.Pop()).Visible = false;
Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = true;
if (WindowList.Count > 0)
Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = true;
}
public Widget OpenWindow(string id)