mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 12:23:39 +01:00
Set BGM via function
This commit is contained in:
parent
92f8ad0fd8
commit
4bcdf6caef
5 changed files with 41 additions and 32 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue