First cut of pulling out the relevant parts of my original game to make a little framework.
This commit is contained in:
commit
6a0c9e8d46
177 changed files with 18197 additions and 0 deletions
54
src/gui/main_ui.hpp
Normal file
54
src/gui/main_ui.hpp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#pragma once
|
||||
#include <SFML/Graphics/RenderWindow.hpp>
|
||||
#include <SFML/System/Clock.hpp>
|
||||
#include "algos/stats.hpp"
|
||||
#include <guecs/ui.hpp>
|
||||
#include "gui/overlay_ui.hpp"
|
||||
#include "gui/debug_ui.hpp"
|
||||
#include "graphics/raycaster.hpp"
|
||||
#include "graphics/animation.hpp"
|
||||
#include "game/components.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace animation {
|
||||
class Animation;
|
||||
}
|
||||
|
||||
namespace gui {
|
||||
class MainUI {
|
||||
public:
|
||||
int $compass_dir = 0;
|
||||
bool $needs_render = true;
|
||||
bool $mind_reading = false;
|
||||
sf::Clock $clock;
|
||||
sf::RenderWindow& $window;
|
||||
OverlayUI $overlay_ui;
|
||||
std::shared_ptr<Raycaster> $rayview;
|
||||
textures::SpriteTexture $hand;
|
||||
animation::Animation $hand_anim;
|
||||
|
||||
MainUI(sf::RenderWindow& window);
|
||||
|
||||
void mouse(int x, int y, guecs::Modifiers mods);
|
||||
void debug();
|
||||
void render_debug();
|
||||
|
||||
void plan_rotate(int dir, float amount);
|
||||
std::optional<Point> play_rotate();
|
||||
std::optional<components::Position> play_move();
|
||||
Point plan_move(int dir, bool strafe);
|
||||
void abort_plan();
|
||||
void update_level();
|
||||
|
||||
void init();
|
||||
void render();
|
||||
void dirty();
|
||||
lel::Cell overlay_cell(const std::string& name);
|
||||
|
||||
void dead_entity(DinkyECS::Entity entity);
|
||||
void toggle_mind_reading();
|
||||
void render_mind_reading();
|
||||
void play_hands();
|
||||
void render_hands();
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue