fix tavern dialog
This commit is contained in:
parent
b4d4c47777
commit
03fae90899
14
src/app.rs
14
src/app.rs
|
@ -42,16 +42,10 @@ impl<'a> App<'a> {
|
|||
match &self.status {
|
||||
AppStatus::Initial => {
|
||||
// determine guests
|
||||
self.guest_list = vec![];
|
||||
// for creature in self.game.state.guests() {
|
||||
// let creature = self.to_person(&creature);
|
||||
// let guest = creature.downcast::<Person>().unwrap();
|
||||
// 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 = self.game.state.guests().iter().map(|creature_id| {
|
||||
let creature = self.game.state.get_creature(*creature_id).unwrap();
|
||||
tui::widgets::ListItem::new(creature.name.clone())
|
||||
}).collect();
|
||||
self.guest_list_state = tui::widgets::ListState::default();
|
||||
self.guest_list_state.select(Some(0));
|
||||
self.status = AppStatus::GuestSelection;
|
||||
|
|
Loading…
Reference in New Issue