Merge pull request #103 from GDGooD/fix_plymouth

Chicago95.script: fix boot and shutdown screen
This commit is contained in:
EMH-Mark-I 2019-12-28 17:30:29 -06:00 committed by GitHub
commit 1437d161f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,17 +14,31 @@ resized_boot_image = boot_image.Scale(screen_width, screen_height);
boot_sprite.SetImage(resized_boot_image); boot_sprite.SetImage(resized_boot_image);
for (i = 0; i < 18; i++) for (i = 0; i <= 19; i++)
boot_images[i] = Image("win95_boot_" + i + ".png"); boot_images[i] = Image("win95_boot_" + i + ".png");
boot_sprite = Sprite(); boot_sprite = Sprite();
shutdown_image = Image("win95_shutdown-01.png");
progress = 0; progress = 0;
fun refresh_callback () fun refresh_callback ()
{ {
if (Plymouth.GetMode () == "boot")
{
Plymouth.SetRefreshRate(10);
resized_image = boot_images[Math.Int(progress)].Scale(screen_width, screen_height); resized_image = boot_images[Math.Int(progress)].Scale(screen_width, screen_height);
boot_sprite.SetImage(resized_image); boot_sprite.SetImage(resized_image);
progress++; progress++;
if (progress > 19)
progress = 0;
}
if (Plymouth.GetMode () == "shutdown")
{
Plymouth.SetRefreshRate(0);
resized_image = shutdown_image.Scale(screen_width, screen_height);
boot_sprite.SetImage(resized_image);
}
} }
Plymouth.SetRefreshFunction (refresh_callback); Plymouth.SetRefreshFunction (refresh_callback);