forked from nikita/muzika-gromche
Refactor: Factor out displaying lyrics as a tip in its own method
This commit is contained in:
parent
78370da460
commit
b6f2ca355b
|
@ -513,6 +513,13 @@ namespace MuzikaGromche
|
|||
return distance <= AudioMaxDistance;
|
||||
}
|
||||
|
||||
public static void DisplayLyrics(string text)
|
||||
{
|
||||
HUDManager.Instance.DisplayTip("[Lyrics]", text);
|
||||
// Don't interrupt the music with constant HUD audio pings
|
||||
HUDManager.Instance.UIAudio.Stop();
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
|
@ -1876,9 +1883,7 @@ namespace MuzikaGromche
|
|||
case LyricsEvent e:
|
||||
if (Plugin.LocalPlayerCanHearMusic(__instance))
|
||||
{
|
||||
HUDManager.Instance.DisplayTip("[Lyrics]", e.Text);
|
||||
// Don't interrupt the music with constant HUD audio pings
|
||||
HUDManager.Instance.UIAudio.Stop();
|
||||
Plugin.DisplayLyrics(e.Text);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue