Inherits Terraria.ModLoader.ILoader.
|
static void | AddMusic (Mod mod, string musicPath) |
| Registers a new music track with the provided mod and its local path to the sound file. More...
|
|
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. More...
|
|
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 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 int | MusicCount = MusicID.Count [get] |
|
◆ AddMusic()
static void Terraria.ModLoader.MusicLoader.AddMusic |
( |
Mod |
mod, |
|
|
string |
musicPath |
|
) |
| |
|
static |
Registers a new music track with the provided mod and its local path to the sound file.
- Parameters
-
mod | The mod that owns the music track. |
musicPath | The provided mod's local path to the music track file, case-sensitive and without extensions. |
◆ AddMusicBox()
static void Terraria.ModLoader.MusicLoader.AddMusicBox |
( |
Mod |
mod, |
|
|
int |
musicSlot, |
|
|
int |
itemType, |
|
|
int |
tileType, |
|
|
int |
tileFrameY = 0 |
|
) |
| |
|
static |
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.
- Parameters
-
mod | The music slot. |
musicSlot | The music slot. |
itemType | Type of the item. |
tileType | Type of the tile. |
tileFrameY | The tile frame y. |
- Exceptions
-
ArgumentOutOfRangeException | Cannot assign music box to vanilla music id. or The provided music id does not exist. or Cannot assign music box to a vanilla item id. or The provided item id does not exist. or Cannot assign music box to a vanilla tile id. or The provided tile id does not exist |
ArgumentException | The provided music id has already been assigned a music box. or The provided item id has already been assigned a music. or Y-frame must be divisible by 36 |