cargo fix
This commit is contained in:
parent
b5e670b491
commit
f465197896
8 changed files with 21 additions and 32 deletions
|
|
@ -3,9 +3,7 @@ use bevy_ratatui::RatatuiContext;
|
|||
use jong::game::hand::DrawnTile;
|
||||
use jong::game::player::{MainPlayer, Player};
|
||||
use jong::tile::Tile;
|
||||
use rand::rand_core::block::BlockRngCore;
|
||||
use ratatui::style::Styled;
|
||||
use ratatui::widgets::{Block, Borders, Widget};
|
||||
use ratatui::widgets::{Block, Borders};
|
||||
|
||||
use crate::tui::render::tile::draw_tile;
|
||||
use crate::tui::{
|
||||
|
|
@ -38,11 +36,11 @@ pub(crate) fn draw_ingame(
|
|||
let horizontal_slicer_left = Layout::horizontal(constraints.iter().rev());
|
||||
let vertical_slicer_top = Layout::vertical(constraints.iter().rev());
|
||||
let [left_hand, this_hand] = horizontal_slicer_right.areas::<2>(term_area);
|
||||
let [_, mut left_hand] = vertical_slicer_bottom.areas::<2>(left_hand);
|
||||
let [_, left_hand] = vertical_slicer_bottom.areas::<2>(left_hand);
|
||||
let [_, mut this_hand] = vertical_slicer_top.areas::<2>(this_hand);
|
||||
let [cross_hand, right_hand] = horizontal_slicer_left.areas::<2>(term_area);
|
||||
let [mut right_hand, _] = vertical_slicer_top.areas::<2>(right_hand);
|
||||
let [mut cross_hand, _] = vertical_slicer_bottom.areas::<2>(cross_hand);
|
||||
let [right_hand, _] = vertical_slicer_top.areas::<2>(right_hand);
|
||||
let [cross_hand, _] = vertical_slicer_bottom.areas::<2>(cross_hand);
|
||||
|
||||
let margin = Margin::new(
|
||||
(left_hand.width + right_hand.width) / 2,
|
||||
|
|
@ -53,7 +51,7 @@ pub(crate) fn draw_ingame(
|
|||
let cross_pond =
|
||||
Layout::vertical([Constraint::Fill(1), Constraint::Max(1), Constraint::Fill(1)]);
|
||||
let [mut left_pond, center, mut right_pond] = all_pond.areas::<3>(pond_area);
|
||||
let [cross_pond, compass, this_pond] = cross_pond.areas::<3>(center);
|
||||
let [cross_pond, _compass, this_pond] = cross_pond.areas::<3>(center);
|
||||
// let shift = left_pond.height - cross_pond.height;
|
||||
left_pond.height = cross_pond.height;
|
||||
left_pond.y += cross_pond.height / 2;
|
||||
|
|
@ -79,14 +77,14 @@ pub(crate) fn draw_ingame(
|
|||
])
|
||||
.flex(Flex::SpaceBetween);
|
||||
let this_clamped = this_hand.height.abs_diff(5);
|
||||
if let Some(val) = this_hand.height.checked_sub(this_clamped) {
|
||||
if let Some(_val) = this_hand.height.checked_sub(this_clamped) {
|
||||
this_hand.height = 4
|
||||
} else {
|
||||
// FIXME show error
|
||||
panic!("terminal too small!");
|
||||
}
|
||||
this_hand.y += this_clamped + 1;
|
||||
let [this_hand, mut this_drawn, this_meld] = hand_area_layout.areas::<3>(this_hand);
|
||||
let [this_hand, mut this_drawn, _this_meld] = hand_area_layout.areas::<3>(this_hand);
|
||||
|
||||
// this_hand
|
||||
let mut constraints = vec![Constraint::Max(5); hand.len()];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue