From 7dc08afa5a8af3e99754e0dcea597b1bd8d687d1 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 22 Jun 2020 13:23:02 +0200 Subject: [PATCH] made UiStyle's ActionSound a SoundEffectInstance to allow for volume/pitch changes --- MLEM.Ui/Elements/Element.cs | 4 ++-- MLEM.Ui/Style/UiStyle.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index bdce8eb..02f8393 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -892,8 +892,8 @@ namespace MLEM.Ui.Elements { /// The new style protected virtual void InitStyle(UiStyle style) { this.SelectionIndicator.SetFromStyle(style.SelectionIndicator); - this.ActionSound.SetFromStyle(style.ActionSound?.CreateInstance()); - this.SecondActionSound.SetFromStyle(style.ActionSound?.CreateInstance()); + this.ActionSound.SetFromStyle(style.ActionSound); + this.SecondActionSound.SetFromStyle(style.ActionSound); } /// diff --git a/MLEM.Ui/Style/UiStyle.cs b/MLEM.Ui/Style/UiStyle.cs index 47cee17..99b36ea 100644 --- a/MLEM.Ui/Style/UiStyle.cs +++ b/MLEM.Ui/Style/UiStyle.cs @@ -133,10 +133,10 @@ namespace MLEM.Ui.Style { /// public float TextScale = 1; /// - /// The that should be played when an element's and events are called. + /// The that should be played when an element's and events are called. /// Note that this sound is only played if the callbacks have any subscribers. /// - public SoundEffect ActionSound; + public SoundEffectInstance ActionSound; } } \ No newline at end of file