diff --git a/Adventures in Lestoria/Adventures in Lestoria.tiled-project b/Adventures in Lestoria/Adventures in Lestoria.tiled-project
index d112b4a3..698ed73e 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.tiled-project
+++ b/Adventures in Lestoria/Adventures in Lestoria.tiled-project
@@ -8,6 +8,17 @@
"."
],
"propertyTypes": [
+ {
+ "id": 27,
+ "name": "BGM",
+ "storageType": "string",
+ "type": "enum",
+ "values": [
+ "None",
+ "foresty_1_1"
+ ],
+ "valuesAsFlags": false
+ },
{
"color": "#ff290aa4",
"drawFill": true,
@@ -160,6 +171,12 @@
"drawFill": true,
"id": 19,
"members": [
+ {
+ "name": "Background Music",
+ "propertyType": "BGM",
+ "type": "string",
+ "value": "None"
+ },
{
"name": "Level Type",
"propertyType": "LevelType",
diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
index 428f4d2b..32375e2e 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
@@ -642,6 +642,8 @@
+
+
diff --git a/Adventures in Lestoria/Audio.cpp b/Adventures in Lestoria/Audio.cpp
index 400a070c..473f1266 100644
--- a/Adventures in Lestoria/Audio.cpp
+++ b/Adventures in Lestoria/Audio.cpp
@@ -43,4 +43,18 @@ INCLUDE_game
MiniAudio&Audio::Engine(){
return game->audioEngine.audioEngine;
+}
+void Audio::Play(const std::string_view sound){
+ Engine().Play(std::string(sound));
+};
+void Audio::PlayBGM(const std::string_view sound,const bool loop=true){
+ if(Engine().LoadS)
+ Engine().Play(std::string(sound));
+};
+
+std::string operator""_SFX(const char*key,size_t length){
+ return "sfx_directory"_S+std::string(key,length);
+}
+std::string operator""_BGM(const char*key,size_t length){
+ return "bgm_directory"_S+std::string(key,length);
}
\ No newline at end of file
diff --git a/Adventures in Lestoria/Audio.h b/Adventures in Lestoria/Audio.h
index d5a9a2a3..cde143d5 100644
--- a/Adventures in Lestoria/Audio.h
+++ b/Adventures in Lestoria/Audio.h
@@ -37,9 +37,21 @@ All rights reserved.
#pragma endregion
#pragma once
#include "olcPGEX_MiniAudio.h"
+#include "config.h"
class Audio{
+ class BGM{
+ std::vectorchannels;
+ public:
+ Load();
+ Unload();
+ };
MiniAudio audioEngine;
public:
static MiniAudio&Engine();
-};
\ No newline at end of file
+ static void Play(const std::string_view sound);
+ static void PlayBGM(const std::string_view sound,const bool loop=true);
+};
+
+std::string operator""_SFX(const char*key,size_t length);
+std::string operator""_BGM(const char*key,size_t length);
\ No newline at end of file
diff --git a/Adventures in Lestoria/State_OverworldMap.cpp b/Adventures in Lestoria/State_OverworldMap.cpp
index f92ec5a7..bbc062c4 100644
--- a/Adventures in Lestoria/State_OverworldMap.cpp
+++ b/Adventures in Lestoria/State_OverworldMap.cpp
@@ -47,6 +47,7 @@ All rights reserved.
#include "VisualNovel.h"
#include "State_OverworldMap.h"
#include "SaveFile.h"
+#include "Audio.h"
INCLUDE_MONSTER_LIST
INCLUDE_game
@@ -106,7 +107,7 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
}
if(game->GetKey(K1).bPressed){
- Audio::Engine().Play("sfx_directory"_S+"sfx100v2_loop_water_01.mp3");
+ Audio::Play("sfx100v2_loop_water_01.mp3"_SFX);
}
#pragma region Handle Connection Point Clicking and Movement
diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h
index b27ae199..23338e9d 100644
--- a/Adventures in Lestoria/Version.h
+++ b/Adventures in Lestoria/Version.h
@@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
-#define VERSION_BUILD 5350
+#define VERSION_BUILD 5353
#define stringify(a) stringify_(a)
#define stringify_(a) #a
diff --git a/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx b/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx
index 2d6de9ef..97fbaf70 100644
--- a/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx
+++ b/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx
@@ -1,6 +1,7 @@