prepare for new audio features on new branch
This commit is contained in:
@@ -73,14 +73,11 @@ enum struct AUDIOMANAGER {
|
|||||||
* @param instant - True = stops music NOW and changes, False = play current song then change
|
* @param instant - True = stops music NOW and changes, False = play current song then change
|
||||||
**/
|
**/
|
||||||
void ChangeBGM(int bgm, bool instant) {
|
void ChangeBGM(int bgm, bool instant) {
|
||||||
if (instant) {
|
if (instant) { this.timeSeconds = GetEngineTime() - this.loopSeconds; }
|
||||||
//this.ticksBGM = -2;
|
this.indexBGM = this.VIPBGM >= 0 ? this.VIPBGM : bgm == 0 ? g_indexBGM : bgm;
|
||||||
this.timeSeconds = GetEngineTime() - this.loopSeconds;
|
|
||||||
}
|
|
||||||
this.indexBGM = (this.VIPBGM >= 0 ? this.VIPBGM : bgm == 0 ? g_indexBGM : bgm);
|
|
||||||
this.shouldTick = true;
|
this.shouldTick = true;
|
||||||
this.hasTimeOffset = BGMArray[this.indexBGM].introSeconds > 0 ? true : false;
|
this.hasTimeOffset = BGMArray[this.indexBGM].introSeconds > 0 ? true : false;
|
||||||
this.stopBGM = (!StrEqual(this.cachedPath, BGMArray[this.indexBGM].realPath) ? true : false);
|
this.stopBGM = !StrEqual(this.cachedPath, BGMArray[this.indexBGM].realPath) ? true : false;
|
||||||
this.bgmPlaying = true;
|
this.bgmPlaying = true;
|
||||||
//if (this.indexBGM >= 20) for (int i = 0; i < MaxClients; i++) for (int s = 19; s < bgm; s++) StopSound(i, this.chanBGM, BGMArray[s].realPath); //Very quick, very dirty, very suboptimal, but gets the job done... This stops all boss music.
|
//if (this.indexBGM >= 20) for (int i = 0; i < MaxClients; i++) for (int s = 19; s < bgm; s++) StopSound(i, this.chanBGM, BGMArray[s].realPath); //Very quick, very dirty, very suboptimal, but gets the job done... This stops all boss music.
|
||||||
}
|
}
|
||||||
@@ -89,7 +86,7 @@ enum struct AUDIOMANAGER {
|
|||||||
this.loops = 0;
|
this.loops = 0;
|
||||||
this.indexBGM = 0;
|
this.indexBGM = 0;
|
||||||
this.timeSeconds = 0.0;
|
this.timeSeconds = 0.0;
|
||||||
if (IsValidClient(this.Client)) for (int s = this.indexBGM; s < sizeof(BGMArray); s++) StopSound(this.Client, g_chanBGM, BGMArray[s].realPath); //Very quick, very dirty, very suboptimal, but gets the job done... This stops all boss music.
|
if (IsValidClient(this.Client)) for (int s = this.indexBGM; s < sizeof(BGMArray); s++) StopSound(this.Client, g_chanBGM, BGMArray[s].realPath);
|
||||||
AssLogger(LOGLVL_DEBUG, "AudioManager has been reset!");
|
AssLogger(LOGLVL_DEBUG, "AudioManager has been reset!");
|
||||||
}
|
}
|
||||||
void SetInEvent(bool inEvent){
|
void SetInEvent(bool inEvent){
|
||||||
@@ -128,12 +125,10 @@ enum struct AUDIOMANAGER {
|
|||||||
void OnClientConnected(int client) {
|
void OnClientConnected(int client) {
|
||||||
this.Client = client;
|
this.Client = client;
|
||||||
this.clientIsFresh = true;
|
this.clientIsFresh = true;
|
||||||
PrintToServer("Handling new client: %N", client);
|
|
||||||
}
|
}
|
||||||
/**When a client respawns */
|
/**When a client respawns */
|
||||||
void OnClientRespawned() {
|
void OnClientRespawned() {
|
||||||
if (this.clientIsFresh) {
|
if (this.clientIsFresh) {
|
||||||
PrintToServer("Client respawned, %N", this.Client);
|
|
||||||
if (soundPreference[this.Client] == 1 || soundPreference[this.Client] == 3) CPrintToChat(this.Client, "[AudioManager v%s] Welcome! We are listening to %s", FSE_VER, BGMArray[g_indexBGM].songName);
|
if (soundPreference[this.Client] == 1 || soundPreference[this.Client] == 3) CPrintToChat(this.Client, "[AudioManager v%s] Welcome! We are listening to %s", FSE_VER, BGMArray[g_indexBGM].songName);
|
||||||
this.ChangeBGM(g_indexBGM, true);
|
this.ChangeBGM(g_indexBGM, true);
|
||||||
this.clientIsFresh = false;
|
this.clientIsFresh = false;
|
||||||
@@ -161,8 +156,6 @@ enum struct AUDIOCONTROLLER {
|
|||||||
AudioManager[i].Client = i;
|
AudioManager[i].Client = i;
|
||||||
for (int x = 0; x < sizeof(BGMArray); ++x) StopSound(i, g_chanBGM, BGMArray[x].realPath);
|
for (int x = 0; x < sizeof(BGMArray); ++x) StopSound(i, g_chanBGM, BGMArray[x].realPath);
|
||||||
}
|
}
|
||||||
//this.shouldTick = true;
|
|
||||||
//this.UpdateBGM();
|
|
||||||
}
|
}
|
||||||
g_indexBGM = GetRandomInt(1, 4);
|
g_indexBGM = GetRandomInt(1, 4);
|
||||||
this.VIPBGM = -1;
|
this.VIPBGM = -1;
|
||||||
@@ -286,14 +279,6 @@ public int MenuHandlerFartsy(Menu menu, MenuAction action, int param1, int param
|
|||||||
} else if (action == MenuAction_End) CloseHandle(menu);
|
} else if (action == MenuAction_End) CloseHandle(menu);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//Restart music for the new client
|
|
||||||
public Action RefireMusicForClient(Handle timer, int client) {
|
|
||||||
if (IsValidClient(client)) {
|
|
||||||
if (GetClientTeam(client) == 0) CreateTimer(1.0, RefireMusicForClient, client);
|
|
||||||
else if (GetClientTeam(client) == 2) CSEClient(client, BGMArray[AudioManager[client].indexBGM].realPath, BGMArray[AudioManager[client].indexBGM].SNDLVL, true, 1, 1.0, 100);
|
|
||||||
}
|
|
||||||
return Plugin_Stop;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Light Entities
|
//Light Entities
|
||||||
bool g_PowerOutage;
|
bool g_PowerOutage;
|
||||||
|
@@ -910,6 +910,7 @@ void sudo(int task) {
|
|||||||
float hwn = GetRandomFloat(core.HWNMin, core.HWNMax);
|
float hwn = GetRandomFloat(core.HWNMin, core.HWNMax);
|
||||||
CreateTimer(hwn, HWBosses);
|
CreateTimer(hwn, HWBosses);
|
||||||
GlobalAudio.setBGM(29, true);
|
GlobalAudio.setBGM(29, true);
|
||||||
|
PrintToChatAll("index 29 should be sound\\fartsy\\music\\wavenull_intro.mp3, waves should be timed so that the music changes right at the end of this intro.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case 42690:{
|
case 42690:{
|
||||||
|
Reference in New Issue
Block a user