-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYTModMenu.cs
44 lines (33 loc) · 1.72 KB
/
YTModMenu.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
using Terraria;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.ID;
namespace yourtale
{
public class YTModMenu : ModMenu
{
// I'm not going to be using any special textures simply because I can't draw.
// private const string menuAssetPath = "yourtale/Assets/Textures/Menu"; // This Creates a constant variable representing the texture path, so we don't have to write it out multiple times
public override Asset<Texture2D> Logo => ModContent.Request<Texture2D>($"yourtale/icon");
// public override Asset<Texture2D> SunTexture => ModContent.Request<Texture2D>($"{menuAssetPath}/ExampleSun");
// public override Asset<Texture2D> MoonTexture => ModContent.Request<Texture2D>($"{menuAssetPath}/ExampliumMoon");
public override int Music => MusicLoader.GetMusicSlot(Mod, "Assets/Music/YourTaleTheme");
// public override ModSurfaceBackgroundStyle MenuBackgroundStyle => ModContent.GetInstance<ExampleSurfaceBackgroundStyle>();
public override string DisplayName => "Your Tale menu";
// I think the amount of raw text data this contains literally pushes the menu switch button to the side. Looks like there's a new bug for the Tmodloader devs to fix?
public new bool IsSelected => MenuLoader.CurrentMenu == this;
public override void OnSelected()
{
SoundEngine.PlaySound(SoundID.Item9); // Plays a sound when this ModMenu is selected
}
public override bool PreDrawLogo(SpriteBatch spriteBatch, ref Vector2 logoDrawCenter, ref float logoRotation, ref float logoScale, ref Color drawColor)
{
drawColor = Main.DiscoColor; // Changes the draw color of the logo
logoScale *= 2.2f;
return true;
}
}
}