|
|
@ -126,12 +126,11 @@ bool GUI::handle_ui_events() { |
|
|
|
bool event_happened = false; |
|
|
|
bool event_happened = false; |
|
|
|
sf::Event event; |
|
|
|
sf::Event event; |
|
|
|
auto player = $world.get_the<Player>(); |
|
|
|
auto player = $world.get_the<Player>(); |
|
|
|
auto& window = $renderer.$window; |
|
|
|
int map_font_size = $renderer.font_size(); |
|
|
|
int map_font_size = $renderer.$map_font_size; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(window.pollEvent(event)) { |
|
|
|
while($renderer.poll_event(event)) { |
|
|
|
if(event.type == sf::Event::Closed) { |
|
|
|
if(event.type == sf::Event::Closed) { |
|
|
|
window.close(); |
|
|
|
$renderer.close(); |
|
|
|
} else if(event.type == sf::Event::KeyPressed) { |
|
|
|
} else if(event.type == sf::Event::KeyPressed) { |
|
|
|
auto& player_motion = $world.get<Motion>(player.entity); |
|
|
|
auto& player_motion = $world.get<Motion>(player.entity); |
|
|
|
|
|
|
|
|
|
|
@ -179,7 +178,7 @@ int GUI::main() { |
|
|
|
create_renderer(); |
|
|
|
create_renderer(); |
|
|
|
run_systems(); |
|
|
|
run_systems(); |
|
|
|
|
|
|
|
|
|
|
|
while($renderer.$window.isOpen()) { |
|
|
|
while($renderer.is_open()) { |
|
|
|
render_scene(); |
|
|
|
render_scene(); |
|
|
|
|
|
|
|
|
|
|
|
if(handle_ui_events()) { |
|
|
|
if(handle_ui_events()) { |
|
|
|