Set BGM via function

This commit is contained in:
goat 2019-11-23 14:12:30 +09:00
parent 92f8ad0fd8
commit 4bcdf6caef
5 changed files with 41 additions and 32 deletions

View file

@ -440,7 +440,7 @@ namespace Dalamud {
private void OnBgmSetCommand(string command, string arguments)
{
Framework.Network.InjectBgmTest(int.Parse(arguments));
Framework.Gui.SetBgm(ushort.Parse(arguments));
}
private void OnItemLinkCommand(string command, string arguments) {
@ -474,26 +474,5 @@ namespace Dalamud {
});
}
public static byte[] StringToByteArray(String value)
{
byte[] bytes = new byte[value.Length * sizeof(char)];
Buffer.BlockCopy(value.ToCharArray(), 0, bytes, 0, bytes.Length);
return bytes;
}
public static String ByteArrayToString(byte[] value)
{
var chars = new char[value.Length / sizeof(char)];
var atValue = 0;
for (var i = 0; i < chars.Length; i++) {
chars[i] = BitConverter.ToChar(value, atValue);
atValue += 2;
}
return new string(chars);
}
}
}