Add mute option to the game
This commit is contained in:
@@ -302,6 +302,8 @@ namespace OpenRA.Widgets
|
||||
return CycleStatusBars();
|
||||
else if (key == Game.Settings.Keys.TogglePixelDoubleKey)
|
||||
return TogglePixelDouble();
|
||||
else if (key == Game.Settings.Keys.ToggleMuteKey)
|
||||
return ToggleMute();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -360,5 +362,23 @@ namespace OpenRA.Widgets
|
||||
worldRenderer.Viewport.Zoom = Game.Settings.Graphics.PixelDouble ? 2 : 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ToggleMute()
|
||||
{
|
||||
Game.Settings.Sound.Mute ^= true;
|
||||
|
||||
if (Game.Settings.Sound.Mute)
|
||||
{
|
||||
Game.Sound.MuteAudio();
|
||||
Game.Debug("Audio muted");
|
||||
}
|
||||
else
|
||||
{
|
||||
Game.Sound.UnmuteAudio();
|
||||
Game.Debug("Audio unmuted");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user