forked from Lion8cake/ConfectionREBAKED-Legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheConfectionRebirth.cs
50 lines (48 loc) · 1.67 KB
/
TheConfectionRebirth.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using TheConfectionRebirth.Items;
using TheConfectionRebirth.Tiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Terraria;
using Terraria.GameContent.Dyes;
using Terraria.GameContent.UI;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.UI;
namespace TheConfectionRebirth
{
public class TheConfectionRebirth : Mod
{
public static Mod mod;
public override void Load()
{
mod = this;
IL.Terraria.Main.DrawMenu += Hooks.ConfectionWorldCreationUI.ILDrawMenu;
if (!Main.dedServ)
{
AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Confection"), ItemType("ConfectionMusicBox"), TileType("ConfectionMusicBox"));
AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/ConfectionUnderground"), ItemType("ConfectionUGMusicBox"), TileType("ConfectionUGMusicBox"));
}
}
public override void UpdateMusic(ref int music, ref MusicPriority priority) {
if (Main.myPlayer == -1 || Main.gameMenu || !Main.LocalPlayer.active) {
return;
}
if (Main.LocalPlayer.GetModPlayer<ConfectionPlayer>().ZoneConfection) {
music = GetSoundSlot(SoundType.Music, "Sounds/Music/Confection");
priority = MusicPriority.BiomeLow;
}
if(Main.LocalPlayer.ZoneRockLayerHeight && Main.LocalPlayer.GetModPlayer<ConfectionPlayer>().ZoneConfection) {
music = GetSoundSlot(SoundType.Music, "Sounds/Music/ConfectionUnderground");
priority = MusicPriority.BiomeLow;
}
}
}
}