Mostly all cleaned up now.

This commit is contained in:
Zed A. Shaw 2024-10-02 19:08:17 -04:00
parent 10e5f53292
commit 187edb898e
2 changed files with 225 additions and 0 deletions

54
gui.hpp Normal file
View file

@ -0,0 +1,54 @@
#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();
};