summaryrefslogtreecommitdiffstats
path: root/common/plymouth/mga.script
diff options
context:
space:
mode:
Diffstat (limited to 'common/plymouth/mga.script')
-rw-r--r--common/plymouth/mga.script212
1 files changed, 170 insertions, 42 deletions
diff --git a/common/plymouth/mga.script b/common/plymouth/mga.script
index fda7b0a..27dae2b 100644
--- a/common/plymouth/mga.script
+++ b/common/plymouth/mga.script
@@ -1,4 +1,4 @@
-# Mdv splashy like theme
+# Mga splashy like theme
Window.GetMaxWidth = fun (){
i = 0;
@@ -20,17 +20,7 @@ Window.GetMaxHeight = fun (){
return height;
};
-anim.imagecount = 32;
-anim.target_width = 0.5* 0.46 * Window.GetWidth();
-anim.target_height = 0.5* 0.11 * Window.GetWidth();
-fun RotatedImage (index){
- index = Math.Int(index);
- if (!RotatedImageCache[index])
- RotatedImageCache[index] = anim.original_image.Rotate((Math.Pi*2*index)/anim.imagecount).Scale(anim.target_width, anim.target_height);
-
- return RotatedImageCache[index];
- }
if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") {
@@ -39,43 +29,97 @@ if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") {
Window.SetBackgroundBottomColor(0, 1, 0);
}
else {
- logo.original_image = ImageNew("logo_mageia.png");
+ logo.original_image = ImageNew("progress-bar0.png");
background.original_image = ImageNew("background.png");
Window.SetBackgroundTopColor(0.234, 0.43, 0.705);
Window.SetBackgroundBottomColor(0.16, 0.25, 0.44);
- anim.image= ImageNew("animation.png");
- anim.original_image= anim.image.Scale(anim.target_width, anim.target_width);
-
- anim.sprite = SpriteNew();
- anim.sprite.SetImage(RotatedImage (0));
- anim.sprite.SetX((Window.GetX() + Window.GetWidth() - RotatedImage(0).GetWidth()) / 2);
- anim.sprite.SetY(Window.GetY() + Window.GetHeight() * 0.82);
- anim.angle = 0;
- anim.index = 0;
-
- motif.original_image = ImageNew("motif.png");
+ motif.original_image = ImageNew("shadow.png");
motif.image = motif.original_image.Scale(motif.original_image.GetWidth() * Window.GetMaxWidth() / background.original_image.GetWidth(), motif.original_image.GetHeight() * Window.GetMaxHeight() / background.original_image.GetHeight());
motif.sprite = SpriteNew();
motif.sprite.SetImage(motif.image);
motif.sprite.SetOpacity(0);
- motif.sprite.SetY((Window.GetMaxHeight() - motif.image.GetHeight()) / 2);
+ #motif.sprite.SetY((Window.GetMaxHeight() - motif.image.GetHeight()) / 2);
if (Plymouth.GetMode() == "shutdown") {
- motif.opacity = 1;
+ motif.opacity = 0;
}
else {
motif.opacity = 0;
}
}
-ratio = logo.original_image.GetWidth() / logo.original_image.GetHeight();
-reduction = 0.4;
-logo.image = logo.original_image.Scale(reduction * Window.GetMaxWidth() , reduction / ratio * Window.GetMaxWidth());
logo.sprite = SpriteNew();
-logo.sprite.SetImage(logo.image);
+logo.sprite.SetImage(logo.original_image);
logo.opacity_angle = 0;
-logo.sprite.SetX((Window.GetX() + Window.GetMaxWidth() - logo.image.GetWidth()) / 2);
-logo.sprite.SetY(Window.GetY() + 50);
+logo.sprite.SetY(Window.GetHeight() * 0.7 - logo.original_image.GetHeight() / 2);
+
+progressbar1 = ImageNew("progress-bar1.png");
+progressbar1.sprite = SpriteNew();
+progressbar1.sprite.SetImage(progressbar1);
+progressbar1.opacity_angle = 0;
+progressbar1.sprite.SetY(Window.GetHeight() * 0.7 - progressbar1.GetHeight() / 2);
+
+progressbar2 = ImageNew("progress-bar2.png");
+progressbar2.sprite = SpriteNew();
+progressbar2.sprite.SetImage(progressbar2);
+progressbar2.opacity_angle = 0;
+progressbar2.sprite.SetY(Window.GetHeight() * 0.7 - progressbar2.GetHeight() / 2);
+
+progressbar3 = ImageNew("progress-bar3.png");
+progressbar3.sprite = SpriteNew();
+progressbar3.sprite.SetImage(progressbar3);
+progressbar3.opacity_angle = 0;
+progressbar3.sprite.SetY(Window.GetHeight() * 0.7 - progressbar3.GetHeight() / 2);
+
+progressbar4 = ImageNew("progress-bar4.png");
+progressbar4.sprite = SpriteNew();
+progressbar4.sprite.SetImage(progressbar4);
+progressbar4.opacity_angle = 0;
+progressbar4.sprite.SetY(Window.GetHeight() * 0.7 - progressbar4.GetHeight() / 2);
+
+progressbar5 = ImageNew("progress-bar5.png");
+progressbar5.sprite = SpriteNew();
+progressbar5.sprite.SetImage(progressbar5);
+progressbar5.opacity_angle = 0;
+progressbar5.sprite.SetY(Window.GetHeight() * 0.7 - progressbar5.GetHeight() / 2);
+
+progressbar6 = ImageNew("progress-bar6.png");
+progressbar6.sprite = SpriteNew();
+progressbar6.sprite.SetImage(progressbar6);
+progressbar6.opacity_angle = 0;
+progressbar6.sprite.SetY(Window.GetHeight() * 0.7 - progressbar6.GetHeight() / 2);
+
+progressbar7 = ImageNew("progress-bar7.png");
+progressbar7.sprite = SpriteNew();
+progressbar7.sprite.SetImage(progressbar7);
+progressbar7.opacity_angle = 0;
+progressbar7.sprite.SetY(Window.GetHeight() * 0.7 - progressbar7.GetHeight() / 2);
+
+progressbar8 = ImageNew("progress-bar8.png");
+progressbar8.sprite = SpriteNew();
+progressbar8.sprite.SetImage(progressbar8);
+progressbar8.opacity_angle = 0;
+progressbar8.sprite.SetY(Window.GetHeight() * 0.7 - progressbar8.GetHeight() / 2);
+
+progressbar9 = ImageNew("progress-bar9.png");
+progressbar9.sprite = SpriteNew();
+progressbar9.sprite.SetImage(progressbar9);
+progressbar9.opacity_angle = 0;
+progressbar9.sprite.SetY(Window.GetHeight() * 0.7 - progressbar9.GetHeight() / 2);
+
+if (Plymouth.GetMode() == "shutdown") {
+ progressbar9.sprite.SetOpacity(1);
+} else {
+ progressbar1.sprite.SetOpacity(0);
+ progressbar2.sprite.SetOpacity(0);
+ progressbar3.sprite.SetOpacity(0);
+ progressbar4.sprite.SetOpacity(0);
+ progressbar5.sprite.SetOpacity(0);
+ progressbar6.sprite.SetOpacity(0);
+ progressbar7.sprite.SetOpacity(0);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+}
background.image = background.original_image.Scale(Window.GetMaxWidth() , Window.GetMaxHeight());
background.sprite = SpriteNew();
@@ -88,15 +132,10 @@ fun refresh_callback ()
{
if (status == "normal")
{
- anim.index += 1;
- anim.index %= anim.imagecount;
- anim.sprite.SetImage(RotatedImage (anim.index));
- #anim.sprite.SetOpacity (1);
motif.sprite.SetOpacity(motif.opacity);
}
else
{
- anim.sprite.SetOpacity(0);
motif.sprite.SetOpacity(0);
}
@@ -180,9 +219,8 @@ fun display_password_callback (prompt, bullets)
else
dialog_opacity(1);
motif.sprite.SetOpacity(0);
- anim.sprite.SetOpacity(0);
- dialog.prompt_sprite.SetImage(Image.Text(prompt, 1.0, 1.0, 1.0));
+ dialog.prompt_sprite.SetImage(Image.Text(prompt, 0, 0, 0.2));
for (index = 0; dialog.bullet[index] || index < bullets; index++)
{
@@ -205,7 +243,7 @@ fun display_password_callback (prompt, bullets)
fun display_message_callback (prompt)
{
-prompt = Image.Text(prompt,1.0, 1.0, 1.0);
+prompt = Image.Text(prompt, 0, 0, 0.2);
sprite_prompt.SetImage(prompt);
sprite_prompt.SetPosition(Window.GetX() + (Window.GetWidth() - prompt.GetWidth()) / 2, Window.GetY() + Window.GetHeight() * 0.93, 2);
}
@@ -245,6 +283,7 @@ if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") {
fun progress_callback (duration, progress)
{
if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") {
+ motif.opacity = progress;
new_width = (progress_box.image.GetWidth() - 2) * progress;
if (progress_bar.image.GetWidth() != Math.Int (new_width))
{
@@ -254,10 +293,100 @@ if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") {
}
if (Plymouth.GetMode() == "shutdown") {
- motif.opacity = 1 - progress;
+ #motif.opacity = progress;
+ if ( progress > 0.1 ) {
+ progressbar9.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.2 ) {
+ progressbar8.sprite.SetOpacity(1);
+ progressbar9.sprite.SetOpacity(0);
+ }
+ if ( progress > 0.3 ) {
+ progressbar7.sprite.SetOpacity(1);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+ }
+ if ( progress > 0.4 ) {
+ progressbar6.sprite.SetOpacity(1);
+ progressbar7.sprite.SetOpacity(0);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+ }
+ if ( progress > 0.5 ) {
+ progressbar5.sprite.SetOpacity(1);
+ progressbar6.sprite.SetOpacity(0);
+ progressbar7.sprite.SetOpacity(0);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+ }
+ if ( progress > 0.6 ) {
+ progressbar4.sprite.SetOpacity(1);
+ progressbar5.sprite.SetOpacity(0);
+ progressbar6.sprite.SetOpacity(0);
+ progressbar7.sprite.SetOpacity(0);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+ }
+ if ( progress > 0.7 ) {
+ progressbar3.sprite.SetOpacity(1);
+ progressbar4.sprite.SetOpacity(0);
+ progressbar5.sprite.SetOpacity(0);
+ progressbar6.sprite.SetOpacity(0);
+ progressbar7.sprite.SetOpacity(0);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+ }
+ if ( progress > 0.8 ) {
+ progressbar2.sprite.SetOpacity(1);
+ progressbar3.sprite.SetOpacity(0);
+ progressbar4.sprite.SetOpacity(0);
+ progressbar5.sprite.SetOpacity(0);
+ progressbar6.sprite.SetOpacity(0);
+ progressbar7.sprite.SetOpacity(0);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+ }
+ if ( progress > 0.9 ) {
+ progressbar1.sprite.SetOpacity(1);
+ progressbar2.sprite.SetOpacity(0);
+ progressbar3.sprite.SetOpacity(0);
+ progressbar4.sprite.SetOpacity(0);
+ progressbar5.sprite.SetOpacity(0);
+ progressbar6.sprite.SetOpacity(0);
+ progressbar7.sprite.SetOpacity(0);
+ progressbar8.sprite.SetOpacity(0);
+ progressbar9.sprite.SetOpacity(0);
+ }
}
else {
- motif.opacity = progress;
+ #motif.opacity = 1 - progress;
+ if ( progress > 0.1 ) {
+ progressbar1.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.2 ) {
+ progressbar2.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.3 ) {
+ progressbar3.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.4 ) {
+ progressbar4.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.5 ) {
+ progressbar5.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.6 ) {
+ progressbar6.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.7 ) {
+ progressbar7.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.8 ) {
+ progressbar8.sprite.SetOpacity(1);
+ }
+ if ( progress > 0.9 ) {
+ progressbar9.sprite.SetOpacity(1);
+ }
}
}
@@ -267,7 +396,6 @@ Plymouth.SetBootProgressFunction(progress_callback);
fun quit_callback ()
{
- anim.sprite.SetOpacity (0);
if (Plymouth.GetMode() == "shutdown") {
motif.sprite.SetOpacity(0);
}