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.
39 lines
918 B
39 lines
918 B
#include "mini_map.hpp"
|
|
#include <functional>
|
|
#include <string>
|
|
#include "dbc.hpp"
|
|
#include "components.hpp"
|
|
#include "rand.hpp"
|
|
#include "animation.hpp"
|
|
#include "systems.hpp"
|
|
#include "rand.hpp"
|
|
#include <codecvt>
|
|
#include <iostream>
|
|
#include <memory>
|
|
|
|
namespace gui {
|
|
using namespace components;
|
|
|
|
MiniMapUI::MiniMapUI(GameLevel &level) :
|
|
$map_grid{L"...", 45, {200, 200, 200, 100}, 10},
|
|
$level(level)
|
|
{
|
|
$font = std::make_shared<sf::Font>(FONT_FILE_NAME);
|
|
}
|
|
|
|
void MiniMapUI::update_level(GameLevel &level) {
|
|
$level = level;
|
|
}
|
|
|
|
void MiniMapUI::init(guecs::UI& overlay) {
|
|
auto top_right = overlay.entity("top_right");
|
|
auto cell = overlay.cell_for(top_right);
|
|
$map_grid.init(cell, $font);
|
|
}
|
|
|
|
void MiniMapUI::render(sf::RenderWindow &window) {
|
|
std::wstring map_out = System::draw_map($level, 5, 3);
|
|
$map_grid.update(map_out);
|
|
window.draw(*$map_grid.text);
|
|
}
|
|
}
|
|
|