plymouth: update for multi-line messages API

This commit is contained in:
Marek Marczykowski-Górecki 2014-03-12 04:37:58 +01:00
parent 0dc5313c36
commit fc4e6b3583

View File

@ -152,13 +152,28 @@ Plymouth.SetQuitFunction(quit_callback);
#----------------------------------------- Message -------------------------------- #----------------------------------------- Message --------------------------------
message_sprite = Sprite(); message_sprites = [];
message_sprite.SetPosition(10, 10, 10000); 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); 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);