Skip to content

Commit

Permalink
centring
Browse files Browse the repository at this point in the history
  • Loading branch information
r3w0p committed May 22, 2024
1 parent 8f10bbb commit 5b2ee64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
os: ubuntu-latest
compiler: clang++

- name: MacOS Clang
os: macos-latest
compiler: clang++
#- name: MacOS Clang
# os: macos-latest
# compiler: clang++

- name: Windows GCC
os: windows-latest
Expand Down
18 changes: 11 additions & 7 deletions src/caravan/view/view_tui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include "ftxui/component/screen_interactive.hpp"
#include "ftxui/dom/elements.hpp"

const uint16_t MIN_X = 150;
const uint16_t MIN_Y = 70;
const uint16_t MIN_X = 130;
const uint16_t MIN_Y = 68;

const uint16_t WIDTH_CARAVAN = 16;
const uint16_t HEIGHT_CARAVAN = 34;
Expand Down Expand Up @@ -91,7 +91,7 @@ std::shared_ptr<ftxui::Node> gen_caravan(std::string title, bool top) {
return window(
text(title) | hcenter | bold,
content
) | size(WIDTH, EQUAL, WIDTH_CARAVAN) | size(HEIGHT, EQUAL, HEIGHT_CARAVAN);
) | center | size(WIDTH, EQUAL, WIDTH_CARAVAN) | size(HEIGHT, EQUAL, HEIGHT_CARAVAN);
}

std::shared_ptr<ftxui::Node> gen_deck_card(std::string position, std::wstring card) {
Expand Down Expand Up @@ -151,17 +151,17 @@ std::shared_ptr<ftxui::Node> gen_input(
separator(),

separatorEmpty(),
hbox(separatorEmpty(), paragraph("YOU has yet to move."), separatorEmpty()),
hbox(separatorEmpty(), paragraph("YOU played KH onto 8C on Caravan C."), separatorEmpty()),
separatorEmpty(),
hbox(separatorEmpty(), paragraph("OPP has yet to move."), separatorEmpty()),
separatorEmpty(),

separator(),

separatorEmpty(),
hbox(separatorEmpty(), paragraph("YOU's turn to move."), separatorEmpty()),
hbox(separatorEmpty(), paragraph("YOU to move next."), separatorEmpty()),
separatorEmpty(),
}) | border | size(WIDTH, EQUAL, 50);
}) | border | size(WIDTH, EQUAL, 44);
}

std::shared_ptr<ftxui::Node> gen_game(
Expand All @@ -177,8 +177,10 @@ std::shared_ptr<ftxui::Node> gen_game(
hbox({ // TOP GAME AREA
gen_caravan(" D ", true),
separatorEmpty(),
separatorEmpty(),
gen_caravan(" E ", true),
separatorEmpty(),
separatorEmpty(),
gen_caravan(" F (100, ASC) ", true),
}), // top game area

Expand All @@ -187,8 +189,10 @@ std::shared_ptr<ftxui::Node> gen_game(
hbox({ // BOTTOM GAME AREA
gen_caravan(" A ", false),
separatorEmpty(),
separatorEmpty(),
gen_caravan(" B (100, ASC) ", false),
separatorEmpty(),
separatorEmpty(),
gen_caravan(" C ", false),
}), // bottom game area

Expand Down Expand Up @@ -218,7 +222,7 @@ std::shared_ptr<ftxui::Node> gen_game(
gen_input(comp_user_input, user_input, command, message)
}), // input area

}); // outermost area
}) | center; // outermost area
}

std::shared_ptr<ftxui::Node> gen_terminal_too_small(
Expand Down

0 comments on commit 5b2ee64

Please sign in to comment.