From f3a87259a139942902649cb18cf0856a5f873bca Mon Sep 17 00:00:00 2001 From: Alula <6276139+alula@users.noreply.github.com> Date: Sat, 16 Oct 2021 15:25:55 +0200 Subject: [PATCH] cover half of the viewport during credits --- src/components/credits.rs | 6 +++--- src/scripting/tsc/text_script.rs | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/credits.rs b/src/components/credits.rs index 7ff7e98..92face5 100644 --- a/src/components/credits.rs +++ b/src/components/credits.rs @@ -39,6 +39,9 @@ impl GameEntity<()> for Credits { } fn draw(&self, state: &mut SharedGameState, ctx: &mut Context, _frame: &Frame) -> GameResult { + let rect = Rect::new(0, 0, (state.screen_size.0 / 2.0) as _, state.screen_size.1 as _); + graphics::draw_rect(ctx, rect, Color::from_rgb(0, 0, 32))?; + if state.textscript_vm.illustration_state != IllustrationState::Hidden { let x = match state.textscript_vm.illustration_state { IllustrationState::FadeIn(x) | IllustrationState::FadeOut(x) => x, @@ -49,9 +52,6 @@ impl GameEntity<()> for Credits { let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, tex)?; batch.add(x, 0.0); batch.draw(ctx)?; - } else { - let rect = Rect::new_size((x * state.scale) as isize, 0, (160.0 * state.scale) as _, state.screen_size.1 as _); - graphics::draw_rect(ctx, rect, Color::from_rgb(0, 0, 32))?; } } diff --git a/src/scripting/tsc/text_script.rs b/src/scripting/tsc/text_script.rs index a097918..6ca861c 100644 --- a/src/scripting/tsc/text_script.rs +++ b/src/scripting/tsc/text_script.rs @@ -1536,6 +1536,10 @@ impl TextScriptVM { } TSCOpCode::SIL => { let number = read_cur_varint(&mut cursor)? as u16; + log::warn!(" { + log::warn!("