Hi
So, I got problem now.
This declaration is in my base.inc
var tech = new Array();
tech[0] = "Green Crystals";
tech[1] = "Cyber Scanner";
tech[2] = "Black Ore";
iTech[0] = "Please show me this stupid text blah blah blah";
this code is in my scene_init.script of scene where will be my journal
#include "scripts\base.inc"
var padu = Game.CreateWindow("okno");
var posY = 0;
for (var i = 0; i < tech.Length; i = i +1)
{
var butt = padu.CreateButton(i);
butt.Text = tech[i];
butt.Y = posY;
butt.Width = 200;
butt.Height = 30;
butt.Visible = true;
posY = posY + 30;
butt.AttachScript("scenes\info_cube\scr\button.script");
}
and this is my button.script
#include "scripts\base.inc"
on "LeftClick"
{
Game.Msg("test");
var showInfo = Game.LoadWindow("scenes\info_cube\tzone.window");
var tt = showInfo.GetControl("infotext");
tt.Text = iTech[this.Name];
}
Almost everything is ok. Yeah, almost
When I click my button, button.script load my window, display text and from this moment my buttons are no clickable anymore. I know that this happens everytime when I load my window to display text from iTech array. I think that when I load my window it took focus from buttons.
Oh, and this is my tzone.window
; generated by WindowEdit
; $EDITOR_PROJECT_ROOT_DIR$ ..\..\..\
WINDOW
{
NAME="info"
CAPTION=""
TITLE_ALIGN="left"
X=0
Y=0
WIDTH=200
HEIGHT=100
DISABLED=FALSE
VISIBLE=TRUE
PARENT_NOTIFY=FALSE
TRANSPARENT=FALSE
PAUSE_MUSIC=TRUE
MENU=FALSE
IN_GAME=FALSE
CLIP_CONTENTS=FALSE
ALPHA_COLOR { 0, 0, 0 }
ALPHA=0
EDITOR_PROPERTY
{
NAME="Selected"
VALUE="False"
}
STATIC
{
NAME="infotext"
CAPTION=""
TEXT="Static"
TEXT_ALIGN="left"
VERTICAL_ALIGN="center"
X=600
Y=180
WIDTH=475
HEIGHT=455
DISABLED=FALSE
VISIBLE=TRUE
PARENT_NOTIFY=FALSE
EDITOR_PROPERTY
{
NAME="Selected"
VALUE="True"
}
}
}
What's wrong with this?