MCPcopy Create free account
hub / github.com/RustOtomeLab/RustEng / execute_jump

Method execute_jump

src/executors/executor.rs:306–358  ·  view source on GitHub ↗
(&mut self, label: Jump)

Source from the content-addressed store, hash-verified

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

Callers 3

execute_loadMethod · 0.80
execute_chooseMethod · 0.80
apply_commandMethod · 0.80

Calls 15

current_bgmMethod · 0.80
take_backlogMethod · 0.80
nameMethod · 0.80
with_nameMethod · 0.80
set_backlogMethod · 0.80
find_labelMethod · 0.80
indexMethod · 0.80
get_bgmMethod · 0.80
get_backgroundMethod · 0.80
get_figuresMethod · 0.80
set_pre_bgMethod · 0.80
set_pre_bgmMethod · 0.80

Tested by

no test coverage detected