|
|
@ -1,32 +1,93 @@ |
|
|
|
# Centaurus theme |
|
|
|
# background |
|
|
|
|
|
|
|
fun imglogo( image, scaleX, scaleY ) |
|
|
|
fun imgscale( image, scale ) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
image.Scale( image.GetWidth() * scale, image.GetHeight() * scale ); |
|
|
|
image.Scale( image.GetWidth() * scaleX, image.GetHeight() * scaleY ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun imgscale2( image, scaleX, scaleY ) |
|
|
|
#----------------------------------------- Ptogress Bar __________________________ |
|
|
|
|
|
|
|
#Boot |
|
|
|
|
|
|
|
if (Plymouth.GetMode () == "boot") |
|
|
|
{ |
|
|
|
{ |
|
|
|
image.Scale( image.GetWidth() * scaleX, image.GetHeight() * scaleY ); |
|
|
|
|
|
|
|
|
|
|
|
# background |
|
|
|
|
|
|
|
if( Window.GetWidth()/Window.GetHeight() > 1.5 ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logo.raw = Image("boot16x9.png"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logo.raw = Image("boot4x3.png"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logo.image = imglogo( logo.raw, Window.GetWidth()/logo.raw.GetWidth(), Window.GetHeight()/logo.raw.GetHeight()); |
|
|
|
|
|
|
|
logo.sprite = Sprite(logo.image); |
|
|
|
|
|
|
|
logo.sprite.SetPosition(0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_box.image = Image("progress_box.png"); |
|
|
|
|
|
|
|
progress_box.sprite = Sprite(progress_box.image); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_box.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2; |
|
|
|
|
|
|
|
#change here |
|
|
|
|
|
|
|
progress_box.y = Window.GetY() + Window.GetHeight() * 0.65 - progress_box.image.GetHeight() / 2; |
|
|
|
|
|
|
|
progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_bar.original_image = Image("progress_bar.png"); |
|
|
|
|
|
|
|
progress_bar.sprite = Sprite(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_bar.x = Window.GetX() + Window.GetWidth() / 2 - progress_bar.original_image.GetWidth() / 2; |
|
|
|
|
|
|
|
#change here |
|
|
|
|
|
|
|
progress_bar.y = Window.GetY() + Window.GetHeight() / 2 * 1.3 - 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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Plymouth.SetBootProgressFunction(progress_callback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# background |
|
|
|
if (Plymouth.GetMode () == "shutdown") |
|
|
|
if( Window.GetWidth()/Window.GetHeight() > 1.5 ) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
logo.raw = Image("background16x9.png"); |
|
|
|
|
|
|
|
|
|
|
|
# background |
|
|
|
|
|
|
|
if( Window.GetWidth()/Window.GetHeight() > 1.5 ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logo.raw = Image("shutdown16x9.png"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logo.raw = Image("shutdown4x3.png"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logo.image = imglogo( logo.raw, Window.GetWidth()/logo.raw.GetWidth(), Window.GetHeight()/logo.raw.GetHeight()); |
|
|
|
|
|
|
|
logo.sprite = Sprite(logo.image); |
|
|
|
|
|
|
|
logo.sprite.SetPosition(0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
if (Plymouth.GetMode () == "reboot") |
|
|
|
{ |
|
|
|
{ |
|
|
|
logo.raw = Image("background4x3.png"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logo.image = imgscale2( logo.raw, |
|
|
|
# background |
|
|
|
Window.GetWidth()/logo.raw.GetWidth(), |
|
|
|
if( Window.GetWidth()/Window.GetHeight() > 1.5 ) |
|
|
|
Window.GetHeight()/logo.raw.GetHeight()); |
|
|
|
{ |
|
|
|
logo.sprite = Sprite(logo.image); |
|
|
|
logo.raw = Image("shutdown16x9.png"); |
|
|
|
logo.sprite.SetPosition(0, 0, 0); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logo.raw = Image("shutdown4x3.png"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logo.image = imglogo( logo.raw, Window.GetWidth()/logo.raw.GetWidth(), Window.GetHeight()/logo.raw.GetHeight()); |
|
|
|
|
|
|
|
logo.sprite = Sprite(logo.image); |
|
|
|
|
|
|
|
logo.sprite.SetPosition(0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------- Dialogue -------------------------------- |
|
|
|
} |
|
|
|
|
|
|
|
#----------------------------------------- Dialog -------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
status = "normal"; |
|
|
|
status = "normal"; |
|
|
|
|
|
|
|
|
|
|
@ -110,65 +171,6 @@ fun display_password_callback (prompt, bullets) |
|
|
|
Plymouth.SetDisplayNormalFunction(display_normal_callback); |
|
|
|
Plymouth.SetDisplayNormalFunction(display_normal_callback); |
|
|
|
Plymouth.SetDisplayPasswordFunction(display_password_callback); |
|
|
|
Plymouth.SetDisplayPasswordFunction(display_password_callback); |
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------- Progress Bar -------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_box.raw = Image("progress_box.png"); |
|
|
|
|
|
|
|
scale_factor = Window.GetWidth() / progress_box.raw.GetWidth() * 0.8; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_box.image = imgscale( progress_box.raw, scale_factor ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_box.sprite = Sprite(progress_box.image); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_box.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2; |
|
|
|
|
|
|
|
progress_box.y = Window.GetY() + Window.GetHeight() / 2 - progress_box.image.GetHeight() / 2; |
|
|
|
|
|
|
|
progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_bar.status.raw = Image("segment_status.png"); |
|
|
|
|
|
|
|
progress_bar.runner = Sprite(); |
|
|
|
|
|
|
|
progress_bar.runner.SetImage ( imgscale(progress_bar.status.raw, scale_factor)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress_bar.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2; |
|
|
|
|
|
|
|
progress_bar.y = Window.GetY() + Window.GetHeight() / 2 - progress_box.image.GetHeight() / 2 + |
|
|
|
|
|
|
|
(progress_box.image.GetHeight() - progress_box.image.GetHeight()) / 2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Total steps |
|
|
|
|
|
|
|
steps=33; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#left corner |
|
|
|
|
|
|
|
progress_bar.l = imgscale( Image("segment_cornerL.png") , scale_factor ); |
|
|
|
|
|
|
|
progress_bar.spriteL = Sprite(); |
|
|
|
|
|
|
|
progress_bar.spriteL.SetImage (progress_bar.l); |
|
|
|
|
|
|
|
progress_bar.spriteL.SetPosition(progress_bar.x,progress_bar.y, 2) ; |
|
|
|
|
|
|
|
progress_bar.x += progress_bar.l.GetWidth()-1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#middle |
|
|
|
|
|
|
|
progress_bar.image = imgscale(Image("segment_middle.png"), scale_factor); |
|
|
|
|
|
|
|
step = progress_bar.image.GetWidth()-1; |
|
|
|
|
|
|
|
for( i=0; i<steps; i++ ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
progress_bar.sprites[i] = Sprite(); |
|
|
|
|
|
|
|
progress_bar.sprites[i].SetImage (progress_bar.image); |
|
|
|
|
|
|
|
progress_bar.sprites[i].SetPosition(progress_bar.x+i*step,progress_bar.y, -1000) ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#right corner |
|
|
|
|
|
|
|
progress_bar.r = imgscale( Image("segment_cornerR.png") , scale_factor ); |
|
|
|
|
|
|
|
progress_bar.sprites[steps+1] = Sprite(); |
|
|
|
|
|
|
|
progress_bar.sprites[steps+1].SetImage (progress_bar.r); |
|
|
|
|
|
|
|
progress_bar.sprites[steps+1].SetPosition(progress_bar.x+step*steps,progress_bar.y, -1000) ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun progress_callback (duration, progress) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for( i=0; i< progress*steps; i++ ) |
|
|
|
|
|
|
|
progress_bar.sprites[i].SetZ(2); |
|
|
|
|
|
|
|
if( progress > 0.99 ) |
|
|
|
|
|
|
|
progress_bar.sprites[i+1].SetZ(2); |
|
|
|
|
|
|
|
if( progress < 0.96 ) |
|
|
|
|
|
|
|
progress_bar.runner.SetPosition(progress_bar.x+progress*step*steps, progress_bar.y, 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Plymouth.SetBootProgressFunction(progress_callback); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------- Quit -------------------------------- |
|
|
|
#----------------------------------------- Quit -------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
fun quit_callback () |
|
|
|
fun quit_callback () |
|
|
@ -205,3 +207,4 @@ fun hide_message_callback (text) |
|
|
|
|
|
|
|
|
|
|
|
Plymouth.SetDisplayMessageFunction (display_message_callback); |
|
|
|
Plymouth.SetDisplayMessageFunction (display_message_callback); |
|
|
|
Plymouth.SetHideMessageFunction (hide_message_callback); |
|
|
|
Plymouth.SetHideMessageFunction (hide_message_callback); |
|
|
|
|
|
|
|
|