Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix double-playing of music, etc.
  • Loading branch information
chrisforbes committed May 5, 2010
1 parent 5cdc47e commit 3992049
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions OpenRA.Game/Sound.cs
Expand Up @@ -78,6 +78,9 @@ public static void PlayMusic(string name)
{
if (name == "" || name == null)
return;

if (music != null)
soundEngine.StopSound(music);

var sound = sounds[name];
music = soundEngine.Play2D(sound, true);
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Game/Widgets/Delegates/ConnectionDialogsDelegate.cs
Expand Up @@ -26,11 +26,11 @@ public ConnectionDialogsDelegate()
{
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 => {
Expand Down
3 changes: 2 additions & 1 deletion OpenRA.Game/Widgets/Widget.cs
Expand Up @@ -209,7 +209,8 @@ public Widget GetWidget(string id)
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)
Expand Down

0 comments on commit 3992049

Please sign in to comment.