Same as last time...
Instead of with image, so it works in other say3's (Maybe I did something wrong) and I find it easier to work with, I've made them gui texts.
Also, if you have ..., it won't pause for time+1 after each dot, it will now do the three dots the pause.
Somehow I'd like to add a going back button, and I'd like to show the scroll speed that will be visually appealing still.
PHP Code:
// Scripted by *callimuc
// Edited by David K?
//#CLIENTSIDE
const layout_image = "callimuc_say3background.png";
const layout_alpha = 0.8;
const TEXT_A = "A - Close";
const TEXT_N = "Right Arrow to go to the next page.";
const TEXT_S = "Left and Right arrow to change scroll speed.";
function onCreated() {
say3_mainwindow.destroy();
say3(message);
hideimgs(203, 204);
this.textStop = 0;
this.read = 0;
}
function say3(message,gani,text_speed,end) {
if (gani == null){
gani = "idle";
}
if (text_speed == null){
text_speed = .1;
}
//player.chat = end SPC text_speed SPC message;
this.textStop = 1;
this.ts = text_speed;
endpage = false;
skippage = false;
new GuiBitmapCtrl("say3_mainwindow") {
extent = {getimgwidth(layout_image), getimgheight(layout_image)};
position = {(GraalControl.extent[0] - extent[0]) / 2, (GraalControl.extent[1] - extent[1]) / 4};
bitmap = layout_image;
mode = 1;
alpha = layout_alpha;
active = visible = false;
new GuiScrollCtrl("say3_scroll") {
useownprofile = true;
profile.opaque = true;
profile.border = 0;
profile.fillcolor = {
0, 0, 0, 0
};
position = {10, 10};
extent = {say3_mainwindow.extent[0] - (position[0] * 2), say3_mainwindow.extent[1] - (position[1] * 2)-5};
hScrollBar = "alwaysOff";
vScrollBar = "alwaysOff";
new GuiMLTextCtrl("say3_text") {
useownprofile = true;
profile.fontcolor = {
61,23,0,225
};
position = {0, 0};
extent = {say3_scroll.extent[0], say3_scroll.extent[1]};
text = " ";
}
}
}
say3_mainwindow.visible = true;
if (message != NULL) {
setani(gani, NULL);
this.reading = true;
disabledefmovement();
say3_mainwindow.show();
this.end = false;
new GuiTextCtrl("say3_text2") {
position = {say3_mainwindow.position[0]+20,say3_mainwindow.position[1] + say3_mainwindow.extent[1]-15};
height = 20;
text = TEXT_S;
}
this.punctuations = {'.','!','?',';',':'};
this.punctuations2 = {'.','!','?',';',':'};
for (this.newText = 0; this.newText < message.length(); this.newText ++) {
say3_text.text = "<font size = 20><b>" @ message.substring(0, this.newText) @ "</b></font>";
say3_scroll.scrollToBottom();
if (message.substring(this.newText-1, 3) == "..."){
sleep(.5);
this.newText++;
say3_text.text = "<font size = 20><b>" @ message.substring(0, this.newText) @ "</b></font>";
sleep(.5);
this.newText++;
say3_text.text = "<font size = 20><b>" @ message.substring(0, this.newText) @ "</b></font>";
sleep(this.ts+1);
}
else if (message.substring(this.newText-1, 1) in this.punctuations2){
sleep(this.ts + .5);
}
else if (message.substring(this.newText-1, 1) in this.punctuations){
sleep(this.ts + 1);
}
else{
sleep(this.ts);
}
if (skippage){
break;
}
}
say3_text.text = "<font size = 20><b>" @ message @ "</b></font>";
say3_scroll.scrollToBottom();
sleep(.5);
if (end == false){
endpage = 1;
say3_text2.text = TEXT_A;
}
else {
say3_text2.text = TEXT_N;
}
this.end = true;
}
}
function onDestroySay3() {
this.textStop = 0;
say3_mainwindow.hide();
say3_text2.text ="";
this.reading = false;
}
function onKeyPressed(key) {
if (key == 37 && this.ts >= .01 && this.reading){
if (this.ts => .3){
this.ts = .3;
}
else {
this.ts += .02;
}
}
if (key == 39 && this.ts <= .3 && this.reading){
if (this.ts <= .02){
this.ts = .01;
}
else {
this.ts -= .02;
}
}
if (key == 39 && this.end && endpage != true){
endpage = true;
this.textStop = 0;
this.read++;
onDestroySay3();
}
if (key == 38 && this.end != true){
this.page--;
}
if (key == 40 && this.end != true){
skippage = true;
}
if (key == 65 && this.reading == true){
this.read++;
enabledefmovement();
onDestroySay3();
}
}