From c34abdc14ef142127981aa0b5825164d85a7292d Mon Sep 17 00:00:00 2001 From: Cherry Date: Tue, 30 Jan 2024 07:11:55 -0500 Subject: [PATCH] use ribbons unwrap in `goto_current_page` --- pets-lib/src/dialogue/dbox/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pets-lib/src/dialogue/dbox/mod.rs b/pets-lib/src/dialogue/dbox/mod.rs index 4587099c..95825bc7 100644 --- a/pets-lib/src/dialogue/dbox/mod.rs +++ b/pets-lib/src/dialogue/dbox/mod.rs @@ -90,8 +90,7 @@ impl DialogBox { self.tween_txt_visibility(); } - /// Start tweening a text's visible characters from - /// 0% to 100% visible... + /// Start tweening a text's visible characters from 0% to 100% visible... /// See pub fn tween_txt_visibility(&mut self) { let tw = tween( @@ -119,9 +118,8 @@ impl DialogBox { if let Some(ix) = ix { let ix = ix.clone(); - let Some(page) = ix.pages.get(pageno) else { - panic!("Page number {} out of range!", pageno); - }; + let page = ix.pages.get(pageno); + let page = unwrap_fmt!(page, "Page #{} out of range!", pageno); self.update_meta(&page.metadata); self.spk_txt = spk_display(&self.speaker.temporary).into();