|
|
|
|
@ -31,34 +31,18 @@ status = "normal";
|
|
|
|
|
|
|
|
|
|
fun dialog_setup()
|
|
|
|
|
{
|
|
|
|
|
local.box;
|
|
|
|
|
local.lock;
|
|
|
|
|
local.entry;
|
|
|
|
|
|
|
|
|
|
box.image = Image("box.png");
|
|
|
|
|
lock.image = Image("lock.png");
|
|
|
|
|
global.max_chars = 23;
|
|
|
|
|
|
|
|
|
|
entry.image = Image("entry.png");
|
|
|
|
|
|
|
|
|
|
box.sprite = Sprite(box.image);
|
|
|
|
|
box.x = Window.GetX() + Window.GetWidth() / 2 - box.image.GetWidth ()/2;
|
|
|
|
|
box.y = Window.GetY() + Window.GetHeight() / 2 - box.image.GetHeight()/2;
|
|
|
|
|
box.z = 10000;
|
|
|
|
|
box.sprite.SetPosition(box.x, box.y, box.z);
|
|
|
|
|
|
|
|
|
|
lock.sprite = Sprite(lock.image);
|
|
|
|
|
lock.x = box.x + box.image.GetWidth()/2 - (lock.image.GetWidth() + entry.image.GetWidth()) / 2;
|
|
|
|
|
lock.y = box.y + box.image.GetHeight()/2 - lock.image.GetHeight()/2;
|
|
|
|
|
lock.z = box.z + 1;
|
|
|
|
|
lock.sprite.SetPosition(lock.x, lock.y, lock.z);
|
|
|
|
|
|
|
|
|
|
entry.sprite = Sprite(entry.image);
|
|
|
|
|
entry.x = lock.x + lock.image.GetWidth();
|
|
|
|
|
entry.y = box.y + box.image.GetHeight()/2 - entry.image.GetHeight()/2;
|
|
|
|
|
entry.z = box.z + 1;
|
|
|
|
|
entry.x = Window.GetX() + Window.GetWidth() / 2 - entry.image.GetWidth ()/2;
|
|
|
|
|
entry.y = Window.GetY() + Window.GetHeight() / 2 + Window.GetHeight() / 4 - entry.image.GetHeight()/2;
|
|
|
|
|
entry.z = 10000;
|
|
|
|
|
entry.sprite.SetPosition(entry.x, entry.y, entry.z);
|
|
|
|
|
|
|
|
|
|
global.dialog.box = box;
|
|
|
|
|
global.dialog.lock = lock;
|
|
|
|
|
global.dialog.entry = entry;
|
|
|
|
|
global.dialog.bullet_image = Image("bullet.png");
|
|
|
|
|
dialog_opacity (1);
|
|
|
|
|
@ -66,8 +50,6 @@ fun dialog_setup()
|
|
|
|
|
|
|
|
|
|
fun dialog_opacity(opacity)
|
|
|
|
|
{
|
|
|
|
|
dialog.box.sprite.SetOpacity (opacity);
|
|
|
|
|
dialog.lock.sprite.SetOpacity (opacity);
|
|
|
|
|
dialog.entry.sprite.SetOpacity (opacity);
|
|
|
|
|
for (index = 0; dialog.bullet[index]; index++)
|
|
|
|
|
{
|
|
|
|
|
@ -94,15 +76,16 @@ fun display_password_callback (prompt, bullets)
|
|
|
|
|
if (!dialog.bullet[index])
|
|
|
|
|
{
|
|
|
|
|
dialog.bullet[index].sprite = Sprite(dialog.bullet_image);
|
|
|
|
|
dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_image.GetWidth();
|
|
|
|
|
# the "+ 1" of (index + 1) for the line bellow is a hack to add 1 character of padding
|
|
|
|
|
dialog.bullet[index].x = dialog.entry.x + (index + 1) * dialog.bullet_image.GetWidth();
|
|
|
|
|
dialog.bullet[index].y = dialog.entry.y + dialog.entry.image.GetHeight() / 2 - dialog.bullet_image.GetHeight() / 2;
|
|
|
|
|
dialog.bullet[index].z = dialog.entry.z + 1;
|
|
|
|
|
dialog.bullet[index].sprite.SetPosition(dialog.bullet[index].x, dialog.bullet[index].y, dialog.bullet[index].z);
|
|
|
|
|
}
|
|
|
|
|
if (index < bullets)
|
|
|
|
|
dialog.bullet[index].sprite.SetOpacity(1);
|
|
|
|
|
if (index < bullets && index < max_chars)
|
|
|
|
|
dialog.bullet[index].sprite.SetOpacity(1);
|
|
|
|
|
else
|
|
|
|
|
dialog.bullet[index].sprite.SetOpacity(0);
|
|
|
|
|
dialog.bullet[index].sprite.SetOpacity(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|