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.
52 lines
1.0 KiB
52 lines
1.0 KiB
#pragma once
|
|
#include "levelmanager.hpp"
|
|
#include "constants.hpp"
|
|
#include <deque>
|
|
#include "textures.hpp"
|
|
#include "guecs.hpp"
|
|
#include "rituals.hpp"
|
|
#include "fsm.hpp"
|
|
|
|
namespace gui {
|
|
|
|
namespace ritual {
|
|
enum class State {
|
|
START=0,
|
|
OPENED=1,
|
|
CLOSED=2,
|
|
OPENING=3,
|
|
CLOSING=4
|
|
};
|
|
|
|
|
|
enum class Event {
|
|
STARTED=0,
|
|
TOGGLE=1,
|
|
TICK=2
|
|
};
|
|
|
|
class UI : public DeadSimpleFSM<State, Event>{
|
|
public:
|
|
sf::IntRect $ritual_closed_rect{{0,0},{380,720}};
|
|
sf::IntRect $ritual_open_rect{{380 * 2,0},{380,720}};
|
|
components::Animation $ritual_anim;
|
|
guecs::UI $gui;
|
|
GameLevel $level;
|
|
textures::SpriteTexture $ritual_ui;
|
|
|
|
UI(GameLevel level);
|
|
|
|
void event(Event ev);
|
|
void START(Event);
|
|
void OPENED(Event);
|
|
void CLOSED(Event);
|
|
void OPENING(Event);
|
|
void CLOSING(Event);
|
|
|
|
bool mouse(float x, float y, bool hover);
|
|
void render(sf::RenderWindow &window);
|
|
bool is_open();
|
|
};
|
|
|
|
}
|
|
}
|
|
|