]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Convert example script functions to use objects
authorCharles Brej <cbrej@cs.man.ac.uk>
Thu, 29 Oct 2009 13:36:27 +0000 (13:36 +0000)
committerCharles Brej <cbrej@cs.man.ac.uk>
Thu, 29 Oct 2009 13:36:27 +0000 (13:36 +0000)
The example script had some old style function names. These still work due to
the compatibility translations, but are not recommended in new code.

themes/script/script.script

index 897d3c5d26ded85a4b715a95c984fa881fc07e35..d99217d08c3690f11fa114161a221ed1c2ad456c 100644 (file)
@@ -13,7 +13,7 @@ fun refresh_callback ()
       {
         logo.opacity_angle += ((2 * 3.14) / 50) * 0.5;  # 0.5 HZ
         min_opacity = 0.3;
-        opacity = (MathCos(logo.opacity_angle) + 1) / 2;
+        opacity = (Math.Cos(logo.opacity_angle) + 1) / 2;
         opacity *= 1 - min_opacity;
         opacity += min_opacity;
         logo.sprite.SetX (Window.GetWidth()  / 2 - logo.image.GetWidth()  / 2);
@@ -28,7 +28,7 @@ fun refresh_callback ()
       }
   }
   
-PlymouthSetRefreshFunction (refresh_callback);
+Plymouth.SetRefreshFunction (refresh_callback);
 
 #----------------------------------------- Dialogue --------------------------------
 
@@ -111,8 +111,8 @@ fun display_password_callback (prompt, bullets)
       }
   }
 
-PlymouthSetDisplayNormalFunction(display_normal_callback);
-PlymouthSetDisplayPasswordFunction(display_password_callback);
+Plymouth.SetDisplayNormalFunction(display_normal_callback);
+Plymouth.SetDisplayPasswordFunction(display_password_callback);
 
 #----------------------------------------- Progress Bar --------------------------------
 
@@ -132,14 +132,14 @@ progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1);
 
 fun progress_callback (duration, progress)
   {
-    if (progress_bar.image.GetWidth () != MathInt (progress_bar.original_image.GetWidth () * 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);
       }
   }
 
-PlymouthSetBootProgressFunction(progress_callback);
+Plymouth.SetBootProgressFunction(progress_callback);
 
 #----------------------------------------- Quit --------------------------------
 
@@ -148,4 +148,4 @@ fun quit_callback ()
  logo.sprite.SetOpacity (1);
 }
 
-PlymouthSetQuitFunction(quit_callback);
+Plymouth.SetQuitFunction(quit_callback);