fix double-playing of music, etc.
This commit is contained in:
@@ -79,6 +79,9 @@ namespace OpenRA
|
|||||||
if (name == "" || name == null)
|
if (name == "" || name == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (music != null)
|
||||||
|
soundEngine.StopSound(music);
|
||||||
|
|
||||||
var sound = sounds[name];
|
var sound = sounds[name];
|
||||||
music = soundEngine.Play2D(sound, true);
|
music = soundEngine.Play2D(sound, true);
|
||||||
music.Volume = musicVolume;
|
music.Volume = musicVolume;
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ namespace OpenRA.Widgets.Delegates
|
|||||||
{
|
{
|
||||||
var r = Chrome.rootWidget;
|
var r = Chrome.rootWidget;
|
||||||
r.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => {
|
r.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => {
|
||||||
r.CloseWindow();
|
Game.Disconnect();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
r.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => {
|
r.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => {
|
||||||
r.CloseWindow();
|
Game.Disconnect();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
r.GetWidget("CONNECTION_BUTTON_RETRY").OnMouseUp = mi => {
|
r.GetWidget("CONNECTION_BUTTON_RETRY").OnMouseUp = mi => {
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ namespace OpenRA.Widgets
|
|||||||
public void CloseWindow()
|
public void CloseWindow()
|
||||||
{
|
{
|
||||||
Chrome.rootWidget.GetWidget(WindowList.Pop()).Visible = false;
|
Chrome.rootWidget.GetWidget(WindowList.Pop()).Visible = false;
|
||||||
|
if (WindowList.Count > 0)
|
||||||
Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = true;
|
Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user