// 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 = "" @ message.substring(0, temp.i) @ "";
say3_scroll.scrollToBottom();
sleep(text_speed);
}
hideimg(204);
say3_text.text = "" @ message @ "";
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();
}