levelmanager.* is now gone, but the code is just moved over to game_level. Now to clean up the api and give it a new name.
This commit is contained in:
parent
5aca2fb56a
commit
a83ee77eea
17 changed files with 147 additions and 178 deletions
|
@ -9,11 +9,6 @@
|
|||
namespace gui {
|
||||
using namespace guecs;
|
||||
|
||||
DebugUI::DebugUI(LevelManager& level_mgr) :
|
||||
$level_mgr(level_mgr)
|
||||
{
|
||||
}
|
||||
|
||||
void DebugUI::init(lel::Cell cell) {
|
||||
$gui.position(cell.x, cell.y, cell.w, cell.h);
|
||||
$gui.layout(
|
||||
|
@ -51,7 +46,7 @@ namespace gui {
|
|||
|
||||
void DebugUI::render(sf::RenderWindow& window) {
|
||||
if(active) {
|
||||
auto& level = $level_mgr.current();
|
||||
auto& level = Game::current();
|
||||
auto player = level.world->get_the<components::Player>();
|
||||
auto player_combat = level.world->get<components::Combat>(player.entity);
|
||||
auto map = level.map;
|
||||
|
@ -81,7 +76,7 @@ namespace gui {
|
|||
active = !active;
|
||||
|
||||
if(active) {
|
||||
auto& level = $level_mgr.current();
|
||||
auto& level = Game::current();
|
||||
// it's on now, enable things
|
||||
auto player = level.world->get_the<components::Player>();
|
||||
auto& player_combat = level.world->get<components::Combat>(player.entity);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "levelmanager.hpp"
|
||||
#include "game_level.hpp"
|
||||
#include <SFML/Graphics/RenderWindow.hpp>
|
||||
#include <SFML/Graphics/Font.hpp>
|
||||
#include <guecs/ui.hpp>
|
||||
|
@ -10,11 +10,8 @@ namespace gui {
|
|||
public:
|
||||
Stats $stats;
|
||||
guecs::UI $gui;
|
||||
LevelManager& $level_mgr;
|
||||
bool active = false;
|
||||
|
||||
DebugUI(LevelManager& level_mgr);
|
||||
|
||||
void init(lel::Cell cell);
|
||||
void render(sf::RenderWindow& window);
|
||||
bool mouse(float x, float y, guecs::Modifiers mods);
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace gui {
|
|||
|
||||
FSM::FSM() :
|
||||
$window(sf::VideoMode({SCREEN_WIDTH, SCREEN_HEIGHT}), "Zed's Raycaster Thing"),
|
||||
$debug_ui(Game::get_the_manager()),
|
||||
$main_ui($window),
|
||||
$font{FONT_FILE_NAME},
|
||||
$dnd_loot($status_ui, $loot_ui, $window, $router)
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace gui {
|
|||
int $temp_attack_id = 0;
|
||||
DebugUI $debug_ui;
|
||||
MainUI $main_ui;
|
||||
shared_ptr<BossFightUI> $boss_fight_ui = nullptr;
|
||||
std::shared_ptr<BossFightUI> $boss_fight_ui = nullptr;
|
||||
CombatUI $combat_ui;
|
||||
StatusUI $status_ui;
|
||||
MapViewUI $map_ui;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "systems.hpp"
|
||||
#include "inventory.hpp"
|
||||
#include "game_level.hpp"
|
||||
#include "levelmanager.hpp"
|
||||
|
||||
namespace gui {
|
||||
using namespace guecs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue