(&mut self, label: Jump)
| 304 | if let Some(window) = self.weak.upgrade() { |
| 305 | window.set_ex_items(ex_items); |
| 306 | } |
| 307 | |
| 308 | Ok(()) |
| 309 | } |
| 310 | |
| 311 | pub(crate) fn execute_bgm_volume(&mut self) -> Result<(), EngineError> { |
| 312 | if let Some(window) = self.weak.upgrade() { |
| 313 | let volume = window.get_main_volume() / 100.0; |
| 314 | let bgm_volume = window.get_bgm_volume() / 100.0; |
| 315 | self.media_player |
| 316 | .borrow() |
| 317 | .change_bgm_volume(volume * bgm_volume); |
| 318 | } |
| 319 | |
| 320 | Ok(()) |
| 321 | } |
| 322 | |
| 323 | pub(crate) fn execute_voice_volume(&mut self) -> Result<(), EngineError> { |
| 324 | if let Some(window) = self.weak.upgrade() { |
| 325 | let volume = window.get_main_volume() / 100.0; |
| 326 | let voice_volume = window.get_voice_volume() / 100.0; |
| 327 | self.media_player |
| 328 | .borrow() |
| 329 | .change_voice_volume(volume * voice_volume); |
| 330 | } |
| 331 | |
| 332 | Ok(()) |
| 333 | } |
| 334 | |
| 335 | pub(crate) fn execute_save_config(&self) -> Result<(), EngineError> { |
| 336 | let weak = self.get_weak(); |
| 337 | save_user_config(weak) |
| 338 | } |
| 339 | |
| 340 | pub(crate) fn execute_choose(&mut self, choice: SharedString) -> Result<(), EngineError> { |
| 341 | *self.choose_lock.borrow_mut() = false; |
| 342 | |
| 343 | let label: (String, String); |
| 344 | { |
| 345 | let scr = self.script.clone(); |
| 346 | let scr = scr.borrow(); |
| 347 | label = scr.get_choice_label(&choice).unwrap().clone(); |
| 348 | } |
| 349 | |
| 350 | if let Some(window) = self.weak.upgrade() { |
| 351 | window.set_choose_branch(Rc::new(VecModel::from(vec![])).into()); |
| 352 | window.set_current_choose(0); |
| 353 | window.set_speaker("".into()); |
| 354 | window.set_dialogue_1(choice); |
| 355 | window.set_dialogue_2(SharedString::default()); |
| 356 | window.set_dialogue_3(SharedString::default()); |
| 357 | } |
| 358 | |
| 359 | if let Some(window) = self.weak.upgrade() { |
| 360 | if window.get_is_auto() { |
| 361 | self.auto_tx |
no test coverage detected