roguish/gui.hpp
2024-10-02 19:08:17 -04:00

54 lines
1.2 KiB
C++

#pragma once
#include <SFML/Audio.hpp>
#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Text.hpp>
#include <codecvt>
#include <ftxui/component/component.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/dom/canvas.hpp>
#include <locale>
#include <string>
#include "entity.hpp"
#include "map.hpp"
using std::string;
using ftxui::Canvas, ftxui::Component, ftxui::Screen;
enum class Value {
BLACK=0, DARK_DARK, DARK_MID,
DARK_LIGHT, MID, LIGHT_DARK, LIGHT_MID,
LIGHT_LIGHT, WHITE, TRANSPARENT
};
class GUI {
sf::Color color(Value val);
Map game_map_;
sf::SoundBuffer hit_buf_;
sf::Sound hit_sound_;
bool show_paths_ = false;
string status_text_ = "NOT DEAD";
Entity player_;
Entity enemy_;
Point goal_;
Component document_;
Component map_view_;
Canvas canvas_;
sf::Font font_;
sf::Text text_;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter_;
sf::RenderWindow window_;
Screen screen_;
public:
GUI();
// disable copying
GUI(GUI &gui) = delete;
void create_renderer();
void render_scene();
void handle_events();
int main();
};