From 2ac28eced322fb3239d160253027008a7913bac8 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 14 Jan 2020 22:41:52 +0100 Subject: [PATCH] made instances be unique for each element --- MLEM.Ui/Elements/Element.cs | 4 ++-- MLEM.Ui/Style/UiStyle.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index 1b46b05..42bbeba 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -501,8 +501,8 @@ namespace MLEM.Ui.Elements { protected virtual void InitStyle(UiStyle style) { this.SelectionIndicator.SetFromStyle(style.SelectionIndicator); - this.ActionSound.SetFromStyle(style.ActionSound); - this.SecondActionSound.SetFromStyle(style.ActionSound); + this.ActionSound.SetFromStyle(style.ActionSound?.CreateInstance()); + this.SecondActionSound.SetFromStyle(style.ActionSound?.CreateInstance()); } public delegate void TextInputCallback(Element element, Keys key, char character); diff --git a/MLEM.Ui/Style/UiStyle.cs b/MLEM.Ui/Style/UiStyle.cs index 1d55bd6..71142a8 100644 --- a/MLEM.Ui/Style/UiStyle.cs +++ b/MLEM.Ui/Style/UiStyle.cs @@ -37,7 +37,7 @@ namespace MLEM.Ui.Style { public IGenericFont ItalicFont; public FormatSettings FormatSettings; public float TextScale = 1; - public SoundEffectInstance ActionSound; + public SoundEffect ActionSound; } } \ No newline at end of file