summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorCharlie Brej <cbrej@cs.man.ac.uk>2009-06-30 21:46:40 +0100
committerRay Strode <rstrode@redhat.com>2009-07-24 09:30:17 -0400
commitbb4ed684b84872f2f41da3018186c6a5659f8744 (patch)
tree4f2e3af1bc1295dc9468daaf6204c4ed6f770e89 /themes
parent156d12b87a8dfd9a8839de20693ff79cf5711c8c (diff)
[script] Add support for 'for'
Matches the use in C as "for (first, condition, last)" where first is executed once, last is executed at the end of each iteration (even when continue is executed) and condition is tested at the start of every cycle.
Diffstat (limited to 'themes')
-rw-r--r--themes/script/script.script10
1 files changed, 3 insertions, 7 deletions
diff --git a/themes/script/script.script b/themes/script/script.script
index dccea015..41bdc55f 100644
--- a/themes/script/script.script
+++ b/themes/script/script.script
@@ -28,7 +28,7 @@ fun refresh (){
SpriteSetY (logo.sprite, 300 - ImageGetHeight(logo.image));
SpriteSetOpacity (logo.sprite, 1);
}
- if (status != "normal"){
+ else{
SpriteSetOpacity (throbber_sprite, 0);
SpriteSetX (logo.sprite, 0);
SpriteSetY (logo.sprite, 0);
@@ -98,9 +98,8 @@ fun dialogue_opacity(opacity){
SpriteSetOpacity (lock.sprite, opacity);
SpriteSetOpacity (entry.sprite, opacity);
index = 0;
- while (bullet[index]){
+ for (index = 0; bullet[index]; index++){
SpriteSetOpacity(bullet[index].sprite, opacity);
- index++;
}
}
@@ -117,8 +116,7 @@ fun display_password (prompt, bullets){
global.status = "password";
if (!global.dialogue) dialogue_setup();
dialogue_opacity (1);
- index = 0;
- while (dialogue.bullet[index] || index < bullets){
+ for (index = 0; dialogue.bullet[index] || index < bullets; index++){
if (!dialogue.bullet[index]){
dialogue.bullet[index].sprite = SpriteNew();
SpriteSetImage(dialogue.bullet[index].sprite, dialogue.bullet_image);
@@ -133,8 +131,6 @@ fun display_password (prompt, bullets){
if (index < bullets){
SpriteSetOpacity(dialogue.bullet[index].sprite, 1);
}
-
- index++;
}
}
PlymouthSetDisplayPasswordFunction(display_password);