More refactoring in prep for a real design.

This commit is contained in:
Zed A. Shaw 2024-08-21 18:34:46 -04:00
parent b9e9119832
commit e35536c7e3
10 changed files with 229 additions and 186 deletions

18
gui.cpp
View file

@ -19,25 +19,11 @@ using namespace std;
using namespace fmt;
namespace fs = std::filesystem;
vector<string> lines;
void output(const string &msg) {
void GUI::output(const string &msg) {
lines.push_back(msg);
}
ButtonOption Style() {
auto option = ButtonOption::Animated();
option.transform = [](const EntryState& s) {
auto element = paragraph(s.label);
if (s.focused) {
element |= bold;
}
return element | center | borderEmpty | flex;
};
return option;
}
int main_loop(GameEngine &game, std::function<bool()> runner) {
int GUI::main_loop(GameEngine &game, std::function<bool()> runner) {
auto screen = ScreenInteractive::Fullscreen();
screen.TrackMouse(true);