From: Charles Brej Date: Thu, 29 Oct 2009 13:36:27 +0000 (+0000) Subject: [script] Convert example script functions to use objects X-Git-Tag: 0.8.0~154 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a086ae755b635229efc90c22a8fef3d0b981de74;p=thirdparty%2Fplymouth.git [script] Convert example script functions to use objects The example script had some old style function names. These still work due to the compatibility translations, but are not recommended in new code. --- diff --git a/themes/script/script.script b/themes/script/script.script index 897d3c5d..d99217d0 100644 --- a/themes/script/script.script +++ b/themes/script/script.script @@ -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);