TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
Terraria.ModLoader.MusicLoader Class Referencesealed
+ Inheritance diagram for Terraria.ModLoader.MusicLoader:
+ Collaboration diagram for Terraria.ModLoader.MusicLoader:

Static Public Member Functions

static int GetMusicSlot (Mod mod, string musicPath)
 Gets the music id of the track with the specified mod path. The path must not have a file extension.
 
static int GetMusicSlot (string musicPath)
 Gets the music id of the track with the specified full path. The path must be prefixed with a mod name and must not have a file extension.
 
static bool MusicExists (Mod mod, string musicPath)
 Returns whether or not a music track with the specified mod path exists. The path must not have a file extension.
 
static bool MusicExists (string musicPath)
 Returns whether or not a music track with the specified path exists. The path must be prefixed with a mod name and must not have a file extension.
 
static IAudioTrack GetMusic (Mod mod, string musicPath)
 Gets the music track with the specified mod path. The path must not have a file extension.
 
static IAudioTrack GetMusic (string musicPath)
 Gets the music track with the specified full path. The path must be prefixed with a mod name and must not have a file extension.
 
static void AddMusic (Mod mod, string musicPath)
 Registers a new music track with the provided mod and its local path to the sound file.
 
static void AddMusicBox (Mod mod, int musicSlot, int itemType, int tileType, int tileFrameY=0)
 Allows you to tie a music ID, and item ID, and a tile ID together to form a music box.
When music with the given ID is playing, equipped music boxes have a chance to change their ID to the given item type.
When an item with the given item type is equipped, it will play the music that has musicSlot as its ID.
When a tile with the given type and Y-frame is nearby, if its X-frame is >= 36, it will play the music that has musicSlot as its ID.
 

Static Package Functions

static void AutoloadMusic (Mod mod)
 
static int ReserveMusicID ()
 
static IAudioTrack LoadMusic (string path, string extension)
 
static void CloseModStreams (Mod mod)
 
static void CloseStream (string musicPath)
 

Static Package Attributes

static readonly string[] supportedExtensions = new string[3] { ".mp3", ".ogg", ".wav" }
 
static readonly Dictionary< int, int > musicToItem = new Dictionary<int, int>()
 Unloaded server side.
 
static readonly Dictionary< int, int > itemToMusic = new Dictionary<int, int>()
 Unloaded server side.
 
static readonly Dictionary< int, Dictionary< int, int > > tileToMusic = new Dictionary<int, Dictionary<int, int>>()
 Only Loads the two keys, Tile type and Tile Y frame server side, the value is set to 0.
 
static readonly Dictionary< string, int > musicByPath = new Dictionary<string, int>()
 
static readonly Dictionary< string, string > musicExtensions = new Dictionary<string, string>()
 

Properties

static int MusicCount = 92 [get, private set]
 

Private Member Functions

void ILoader. ResizeArrays ()
 
void ILoader. Unload ()
 

Detailed Description

Definition at line 11 of file MusicLoader.cs.


The documentation for this class was generated from the following file: