From 85cacb783e00190d4d8ae68ea0c1fa5f804185f0 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 23 Nov 2011 16:35:34 +0100 Subject: progress bar replaced with moving dot --- .../lib/plymouth/themes/unifr-rz/progress_bar.png | Bin 173 -> 0 bytes .../lib/plymouth/themes/unifr-rz/progress_box.png | Bin 196 -> 0 bytes .../lib/plymouth/themes/unifr-rz/unifr-rz.script | 108 +++++++++++++++++---- .../plymouth/themes/unifr-rz/white_dot_small.png | Bin 0 -> 376 bytes 4 files changed, 91 insertions(+), 17 deletions(-) delete mode 100644 src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.png delete mode 100644 src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.png create mode 100644 src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/white_dot_small.png (limited to 'src') diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.png b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.png deleted file mode 100644 index dd1e747a..00000000 Binary files a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_bar.png and /dev/null differ diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.png b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.png deleted file mode 100644 index c485cfbc..00000000 Binary files a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/progress_box.png and /dev/null differ diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script index 00b6970a..03732411 100644 --- a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script +++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script @@ -9,29 +9,103 @@ screen_width = Window.GetWidth(); title_right_sprite.SetX(screen_width - title_right_image.GetWidth()); -#----------------------------------------- Progress Bar -------------------------------- +dot.image = Image("white_dot_small.png"); +dot.sprite1 = Sprite(dot.image); +dot.sprite2 = Sprite(dot.image); +dot.sprite3 = Sprite(dot.image); +dot.sprite4 = Sprite(dot.image); +dot.sprite5 = Sprite(dot.image); -progress_box.image = Image("progress_box.png"); -progress_box.sprite = Sprite(progress_box.image); +#----------------------------------------- Progress Dots -------------------------------- -progress_box.x = Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2; -progress_box.y = Window.GetHeight() * 0.75 - progress_box.image.GetHeight() / 2; -progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0); +dot.x = Window.GetWidth() / 3; +dot.y = Window.GetHeight() * 0.75 - dot.image.GetHeight() / 2; -progress_bar.original_image = Image("progress_bar.png"); -progress_bar.sprite = Sprite(); - -progress_bar.x = Window.GetWidth() / 2 - progress_bar.original_image.GetWidth() / 2; -progress_bar.y = Window.GetHeight() / 2 * 1.5 - progress_box.image.GetHeight() / 2 + (progress_box.image.GetHeight() - progress_bar.original_image.GetHeight()) / 2; -progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1); +dot.sprite1.SetPosition(dot.x, dot.y, 1); +dot.sprite1.SetOpacity(0.1); +dot.sprite2.SetPosition( ( Window.GetWidth() / 3 ) * 1.2 , dot.y, 1); +dot.sprite2.SetOpacity(0.1); +dot.sprite3.SetPosition( ( Window.GetWidth() / 3 ) * 1.4 , dot.y, 1); +dot.sprite3.SetOpacity(0.1); +dot.sprite4.SetPosition( ( Window.GetWidth() / 3 ) * 1.6 , dot.y, 1); +dot.sprite4.SetOpacity(0.1); +dot.sprite5.SetPosition( ( Window.GetWidth() / 3 ) * 1.8 , dot.y, 1); +dot.sprite5.SetOpacity(0.1); fun progress_callback (duration, progress) { - if (progress_bar.image.GetWidth () != Math.Int (progress_bar.original_image.GetWidth () * progress)) - { - progress_bar.image = progress_bar.original_image.Scale(progress_bar.original_image.GetWidth(progress_bar.original_image) * progress, progress_bar.original_image.GetHeight()); - progress_bar.sprite.SetImage (progress_bar.image); - } + if ( Math.Int(duration * 2) % 10 == 1 ) + { + fade_out(dot.sprite5); + fade_in(dot.sprite1); + } + + if ( Math.Int(duration * 2) % 10 == 2 ) + { + fade_out(dot.sprite1); + fade_in(dot.sprite2); + } + + if ( Math.Int(duration * 2) % 10 == 3 ) + { + fade_out(dot.sprite2); + fade_in(dot.sprite3); + } + + if ( Math.Int(duration * 2) % 10 == 4 ) + { + fade_out(dot.sprite3); + fade_in(dot.sprite4); + } + + if ( Math.Int(duration * 2) % 10 == 5 ) + { + fade_out(dot.sprite4); + fade_in(dot.sprite5); + } + + if ( Math.Int(duration * 2) % 10 == 6 ) + { + fade_out(dot.sprite5); + fade_in(dot.sprite1); + } + + if ( Math.Int(duration * 2) % 10 == 7 ) + { + fade_out(dot.sprite1); + fade_in(dot.sprite2); + } + + if ( Math.Int(duration * 2) % 10 == 8 ) + { + fade_out(dot.sprite2); + fade_in(dot.sprite3); + } + + if ( Math.Int(duration * 2) % 10 == 9 ) + { + fade_out(dot.sprite3); + fade_in(dot.sprite4); + } + + if ( Math.Int(duration * 2) % 10 == 0 ) + { + fade_out(dot.sprite4); + if ( Math.Int(duration) > 0 ) + { fade_in(dot.sprite5); } + } } +fun fade_in(sprite) +{ + if ( sprite.GetOpacity() + 0.1 < 1 ) + { sprite.SetOpacity(sprite.GetOpacity() + 0.1);} +} + +fun fade_out(sprite) +{ + if ( sprite.GetOpacity() - 0.1 > 0.1 ) + { sprite.SetOpacity(sprite.GetOpacity() - 0.1);} +} + Plymouth.SetBootProgressFunction(progress_callback); diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/white_dot_small.png b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/white_dot_small.png new file mode 100644 index 00000000..4fd4be30 Binary files /dev/null and b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/white_dot_small.png differ -- cgit v1.2.3-55-g7522