Converted almost everything to use wstring so that it works better with SFML and the unicode/utf8 usage in the system.
This commit is contained in:
parent
47c6bfd531
commit
72951f308f
17 changed files with 156 additions and 162 deletions
13
map_view.cpp
13
map_view.cpp
|
@ -9,6 +9,7 @@
|
|||
#include "rand.hpp"
|
||||
#include <codecvt>
|
||||
#include <iostream>
|
||||
#include <fmt/xchar.h>
|
||||
|
||||
namespace gui {
|
||||
using namespace components;
|
||||
|
@ -32,12 +33,12 @@ namespace gui {
|
|||
);
|
||||
|
||||
auto grid = $gui.entity("map_grid");
|
||||
$gui.set<guecs::WideText>(grid,
|
||||
$gui.set<guecs::Textual>(grid,
|
||||
{L"Loading...", 65, {27, 26, 23, 150}, 10});
|
||||
|
||||
auto status = $gui.entity("status");
|
||||
$gui.set<guecs::Textual>(status,
|
||||
{"Loading...", 25, {37, 36, 33}, 25});
|
||||
{L"Loading...", 25, {37, 36, 33}, 25});
|
||||
|
||||
$paper.sprite->setPosition({0, 0});
|
||||
$gui.init();
|
||||
|
@ -51,14 +52,14 @@ namespace gui {
|
|||
|
||||
std::wstring map_out = System::draw_map($level, 23, 9);
|
||||
|
||||
auto& map_text = $gui.get<guecs::WideText>(grid);
|
||||
auto& map_text = $gui.get<guecs::Textual>(grid);
|
||||
map_text.update(map_out);
|
||||
|
||||
auto& status_text = $gui.get<guecs::Textual>(status);
|
||||
|
||||
std::string status_out = fmt::format(
|
||||
"Level: {}\n"
|
||||
"Enemies Killed: A Lot\n",
|
||||
std::wstring status_out = fmt::format(
|
||||
L"Level: {}\n"
|
||||
L"Enemies Killed: A Lot\n",
|
||||
$level.index + 1);
|
||||
|
||||
status_text.update(status_out);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue