Commit 8fd12bed authored by Andrey Cherepanov's avatar Andrey Cherepanov Committed by Alexey Shabalin

Fix Plymouth theme

parent 6d1ed870
...@@ -115,7 +115,7 @@ Plymouth.SetDisplayPasswordFunction(display_password_callback); ...@@ -115,7 +115,7 @@ Plymouth.SetDisplayPasswordFunction(display_password_callback);
# Define bar size and position # Define bar size and position
bar_height = 36; bar_height = 36;
bar_x = Window.GetWidth() * 0.10; # 10% from left edge bar_x = Window.GetWidth() * 0.10; # 10% from left edge
bar_y = Window.GetHeight() * 0.85; # from bar bottom to bottom screen edge: 10% bar_y = Window.GetHeight() / 2; # top progressbar edge should be at middle of screen
bar_width = Window.GetWidth() * 0.80; # 80% of screen width bar_width = Window.GetWidth() * 0.80; # 80% of screen width
# Progress background spite # Progress background spite
...@@ -127,17 +127,22 @@ progress_bg.sprite.SetZ (5); ...@@ -127,17 +127,22 @@ progress_bg.sprite.SetZ (5);
# Progress bar sprite # Progress bar sprite
progress_bar.raw = Image ("progress_bar.png"); progress_bar.raw = Image ("progress_bar.png");
progress_bar.image = imgscale (progress_bar.raw, 1); progress_bar.image = progress_bar.raw;
# Maximum number of sprites # Maximum number of sprites
steps = Math.Int (bar_width/18); steps = Math.Int (bar_width/18);
# Show first step
progress_bar.sprites[0] = Sprite ();
progress_bar.sprites[0].SetImage (progress_bar.image);
progress_bar.sprites[0].SetPosition (bar_x, bar_y);
progress_bar.sprites[0].SetZ (10);
fun progress_callback (duration, progress) fun progress_callback (duration, progress)
{ {
# Redraw progress_bar with appropriate width with step 20% with 5% ahead step = Math.Int ((progress+0.05) * steps) + 1;
step = Math.Int ((progress+0.05) / steps) + 1;
if ( step > steps ) step = steps; if ( step > steps ) step = steps;
for( i=0; i<step; i++ ) for( i=0; i<step; i++ ) {
progress_bar.sprites[i] = Sprite (); progress_bar.sprites[i] = Sprite ();
progress_bar.sprites[i].SetImage (progress_bar.image); progress_bar.sprites[i].SetImage (progress_bar.image);
progress_bar.sprites[i].SetPosition (bar_x+i*18, bar_y); progress_bar.sprites[i].SetPosition (bar_x+i*18, bar_y);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment