I can now load a json config file name .tarpit.json to configure everything. It now works to configure the sounds used.
This commit is contained in:
parent
268d8abf52
commit
90f4f727ba
8 changed files with 91 additions and 17 deletions
26
gui.hpp
26
gui.hpp
|
@ -5,18 +5,28 @@
|
|||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
class SoundQuip {
|
||||
public:
|
||||
sf::Sound sound;
|
||||
sf::SoundBuffer buffer;
|
||||
bool initialized;
|
||||
|
||||
SoundQuip();
|
||||
|
||||
void load(nlohmann::json &data, const char *in_file);
|
||||
void play();
|
||||
void stop();
|
||||
};
|
||||
|
||||
class GUI {
|
||||
vector<string> lines;
|
||||
|
||||
sf::Sound you_died_sound;
|
||||
sf::Sound build_works_sound;
|
||||
sf::Sound build_failed_sound;
|
||||
sf::Sound building_sound;
|
||||
sf::SoundBuffer you_died_buffer;
|
||||
sf::SoundBuffer build_works_buffer;
|
||||
sf::SoundBuffer build_failed_buffer;
|
||||
sf::SoundBuffer building_buffer;
|
||||
SoundQuip you_died_sound;
|
||||
SoundQuip build_works_sound;
|
||||
SoundQuip build_failed_sound;
|
||||
SoundQuip building_sound;
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue