2022-05-04 06:11:30 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace TJAPlayer3
|
|
|
|
|
{
|
|
|
|
|
class CHitSounds
|
|
|
|
|
{
|
|
|
|
|
public CHitSounds(string path)
|
|
|
|
|
{
|
|
|
|
|
tLoadFile(path);
|
2023-02-15 01:27:05 +01:00
|
|
|
|
for (int i = 0; i < 5; i++)
|
2022-05-04 06:11:30 +02:00
|
|
|
|
{
|
|
|
|
|
tReloadHitSounds(TJAPlayer3.ConfigIni.nHitSounds[i], i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool tReloadHitSounds(int id, int player)
|
|
|
|
|
{
|
|
|
|
|
if (id >= names.Length || id >= data.Length)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
string ext = "";
|
|
|
|
|
|
|
|
|
|
if (data[id].format == "WAV")
|
|
|
|
|
ext = ".wav";
|
|
|
|
|
else if (data[id].format == "OGG")
|
|
|
|
|
ext = ".ogg";
|
|
|
|
|
|
|
|
|
|
don[player] = data[id].path + "dong" + ext;
|
|
|
|
|
ka[player] = data[id].path + "ka" + ext;
|
|
|
|
|
adlib[player] = data[id].path + "Adlib" + ext;
|
2022-05-07 07:27:52 +02:00
|
|
|
|
clap[player] = data[id].path + "clap" + ext;
|
2022-05-04 06:11:30 +02:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string[] names;
|
|
|
|
|
|
2023-02-15 01:27:05 +01:00
|
|
|
|
public string[] don = new string[5];
|
|
|
|
|
public string[] ka = new string[5];
|
|
|
|
|
public string[] adlib = new string[5];
|
|
|
|
|
public string[] clap = new string[5];
|
2022-05-04 06:11:30 +02:00
|
|
|
|
|
|
|
|
|
#region [private]
|
|
|
|
|
|
|
|
|
|
private class HitSoundsData
|
|
|
|
|
{
|
|
|
|
|
public string name;
|
|
|
|
|
public string path;
|
|
|
|
|
public string format;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private HitSoundsData[] data;
|
|
|
|
|
|
|
|
|
|
private void tLoadFile(string path)
|
|
|
|
|
{
|
|
|
|
|
data = ConfigManager.GetConfig<List<HitSoundsData>>(path).ToArray();
|
|
|
|
|
|
|
|
|
|
names = new string[data.Length];
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < data.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
names[i] = data[i].name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|