From fc4e6b35832745cf3fe1902c41222ac35621d916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 12 Mar 2014 04:37:58 +0100 Subject: [PATCH] plymouth: update for multi-line messages API --- qubes-logos/plymouth/qubes/qubes.script | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/qubes-logos/plymouth/qubes/qubes.script b/qubes-logos/plymouth/qubes/qubes.script index 175fc70..f36742d 100644 --- a/qubes-logos/plymouth/qubes/qubes.script +++ b/qubes-logos/plymouth/qubes/qubes.script @@ -152,13 +152,28 @@ Plymouth.SetQuitFunction(quit_callback); #----------------------------------------- Message -------------------------------- -message_sprite = Sprite(); -message_sprite.SetPosition(10, 10, 10000); +message_sprites = []; +message_sprite_count = 0; +message_sprite_y = 10; -fun message_callback (text) +fun display_message_callback (text) { my_image = Image.Text(text, 1, 1, 1); - message_sprite.SetImage(my_image); + message_sprites[message_sprite_count] = Sprite(my_image); + message_sprites[message_sprite_count].SetPosition(10, message_sprite_y, 10000); + message_sprites[message_sprite_count].text = text; + message_sprite_count++; + message_sprite_y += my_image.GetHeight(); } -Plymouth.SetMessageFunction(message_callback); +fun hide_message_callback (text) +{ + for (i = 0; i < message_sprite_count; i++) + { + if (message_sprites[i].text == text) + message_sprites[i] = NULL; + } +} + +Plymouth.SetDisplayMessageFunction (display_message_callback); +Plymouth.SetHideMessageFunction (hide_message_callback);