You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
791 B
45 lines
791 B
#pragma once
|
|
|
|
#include <efsw/efsw.hpp>
|
|
#include "game_engine.hpp"
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <SFML/Audio.hpp>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
using std::string;
|
|
|
|
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 {
|
|
std::vector<string> lines;
|
|
|
|
SoundQuip you_died_sound;
|
|
SoundQuip build_works_sound;
|
|
SoundQuip build_failed_sound;
|
|
SoundQuip building_sound;
|
|
|
|
public:
|
|
|
|
GUI();
|
|
|
|
void output(const string &msg);
|
|
|
|
int main_loop(GameEngine &game, std::function<bool()> runner);
|
|
|
|
void build_works();
|
|
void build_failed(bool play_sound, const string &command);
|
|
void you_died();
|
|
void building();
|
|
};
|
|
|