Graal Pastebin

New Paste
Pasted on April 4, 2012.
View the raw file

// Scripted by *callimuc
//#CLIENTSIDE
const layout_image = "callimuc_say3background.png";
const layout_alpha = 0.8;
const text_speed   = 0.1;
const text_a   = "A - Close";
const text_s   = "S - Scroll to bottom";
 
function onCreated() {
  say3_mainwindow.destroy();
  hideimgs(203, 204);
}
 
function say3(message) {
  if (message != NULL) {
    setani("idle", NULL);
    this.reading = true;
    disabledefmovement();
 
    new GuiBitmapCtrl("say3_mainwindow") {
      width  = getimgwidth(layout_image);
      height = getimgheight(layout_image);
      x = (GraalControl.width  - width)  / 2;
      y = (GraalControl.height - height) / 4;
      bitmap = layout_image;
      mode = 1;
      alpha = layout_alpha;
 
      new GuiScrollCtrl("say3_scroll") {
        useownprofile = true;
        profile.opaque = true;
        profile.border = 0;
        profile.fillcolor = {
            0,  0,  0,  0
        };
        x = y = 10;
        width = say3_mainwindow.width - (x * 2);
        height = say3_mainwindow.height - (y * 2)-5;
        hScrollBar = "alwaysOff";
        vScrollBar = "alwaysOff";
 
        new GuiMLTextCtrl("say3_text") {
          useownprofile = true;
          profile.fontcolor = {
            61,23,0,225
          };
          x = y = 0;
          width  = say3_scroll.width;
          height = say3_scroll.height;
          text = " ";
        }
      }
    }
 
    with (findimg(204)) {
      layer = 4;
      text  = text_s;
      style = "bl";
      zoom  = 0.75;
      alpha = 0.8;
      mode  = 1;
      x = say3_mainwindow.x;
      y = say3_mainwindow.y + say3_mainwindow.height + 3;
      textshadow = true;
      shadowoffset = {1, 1};
      shadowcolor = {0, 0, 255, 255};
    }
 
    for (temp.i = 0; temp.i < message.length(); temp.i ++) {
      if (keydown(5))
        break;
      say3_text.text = "<font size = 20><b>" @ message.substring(0, temp.i) @ "</b></font>";
      say3_scroll.scrollToBottom();
      sleep(text_speed);
    }
 
    hideimg(204);
    say3_text.text = "<font size = 20><b>" @ message @ "</b></font>";
    say3_scroll.scrollToBottom();
 
    with (findimg(203)) {
      layer = 4;
      text = text_a;
      style = "br";
      zoom = 0.75;
      alpha = 0.8;
      mode = 1;
      x = say3_mainwindow.x + say3_mainwindow.width;
      y = say3_mainwindow.y + say3_mainwindow.height + 3;
      textshadow   = true;
      shadowoffset = {1, 1};
      shadowcolor  = {0, 0, 255, 255};
    }
  }
}
 
function onDestroySay3() {
  say3_mainwindow.destroy();
  hideimgs(203, 204);
  this.reading = false;
  enabledefmovement();
}
 
function onKeyPressed() {
  if (keydown(6) && this.reading)
    onDestroySay3();
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107