diff --git a/ftx_thread_test.cpp b/ftx_thread_test.cpp index 0d60306..833712f 100644 --- a/ftx_thread_test.cpp +++ b/ftx_thread_test.cpp @@ -1,7 +1,3 @@ - -// Copyright 2020 Arthur Sonzogni. All rights reserved. -// Use of this source code is governed by the MIT license that can be found in -// the LICENSE file. #include // for EXIT_SUCCESS #include // for milliseconds #include // for sleep_for, thread diff --git a/ftxtest.cpp b/ftxtest.cpp index ffd4e68..389508c 100644 --- a/ftxtest.cpp +++ b/ftxtest.cpp @@ -1,6 +1,3 @@ -// Copyright 2020 Arthur Sonzogni. All rights reserved. -// Use of this source code is governed by the MIT license that can be found in -// the LICENSE file. #include // for EXIT_SUCCESS #include // for milliseconds #include diff --git a/gui.cpp b/gui.cpp index bb29ac1..7d233d0 100644 --- a/gui.cpp +++ b/gui.cpp @@ -33,10 +33,10 @@ int GUI::main_loop(GameEngine &game, std::function runner) { auto status = Renderer([&] { return vbox({ - paragraph(fmt::format("HP {}", game.hit_points)), + text(fmt::format("HP {}", game.hit_points)), separator(), hbox({ - text("HP"), + text("HP "), gauge(game.hit_points / 100.0f), }), }); @@ -52,20 +52,33 @@ int GUI::main_loop(GameEngine &game, std::function runner) { return vbox(output); }); - auto scrollable_content = Renderer(content, + auto game_stuff = Renderer([&] { + return vbox({ + text("Welcome to...Turing's Tarpit!"), + separator(), + hbox({ + text("left") | border | flex , + text("middle") | border | flex, + text("right") | border | flex, + }) | yflex_grow + }); + }); + + auto build_log = Renderer(content, [&, content] { return content->Render() | focusPositionRelative(scroll_x, scroll_y) | frame | flex; }); - auto component = Renderer(scrollable_content, [&] { + auto component = Renderer(build_log, [&] { return vbox({ - status->Render(), + game_stuff->Render() | flex, + separator(), + build_log->Render() | vscroll_indicator | yframe | flex, separator(), - scrollable_content->Render() | vscroll_indicator | yframe | size(HEIGHT, LESS_THAN, 20), - }) | - border; + status->Render() + }) | border; }); component |= CatchEvent([&](Event) -> bool {