fix tavern dialog

This commit is contained in:
Niko Abeler 2023-01-04 14:41:32 +01:00
parent b4d4c47777
commit 03fae90899
1 changed files with 4 additions and 10 deletions

View File

@ -42,16 +42,10 @@ impl<'a> App<'a> {
match &self.status { match &self.status {
AppStatus::Initial => { AppStatus::Initial => {
// determine guests // determine guests
self.guest_list = vec![]; self.guest_list = self.game.state.guests().iter().map(|creature_id| {
// for creature in self.game.state.guests() { let creature = self.game.state.get_creature(*creature_id).unwrap();
// let creature = self.to_person(&creature); tui::widgets::ListItem::new(creature.name.clone())
// let guest = creature.downcast::<Person>().unwrap(); }).collect();
// self.guest_list.push(tui::widgets::ListItem::new(guest.name.clone()));
// }
// self.guest_list = self.game.state.guests().iter().map(|creature: &Box<dyn Any>| {
// let guest = creature.downcast::<Person>().unwrap();
// tui::widgets::ListItem::new(guest.name.clone())
// }).collect();
self.guest_list_state = tui::widgets::ListState::default(); self.guest_list_state = tui::widgets::ListState::default();
self.guest_list_state.select(Some(0)); self.guest_list_state.select(Some(0));
self.status = AppStatus::GuestSelection; self.status = AppStatus::GuestSelection;