Merge pull request #209 from GDGooD/plymouth_password

plymouth: Update password promt and message
This commit is contained in:
grassmunk 2021-12-04 11:38:31 -08:00 committed by GitHub
commit 0538a898c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -15,7 +15,7 @@ for (i = 0; i < 20; i++)
fun refresh_callback () fun refresh_callback ()
{ {
if (Plymouth.GetMode () == "boot" || Plymouth.GetMode () == "resume") if ((Plymouth.GetMode () == "boot" || Plymouth.GetMode () == "resume") && global.status == "normal")
{ {
if (progress == 0) if (progress == 0)
{ {
@ -45,6 +45,7 @@ fun dialog_setup()
local.box; local.box;
local.lock; local.lock;
local.entry; local.entry;
local.text;
box.image = Image("box.png"); box.image = Image("box.png");
lock.image = Image("lock.png"); lock.image = Image("lock.png");
@ -68,10 +69,15 @@ fun dialog_setup()
entry.z = box.z + 1; entry.z = box.z + 1;
entry.sprite.SetPosition(entry.x, entry.y, entry.z); entry.sprite.SetPosition(entry.x, entry.y, entry.z);
prompt_sprite = SpriteNew();
prompt_sprite.SetPosition(prompt_sprite.x, prompt_sprite.y, prompt_sprite.z);
global.dialog.box = box; global.dialog.box = box;
global.dialog.lock = lock; global.dialog.lock = lock;
global.dialog.entry = entry; global.dialog.entry = entry;
global.dialog.bullet_image = Image("bullet.png"); global.dialog.bullet_image = Image("bullet.png");
global.dialog.prompt_sprite = prompt_sprite;
dialog_opacity (1); dialog_opacity (1);
} }
@ -100,6 +106,8 @@ fun display_password_callback (prompt, bullets)
dialog_setup(); dialog_setup();
else else
dialog_opacity(1); dialog_opacity(1);
dialog.prompt_sprite.SetImage(Image.Text(prompt, 1, 0.5, 0, 1, "Mono Bold 14"));
dialog.prompt_sprite.SetPosition(((screen_width) * 0.3), (screen_height * 0.9), 2);
for (index = 0; dialog.bullet[index] || index < 19; index++) for (index = 0; dialog.bullet[index] || index < 19; index++)
{ {
if (!dialog.bullet[index]) if (!dialog.bullet[index])
@ -159,11 +167,11 @@ Plymouth.SetQuitFunction(quit_callback);
#----------------------------------------- Message -------------------------------- #----------------------------------------- Message --------------------------------
message_sprite = Sprite(); message_sprite = Sprite();
message_sprite.SetPosition(10, 10, 10000); message_sprite.SetPosition((screen_width * 0.3), (screen_height * 0.9), 2);
fun message_callback (text) fun message_callback (text)
{ {
my_image = Image.Text(text, 1, 1, 1); my_image = Image.Text(text, 1, 0.5, 0, 1, "Mono Bold 14");
message_sprite.SetImage(my_image); message_sprite.SetImage(my_image);
} }