Skip to content

Commit 0e3411c

Browse files
committed
Remove redundant MOD in names, update class name to be more descriptive
1 parent c726bcd commit 0e3411c

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

Assembly-CSharp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<Compile Include="Assets.Scripts.Core.Audio\AudioInfo.cs" />
7272
<Compile Include="Assets.Scripts.Core.Audio\AudioLayerUnity.cs" />
7373
<Compile Include="Assets.Scripts.Core.Audio\AudioType.cs" />
74-
<Compile Include="MOD.Scripts.Core.Audio\MODAudio.cs" />
74+
<Compile Include="MOD.Scripts.Core.Audio\MODAudioTracking.cs" />
7575
<Compile Include="Assets.Scripts.Core.Audio\OnFinishLoad.cs" />
7676
<Compile Include="Assets.Scripts.Core.Buriko.Util\BurikoObjectConverter.cs" />
7777
<Compile Include="Assets.Scripts.Core.Buriko.Util\BurikoReference.cs" />

Assets.Scripts.Core.Audio/AudioController.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public void FadeOutBGM(int channel, int time, bool waitForFade, bool noBGMTracki
223223
{
224224
if (!noBGMTracking)
225225
{
226-
MODAudio.Instance.MODForgetLastBGM(channel);
226+
MODAudioTracking.Instance.ForgetLastBGM(channel);
227227
}
228228
float num = (float)time / 1000f;
229229
int channelByTypeChannel = GetChannelByTypeChannel(AudioType.BGM, channel);
@@ -243,7 +243,7 @@ public void StopBGM(int channel, bool noBGMTracking = false)
243243
{
244244
if (!noBGMTracking)
245245
{
246-
MODAudio.Instance.MODForgetLastBGM(channel);
246+
MODAudioTracking.Instance.ForgetLastBGM(channel);
247247
}
248248
AudioLayerUnity audioLayerUnity = channelDictionary[channel];
249249
audioLayerUnity.StopAudio();
@@ -257,7 +257,7 @@ public void FadeOutMultiBGM(int channelstart, int channelend, int time, bool wai
257257
{
258258
for (int i = channelstart; i <= channelend; i++)
259259
{
260-
MODAudio.Instance.MODForgetLastBGM(i);
260+
MODAudioTracking.Instance.ForgetLastBGM(i);
261261
FadeOutBGM(i, time, waitForFade);
262262
}
263263
}
@@ -389,7 +389,7 @@ public void StopAllAudio()
389389
{
390390
for (int i = 0; i < 6; i++)
391391
{
392-
MODAudio.Instance.MODForgetLastBGM(i);
392+
MODAudioTracking.Instance.ForgetLastBGM(i);
393393
AudioLayerUnity audioLayerUnity = channelDictionary[GetChannelByTypeChannel(AudioType.BGM, i)];
394394
if (audioLayerUnity.IsPlaying())
395395
{
@@ -432,7 +432,7 @@ public void PlayAudio(string filename, AudioType type, int channel, float volume
432432
{
433433
if (!noBGMTracking)
434434
{
435-
MODAudio.Instance.MODSaveLastBGM(new AudioInfo(volume, filename, channel));
435+
MODAudioTracking.Instance.SaveLastBGM(new AudioInfo(volume, filename, channel));
436436
}
437437

438438
if (currentAudio[AudioType.BGM].ContainsKey(channel))

Assets.Scripts.Core.Buriko/BurikoScriptFile.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ private BurikoVariable OperationMODPlayBGM()
466466
// OperationMODPlayBGM accepts one extra argument - the GAltBGMflow setting where this bgm should be played
467467
int targetBGMFlow = ReadVariable().IntValue();
468468

469-
MODAudio.Instance.MODSaveLastAltBGM(targetBGMFlow, new AudioInfo(volume, filename, channel));
469+
MODAudioTracking.Instance.SaveLastAltBGM(targetBGMFlow, new AudioInfo(volume, filename, channel));
470470

471471
if(BurikoMemory.Instance.GetGlobalFlag("GAltBGMflow").IntValue() == targetBGMFlow)
472472
{
@@ -521,7 +521,7 @@ private BurikoVariable OperationMODFadeOutBGM()
521521
FadeBGMCommon(out int channel, out int time, out bool waitForFade);
522522
int targetBGMFlow = ReadVariable().IntValue();
523523

524-
MODAudio.Instance.MODForgetLastAltBGM(targetBGMFlow, channel);
524+
MODAudioTracking.Instance.ForgetLastAltBGM(targetBGMFlow, channel);
525525

526526
if (BurikoMemory.Instance.GetGlobalFlag("GAltBGMflow").IntValue() == targetBGMFlow)
527527
{

MOD.Scripts.Core.Audio/MODAudio.cs MOD.Scripts.Core.Audio/MODAudioTracking.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
namespace MOD.Scripts.Core.Audio
88
{
9-
public class MODAudio
9+
public class MODAudioTracking
1010
{
11-
private static MODAudio _instance;
12-
public static MODAudio Instance => _instance ?? (_instance = new MODAudio());
11+
private static MODAudioTracking _instance;
12+
public static MODAudioTracking Instance => _instance ?? (_instance = new MODAudioTracking());
1313

1414
// Dictionary of BGMFlow setting -> (Dictionary of channel -> last audio played on that channel by MODPlayBGM functions))
1515
private Dictionary<int, AudioInfo>[] lastAltBGM;
@@ -24,7 +24,7 @@ private void Log(string text)
2424
}
2525
}
2626

27-
public MODAudio()
27+
public MODAudioTracking()
2828
{
2929
lastAltBGM = new Dictionary<int, AudioInfo>[8];
3030
for (int i = 0; i < lastAltBGM.Length; i++)
@@ -35,7 +35,7 @@ public MODAudio()
3535

3636
private bool flowInRange(int flow) => flow < lastAltBGM.Length;
3737

38-
public void MODSaveLastBGM(AudioInfo info)
38+
public void SaveLastBGM(AudioInfo info)
3939
{
4040
Log($"Saving bgm {info.Filename} channel {info.Channel} all flows");
4141
foreach (Dictionary<int, AudioInfo> channelDict in lastAltBGM)
@@ -44,7 +44,7 @@ public void MODSaveLastBGM(AudioInfo info)
4444
}
4545
}
4646

47-
public void MODForgetLastBGM(int channel)
47+
public void ForgetLastBGM(int channel)
4848
{
4949
Log($"Forgetting channel {channel} all flows");
5050
foreach (Dictionary<int, AudioInfo> channelDict in lastAltBGM)
@@ -53,7 +53,7 @@ public void MODForgetLastBGM(int channel)
5353
}
5454
}
5555

56-
public void MODSaveLastAltBGM(int altBGMFlow, AudioInfo info)
56+
public void SaveLastAltBGM(int altBGMFlow, AudioInfo info)
5757
{
5858
Log($"Saving bgm {info.Filename} channel {info.Channel} flow {altBGMFlow}");
5959
if (flowInRange(altBGMFlow))
@@ -62,7 +62,7 @@ public void MODSaveLastAltBGM(int altBGMFlow, AudioInfo info)
6262
}
6363
}
6464

65-
public void MODForgetLastAltBGM(int altBGMFlow, int channel)
65+
public void ForgetLastAltBGM(int altBGMFlow, int channel)
6666
{
6767
Log($"Forgetting channel {channel} flow {altBGMFlow}");
6868
if (flowInRange(altBGMFlow))
@@ -71,7 +71,7 @@ public void MODForgetLastAltBGM(int altBGMFlow, int channel)
7171
}
7272
}
7373

74-
public void MODRestoreBGM(int oldBGMFlow, int newBGMFlow)
74+
public void RestoreBGM(int oldBGMFlow, int newBGMFlow)
7575
{
7676
Log($"Begin BGM restore...");
7777
if (!flowInRange(oldBGMFlow) || !flowInRange(newBGMFlow))

MOD.Scripts.UI/MODMenu.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ public void OnGUIFragment()
449449
SetGlobal("GAltBGMflow", newBGMSEValue);
450450
SetGlobal("GAltSEflow", newBGMSEValue);
451451

452-
MODAudio.Instance.MODRestoreBGM(oldBGMSEValue, newBGMSEValue);
452+
MODAudioTracking.Instance.RestoreBGM(oldBGMSEValue, newBGMSEValue);
453453
}
454454
}
455455

0 commit comments

Comments
 (0)