|
| @@ -101,13 +101,11 @@ fun hide_progress_bar() |
| 101 | | | 101 | | |
| 102 | | fun show_password_dialog() | 102 | | fun show_password_dialog() |
| 103 | | { | 103 | | { |
| 104 | - | lock.sprite.SetOpacity(1); | | | |
| 105 | | entry.sprite.SetOpacity(1); | 104 | | entry.sprite.SetOpacity(1); |
| 106 | | } | 105 | | } |
| 107 | | | 106 | | |
| 108 | | fun hide_password_dialog() | 107 | | fun hide_password_dialog() |
| 109 | | { | 108 | | { |
| 110 | - | lock.sprite.SetOpacity(0); | | | |
| 111 | | entry.sprite.SetOpacity(0); | 109 | | entry.sprite.SetOpacity(0); |
| 112 | | for (index = 0; bullet.sprites[index]; index++) | 110 | | for (index = 0; bullet.sprites[index]; index++) |
| 113 | | bullet.sprites[index].SetOpacity(0); | 111 | | bullet.sprites[index].SetOpacity(0); |
|
| @@ -133,39 +131,32 @@ fun stop_fake_progress() |
| 133 | | | 131 | | |
| 134 | | #----------------------------------------- Dialogue -------------------------------- | 132 | | #----------------------------------------- Dialogue -------------------------------- |
| 135 | | | 133 | | |
| 136 | - | lock.image = Image("lock.png"); | | | |
| 137 | | entry.image = Image("entry.png"); | 134 | | entry.image = Image("entry.png"); |
| 138 | | bullet.image = Image("bullet.png"); | 135 | | bullet.image = Image("bullet.png"); |
| 139 | | | 136 | | |
| | | 137 | + | # Scale entry to 60% of its original size |
| | | 138 | + | entry.scaled_image = entry.image.Scale( |
| | | 139 | + | Math.Int(entry.image.GetWidth() * 0.6), |
| | | 140 | + | Math.Int(entry.image.GetHeight() * 0.6) |
| | | 141 | + | ); |
| | | 142 | + | |
| 140 | | # Gap between logo bottom and entry top when password dialog is shown | 143 | | # Gap between logo bottom and entry top when password dialog is shown |
| 141 | | dialog_gap = 40; | 144 | | dialog_gap = 40; |
| 142 | | | 145 | | |
| 143 | | # Total height of logo + gap + entry when grouped for password dialog | 146 | | # Total height of logo + gap + entry when grouped for password dialog |
| 144 | - | dialog_group_height = logo.image.GetHeight() + dialog_gap + entry.image.GetHeight(); | 147 | + | dialog_group_height = logo.image.GetHeight() + dialog_gap + entry.scaled_image.GetHeight(); |
| 145 | | | 148 | | |
| 146 | | # Vertical start so the group is centered on screen | 149 | | # Vertical start so the group is centered on screen |
| 147 | | dialog_group_y = Window.GetHeight() / 2 - dialog_group_height / 2; | 150 | | dialog_group_y = Window.GetHeight() / 2 - dialog_group_height / 2; |
| 148 | | | 151 | | |
| 149 | | # Entry sits below the logo in password mode | 152 | | # Entry sits below the logo in password mode |
| 150 | | entry.dialog_y = dialog_group_y + logo.image.GetHeight() + dialog_gap; | 153 | | entry.dialog_y = dialog_group_y + logo.image.GetHeight() + dialog_gap; |
| 151 | - | entry.x = Window.GetWidth() / 2 - entry.image.GetWidth() / 2; | 154 | + | entry.x = Window.GetWidth() / 2 - entry.scaled_image.GetWidth() / 2; |
| 152 | | | 155 | | |
| 153 | - | entry.sprite = Sprite(entry.image); | 156 | + | entry.sprite = Sprite(entry.scaled_image); |
| 154 | | entry.sprite.SetPosition(entry.x, entry.dialog_y, 10001); | 157 | | entry.sprite.SetPosition(entry.x, entry.dialog_y, 10001); |
| 155 | | entry.sprite.SetOpacity(0); | 158 | | entry.sprite.SetOpacity(0); |
| 156 | | | 159 | | |
| 157 | - | # Scale lock icon to match entry field height | | | |
| 158 | - | lock_height = entry.image.GetHeight() * 0.8; | | | |
| 159 | - | lock_scale = lock_height / 96; | | | |
| 160 | - | lock_width = 84 * lock_scale; | | | |
| 161 | - | | | | |
| 162 | - | scaled_lock = lock.image.Scale(lock_width, lock_height); | | | |
| 163 | - | lock.sprite = Sprite(scaled_lock); | | | |
| 164 | - | lock.x = entry.x - lock_width - 15; | | | |
| 165 | - | lock.y = entry.dialog_y + entry.image.GetHeight() / 2 - lock_height / 2; | | | |
| 166 | - | lock.sprite.SetPosition(lock.x, lock.y, 10001); | | | |
| 167 | - | lock.sprite.SetOpacity(0); | | | |
| 168 | - | | | | |
| 169 | | # Bullet array | 160 | | # Bullet array |
| 170 | | bullet.sprites = []; | 161 | | bullet.sprites = []; |
| 171 | | | 162 | | |
|
| @@ -217,11 +208,11 @@ fun display_password_callback (prompt, bullets) |
| 217 | | { | 208 | | { |
| 218 | | if (!bullet.sprites[index]) | 209 | | if (!bullet.sprites[index]) |
| 219 | | { | 210 | | { |
| 220 | - | # Scale bullet image to 7x7 pixels | 211 | + | # Scale bullet image to 6x6 pixels |
| 221 | - | scaled_bullet = bullet.image.Scale(7, 7); | 212 | + | scaled_bullet = bullet.image.Scale(6, 6); |
| 222 | | bullet.sprites[index] = Sprite(scaled_bullet); | 213 | | bullet.sprites[index] = Sprite(scaled_bullet); |
| 223 | - | bullet.x = entry.x + 20 + index * (7 + 5); | 214 | + | bullet.x = entry.x + 12 + index * (6 + 4); |
| 224 | - | bullet.y = entry.dialog_y + entry.image.GetHeight() / 2 - 3.5; | 215 | + | bullet.y = entry.dialog_y + entry.scaled_image.GetHeight() / 2 - 3; |
| 225 | | bullet.sprites[index].SetPosition(bullet.x, bullet.y, 10002); | 216 | | bullet.sprites[index].SetPosition(bullet.x, bullet.y, 10002); |
| 226 | | } | 217 | | } |
| 227 | | bullet.sprites[index].SetOpacity(1); | 218 | | bullet.sprites[index].SetOpacity(1); |