refactors cell content updating
This commit is contained in:
23
src/main.rs
23
src/main.rs
@@ -68,7 +68,6 @@ impl App {
|
||||
.get_object("app")
|
||||
.unwrap();
|
||||
win.set_application(app);
|
||||
|
||||
// Set up a simple switch for the Pawn list panel
|
||||
let panel: gtk::Paned = builder.get_object("panel").unwrap();
|
||||
Self::new_action(app, "panel_switch", move |_,_| {
|
||||
@@ -78,18 +77,7 @@ impl App {
|
||||
panel.set_position(0);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize grid
|
||||
let grid: gtk::Grid = builder.get_object("map").unwrap();
|
||||
// TODO: implement drag-drop events
|
||||
// * From pawn_list to cell : place pawn on dest cell
|
||||
// * From cell to cell : move pawn from source to dest cell
|
||||
let _grid = grid::Grid::init(grid, 10, app_state.clone());
|
||||
|
||||
// TODO:
|
||||
// * Display creature description when hovering over its position (cell)
|
||||
|
||||
// TODO: Pawn list
|
||||
// Pawn list
|
||||
let pawn_list = builder.get_object("pawn_list").unwrap();
|
||||
let pawn_list = pawn::PawnList::init(pawn_list);
|
||||
|
||||
@@ -99,7 +87,14 @@ impl App {
|
||||
pawn.connect_stats();
|
||||
app_state.borrow_mut().pawns.push(pawn);
|
||||
}
|
||||
win.show_all();
|
||||
win.show_all(); // Before grid because we want to hide some widgets there
|
||||
// Initialize grid
|
||||
let grid: gtk::Grid = builder.get_object("map").unwrap();
|
||||
// TODO: implement drag-drop events
|
||||
// * From pawn_list to cell : place pawn on dest cell
|
||||
// * From cell to cell : move pawn from source to dest cell
|
||||
let _grid = grid::Grid::init(grid, 10, app_state.clone());
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user