Added Sound effect configuration and implementation.

This commit is contained in:
2024-01-08 05:26:20 -06:00
parent 6539bbdb50
commit 0643393b9c
13 changed files with 259 additions and 57 deletions
@@ -69,6 +69,7 @@ All rights reserved.
#include "Merchant.h"
#include "SaveFile.h"
#include "TitleScreen.h"
#include "SoundEffect.h"
#ifndef __EMSCRIPTEN__
#include "discord.h"
#endif
@@ -237,6 +238,7 @@ bool AiL::OnUserCreate(){
Audio::Initialize();
EnvironmentalAudio::Initialize();
SoundEffect::Initialize();
LoadLevel(LEVEL_NAMES["starting_map"_S]);
ChangePlayerClass(WARRIOR);
@@ -2467,6 +2469,9 @@ bool AiL::UseLoadoutItem(int slot){
if(GetLoadoutItem(slot).lock()->Amt()>0){
Inventory::UseItem(GetLoadoutItem(slot).lock()->ActualName());
GetLoadoutItem(slot).lock()->amt--;
if(GetLoadoutItem(slot).lock()->UseSound().length()>0){
SoundEffect::PlaySFX(GetLoadoutItem(slot).lock()->UseSound());
}
return true;
}
return false;